Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 899 Lines • ▼ Show 20 Lines | ixl_if_suspend(if_ctx_t ctx) | ||||
/* TODO: Then setup low power mode */ | /* TODO: Then setup low power mode */ | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_resume(if_ctx_t ctx) | ixl_if_resume(if_ctx_t ctx) | ||||
{ | { | ||||
struct ifnet *ifp = iflib_get_ifp(ctx); | if_t ifp = iflib_get_ifp(ctx); | ||||
INIT_DEBUGOUT("ixl_if_resume: begin"); | INIT_DEBUGOUT("ixl_if_resume: begin"); | ||||
/* Read & clear wake-up registers */ | /* Read & clear wake-up registers */ | ||||
/* Required after D3->D0 transition */ | /* Required after D3->D0 transition */ | ||||
if (ifp->if_flags & IFF_UP) | if (if_getflags(ifp) & IFF_UP) | ||||
ixl_if_init(ctx); | ixl_if_init(ctx); | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
ixl_if_init(if_ctx_t ctx) | ixl_if_init(if_ctx_t ctx) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct i40e_hw *hw = &pf->hw; | struct i40e_hw *hw = &pf->hw; | ||||
struct ifnet *ifp = iflib_get_ifp(ctx); | if_t ifp = iflib_get_ifp(ctx); | ||||
device_t dev = iflib_get_dev(ctx); | device_t dev = iflib_get_dev(ctx); | ||||
u8 tmpaddr[ETHER_ADDR_LEN]; | u8 tmpaddr[ETHER_ADDR_LEN]; | ||||
int ret; | int ret; | ||||
if (IXL_PF_IN_RECOVERY_MODE(pf)) | if (IXL_PF_IN_RECOVERY_MODE(pf)) | ||||
return; | return; | ||||
/* | /* | ||||
* If the aq is dead here, it probably means something outside of the driver | * If the aq is dead here, it probably means something outside of the driver | ||||
* did something to the adapter, like a PF reset. | * did something to the adapter, like a PF reset. | ||||
* So, rebuild the driver's state here if that occurs. | * So, rebuild the driver's state here if that occurs. | ||||
*/ | */ | ||||
if (!i40e_check_asq_alive(&pf->hw)) { | if (!i40e_check_asq_alive(&pf->hw)) { | ||||
device_printf(dev, "Admin Queue is down; resetting...\n"); | device_printf(dev, "Admin Queue is down; resetting...\n"); | ||||
ixl_teardown_hw_structs(pf); | ixl_teardown_hw_structs(pf); | ||||
ixl_rebuild_hw_structs_after_reset(pf, false); | ixl_rebuild_hw_structs_after_reset(pf, false); | ||||
} | } | ||||
/* Get the latest mac address... User might use a LAA */ | /* Get the latest mac address... User might use a LAA */ | ||||
bcopy(IF_LLADDR(vsi->ifp), tmpaddr, ETH_ALEN); | bcopy(if_getlladdr(vsi->ifp), tmpaddr, ETH_ALEN); | ||||
if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && | if (!ixl_ether_is_equal(hw->mac.addr, tmpaddr) && | ||||
(i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { | (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { | ||||
ixl_del_all_vlan_filters(vsi, hw->mac.addr); | ixl_del_all_vlan_filters(vsi, hw->mac.addr); | ||||
bcopy(tmpaddr, hw->mac.addr, ETH_ALEN); | bcopy(tmpaddr, hw->mac.addr, ETH_ALEN); | ||||
ret = i40e_aq_mac_address_write(hw, | ret = i40e_aq_mac_address_write(hw, | ||||
I40E_AQC_WRITE_TYPE_LAA_ONLY, | I40E_AQC_WRITE_TYPE_LAA_ONLY, | ||||
hw->mac.addr, NULL); | hw->mac.addr, NULL); | ||||
if (ret) { | if (ret) { | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | #ifdef IXL_IW | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
void | void | ||||
ixl_if_stop(if_ctx_t ctx) | ixl_if_stop(if_ctx_t ctx) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ifnet *ifp = iflib_get_ifp(ctx); | if_t ifp = iflib_get_ifp(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
INIT_DEBUGOUT("ixl_if_stop: begin\n"); | INIT_DEBUGOUT("ixl_if_stop: begin\n"); | ||||
if (IXL_PF_IN_RECOVERY_MODE(pf)) | if (IXL_PF_IN_RECOVERY_MODE(pf)) | ||||
return; | return; | ||||
// TODO: This may need to be reworked | // TODO: This may need to be reworked | ||||
▲ Show 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | ixl_if_media_change(if_ctx_t ctx) | ||||
return (ENODEV); | return (ENODEV); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_promisc_set(if_ctx_t ctx, int flags) | ixl_if_promisc_set(if_ctx_t ctx, int flags) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ifnet *ifp = iflib_get_ifp(ctx); | if_t ifp = iflib_get_ifp(ctx); | ||||
struct i40e_hw *hw = vsi->hw; | struct i40e_hw *hw = vsi->hw; | ||||
int err; | int err; | ||||
bool uni = FALSE, multi = FALSE; | bool uni = FALSE, multi = FALSE; | ||||
if (flags & IFF_PROMISC) | if (flags & IFF_PROMISC) | ||||
uni = multi = TRUE; | uni = multi = TRUE; | ||||
else if (flags & IFF_ALLMULTI || if_llmaddr_count(ifp) >= | else if (flags & IFF_ALLMULTI || if_llmaddr_count(ifp) >= | ||||
MAX_MULTICAST_ADDR) | MAX_MULTICAST_ADDR) | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |