drivers/net/ethernet/sfc/falcon/net_driver.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/falcon/net_driver.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/falcon/net_driver.h- Extension
.h- Size
- 49485 bytes
- Lines
- 1337
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/if_vlan.hlinux/timer.hlinux/mdio.hlinux/list.hlinux/pci.hlinux/device.hlinux/highmem.hlinux/workqueue.hlinux/mutex.hlinux/rwsem.hlinux/vmalloc.hlinux/i2c.hlinux/mtd/mtd.hnet/busy_poll.henum.hbitfield.hfilter.h
Detected Declarations
struct ef4_self_testsstruct ef4_bufferstruct ef4_special_bufferstruct ef4_tx_bufferstruct ef4_tx_queuestruct ef4_rx_bufferstruct ef4_rx_page_statestruct ef4_rx_queuestruct ef4_channelstruct ef4_msi_contextstruct ef4_channel_typestruct ef4_nicstruct ef4_link_statestruct ef4_phy_operationsstruct ef4_hw_stat_descstruct ef4_nicstruct ef4_mtd_partitionstruct ef4_nic_typeenum ef4_led_modeenum ef4_int_modeenum nic_stateenum ef4_phy_modefunction ef4_link_state_equalfunction ef4_phy_mode_disabledfunction ef4_dev_registeredfunction ef4_port_numfunction ef4_get_channelfunction ef4_get_tx_queuefunction ef4_channel_has_tx_queuesfunction ef4_channel_get_tx_queuefunction ef4_tx_queue_usedfunction ef4_channel_has_rx_queuefunction ef4_channel_get_rx_queuefunction ef4_rx_queue_channelfunction ef4_rx_queue_indexfunction ef4_supported_featuresfunction ef4_tx_queue_get_insert_indexfunction __ef4_tx_queue_get_insert_bufferfunction ef4_tx_queue_get_insert_buffer
Annotated Snippet
struct ef4_buffer {
void *addr;
dma_addr_t dma_addr;
unsigned int len;
};
/**
* struct ef4_special_buffer - DMA buffer entered into buffer table
* @buf: Standard &struct ef4_buffer
* @index: Buffer index within controller;s buffer table
* @entries: Number of buffer table entries
*
* The NIC has a buffer table that maps buffers of size %EF4_BUF_SIZE.
* Event and descriptor rings are addressed via one or more buffer
* table entries (and so can be physically non-contiguous, although we
* currently do not take advantage of that). On Falcon and Siena we
* have to take care of allocating and initialising the entries
* ourselves. On later hardware this is managed by the firmware and
* @index and @entries are left as 0.
*/
struct ef4_special_buffer {
struct ef4_buffer buf;
unsigned int index;
unsigned int entries;
};
/**
* struct ef4_tx_buffer - buffer state for a TX descriptor
* @skb: When @flags & %EF4_TX_BUF_SKB, the associated socket buffer to be
* freed when descriptor completes
* @option: When @flags & %EF4_TX_BUF_OPTION, a NIC-specific option descriptor.
* @dma_addr: DMA address of the fragment.
* @flags: Flags for allocation and DMA mapping type
* @len: Length of this fragment.
* This field is zero when the queue slot is empty.
* @unmap_len: Length of this fragment to unmap
* @dma_offset: Offset of @dma_addr from the address of the backing DMA mapping.
* Only valid if @unmap_len != 0.
*/
struct ef4_tx_buffer {
const struct sk_buff *skb;
union {
ef4_qword_t option;
dma_addr_t dma_addr;
};
unsigned short flags;
unsigned short len;
unsigned short unmap_len;
unsigned short dma_offset;
};
#define EF4_TX_BUF_CONT 1 /* not last descriptor of packet */
#define EF4_TX_BUF_SKB 2 /* buffer is last part of skb */
#define EF4_TX_BUF_MAP_SINGLE 8 /* buffer was mapped with dma_map_single() */
#define EF4_TX_BUF_OPTION 0x10 /* empty buffer for option descriptor */
/**
* struct ef4_tx_queue - An Efx TX queue
*
* This is a ring buffer of TX fragments.
* Since the TX completion path always executes on the same
* CPU and the xmit path can operate on different CPUs,
* performance is increased by ensuring that the completion
* path and the xmit path operate on different cache lines.
* This is particularly important if the xmit path is always
* executing on one CPU which is different from the completion
* path. There is also a cache line for members which are
* read but not written on the fast path.
*
* @efx: The associated Efx NIC
* @queue: DMA queue number
* @channel: The associated channel
* @core_txq: The networking core TX queue structure
* @buffer: The software buffer ring
* @cb_page: Array of pages of copy buffers. Carved up according to
* %EF4_TX_CB_ORDER into %EF4_TX_CB_SIZE-sized chunks.
* @txd: The hardware descriptor ring
* @ptr_mask: The size of the ring minus 1.
* @initialised: Has hardware queue been initialised?
* @tx_min_size: Minimum transmit size for this queue. Depends on HW.
* @read_count: Current read pointer.
* This is the number of buffers that have been removed from both rings.
* @old_write_count: The value of @write_count when last checked.
* This is here for performance reasons. The xmit path will
* only get the up-to-date value of @write_count if this
* variable indicates that the queue is empty. This is to
* avoid cache-line ping-pong between the xmit path and the
* completion path.
* @merge_events: Number of TX merged completion events
* @insert_count: Current insert pointer
* This is the number of buffers that have been added to the
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/timer.h`, `linux/mdio.h`, `linux/list.h`, `linux/pci.h`.
- Detected declarations: `struct ef4_self_tests`, `struct ef4_buffer`, `struct ef4_special_buffer`, `struct ef4_tx_buffer`, `struct ef4_tx_queue`, `struct ef4_rx_buffer`, `struct ef4_rx_page_state`, `struct ef4_rx_queue`, `struct ef4_channel`, `struct ef4_msi_context`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.