drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h- Extension
.h- Size
- 19013 bytes
- Lines
- 762
- 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/dim.hlinux/if_vlan.hnet/page_pool/types.hasm/barrier.hhnae3.h
Detected Declarations
struct iphdrstruct ipv6hdrstruct hns3_desc_cbstruct hns3_rx_ptypestruct ring_statsstruct hns3_tx_sparestruct hns3_enet_ringstruct hns3_enet_coalescestruct hns3_enet_ring_groupstruct hns3_enet_tqp_vectorstruct hns3_nic_privstruct hns3_hw_error_infostruct hns3_reset_type_mapenum hns3_nic_stateenum hns3_pkt_l2t_typeenum hns3_pkt_l3t_typeenum hns3_pkt_l4t_typeenum hns3_pkt_ol3t_typeenum hns3_pkt_tun_typeenum hns3_desc_typeenum hns3_pkt_l3typeenum hns3_pkt_l4typeenum hns3_pkt_ol3typeenum hns3_pkt_ol4typeenum hns3_flow_level_rangefunction ring_spacefunction hns3_tqp_read_regfunction hns3_read_regfunction hns3_write_regfunction hns3_nic_resettingfunction hns3_page_orderfunction hns3_dcbnl_setup
Annotated Snippet
struct hns3_desc_cb {
dma_addr_t dma; /* dma address of this desc */
void *buf; /* cpu addr for a desc */
/* priv data for the desc, e.g. skb when use with ip stack */
void *priv;
union {
u32 page_offset; /* for rx */
u32 send_bytes; /* for tx */
};
u32 length; /* length of the buffer */
u16 reuse_flag;
u16 refill;
/* desc type, used by the ring user to mark the type of the priv data */
u16 type;
u16 pagecnt_bias;
};
enum hns3_pkt_l3type {
HNS3_L3_TYPE_IPV4,
HNS3_L3_TYPE_IPV6,
HNS3_L3_TYPE_ARP,
HNS3_L3_TYPE_RARP,
HNS3_L3_TYPE_IPV4_OPT,
HNS3_L3_TYPE_IPV6_EXT,
HNS3_L3_TYPE_LLDP,
HNS3_L3_TYPE_BPDU,
HNS3_L3_TYPE_MAC_PAUSE,
HNS3_L3_TYPE_PFC_PAUSE, /* 0x9 */
/* reserved for 0xA~0xB */
HNS3_L3_TYPE_CNM = 0xc,
/* reserved for 0xD~0xE */
HNS3_L3_TYPE_PARSE_FAIL = 0xf /* must be last */
};
enum hns3_pkt_l4type {
HNS3_L4_TYPE_UDP,
HNS3_L4_TYPE_TCP,
HNS3_L4_TYPE_GRE,
HNS3_L4_TYPE_SCTP,
HNS3_L4_TYPE_IGMP,
HNS3_L4_TYPE_ICMP,
/* reserved for 0x6~0xE */
HNS3_L4_TYPE_PARSE_FAIL = 0xf /* must be last */
};
enum hns3_pkt_ol3type {
HNS3_OL3_TYPE_IPV4 = 0,
HNS3_OL3_TYPE_IPV6,
/* reserved for 0x2~0x3 */
HNS3_OL3_TYPE_IPV4_OPT = 4,
HNS3_OL3_TYPE_IPV6_EXT,
/* reserved for 0x6~0xE */
HNS3_OL3_TYPE_PARSE_FAIL = 0xf /* must be last */
};
enum hns3_pkt_ol4type {
HNS3_OL4_TYPE_NO_TUN,
HNS3_OL4_TYPE_MAC_IN_UDP,
HNS3_OL4_TYPE_NVGRE,
HNS3_OL4_TYPE_UNKNOWN
};
struct hns3_rx_ptype {
u32 ptype : 8;
u32 csum_level : 2;
u32 ip_summed : 2;
u32 l3_type : 4;
u32 valid : 1;
u32 hash_type: 3;
};
struct ring_stats {
u64 sw_err_cnt;
u64 seg_pkt_cnt;
union {
struct {
u64 tx_pkts;
Annotation
- Immediate include surface: `linux/dim.h`, `linux/if_vlan.h`, `net/page_pool/types.h`, `asm/barrier.h`, `hnae3.h`.
- Detected declarations: `struct iphdr`, `struct ipv6hdr`, `struct hns3_desc_cb`, `struct hns3_rx_ptype`, `struct ring_stats`, `struct hns3_tx_spare`, `struct hns3_enet_ring`, `struct hns3_enet_coalesce`, `struct hns3_enet_ring_group`, `struct hns3_enet_tqp_vector`.
- 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.