include/linux/firmware/intel/stratix10-svc-client.h

Source file repositories/reference/linux-study-clean/include/linux/firmware/intel/stratix10-svc-client.h

File Facts

System
Linux kernel
Corpus path
include/linux/firmware/intel/stratix10-svc-client.h
Extension
.h
Size
13688 bytes
Lines
393
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 stratix10_svc_client_msg {
	void *payload;
	size_t payload_length;
	void *payload_output;
	size_t payload_length_output;
	enum stratix10_svc_command_code command;
	u64 arg[3];
};

/**
 * struct stratix10_svc_command_config_type - config type
 * @flags: flag bit for the type of FPGA configuration
 */
struct stratix10_svc_command_config_type {
	u32 flags;
};

/**
 * struct stratix10_svc_cb_data - callback data structure from service layer
 * @status: the status of sent command
 * @kaddr1: address of 1st completed data block
 * @kaddr2: address of 2nd completed data block
 * @kaddr3: address of 3rd completed data block
 */
struct stratix10_svc_cb_data {
	u32 status;
	void *kaddr1;
	void *kaddr2;
	void *kaddr3;
};

/**
 * struct stratix10_svc_client - service client structure
 * @dev: the client device
 * @receive_cb: callback to provide service client the received data
 * @priv: client private data
 */
struct stratix10_svc_client {
	struct device *dev;
	void (*receive_cb)(struct stratix10_svc_client *client,
			   struct stratix10_svc_cb_data *cb_data);
	void *priv;
};

/**
 * stratix10_svc_request_channel_byname() - request service channel
 * @client: identity of the client requesting the channel
 * @name: supporting client name defined above
 *
 * Return: a pointer to channel assigned to the client on success,
 * or ERR_PTR() on error.
 */
struct stratix10_svc_chan
*stratix10_svc_request_channel_byname(struct stratix10_svc_client *client,
	const char *name);

/**
 * stratix10_svc_free_channel() - free service channel.
 * @chan: service channel to be freed
 */
void stratix10_svc_free_channel(struct stratix10_svc_chan *chan);

/**
 * stratix10_svc_allocate_memory() - allocate the momory
 * @chan: service channel assigned to the client
 * @size: number of bytes client requests
 *
 * Service layer allocates the requested number of bytes from the memory
 * pool for the client.
 *
 * Return: the starting address of allocated memory on success, or
 * ERR_PTR() on error.
 */
void *stratix10_svc_allocate_memory(struct stratix10_svc_chan *chan,
				    size_t size);

/**
 * stratix10_svc_free_memory() - free allocated memory
 * @chan: service channel assigned to the client
 * @kaddr: starting address of memory to be free back to pool
 */
void stratix10_svc_free_memory(struct stratix10_svc_chan *chan, void *kaddr);

/**
 * stratix10_svc_send() - send a message to the remote
 * @chan: service channel assigned to the client
 * @msg: message data to be sent, in the format of
 * struct stratix10_svc_client_msg
 *
 * Return: 0 for success, -ENOMEM or -ENOBUFS on error.

Annotation

Implementation Notes