STRUCT EFX_NIC_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct efx_nic_type(9) β€” Efx device type definition πŸ¦‹

okay bestie, welcome to the Kernel API Manual entry for struct efx_nic_type. the vibe is device type definition, and this thing is lowkey massive. we're keeping every single member exactly as written β€” no missing flags, no skipped fields, no cap. πŸ’…


🌸 NAME 🌸

struct efx_nic_type β€” Efx device type definition


✨ SYNOPSIS ✨

here's the whole struct, bestie. every field, every function pointer, every #ifdef, all of it. copy-paste safe, exactly as the manual gives it:

       struct efx_nic_type {
           bool is_vf;
           unsigned int (*mem_bar)(struct efx_nic *efx);
           unsigned int (*mem_map_size)(struct efx_nic *efx);
           int (*probe)(struct efx_nic *efx);
           void (*remove)(struct efx_nic *efx);
           int (*init)(struct efx_nic *efx);
           int (*dimension_resources)(struct efx_nic *efx);
           void (*fini)(struct efx_nic *efx);
           void (*monitor)(struct efx_nic *efx);
           enum reset_type (*map_reset_reason)(enum reset_type reason);
           int (*map_reset_flags)(u32 *flags);
           int (*reset)(struct efx_nic *efx, enum reset_type method);
           int (*probe_port)(struct efx_nic *efx);
           void (*remove_port)(struct efx_nic *efx);
           bool (*handle_global_event)(struct efx_channel *channel, efx_qword_t
       *);
           int (*fini_dmaq)(struct efx_nic *efx);
           void (*prepare_flush)(struct efx_nic *efx);
           void (*finish_flush)(struct efx_nic *efx);
           void (*prepare_flr)(struct efx_nic *efx);
           void (*finish_flr)(struct efx_nic *efx);
           size_t (*describe_stats)(struct efx_nic *efx, u8 **names);
           size_t (*update_stats)(struct efx_nic *efx, u64 *full_stats, struct
       rtnl_link_stats64 *core_stats);
           size_t (*update_stats_atomic)(struct efx_nic *efx, u64 *full_stats,
       struct rtnl_link_stats64 *core_stats);
           void (*start_stats)(struct efx_nic *efx);
           void (*pull_stats)(struct efx_nic *efx);
           void (*stop_stats)(struct efx_nic *efx);
           void (*push_irq_moderation)(struct efx_channel *channel);
           int (*reconfigure_port)(struct efx_nic *efx);
           void (*prepare_enable_fc_tx)(struct efx_nic *efx);
           int (*reconfigure_mac)(struct efx_nic *efx, bool mtu_only);
           bool (*check_mac_fault)(struct efx_nic *efx);
           void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol);
           int (*set_wol)(struct efx_nic *efx, u32 type);
           void (*resume_wol)(struct efx_nic *efx);
           void (*get_fec_stats)(struct efx_nic *efx, struct ethtool_fec_stats
       *fec_stats);
           unsigned int (*check_caps)(const struct efx_nic *efx, u8 flag, u32
       offset);
           int (*test_chip)(struct efx_nic *efx, struct efx_self_tests *tests);
           int (*test_nvram)(struct efx_nic *efx);
           void (*mcdi_request)(struct efx_nic *efx, const efx_dword_t *hdr,
       size_t hdr_len, const efx_dword_t *sdu, size_t sdu_len);
           bool (*mcdi_poll_response)(struct efx_nic *efx);
           void (*mcdi_read_response)(struct efx_nic *efx, efx_dword_t *pdu,
       size_t pdu_offset, size_t pdu_len);
           int (*mcdi_poll_reboot)(struct efx_nic *efx);
           void (*mcdi_reboot_detected)(struct efx_nic *efx);
           void (*irq_enable_master)(struct efx_nic *efx);
           int (*irq_test_generate)(struct efx_nic *efx);
           void (*irq_disable_non_ev)(struct efx_nic *efx);
           irqreturn_t (*irq_handle_msi)(int irq, void *dev_id);
           irqreturn_t (*irq_handle_legacy)(int irq, void *dev_id);
           int (*tx_probe)(struct efx_tx_queue *tx_queue);
           void (*tx_init)(struct efx_tx_queue *tx_queue);
           void (*tx_remove)(struct efx_tx_queue *tx_queue);
           void (*tx_write)(struct efx_tx_queue *tx_queue);
           netdev_tx_t (*tx_enqueue)(struct efx_tx_queue *tx_queue, struct
       sk_buff *skb);
           unsigned int (*tx_limit_len)(struct efx_tx_queue *tx_queue,
       dma_addr_t dma_addr, unsigned int len);
           int (*rx_push_rss_config)(struct efx_nic *efx, bool user, const u32
       *rx_indir_table, const u8 *key);
           int (*rx_pull_rss_config)(struct efx_nic *efx);
           int (*rx_probe)(struct efx_rx_queue *rx_queue);
           void (*rx_init)(struct efx_rx_queue *rx_queue);
           void (*rx_remove)(struct efx_rx_queue *rx_queue);
           void (*rx_write)(struct efx_rx_queue *rx_queue);
           void (*rx_defer_refill)(struct efx_rx_queue *rx_queue);
           void (*rx_packet)(struct efx_channel *channel);
           bool (*rx_buf_hash_valid)(const u8 *prefix);
           int (*ev_probe)(struct efx_channel *channel);
           int (*ev_init)(struct efx_channel *channel);
           void (*ev_fini)(struct efx_channel *channel);
           void (*ev_remove)(struct efx_channel *channel);
           int (*ev_process)(struct efx_channel *channel, int quota);
           void (*ev_read_ack)(struct efx_channel *channel);
           void (*ev_test_generate)(struct efx_channel *channel);
           int (*filter_table_probe)(struct efx_nic *efx);
           void (*filter_table_restore)(struct efx_nic *efx);
           void (*filter_table_remove)(struct efx_nic *efx);
           void (*filter_update_rx_scatter)(struct efx_nic *efx);
           s32 (*filter_insert)(struct efx_nic *efx, struct efx_filter_spec
       *spec, bool replace);
           int (*filter_remove_safe)(struct efx_nic *efx, enum
       efx_filter_priority priority, u32 filter_id);
           int (*filter_get_safe)(struct efx_nic *efx, enum efx_filter_priority
       priority, u32 filter_id, struct efx_filter_spec *);
           int (*filter_clear_rx)(struct efx_nic *efx, enum efx_filter_priority
       priority);
           u32 (*filter_count_rx_used)(struct efx_nic *efx, enum
       efx_filter_priority priority);
           u32 (*filter_get_rx_id_limit)(struct efx_nic *efx);
           s32 (*filter_get_rx_ids)(struct efx_nic *efx, enum
       efx_filter_priority priority, u32 *buf, u32 size);
         #ifdef CONFIG_RFS_ACCEL;
           bool (*filter_rfs_expire_one)(struct efx_nic *efx, u32 flow_id,
       unsigned int index);
         #endif;
         #ifdef CONFIG_SFC_SIENA_MTD;
           int (*mtd_probe)(struct efx_nic *efx);
           void (*mtd_rename)(struct efx_mtd_partition *part);
           int (*mtd_read)(struct mtd_info *mtd, loff_t start, size_t len,
       size_t *retlen, u8 *buffer);
           int (*mtd_erase)(struct mtd_info *mtd, loff_t start, size_t len);
           int (*mtd_write)(struct mtd_info *mtd, loff_t start, size_t len,
       size_t *retlen, const u8 *buffer);
           int (*mtd_sync)(struct mtd_info *mtd);
         #endif;
           void (*ptp_write_host_time)(struct efx_nic *efx, u32 host_time);
           int (*ptp_set_ts_sync_events)(struct efx_nic *efx, bool en, bool
       temp);
           int (*ptp_set_ts_config)(struct efx_nic *efx, struct
       kernel_hwtstamp_config *init);
           int (*sriov_configure)(struct efx_nic *efx, int num_vfs);
           int (*vlan_rx_add_vid)(struct efx_nic *efx, __be16 proto, u16 vid);
           int (*vlan_rx_kill_vid)(struct efx_nic *efx, __be16 proto, u16 vid);
           int (*get_phys_port_id)(struct efx_nic *efx, struct
       netdev_phys_item_id *ppid);
           int (*sriov_init)(struct efx_nic *efx);
           void (*sriov_fini)(struct efx_nic *efx);
           bool (*sriov_wanted)(struct efx_nic *efx);
           void (*sriov_reset)(struct efx_nic *efx);
           void (*sriov_flr)(struct efx_nic *efx, unsigned vf_i);
           int (*sriov_set_vf_mac)(struct efx_nic *efx, int vf_i, const u8
       *mac);
           int (*sriov_set_vf_vlan)(struct efx_nic *efx, int vf_i, u16 vlan, u8
       qos);
           int (*sriov_set_vf_spoofchk)(struct efx_nic *efx, int vf_i, bool
       spoofchk);
           int (*sriov_get_vf_config)(struct efx_nic *efx, int vf_i, struct
       ifla_vf_info *ivi);
           int (*sriov_set_vf_link_state)(struct efx_nic *efx, int vf_i, int
       link_state);
           int (*vswitching_probe)(struct efx_nic *efx);
           int (*vswitching_restore)(struct efx_nic *efx);
           void (*vswitching_remove)(struct efx_nic *efx);
           int (*get_mac_address)(struct efx_nic *efx, unsigned char
       *perm_addr);
           int (*set_mac_address)(struct efx_nic *efx);
           u32 (*tso_versions)(struct efx_nic *efx);
           int (*udp_tnl_push_ports)(struct efx_nic *efx);
           bool (*udp_tnl_has_port)(struct efx_nic *efx, __be16 port);
           size_t (*print_additional_fwver)(struct efx_nic *efx, char *buf,
       size_t len);
           void (*sensor_event)(struct efx_nic *efx, efx_qword_t *ev);
           unsigned int (*rx_recycle_ring_size)(const struct efx_nic *efx);
           int revision;
           unsigned int txd_ptr_tbl_base;
           unsigned int rxd_ptr_tbl_base;
           unsigned int buf_tbl_base;
           unsigned int evq_ptr_tbl_base;
           unsigned int evq_rptr_tbl_base;
           u64 max_dma_mask;
           unsigned int rx_prefix_size;
           unsigned int rx_hash_offset;
           unsigned int rx_ts_offset;
           unsigned int rx_buffer_padding;
           bool can_rx_scatter;
           bool always_rx_scatter;
           bool option_descriptors;
           unsigned int min_interrupt_mode;
           unsigned int timer_period_max;
           netdev_features_t offload_features;
           int mcdi_max_ver;
           unsigned int max_rx_ip_filters;
           u32 hwtstamp_filters;
           unsigned int rx_hash_key_size;
        };

