drivers/net/ethernet/microchip/lan966x/lan966x_main.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/lan966x/lan966x_main.h- Extension
.h- Size
- 22386 bytes
- Lines
- 747
- 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/debugfs.hlinux/etherdevice.hlinux/if_vlan.hlinux/jiffies.hlinux/phy.hlinux/phylink.hlinux/ptp_clock_kernel.hnet/page_pool/types.hnet/pkt_cls.hnet/pkt_sched.hnet/switchdev.hnet/xdp.hfdma_api.hvcap_api.hvcap_api_client.hlan966x_regs.hlan966x_ifh.h
Detected Declarations
struct lan966x_portstruct lan966x_rxstruct lan966x_tx_dcb_bufstruct lan966x_txstruct lan966x_stat_layoutstruct lan966x_phcstruct lan966x_skb_cbstruct lan966xstruct lan966x_port_configstruct lan966x_port_tcstruct lan966x_port_qos_pcpstruct lan966x_port_qos_dscpstruct lan966x_port_qos_pcp_rewrstruct lan966x_port_qos_dscp_rewrstruct lan966x_port_qosstruct lan966x_portenum macaccess_entry_typeenum lan966x_fdma_actionenum LAN966X_PORT_MASK_MODEenum vcap_is2_port_sel_ipv6enum vcap_is1_port_sel_otherenum vcap_is1_port_sel_ipv4enum vcap_is1_port_sel_ipv6enum vcap_is1_port_sel_rtfunction lan966x_xdp_port_presentfunction lan966x_vcap_port_infofunction lan966x_dcb_initfunction lan_rdfunction lan_wrfunction lan_rmw
Annotated Snippet
struct lan966x_rx {
struct lan966x *lan966x;
struct fdma fdma;
/* For each DB, there is a page */
struct page *page[FDMA_DCB_MAX][FDMA_RX_DCB_MAX_DBS];
/* Represents the page order that is used to allocate the pages for the
* RX buffers. This value is calculated based on max MTU of the devices.
*/
u8 page_order;
/* Represents the max size frame that it can receive to the CPU. This
* includes the IFH + VLAN tags + frame + skb_shared_info
*/
u32 max_mtu;
struct page_pool *page_pool;
};
struct lan966x_tx_dcb_buf {
dma_addr_t dma_addr;
struct net_device *dev;
union {
struct sk_buff *skb;
struct xdp_frame *xdpf;
struct page *page;
} data;
u32 len;
u32 used : 1;
u32 ptp : 1;
u32 use_skb : 1;
u32 xdp_ndo : 1;
};
struct lan966x_tx {
struct lan966x *lan966x;
struct fdma fdma;
/* Array of dcbs that are given to the HW */
struct lan966x_tx_dcb_buf *dcbs_buf;
bool activated;
};
struct lan966x_stat_layout {
u32 offset;
char name[ETH_GSTRING_LEN];
};
struct lan966x_phc {
struct ptp_clock *clock;
struct ptp_clock_info info;
struct ptp_pin_desc pins[LAN966X_PHC_PINS_NUM];
struct kernel_hwtstamp_config hwtstamp_config;
struct lan966x *lan966x;
u8 index;
};
struct lan966x_skb_cb {
u8 rew_op;
u8 pdu_type;
u16 ts_id;
unsigned long jiffies;
};
#define LAN966X_PTP_TIMEOUT msecs_to_jiffies(10)
#define LAN966X_SKB_CB(skb) \
((struct lan966x_skb_cb *)((skb)->cb))
struct lan966x {
struct device *dev;
u8 num_phys_ports;
struct lan966x_port **ports;
void __iomem *regs[NUM_TARGETS];
int shared_queue_sz;
u8 base_mac[ETH_ALEN];
spinlock_t tx_lock; /* lock for frame transmission */
struct net_device *bridge;
u16 bridge_mask;
u16 bridge_fwd_mask;
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/etherdevice.h`, `linux/if_vlan.h`, `linux/jiffies.h`, `linux/phy.h`, `linux/phylink.h`, `linux/ptp_clock_kernel.h`, `net/page_pool/types.h`.
- Detected declarations: `struct lan966x_port`, `struct lan966x_rx`, `struct lan966x_tx_dcb_buf`, `struct lan966x_tx`, `struct lan966x_stat_layout`, `struct lan966x_phc`, `struct lan966x_skb_cb`, `struct lan966x`, `struct lan966x_port_config`, `struct lan966x_port_tc`.
- 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.