/*
* Copyright (c) 2012-2015 Solarflare Communications Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the FreeBSD Project.
*/
#include "efx.h"
#include "efx_impl.h"
{
goto fail1;
return (0);
return (rc);
}
{
/*
* Because EF10 doesn't *require* polling, we can't rely on
* ef10_mac_poll() being executed to populate epp->ep_mac_up.
*/
goto fail1;
return (0);
return (rc);
}
/*
* EF10 adapters use MC_CMD_VADAPTOR_SET_MAC to set the
* MAC address; the address field in MC_CMD_SET_MAC has no
* effect.
* MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and
* the port to have no filters or queues active.
*/
static __checkReturn efx_rc_t
{
enp->en_vport_id);
epp->ep_mac_addr);
goto fail1;
}
return (0);
return (rc);
}
{
goto fail1;
/*
* Fallback for older Huntington firmware without Vadapter
* support.
*/
goto fail2;
}
return (0);
return (rc);
}
static __checkReturn efx_rc_t
{
/* Only configure the MTU in this call to MC_CMD_SET_MAC */
goto fail1;
}
return (0);
return (rc);
}
{
if (encp->enc_enhanced_set_mac_supported) {
goto fail1;
} else {
/*
* Fallback for older Huntington firmware, which always
* configure all of the parameters to MC_CMD_SET_MAC. This isn't
* suitable for setting the MTU on unpriviliged functions.
*/
goto fail2;
}
return (0);
return (rc);
}
{
epp->ep_mac_addr);
/*
* Note: The Huntington MAC does not support REJECT_BRDCST.
* The REJECT_UNCST flag will also prevent multicast traffic
* from reaching the filters. As Huntington filters drop any
* traffic that does not match a filter it is ok to leave the
* MAC running in promiscuous mode. See bug41141.
*
* FIXME: Does REJECT_UNCST behave the same way on Medford?
*/
/*
* Flow control, whether it is auto-negotiated or not,
* is set via the PHY advertised capabilities. When set to
* automatic the MAC will use the PHY settings to determine
* the flow control settings.
*/
/* Do not include the Ethernet frame checksum in RX packets */
/*
* Unprivileged functions cannot control link state,
* but still need to configure filters.
*/
goto fail1;
}
}
/*
* Apply the filters for the MAC configuration.
* If the NIC isn't ready to accept filters this may
* return success without setting anything.
*/
return (0);
return (rc);
}
{
goto fail1;
return (0);
return (rc);
}
{
if (rc != 0)
goto fail1;
return (0);
return (rc);
}
void
{
}
{
/* The PHY object handles this on EF10 */
goto fail1;
return (0);
return (rc);
}
#endif /* EFSYS_OPT_LOOPBACK */
{
/* Read END first so we don't race with the MC */
/* TX */
&value);
&value);
&value);
/* RX */
/* Packet memory (EF10 only) */
/* RX datapath */
/* VADAPTER RX */
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
/* VADAPTER TX */
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
&value);
/* Check that we didn't read the stats in the middle of a DMA */
/* Not a good enough check ? */
sizeof (generation_start)))
return (EAGAIN);
if (generationp)
return (0);
}
#endif /* EFSYS_OPT_MAC_STATS */
#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */