Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | em_if_attach_pre(if_ctx_t ctx) | ||||
dev = iflib_get_dev(ctx); | dev = iflib_get_dev(ctx); | ||||
adapter = iflib_get_softc(ctx); | adapter = iflib_get_softc(ctx); | ||||
if (resource_disabled("em", device_get_unit(dev))) { | if (resource_disabled("em", device_get_unit(dev))) { | ||||
device_printf(dev, "Disabled by device hint\n"); | device_printf(dev, "Disabled by device hint\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
adapter->ctx = ctx; | adapter->ctx = adapter->osdep.ctx = ctx; | ||||
adapter->dev = adapter->osdep.dev = dev; | adapter->dev = adapter->osdep.dev = dev; | ||||
scctx = adapter->shared = iflib_get_softc_ctx(ctx); | scctx = adapter->shared = iflib_get_softc_ctx(ctx); | ||||
adapter->media = iflib_get_media(ctx); | adapter->media = iflib_get_media(ctx); | ||||
hw = &adapter->hw; | hw = &adapter->hw; | ||||
adapter->tx_process_limit = scctx->isc_ntxd[0]; | adapter->tx_process_limit = scctx->isc_ntxd[0]; | ||||
/* SYSCTL stuff */ | /* SYSCTL stuff */ | ||||
▲ Show 20 Lines • Show All 930 Lines • ▼ Show 20 Lines | em_if_timer(if_ctx_t ctx, uint16_t qid) | ||||
struct em_rx_queue *que; | struct em_rx_queue *que; | ||||
int i; | int i; | ||||
int trigger = 0; | int trigger = 0; | ||||
if (qid != 0) | if (qid != 0) | ||||
return; | return; | ||||
iflib_admin_intr_deferred(ctx); | iflib_admin_intr_deferred(ctx); | ||||
/* Reset LAA into RAR[0] on 82571 */ | |||||
if ((adapter->hw.mac.type == e1000_82571) && | |||||
e1000_get_laa_state_82571(&adapter->hw)) | |||||
e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); | |||||
if (adapter->hw.mac.type < em_mac_min) | |||||
lem_smartspeed(adapter); | |||||
/* Mask to use in the irq trigger */ | /* Mask to use in the irq trigger */ | ||||
if (adapter->intr_type == IFLIB_INTR_MSIX) { | if (adapter->intr_type == IFLIB_INTR_MSIX) { | ||||
for (i = 0, que = adapter->rx_queues; i < adapter->rx_num_queues; i++, que++) | for (i = 0, que = adapter->rx_queues; i < adapter->rx_num_queues; i++, que++) | ||||
trigger |= que->eims; | trigger |= que->eims; | ||||
} else { | } else { | ||||
trigger = E1000_ICS_RXDMT0; | trigger = E1000_ICS_RXDMT0; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (link_check && (adapter->link_active == 0)) { | ||||
adapter->link_duplex = 0; | adapter->link_duplex = 0; | ||||
if (bootverbose) | if (bootverbose) | ||||
device_printf(dev, "Link is Down\n"); | device_printf(dev, "Link is Down\n"); | ||||
adapter->link_active = 0; | adapter->link_active = 0; | ||||
iflib_link_state_change(ctx, LINK_STATE_DOWN, ifp->if_baudrate); | iflib_link_state_change(ctx, LINK_STATE_DOWN, ifp->if_baudrate); | ||||
printf("link state changed to down\n"); | printf("link state changed to down\n"); | ||||
} | } | ||||
em_update_stats_counters(adapter); | em_update_stats_counters(adapter); | ||||
/* Reset LAA into RAR[0] on 82571 */ | |||||
if ((adapter->hw.mac.type == e1000_82571) && | |||||
e1000_get_laa_state_82571(&adapter->hw)) | |||||
e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); | |||||
if (adapter->hw.mac.type < em_mac_min) | |||||
lem_smartspeed(adapter); | |||||
E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); | E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* This routine disables all traffic on the adapter by issuing a | * This routine disables all traffic on the adapter by issuing a | ||||
* global reset on the MAC and deallocates TX/RX buffers. | * global reset on the MAC and deallocates TX/RX buffers. | ||||
▲ Show 20 Lines • Show All 2,739 Lines • Show Last 20 Lines |