STRUCT EFX_NIC_TYPE(9)
π¦ 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 thatprobeallocated, 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 frresetβ 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 thatprobe_portallocatedhandle_global_eventβ handle a "global" event (this one may beNULL) π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 FLRfinish_flrβ clean up after that FLRdescribe_statsβ describe the statistics for ethtool πupdate_statsβ update statistics that event handling didn't provide. either argument may beNULLπupdate_stats_atomicβ update statistics while in atomic context, but only if that's more limiting thanupdate_stats. otherwise just leave itNULLand the driver core will callupdate_statsfor 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 valuereconfigure_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 beNULL)reconfigure_macβ push MAC address, MTU, flow control and filter settings to the hardware. this one's serialised by themac_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 NICresume_wolβ synchronise WoL state between the driver and the MC (like, after a resume, iykyk) πget_fec_statsβ get the standard FEC statisticstest_chipβ test the registers. it may useefx_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 from0up to the protocol-defined maximum, but its buffer will be padded to a multiple of4bytes π¨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 of4; 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 return0π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. thedev_idargument is a pointer to thestruct efx_msi_contextfor the channel πirq_handle_legacyβ handle a legacy interrupt. heredev_idis a pointer to thestruct 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 NICtx_removeβ free the resources for the TX queuetx_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 NICrx_pull_rss_configβ read the RSS hash key and indirection table back from the NICrx_probeβ allocate resources for the RX queue π₯rx_initβ initialise the RX queue on the NICrx_removeβ free the resources for the RX queuerx_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 channelrx_buf_hash_validβ figure out whether the RX prefix actually contains a valid hash π€ev_probeβ allocate resources for the event queueev_initβ initialise the event queue on the NICev_finiβ deinitialise the event queue on the NICev_removeβ free the resources for the event queueev_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 hardwarefilter_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 settingfilter_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 notEFX_FILTER_PRI_AUTOfilter_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, plus1filter_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 thatrps_may_expire_flowreturns true for it ποΈmtd_probeβ probe and add the MTD partitions associated with this net device, usingefx_siena_mtd_addπ½mtd_renameβ set an MTD partition name using the net device namemtd_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 andtx_typewill already have been validated, but this operation still has to validate and updaterx_filterβget_phys_port_idβ get the underlying physical port id π·οΈset_mac_addressβ set the MAC address of the devicetso_versionsβ returns a mask of the firmware-assisted TSO versions supported. if it'sNULL, 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 tunnelprint_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 revisiontxd_ptr_tbl_baseβ the TX descriptor ring base addressrxd_ptr_tbl_baseβ the RX descriptor ring base addressbuf_tbl_baseβ the buffer table base addressevq_ptr_tbl_baseβ the event queue pointer table base addressevq_rptr_tbl_baseβ the event queue read-pointer table base addressmax_dma_maskβ the maximum possible DMA mask πrx_prefix_sizeβ the size of the RX prefix before the packet datarx_hash_offsetβ where the RX flow hash sits within that prefixrx_ts_offsetβ where the timestamp sits within that prefixrx_buffer_paddingβ the size of the padding at the end of an RX packetcan_rx_scatterβ the NIC can scatter packets to multiple buffersalways_rx_scatterβ the NIC will always scatter packets to multiple buffers, no choice bestieoption_descriptorsβ the NIC supports TX option descriptorsmin_interrupt_modeβ the lowest capability interrupt mode supported, fromenum efx_int_modetimer_period_maxβ the maximum period of the interrupt timer (in ticks) β²οΈoffload_featuresβ thenet_devicefeature flags for protocol offload features that are implemented in hardwaremcdi_max_verβ the maximum MCDI version supportedhwtstamp_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.hstruct 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms