drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h- Extension
.h- Size
- 32442 bytes
- Lines
- 1185
- 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/fs.hlinux/types.hlinux/phy.hlinux/if_vlan.hlinux/kfifo.hnet/devlink.hnet/ipv6.hhclge_cmd.hhclge_ptp.hhnae3.hhclge_comm_rss.hhclge_comm_tqp_stats.h
Detected Declarations
struct hclge_wol_infostruct hclge_macstruct hclge_hwstruct hclge_pg_infostruct hclge_tc_infostruct hclge_cfgstruct hclge_tm_infostruct hclge_comm_stats_strstruct hclge_mac_statsstruct hclge_fec_statsstruct hclge_vlan_type_cfgstruct key_infostruct hclge_fd_user_def_cfgstruct hclge_fd_user_def_infostruct hclge_fd_key_cfgstruct hclge_fd_cfgstruct hclge_fd_rule_tuplesstruct hclge_fd_rulestruct hclge_fd_ad_datastruct hclge_mac_nodestruct hclge_vport_vlan_cfgstruct hclge_rst_statsstruct hclge_mac_tnl_statsstruct hclge_vf_vlan_cfgstruct hclge_devstruct hclge_tx_vtag_cfgstruct hclge_rx_vtag_cfgstruct hclge_vlan_infostruct hclge_port_base_vlan_configstruct hclge_vf_infostruct hclge_vportstruct hclge_speed_bit_mapstruct hclge_mac_speed_mapstruct hclge_link_mode_bmapenum HLCGE_PORT_TYPEenum HCLGE_DEV_STATEenum hclge_evt_causeenum HCLGE_MAC_SPEEDenum HCLGE_MAC_DUPLEXenum hclge_hilink_versionenum hclge_fc_modeenum hclge_vlan_fltr_capenum hclge_link_fail_codeenum HCLGE_FD_MODEenum HCLGE_FD_KEY_TYPEenum HCLGE_FD_STAGEenum HCLGE_FD_TUPLEenum HCLGE_FD_META_DATA
Annotated Snippet
struct hclge_wol_info {
u32 wol_support_mode; /* store the wake on lan info */
u32 wol_current_mode;
u8 wol_sopass[SOPASS_MAX];
u8 wol_sopass_size;
};
struct hclge_mac {
u8 mac_id;
u8 phy_addr;
u8 flag;
u8 media_type; /* port media type, e.g. fibre/copper/backplane */
u8 mac_addr[ETH_ALEN];
u8 autoneg;
u8 req_autoneg;
u8 duplex;
u8 req_duplex;
u8 support_autoneg;
u8 speed_type; /* 0: sfp speed, 1: active speed */
u8 lane_num;
u32 speed;
u32 req_speed;
u32 max_speed;
u32 speed_ability; /* speed ability supported by current media */
u32 module_type; /* sub media type, e.g. kr/cr/sr/lr */
u32 fec_mode; /* active fec mode */
u32 user_fec_mode;
u32 fec_ability;
int link; /* store the link status of mac & phy (if phy exists) */
struct hclge_wol_info wol;
struct phy_device *phydev;
struct mii_bus *mdio_bus;
phy_interface_t phy_if;
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
};
struct hclge_hw {
struct hclge_comm_hw hw;
struct hclge_mac mac;
int num_vec;
};
enum hclge_fc_mode {
HCLGE_FC_NONE,
HCLGE_FC_RX_PAUSE,
HCLGE_FC_TX_PAUSE,
HCLGE_FC_FULL,
HCLGE_FC_PFC,
HCLGE_FC_DEFAULT
};
#define HCLGE_FILTER_TYPE_VF 0
#define HCLGE_FILTER_TYPE_PORT 1
#define HCLGE_FILTER_FE_EGRESS_V1_B BIT(0)
#define HCLGE_FILTER_FE_NIC_INGRESS_B BIT(0)
#define HCLGE_FILTER_FE_NIC_EGRESS_B BIT(1)
#define HCLGE_FILTER_FE_ROCE_INGRESS_B BIT(2)
#define HCLGE_FILTER_FE_ROCE_EGRESS_B BIT(3)
#define HCLGE_FILTER_FE_EGRESS (HCLGE_FILTER_FE_NIC_EGRESS_B \
| HCLGE_FILTER_FE_ROCE_EGRESS_B)
#define HCLGE_FILTER_FE_INGRESS (HCLGE_FILTER_FE_NIC_INGRESS_B \
| HCLGE_FILTER_FE_ROCE_INGRESS_B)
enum hclge_vlan_fltr_cap {
HCLGE_VLAN_FLTR_DEF,
HCLGE_VLAN_FLTR_CAN_MDF,
};
enum hclge_link_fail_code {
HCLGE_LF_NORMAL,
HCLGE_LF_REF_CLOCK_LOST,
HCLGE_LF_XSFP_TX_DISABLE,
HCLGE_LF_XSFP_ABSENT,
};
#define HCLGE_LINK_STATUS_DOWN 0
#define HCLGE_LINK_STATUS_UP 1
#define HCLGE_PG_NUM 4
#define HCLGE_SCH_MODE_SP 0
#define HCLGE_SCH_MODE_DWRR 1
struct hclge_pg_info {
u8 pg_id;
u8 pg_sch_mode; /* 0: sp; 1: dwrr */
u8 tc_bit_map;
u32 bw_limit;
u8 tc_dwrr[HNAE3_MAX_TC];
};
struct hclge_tc_info {
Annotation
- Immediate include surface: `linux/fs.h`, `linux/types.h`, `linux/phy.h`, `linux/if_vlan.h`, `linux/kfifo.h`, `net/devlink.h`, `net/ipv6.h`, `hclge_cmd.h`.
- Detected declarations: `struct hclge_wol_info`, `struct hclge_mac`, `struct hclge_hw`, `struct hclge_pg_info`, `struct hclge_tc_info`, `struct hclge_cfg`, `struct hclge_tm_info`, `struct hclge_comm_stats_str`, `struct hclge_mac_stats`, `struct hclge_fec_stats`.
- 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.