drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h
Extension
.h
Size
5464 bytes
Lines
182
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hinic_recv_msg {
	u8                      *msg;
	u8                      *buf_out;

	struct completion       recv_done;

	u16                     cmd;
	enum hinic_mod_type     mod;
	int                     async_mgmt_to_pf;

	u16                     msg_len;
	u16                     msg_id;
};

struct hinic_mgmt_cb {
	void    (*cb)(void *handle, u8 cmd,
		      void *buf_in, u16 in_size,
		      void *buf_out, u16 *out_size);

	void            *handle;
	unsigned long   state;
};

struct hinic_pf_to_mgmt {
	struct hinic_hwif               *hwif;
	struct hinic_hwdev		*hwdev;
	struct semaphore                sync_msg_lock;
	u16                             sync_msg_id;
	u8                              *sync_msg_buf;
	void				*mgmt_ack_buf;

	struct hinic_recv_msg           recv_resp_msg_from_mgmt;
	struct hinic_recv_msg           recv_msg_from_mgmt;

	struct hinic_api_cmd_chain      *cmd_chain[HINIC_API_CMD_MAX];

	struct hinic_mgmt_cb            mgmt_cb[HINIC_MOD_MAX];

	struct workqueue_struct		*workq;
};

struct hinic_mgmt_msg_handle_work {
	struct work_struct work;
	struct hinic_pf_to_mgmt *pf_to_mgmt;

	void			*msg;
	u16			msg_len;

	enum hinic_mod_type	mod;
	u8			cmd;
	u16			msg_id;
	int			async_mgmt_to_pf;
};

void hinic_register_mgmt_msg_cb(struct hinic_pf_to_mgmt *pf_to_mgmt,
				enum hinic_mod_type mod,
				void *handle,
				void (*callback)(void *handle,
						 u8 cmd, void *buf_in,
						 u16 in_size, void *buf_out,
						 u16 *out_size));

void hinic_unregister_mgmt_msg_cb(struct hinic_pf_to_mgmt *pf_to_mgmt,
				  enum hinic_mod_type mod);

int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
		      enum hinic_mod_type mod, u8 cmd,
		      void *buf_in, u16 in_size, void *buf_out, u16 *out_size,
		      enum hinic_mgmt_msg_type sync);

int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt,
			  struct hinic_hwif *hwif);

void hinic_pf_to_mgmt_free(struct hinic_pf_to_mgmt *pf_to_mgmt);

#endif

Annotation

Implementation Notes