include/linux/ipmi_smi.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/ipmi_smi.h
Extension
.h
Size
10214 bytes
Lines
329
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ipmi_smi_msg {
	struct list_head link;

	enum ipmi_smi_msg_type type;

	long msgid;
	/* Response to this message, will be NULL if not from a user request. */
	struct ipmi_recv_msg *recv_msg;

	int           data_size;
	unsigned char data[IPMI_MAX_MSG_LENGTH];

	int           rsp_size;
	unsigned char rsp[IPMI_MAX_MSG_LENGTH];

	/*
	 * Will be called when the system is done with the message
	 * (presumably to free it).
	 */
	void (*done)(struct ipmi_smi_msg *msg);
};

#define INIT_IPMI_SMI_MSG(done_handler) \
{						\
	.done = done_handler,			\
	.type = IPMI_SMI_MSG_TYPE_NORMAL	\
}

struct ipmi_smi_handlers {
	struct module *owner;

	/* Capabilities of the SMI. */
#define IPMI_SMI_CAN_HANDLE_IPMB_DIRECT		(1 << 0)
	unsigned int flags;

	/*
	 * The low-level interface cannot start sending messages to
	 * the upper layer until this function is called.  This may
	 * not be NULL, the lower layer must take the interface from
	 * this call.
	 */
	int (*start_processing)(void            *send_info,
				struct ipmi_smi *new_intf);

	/*
	 * When called, the low-level interface should disable all
	 * processing, it should be complete shut down when it returns.
	 */
	void (*shutdown)(void *send_info);

	/*
	 * Get the detailed private info of the low level interface and store
	 * it into the structure of ipmi_smi_data. For example: the
	 * ACPI device handle will be returned for the pnp_acpi IPMI device.
	 */
	int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data);

	/*
	 * Called to enqueue an SMI message to be sent.  This
	 * operation is not allowed to fail.  If an error occurs, it
	 * should report back the error in a received message.  It may
	 * do this in the current call context, since no write locks
	 * are held when this is run.  Message are delivered one at
	 * a time by the message handler, a new message will not be
	 * delivered until the previous message is returned.
	 *
	 * This can return an error if the SMI is not in a state where it
	 * can send a message.
	 */
	int (*sender)(void *send_info, struct ipmi_smi_msg *msg);

	/*
	 * Called by the upper layer to request that we try to get
	 * events from the BMC we are attached to.
	 */
	void (*request_events)(void *send_info);

	/*
	 * Called by the upper layer when some user requires that the
	 * interface watch for received messages and watchdog
	 * pretimeouts (basically do a "Get Flags", or not.  Used by
	 * the SMI to know if it should watch for these.  This may be
	 * NULL if the SMI does not implement it.  watch_mask is from
	 * IPMI_WATCH_MASK_xxx above.  The interface should run slower
	 * timeouts for just watchdog checking or faster timeouts when
	 * waiting for the message queue.
	 */
	void (*set_need_watch)(void *send_info, unsigned int watch_mask);

	/*

Annotation

Implementation Notes