drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h- Extension
.h- Size
- 6490 bytes
- Lines
- 295
- 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/ethtool.hlinux/netdevice.hlinux/pci.hnet/page_pool/helpers.hhbg_reg.h
Detected Declarations
struct hbg_bufferstruct hbg_ringstruct hbg_dev_specsstruct hbg_irq_infostruct hbg_vectorstruct hbg_macstruct hbg_mac_table_entrystruct hbg_mac_filterstruct hbg_user_defstruct hbg_statsstruct hbg_privenum hbg_direnum hbg_tx_stateenum hbg_nic_stateenum hbg_reset_typeenum hbg_hw_event_type
Annotated Snippet
struct hbg_buffer {
u32 state;
dma_addr_t state_dma;
struct sk_buff *skb;
dma_addr_t skb_dma;
u32 skb_len;
struct page *page;
void *page_addr;
dma_addr_t page_dma;
u32 page_size;
u32 page_offset;
enum hbg_dir dir;
struct hbg_ring *ring;
struct hbg_priv *priv;
};
struct hbg_ring {
struct hbg_buffer *queue;
dma_addr_t queue_dma;
union {
u32 head;
u32 ntc;
};
union {
u32 tail;
u32 ntu;
};
u32 len;
enum hbg_dir dir;
struct hbg_priv *priv;
struct napi_struct napi;
char *tout_log_buf; /* tx timeout log buffer */
struct page_pool *page_pool; /* only for rx */
};
enum hbg_hw_event_type {
HBG_HW_EVENT_NONE = 0,
HBG_HW_EVENT_INIT, /* driver is loading */
HBG_HW_EVENT_RESET,
HBG_HW_EVENT_CORE_RESET,
};
struct hbg_dev_specs {
u32 mac_id;
struct sockaddr mac_addr;
u32 phy_addr;
u32 mdio_frequency;
u32 rx_fifo_num;
u32 tx_fifo_num;
u32 vlan_layers;
u32 max_mtu;
u32 min_mtu;
u32 uc_mac_num;
u32 max_frame_len;
u32 rx_buf_size;
};
struct hbg_irq_info {
const char *name;
u32 mask;
bool re_enable;
bool need_print;
bool need_reset;
void (*irq_handle)(struct hbg_priv *priv,
const struct hbg_irq_info *info);
};
struct hbg_vector {
char name[HBG_VECTOR_NUM][32];
u64 *stats_array;
const struct hbg_irq_info *info_array;
u32 info_array_len;
};
struct hbg_mac {
struct mii_bus *mdio_bus;
struct phy_device *phydev;
u8 phy_addr;
u32 speed;
u32 duplex;
u32 autoneg;
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/netdevice.h`, `linux/pci.h`, `net/page_pool/helpers.h`, `hbg_reg.h`.
- Detected declarations: `struct hbg_buffer`, `struct hbg_ring`, `struct hbg_dev_specs`, `struct hbg_irq_info`, `struct hbg_vector`, `struct hbg_mac`, `struct hbg_mac_table_entry`, `struct hbg_mac_filter`, `struct hbg_user_def`, `struct hbg_stats`.
- 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.