include/cxl/mailbox.h

Source file repositories/reference/linux-study-clean/include/cxl/mailbox.h

File Facts

System
Linux kernel
Corpus path
include/cxl/mailbox.h
Extension
.h
Size
2757 bytes
Lines
71
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct cxl_mbox_cmd {
	u16 opcode;
	void *payload_in;
	void *payload_out;
	size_t size_in;
	size_t size_out;
	size_t min_out;
	int poll_count;
	int poll_interval_ms;
	u16 return_code;
};

/**
 * struct cxl_mailbox - context for CXL mailbox operations
 * @host: device that hosts the mailbox
 * @enabled_cmds: mailbox commands that are enabled by the driver
 * @exclusive_cmds: mailbox commands that are exclusive to the kernel
 * @payload_size: Size of space for payload
 *                (CXL 3.1 8.2.8.4.3 Mailbox Capabilities Register)
 * @mbox_mutex: mutex protects device mailbox and firmware
 * @mbox_wait: rcuwait for mailbox
 * @mbox_send: @dev specific transport for transmitting mailbox commands
 * @feat_cap: Features capability
 */
struct cxl_mailbox {
	struct device *host;
	DECLARE_BITMAP(enabled_cmds, CXL_MEM_COMMAND_ID_MAX);
	DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
	size_t payload_size;
	struct mutex mbox_mutex; /* lock to protect mailbox context */
	struct rcuwait mbox_wait;
	int (*mbox_send)(struct cxl_mailbox *cxl_mbox, struct cxl_mbox_cmd *cmd);
	enum cxl_features_capability feat_cap;
};

int cxl_mailbox_init(struct cxl_mailbox *cxl_mbox, struct device *host);

#endif

Annotation

Implementation Notes