πŸŽ€ MEMBERS πŸŽ€

okay bestie, this is the big one β€” every single function pointer and field in struct efx_nic_type, in the exact order, no skips, no "eh you get the idea". buckle up πŸ’–

  • mem_bar β€” grab me the memory BAR, pls ✨
  • mem_map_size β€” and now tell me the mapped size of that memory BAR 🫢
  • probe β€” probe the controller (the lil "u up? are you actually there" moment) πŸ”
  • remove β€” free all the resources that probe allocated, we're cleaning up πŸ’…
  • init β€” initialise the controller, get it cute and ready 🌸
  • dimension_resources β€” dimension the controller resources β€” that's the buffer table, plus the VIs once the available interrupt resources are clear 🧚
  • fini β€” shut the controller down, bye bestie 😭
  • monitor β€” the periodic function that polls link state and the hardware monitor, like a little vibe check on a timer ⏱️
  • map_reset_reason β€” map an ethtool reset reason to a reset method πŸ”
  • map_reset_flags β€” map ethtool reset flags to a reset method, if possible β€” no promises fr
  • reset β€” reset the controller hardware and possibly the PHY too. heads up: this gets called while the controller is uninitialised ⚠️
  • probe_port β€” probe the MAC and the PHY 🩺
  • remove_port β€” free the resources that probe_port allocated
  • handle_global_event β€” handle a "global" event (this one may be NULL) 🌍
  • fini_dmaq β€” flush and finalise the DMA queues (both the RX and TX queues) 🚰
  • prepare_flush β€” prep the hardware for flushing the DMA queues (Falcon architecture only) πŸ¦…
  • finish_flush β€” clean up after flushing the DMA queues (also Falcon architecture) πŸ¦…
  • prepare_flr β€” get ready for an FLR
  • finish_flr β€” clean up after that FLR
  • describe_stats β€” describe the statistics for ethtool πŸ“Š
  • update_stats β€” update statistics that event handling didn't provide. either argument may be NULL πŸ‘€
  • update_stats_atomic β€” update statistics while in atomic context, but only if that's more limiting than update_stats. otherwise just leave it NULL and the driver core will call update_stats for you 🫑
  • start_stats β€” kick off the regular fetching of statistics ▢️
  • pull_stats β€” pull the stats from the NIC and wait until they arrive, no rushing ⏳
  • stop_stats β€” stop the regular fetching of statistics ⏹️
  • push_irq_moderation β€” apply the interrupt moderation value
  • reconfigure_port β€” push loopback / power / txdis changes down to the MAC and PHY πŸ”§
  • prepare_enable_fc_tx β€” prep the MAC to enable pause frame TX (may be NULL)
  • reconfigure_mac β€” push MAC address, MTU, flow control and filter settings to the hardware. this one's serialised by the mac_lock πŸ”’
  • check_mac_fault β€” check the MAC fault state; returns true if a fault is present 🚨
  • get_wol β€” get the WoL configuration out of the driver state 😴
  • set_wol β€” push the WoL configuration to the NIC
  • resume_wol β€” synchronise WoL state between the driver and the MC (like, after a resume, iykyk) πŸ”„
  • get_fec_stats β€” get the standard FEC statistics
  • test_chip β€” test the registers. it may use efx_farch_test_registers, and it's expected to reset the NIC ⚑
  • test_nvram β€” test that the NVRAM contents are actually valid πŸ’Ύ
  • mcdi_request β€” send an MCDI request with the given header and SDU. the SDU length can be anything from 0 up to the protocol-defined maximum, but its buffer will be padded to a multiple of 4 bytes πŸ“¨
  • mcdi_poll_response β€” test whether an MCDI response is even available yet πŸ‘€
  • mcdi_read_response β€” read the MCDI response PDU. the offset will be a multiple of 4; the length might not be, but the buffer gets padded so it's safe to round up 🫢
  • mcdi_poll_reboot β€” test whether the MCDI has rebooted. if it has, return an appropriate error code for aborting any current request; otherwise return 0 πŸ”„
  • irq_enable_master β€” enable IRQs on the NIC. note that each event queue still has to be enabled separately after this one 🎚️
  • irq_test_generate β€” generate a test IRQ πŸ§ͺ
  • irq_disable_non_ev β€” disable the non-event IRQs on the NIC. each event queue must be separately disabled before this 🎚️
  • irq_handle_msi β€” handle MSI for a channel. the dev_id argument is a pointer to the struct efx_msi_context for the channel πŸ“
  • irq_handle_legacy β€” handle a legacy interrupt. here dev_id is a pointer to the struct efx_nic πŸ“
  • tx_probe β€” allocate resources for the TX queue (and pick the TXQ type while you're at it) πŸ“€
  • tx_init β€” initialise the TX queue on the NIC
  • tx_remove β€” free the resources for the TX queue
  • tx_write β€” write the TX descriptors and ring that doorbell πŸ””
  • tx_enqueue β€” add an SKB to the TX queue πŸ“¦
  • rx_push_rss_config β€” write the RSS hash key and indirection table to the NIC
  • rx_pull_rss_config β€” read the RSS hash key and indirection table back from the NIC
  • rx_probe β€” allocate resources for the RX queue πŸ“₯
  • rx_init β€” initialise the RX queue on the NIC
  • rx_remove β€” free the resources for the RX queue
  • rx_write β€” write the RX descriptors and ring that doorbell πŸ””
  • rx_defer_refill β€” generate a refill reminder event ⏰
  • rx_packet β€” receive the queued RX buffer on a channel
  • rx_buf_hash_valid β€” figure out whether the RX prefix actually contains a valid hash πŸ€”
  • ev_probe β€” allocate resources for the event queue
  • ev_init β€” initialise the event queue on the NIC
  • ev_fini β€” deinitialise the event queue on the NIC
  • ev_remove β€” free the resources for the event queue
  • ev_process β€” process events for a queue, up to the given NAPI quota πŸ“ˆ
  • ev_read_ack β€” acknowledge read events on a queue and rearm its IRQ πŸ””
  • ev_test_generate β€” generate a test event πŸ§ͺ
  • filter_table_probe β€” probe the filter capabilities and set up the filter software state πŸ•ΈοΈ
  • filter_table_restore β€” restore the filters that got removed from hardware
  • filter_table_remove β€” remove filters from the hardware and tear down the software state 🧹
  • filter_update_rx_scatter β€” update the filters after a change to the rx scatter setting
  • filter_insert β€” add or replace a filter βž•
  • filter_remove_safe β€” remove a filter by ID, carefully 🧀
  • filter_get_safe β€” retrieve a filter by ID, carefully 🧀
  • filter_clear_rx β€” remove all RX filters whose priority is less than or equal to the given priority and is not EFX_FILTER_PRI_AUTO
  • filter_count_rx_used β€” get the number of filters in use at a given priority πŸ”’
  • filter_get_rx_id_limit β€” get the maximum value of a filter id, plus 1
  • filter_get_rx_ids β€” get the list of RX filters at a given priority πŸ“‹
  • filter_rfs_expire_one β€” consider expiring a filter that was inserted for RFS. this one must check whether the specified table entry is used by RFS and that rps_may_expire_flow returns true for it πŸ—‘οΈ
  • mtd_probe β€” probe and add the MTD partitions associated with this net device, using efx_siena_mtd_add πŸ’½
  • mtd_rename β€” set an MTD partition name using the net device name
  • mtd_read β€” read from an MTD partition πŸ“–
  • mtd_erase β€” erase part of an MTD partition 🧽
  • mtd_write β€” write to an MTD partition ✍️
  • mtd_sync β€” wait for write-back to complete on an MTD partition. this also notifies the driver that a writer has finished using this partition 🫑
  • ptp_write_host_time β€” send host time to the MC as part of the sync protocol πŸ•°οΈ
  • ptp_set_ts_sync_events β€” enable or disable sync events for inline RX timestamping, possibly only temporarily for the purposes of a reset ⏱️
  • ptp_set_ts_config β€” set the hardware timestamp configuration. the flags and tx_type will already have been validated, but this operation still has to validate and update rx_filter βœ…
  • get_phys_port_id β€” get the underlying physical port id 🏷️
  • set_mac_address β€” set the MAC address of the device
  • tso_versions β€” returns a mask of the firmware-assisted TSO versions supported. if it's NULL, the device doesn't support any TSO version 🚫
  • udp_tnl_push_ports β€” push the list of UDP tunnel ports to the NIC, if that's required πŸš‡
  • udp_tnl_has_port β€” check whether a port has been added as a UDP tunnel
  • print_additional_fwver β€” dump the NIC-specific additional FW version info πŸ–¨οΈ
  • sensor_event β€” handle a sensor event coming from MCDI 🌑️
  • rx_recycle_ring_size β€” the size of the RX recycle ring ♻️
  • revision β€” the hardware architecture revision
  • txd_ptr_tbl_base β€” the TX descriptor ring base address
  • rxd_ptr_tbl_base β€” the RX descriptor ring base address
  • buf_tbl_base β€” the buffer table base address
  • evq_ptr_tbl_base β€” the event queue pointer table base address
  • evq_rptr_tbl_base β€” the event queue read-pointer table base address
  • max_dma_mask β€” the maximum possible DMA mask 🎭
  • rx_prefix_size β€” the size of the RX prefix before the packet data
  • rx_hash_offset β€” where the RX flow hash sits within that prefix
  • rx_ts_offset β€” where the timestamp sits within that prefix
  • rx_buffer_padding β€” the size of the padding at the end of an RX packet
  • can_rx_scatter β€” the NIC can scatter packets to multiple buffers
  • always_rx_scatter β€” the NIC will always scatter packets to multiple buffers, no choice bestie
  • option_descriptors β€” the NIC supports TX option descriptors
  • min_interrupt_mode β€” the lowest capability interrupt mode supported, from enum efx_int_mode
  • timer_period_max β€” the maximum period of the interrupt timer (in ticks) ⏲️
  • offload_features β€” the net_device feature flags for protocol offload features that are implemented in hardware
  • mcdi_max_ver β€” the maximum MCDI version supported
  • hwtstamp_filters β€” the mask of hardware timestamp filter types supported

🌈 SEE ALSO 🌈

go read these next, bestie, they're the whole friend group πŸ’–

  • Kernel file ./drivers/net/ethernet/sfc/siena/net_driver.h struct efx_buffer(9)
  • struct efx_special_buffer(9)
  • struct efx_tx_buffer(9)
  • struct efx_tx_queue(9)
  • struct efx_rx_buffer(9)
  • struct efx_rx_page_state(9)
  • struct efx_rx_queue(9)
  • struct efx_channel(9)
  • struct efx_msi_context(9)
  • struct efx_channel_type(9)
  • struct efx_link_state(9)
  • enum efx_phy_mode(9)
  • struct efx_hw_stat_desc(9)
  • struct efx_rss_context(9)
  • struct efx_arfs_rule(9)
  • struct efx_async_filter_insertion(9)
  • struct efx_nic(9)

and that's the whole page, periodt πŸ’… the source lives at ./drivers/net/ethernet/sfc/siena, the version stamp says October 2026, and it's all about struct efx_nic_type(9) β€” go be the main character of your own driver now, ily πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from