drivers/net/ethernet/airoha/airoha_eth.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/airoha/airoha_eth.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/airoha/airoha_eth.h- Extension
.h- Size
- 15038 bytes
- Lines
- 704
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/etherdevice.hlinux/iopoll.hlinux/kernel.hlinux/netdevice.hlinux/reset.hlinux/soc/airoha/airoha_offload.hnet/dsa.h
Detected Declarations
struct airoha_queue_entrystruct airoha_queuestruct airoha_tx_irq_queuestruct airoha_hw_statsstruct airoha_foe_mac_info_commonstruct airoha_foe_mac_infostruct airoha_foe_bridgestruct airoha_foe_ipv4_tuplestruct airoha_foe_ipv4struct airoha_foe_ipv4_dslitestruct airoha_foe_ipv6struct airoha_foe_entrystruct airoha_foe_statsstruct airoha_foe_stats64struct airoha_flow_datastruct airoha_flow_table_entrystruct airoha_wdma_infostruct airoha_irq_bankstruct airoha_qdmastruct airoha_gdm_devstruct airoha_gdm_portstruct airoha_ppestruct airoha_eth_soc_datastruct airoha_ethenum airoha_gdm_indexenum tx_sched_modeenum trtcm_unit_typeenum trtcm_param_typeenum trtcm_mode_typeenum trtcm_paramenum airoha_flow_entry_typeenum airoha_priv_flagsfunction airoha_qdma_get_txqfunction airoha_is_lan_gdm_devfunction airoha_is_7581function airoha_is_7583function airoha_ppe_debugfs_init
Annotated Snippet
struct airoha_queue_entry {
union {
void *buf;
struct {
struct list_head list;
struct sk_buff *skb;
};
};
dma_addr_t dma_addr;
u16 dma_len;
};
struct airoha_queue {
struct airoha_qdma *qdma;
/* protect concurrent queue accesses */
spinlock_t lock;
struct airoha_queue_entry *entry;
struct airoha_qdma_desc *desc;
u16 head;
u16 tail;
int queued;
int ndesc;
int free_thr;
int buf_size;
bool txq_stopped;
struct napi_struct napi;
struct page_pool *page_pool;
struct sk_buff *skb;
struct list_head tx_list;
};
struct airoha_tx_irq_queue {
struct airoha_qdma *qdma;
struct napi_struct napi;
int size;
u32 *q;
};
struct airoha_hw_stats {
struct u64_stats_sync syncp;
/* get_stats64 */
u64 rx_ok_pkts;
u64 tx_ok_pkts;
u64 rx_ok_bytes;
u64 tx_ok_bytes;
u64 rx_multicast;
u64 rx_errors;
u64 rx_drops;
u64 tx_drops;
u64 rx_crc_error;
u64 rx_over_errors;
/* ethtool stats */
u64 tx_broadcast;
u64 tx_multicast;
u64 tx_len[7];
u64 rx_broadcast;
u64 rx_fragment;
u64 rx_jabber;
u64 rx_len[7];
};
enum {
AIROHA_FOE_STATE_INVALID,
AIROHA_FOE_STATE_UNBIND,
AIROHA_FOE_STATE_BIND,
AIROHA_FOE_STATE_FIN
};
enum {
PPE_PKT_TYPE_IPV4_HNAPT = 0,
PPE_PKT_TYPE_IPV4_ROUTE = 1,
PPE_PKT_TYPE_BRIDGE = 2,
PPE_PKT_TYPE_IPV4_DSLITE = 3,
PPE_PKT_TYPE_IPV6_ROUTE_3T = 4,
PPE_PKT_TYPE_IPV6_ROUTE_5T = 5,
PPE_PKT_TYPE_IPV6_6RD = 7,
};
#define AIROHA_FOE_MAC_SMAC_ID GENMASK(20, 16)
#define AIROHA_FOE_MAC_PPPOE_ID GENMASK(15, 0)
#define AIROHA_FOE_MAC_WDMA_QOS GENMASK(15, 12)
#define AIROHA_FOE_MAC_WDMA_BAND BIT(11)
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/etherdevice.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/netdevice.h`, `linux/reset.h`, `linux/soc/airoha/airoha_offload.h`, `net/dsa.h`.
- Detected declarations: `struct airoha_queue_entry`, `struct airoha_queue`, `struct airoha_tx_irq_queue`, `struct airoha_hw_stats`, `struct airoha_foe_mac_info_common`, `struct airoha_foe_mac_info`, `struct airoha_foe_bridge`, `struct airoha_foe_ipv4_tuple`, `struct airoha_foe_ipv4`, `struct airoha_foe_ipv4_dslite`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.