Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/e1000/if_em.c
| Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | |||||
| static void em_if_stop(if_ctx_t ctx); | static void em_if_stop(if_ctx_t ctx); | ||||
| static void em_if_media_status(if_ctx_t, struct ifmediareq *); | static void em_if_media_status(if_ctx_t, struct ifmediareq *); | ||||
| static int em_if_media_change(if_ctx_t ctx); | static int em_if_media_change(if_ctx_t ctx); | ||||
| static int em_if_mtu_set(if_ctx_t ctx, uint32_t mtu); | static int em_if_mtu_set(if_ctx_t ctx, uint32_t mtu); | ||||
| static void em_if_timer(if_ctx_t ctx, uint16_t qid); | static void em_if_timer(if_ctx_t ctx, uint16_t qid); | ||||
| static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); | static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); | ||||
| static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | ||||
| static void em_if_watchdog_reset(if_ctx_t ctx); | static void em_if_watchdog_reset(if_ctx_t ctx); | ||||
| static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); | |||||
| static void em_identify_hardware(if_ctx_t ctx); | static void em_identify_hardware(if_ctx_t ctx); | ||||
| static int em_allocate_pci_resources(if_ctx_t ctx); | static int em_allocate_pci_resources(if_ctx_t ctx); | ||||
| static void em_free_pci_resources(if_ctx_t ctx); | static void em_free_pci_resources(if_ctx_t ctx); | ||||
| static void em_reset(if_ctx_t ctx); | static void em_reset(if_ctx_t ctx); | ||||
| static int em_setup_interface(if_ctx_t ctx); | static int em_setup_interface(if_ctx_t ctx); | ||||
| static int em_setup_msix(if_ctx_t ctx); | static int em_setup_msix(if_ctx_t ctx); | ||||
| ▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | static device_method_t em_if_methods[] = { | ||||
| DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), | DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), | ||||
| DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), | DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), | ||||
| DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), | DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), | ||||
| DEVMETHOD(ifdi_get_counter, em_if_get_counter), | DEVMETHOD(ifdi_get_counter, em_if_get_counter), | ||||
| DEVMETHOD(ifdi_led_func, em_if_led_func), | DEVMETHOD(ifdi_led_func, em_if_led_func), | ||||
| DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), | DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), | ||||
| DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), | DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), | ||||
| DEVMETHOD(ifdi_debug, em_if_debug), | DEVMETHOD(ifdi_debug, em_if_debug), | ||||
| DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), | |||||
| DEVMETHOD_END | DEVMETHOD_END | ||||
| }; | }; | ||||
| static driver_t em_if_driver = { | static driver_t em_if_driver = { | ||||
| "em_if", em_if_methods, sizeof(struct adapter) | "em_if", em_if_methods, sizeof(struct adapter) | ||||
| }; | }; | ||||
| static device_method_t igb_if_methods[] = { | static device_method_t igb_if_methods[] = { | ||||
| Show All 21 Lines | static device_method_t igb_if_methods[] = { | ||||
| DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), | DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), | ||||
| DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), | DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), | ||||
| DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), | DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), | ||||
| DEVMETHOD(ifdi_get_counter, em_if_get_counter), | DEVMETHOD(ifdi_get_counter, em_if_get_counter), | ||||
| DEVMETHOD(ifdi_led_func, em_if_led_func), | DEVMETHOD(ifdi_led_func, em_if_led_func), | ||||
| DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), | DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), | ||||
| DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), | DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), | ||||
| DEVMETHOD(ifdi_debug, em_if_debug), | DEVMETHOD(ifdi_debug, em_if_debug), | ||||
| DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), | |||||
| DEVMETHOD_END | DEVMETHOD_END | ||||
| }; | }; | ||||
| static driver_t igb_if_driver = { | static driver_t igb_if_driver = { | ||||
| "igb_if", igb_if_methods, sizeof(struct adapter) | "igb_if", igb_if_methods, sizeof(struct adapter) | ||||
| }; | }; | ||||
| /********************************************************************* | /********************************************************************* | ||||
| ▲ Show 20 Lines • Show All 3,582 Lines • ▼ Show 20 Lines | return (adapter->dropped_pkts + adapter->stats.rxerrc + | ||||
| adapter->stats.crcerrs + adapter->stats.algnerrc + | adapter->stats.crcerrs + adapter->stats.algnerrc + | ||||
| adapter->stats.ruc + adapter->stats.roc + | adapter->stats.ruc + adapter->stats.roc + | ||||
| adapter->stats.mpc + adapter->stats.cexterr); | adapter->stats.mpc + adapter->stats.cexterr); | ||||
| case IFCOUNTER_OERRORS: | case IFCOUNTER_OERRORS: | ||||
| return (adapter->stats.ecol + adapter->stats.latecol + | return (adapter->stats.ecol + adapter->stats.latecol + | ||||
| adapter->watchdog_events); | adapter->watchdog_events); | ||||
| default: | default: | ||||
| return (if_get_counter_default(ifp, cnt)); | return (if_get_counter_default(ifp, cnt)); | ||||
| } | |||||
| } | |||||
| /* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized | |||||
| * @ctx: iflib context | |||||
| * @event: event code to check | |||||
| * | |||||
| * Defaults to returning true for unknown events. | |||||
| * | |||||
| * @returns true if iflib needs to reinit the interface | |||||
| */ | |||||
| static bool | |||||
| em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) | |||||
| { | |||||
| switch (event) { | |||||
| case IFLIB_RESTART_VLAN_CONFIG: | |||||
| return (false); | |||||
| default: | |||||
| return (true); | |||||
| } | } | ||||
| } | } | ||||
| /* Export a single 32-bit register via a read-only sysctl. */ | /* Export a single 32-bit register via a read-only sysctl. */ | ||||
| static int | static int | ||||
| em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) | em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) | ||||
| { | { | ||||
| struct adapter *adapter; | struct adapter *adapter; | ||||
| ▲ Show 20 Lines • Show All 565 Lines • Show Last 20 Lines | |||||