drivers/net/ethernet/microchip/sparx5/sparx5_main.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/sparx5/sparx5_main.h- Extension
.h- Size
- 27550 bytes
- Lines
- 868
- 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/types.hlinux/phy/phy.hlinux/netdevice.hlinux/phy.hlinux/if_vlan.hlinux/bitmap.hlinux/phylink.hlinux/net_tstamp.hlinux/ptp_clock_kernel.hlinux/hrtimer.hlinux/debugfs.hnet/flow_offload.hfdma_api.hsparx5_main_regs.h
Detected Declarations
struct sparx5struct sparx5_calendar_datastruct sparx5_rxstruct sparx5_tx_bufstruct sparx5_txstruct sparx5_port_configstruct sparx5_portstruct sparx5_phcstruct sparx5_skb_cbstruct sparx5_mdb_entrystruct sparx5_mall_mirror_entrystruct sparx5_mall_entrystruct sparx5_regsstruct sparx5_constsstruct sparx5_opsstruct sparx5_main_io_resourcestruct sparx5_match_datastruct sparx5struct frame_infostruct sparx5_pool_entrystruct sparx5_sdlb_groupstruct sparx5_policerstruct sparx5_psfp_fmstruct sparx5_psfp_gcestruct sparx5_psfp_sgstruct sparx5_psfp_sfenum spx5_target_chiptypeenum sparx5_port_max_tagsenum sparx5_vlan_port_typeenum sparx5_cal_bwenum sparx5_featureenum sparx5_core_clockfreqenum sparx5_pgid_typefunction sparx5_dcb_initfunction sparx5_clk_periodfunction sparx5_is_baserfunction spx5_offsetfunction spx5_rdfunction spx5_inst_rdfunction spx5_wrfunction spx5_inst_wrfunction spx5_rmwfunction spx5_inst_rmw
Annotated Snippet
struct sparx5_calendar_data {
u32 schedule[SPX5_DSM_CAL_LEN];
u32 avg_dist[SPX5_DSM_CAL_MAX_DEVS_PER_TAXI];
u32 taxi_ports[SPX5_DSM_CAL_MAX_DEVS_PER_TAXI];
u32 taxi_speeds[SPX5_DSM_CAL_MAX_DEVS_PER_TAXI];
u32 dev_slots[SPX5_DSM_CAL_MAX_DEVS_PER_TAXI];
u32 new_slots[SPX5_DSM_CAL_LEN];
u32 temp_sched[SPX5_DSM_CAL_LEN];
u32 indices[SPX5_DSM_CAL_LEN];
u32 short_list[SPX5_DSM_CAL_LEN];
u32 long_list[SPX5_DSM_CAL_LEN];
};
/* Frame DMA receive state:
* For each DB, there is a SKB, and the skb data pointer is mapped in
* the DB. Once a frame is received the skb is given to the upper layers
* and a new skb is added to the dcb.
* When the db_index reached FDMA_RX_DCB_MAX_DBS the DB is reused.
*/
struct sparx5_rx {
struct fdma fdma;
struct page_pool *page_pool;
union {
struct sk_buff *skb[FDMA_DCB_MAX][FDMA_RX_DCB_MAX_DBS];
struct page *page[FDMA_DCB_MAX][FDMA_RX_DCB_MAX_DBS];
};
dma_addr_t dma;
struct napi_struct napi;
struct net_device *ndev;
u64 packets;
u8 page_order;
};
/* Used to store information about TX buffers. */
struct sparx5_tx_buf {
struct net_device *dev;
struct sk_buff *skb;
dma_addr_t dma_addr;
bool used;
bool ptp;
};
/* Frame DMA transmit state:
* DCBs are chained using the DCBs nextptr field.
*/
struct sparx5_tx {
struct fdma fdma;
struct sparx5_tx_buf *dbs;
u64 packets;
u64 dropped;
};
struct sparx5_port_config {
phy_interface_t portmode;
u32 bandwidth;
int speed;
int duplex;
enum phy_media media;
bool inband;
bool power_down;
bool autoneg;
bool serdes_reset;
u32 pause;
u32 pause_adv;
phy_interface_t phy_mode;
u32 sd_sgpio;
};
struct sparx5_port {
struct net_device *ndev;
struct sparx5 *sparx5;
struct device_node *of_node;
struct phy *serdes;
struct sparx5_port_config conf;
struct phylink_config phylink_config;
struct phylink *phylink;
struct phylink_pcs phylink_pcs;
struct flow_stats mirror_stats;
u16 portno;
/* Ingress default VLAN (pvid) */
u16 pvid;
/* Egress default VLAN (vid) */
u16 vid;
bool signd_internal;
bool signd_active_high;
bool signd_enable;
bool flow_control;
enum sparx5_port_max_tags max_vlan_tags;
enum sparx5_vlan_port_type vlan_type;
u32 custom_etype;
Annotation
- Immediate include surface: `linux/types.h`, `linux/phy/phy.h`, `linux/netdevice.h`, `linux/phy.h`, `linux/if_vlan.h`, `linux/bitmap.h`, `linux/phylink.h`, `linux/net_tstamp.h`.
- Detected declarations: `struct sparx5`, `struct sparx5_calendar_data`, `struct sparx5_rx`, `struct sparx5_tx_buf`, `struct sparx5_tx`, `struct sparx5_port_config`, `struct sparx5_port`, `struct sparx5_phc`, `struct sparx5_skb_cb`, `struct sparx5_mdb_entry`.
- 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.