drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h- Extension
.h- Size
- 7101 bytes
- Lines
- 257
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/mutex.hlinux/types.h
Detected Declarations
struct hclge_ring_chain_paramstruct hclge_basic_infostruct hclgevf_mbx_resp_statusstruct hclge_respond_to_vf_msgstruct hclge_vf_to_pf_msgstruct hclge_pf_to_vf_msgstruct hclge_mbx_vf_to_pf_cmdstruct hclge_mbx_pf_to_vf_cmdstruct hclge_vf_rst_cmdstruct hclge_mbx_link_statusstruct hclge_mbx_link_modestruct hclge_mbx_port_base_vlanstruct hclge_mbx_vf_queue_infostruct hclge_mbx_vf_queue_depthstruct hclge_mbx_vlan_filterstruct hclge_mbx_mtu_infostruct hclgevf_mbx_arq_ringstruct hclge_devstruct hclge_mbx_ops_paramenum HCLGE_MBX_OPCODEenum hclge_mbx_mac_vlan_subcodeenum hclge_mbx_vlan_cfg_subcodeenum hclge_mbx_tbl_cfg_subcode
Annotated Snippet
struct hclge_ring_chain_param {
u8 ring_type;
u8 tqp_index;
u8 int_gl_index;
};
struct hclge_basic_info {
u8 hw_tc_map;
u8 rsv;
__le16 mbx_api_version;
__le32 pf_caps;
};
struct hclgevf_mbx_resp_status {
struct mutex mbx_mutex; /* protects against contending sync cmd resp */
u32 origin_mbx_msg;
bool received_resp;
int resp_status;
u16 match_id;
u8 additional_info[HCLGE_MBX_MAX_RESP_DATA_SIZE];
};
struct hclge_respond_to_vf_msg {
int status;
u8 data[HCLGE_MBX_MAX_RESP_DATA_SIZE];
u16 len;
};
struct hclge_vf_to_pf_msg {
u8 code;
union {
struct {
u8 subcode;
u8 data[HCLGE_MBX_MAX_MSG_SIZE];
};
struct {
u8 en_bc;
u8 en_uc;
u8 en_mc;
u8 en_limit_promisc;
};
struct {
u8 vector_id;
u8 ring_num;
struct hclge_ring_chain_param
param[HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM];
};
};
};
struct hclge_pf_to_vf_msg {
__le16 code;
union {
/* used for mbx response */
struct {
__le16 vf_mbx_msg_code;
__le16 vf_mbx_msg_subcode;
__le16 resp_status;
u8 resp_data[HCLGE_MBX_MAX_RESP_DATA_SIZE];
};
/* used for general mbx */
struct {
u8 msg_data[HCLGE_MBX_MAX_MSG_SIZE];
};
};
};
struct hclge_mbx_vf_to_pf_cmd {
u8 rsv;
u8 mbx_src_vfid; /* Auto filled by IMP */
u8 mbx_need_resp;
u8 rsv1[1];
u8 msg_len;
u8 rsv2;
__le16 match_id;
struct hclge_vf_to_pf_msg msg;
};
#define HCLGE_MBX_NEED_RESP_B 0
struct hclge_mbx_pf_to_vf_cmd {
u8 dest_vfid;
u8 rsv[3];
u8 msg_len;
u8 rsv1;
__le16 match_id;
struct hclge_pf_to_vf_msg msg;
};
struct hclge_vf_rst_cmd {
Annotation
- Immediate include surface: `linux/init.h`, `linux/mutex.h`, `linux/types.h`.
- Detected declarations: `struct hclge_ring_chain_param`, `struct hclge_basic_info`, `struct hclgevf_mbx_resp_status`, `struct hclge_respond_to_vf_msg`, `struct hclge_vf_to_pf_msg`, `struct hclge_pf_to_vf_msg`, `struct hclge_mbx_vf_to_pf_cmd`, `struct hclge_mbx_pf_to_vf_cmd`, `struct hclge_vf_rst_cmd`, `struct hclge_mbx_link_status`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.