drivers/net/ethernet/freescale/enetc/enetc.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/enetc/enetc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/enetc/enetc.h- Extension
.h- Size
- 19013 bytes
- Lines
- 700
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/timer.hlinux/pci.hlinux/netdevice.hlinux/etherdevice.hlinux/dma-mapping.hlinux/skbuff.hlinux/ethtool.hlinux/fsl/ntmp.hlinux/if_vlan.hlinux/phylink.hlinux/dim.hnet/xdp.henetc_hw.henetc4_hw.henetc_mailbox.h
Detected Declarations
struct enetc_mac_filterstruct enetc_tx_swbdstruct enetc_skb_cbstruct enetc_lso_tstruct enetc_rx_swbdstruct enetc_ring_statsstruct enetc_xdp_datastruct enetc_bdr_resourcestruct enetc_bdrstruct enetc_cbdrstruct enetc_drvdatastruct enetc_platform_infostruct enetc_sistruct enetc_si_opsstruct enetc_sistruct enetc_int_vectorstruct enetc_cls_rulestruct psfp_capstruct enetc_ndev_privenum enetc_mac_addr_typeenum enetc_errataenum enetc_active_offloadsenum enetc_flags_bitenum enetc_ic_modefunction enetc_bdr_idx_incfunction enetc_bd_unusedfunction enetc_swbd_unusedfunction enetc_rxbd_nextfunction is_enetc_rev1function enetc_si_is_pffunction enetc_pf_to_portfunction enetc_is_pseudo_macfunction enetc_cbd_free_data_memfunction enetc_ptp_clock_is_enabledfunction enetc_get_max_capfunction enetc_psfp_enablefunction enetc_psfp_disablefunction enetc_psfp_enablefunction enetc_psfp_disablefunction enetc_set_psfp
Annotated Snippet
struct enetc_mac_filter {
union {
char mac_addr[ETH_ALEN];
DECLARE_BITMAP(mac_hash_table, ENETC_MADDR_HASH_TBL_SZ);
};
int mac_addr_cnt;
};
struct enetc_tx_swbd {
union {
struct sk_buff *skb;
struct xdp_frame *xdp_frame;
};
dma_addr_t dma;
struct page *page; /* valid only if is_xdp_tx */
u16 page_offset; /* valid only if is_xdp_tx */
u16 len;
enum dma_data_direction dir;
u8 is_dma_page:1;
u8 check_wb:1;
u8 do_twostep_tstamp:1;
u8 is_eof:1;
u8 is_xdp_tx:1;
u8 is_xdp_redirect:1;
u8 qbv_en:1;
};
struct enetc_skb_cb {
u8 flag;
bool udp;
u16 correction_off;
u16 origin_tstamp_off;
};
#define ENETC_SKB_CB(skb) ((struct enetc_skb_cb *)((skb)->cb))
struct enetc_lso_t {
bool ipv6;
bool tcp;
u8 l3_hdr_len;
u8 hdr_len; /* LSO header length */
u8 l3_start;
u16 lso_seg_size;
int total_len; /* total data length, not include LSO header */
};
#define ENETC_LSO_MAX_DATA_LEN SZ_256K
#define ENETC_RX_MAXFRM_SIZE ENETC_MAC_MAXFRM_SIZE
#define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1)
#define ENETC_RXB_PAD NET_SKB_PAD /* add extra space if needed */
#define ENETC_RXB_DMA_SIZE \
min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD, 0xffff)
#define ENETC_RXB_DMA_SIZE_XDP \
min(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM, 0xffff)
struct enetc_rx_swbd {
dma_addr_t dma;
struct page *page;
u16 page_offset;
enum dma_data_direction dir;
u16 len;
};
/* ENETC overhead: optional extension BD + 1 BD gap */
#define ENETC_TXBDS_NEEDED(val) ((val) + 2)
/* For LS1028A, max # of chained Tx BDs is 15, including head and
* extension BD.
*/
#define ENETC_MAX_SKB_FRAGS 13
/* For ENETC v4 and later versions, max # of chained Tx BDs is 63,
* including head and extension BD, but the range of MAX_SKB_FRAGS
* is 17 ~ 45, so set ENETC4_MAX_SKB_FRAGS to MAX_SKB_FRAGS.
*/
#define ENETC4_MAX_SKB_FRAGS MAX_SKB_FRAGS
#define ENETC_TXBDS_MAX_NEEDED(x) ENETC_TXBDS_NEEDED((x) + 1)
struct enetc_ring_stats {
unsigned long packets;
unsigned long bytes;
unsigned long rx_alloc_errs;
unsigned long xdp_drops;
unsigned long xdp_tx;
unsigned long xdp_tx_drops;
unsigned long xdp_redirect;
unsigned long xdp_redirect_failures;
unsigned long recycles;
unsigned long recycle_failures;
unsigned long win_drop;
};
Annotation
- Immediate include surface: `linux/timer.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/dma-mapping.h`, `linux/skbuff.h`, `linux/ethtool.h`, `linux/fsl/ntmp.h`.
- Detected declarations: `struct enetc_mac_filter`, `struct enetc_tx_swbd`, `struct enetc_skb_cb`, `struct enetc_lso_t`, `struct enetc_rx_swbd`, `struct enetc_ring_stats`, `struct enetc_xdp_data`, `struct enetc_bdr_resource`, `struct enetc_bdr`, `struct enetc_cbdr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.