include/linux/rpmsg.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/rpmsg.h
Extension
.h
Size
8959 bytes
Lines
328
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: operation-table or driver-model contract
Status
pattern 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 device_driver drv;
	const struct rpmsg_device_id *id_table;
	int (*probe)(struct rpmsg_device *dev);
	void (*remove)(struct rpmsg_device *dev);
	int (*callback)(struct rpmsg_device *, void *, int, void *, u32);
	int (*flowcontrol)(struct rpmsg_device *, void *, bool);
};

static inline u16 rpmsg16_to_cpu(struct rpmsg_device *rpdev, __rpmsg16 val)
{
	if (!rpdev)
		return __rpmsg16_to_cpu(rpmsg_is_little_endian(), val);
	else
		return __rpmsg16_to_cpu(rpdev->little_endian, val);
}

static inline __rpmsg16 cpu_to_rpmsg16(struct rpmsg_device *rpdev, u16 val)
{
	if (!rpdev)
		return __cpu_to_rpmsg16(rpmsg_is_little_endian(), val);
	else
		return __cpu_to_rpmsg16(rpdev->little_endian, val);
}

static inline u32 rpmsg32_to_cpu(struct rpmsg_device *rpdev, __rpmsg32 val)
{
	if (!rpdev)
		return __rpmsg32_to_cpu(rpmsg_is_little_endian(), val);
	else
		return __rpmsg32_to_cpu(rpdev->little_endian, val);
}

static inline __rpmsg32 cpu_to_rpmsg32(struct rpmsg_device *rpdev, u32 val)
{
	if (!rpdev)
		return __cpu_to_rpmsg32(rpmsg_is_little_endian(), val);
	else
		return __cpu_to_rpmsg32(rpdev->little_endian, val);
}

static inline u64 rpmsg64_to_cpu(struct rpmsg_device *rpdev, __rpmsg64 val)
{
	if (!rpdev)
		return __rpmsg64_to_cpu(rpmsg_is_little_endian(), val);
	else
		return __rpmsg64_to_cpu(rpdev->little_endian, val);
}

static inline __rpmsg64 cpu_to_rpmsg64(struct rpmsg_device *rpdev, u64 val)
{
	if (!rpdev)
		return __cpu_to_rpmsg64(rpmsg_is_little_endian(), val);
	else
		return __cpu_to_rpmsg64(rpdev->little_endian, val);
}

#if IS_ENABLED(CONFIG_RPMSG)

int rpmsg_register_device_override(struct rpmsg_device *rpdev,
				   const char *driver_override);
int rpmsg_register_device(struct rpmsg_device *rpdev);
int rpmsg_unregister_device(struct device *parent,
			    struct rpmsg_channel_info *chinfo);
int __register_rpmsg_driver(struct rpmsg_driver *drv, struct module *owner);
void unregister_rpmsg_driver(struct rpmsg_driver *drv);
void rpmsg_destroy_ept(struct rpmsg_endpoint *);
struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *,
					rpmsg_rx_cb_t cb, void *priv,
					struct rpmsg_channel_info chinfo);

int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len);
int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);

int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len);
int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);

__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
			poll_table *wait);

ssize_t rpmsg_get_mtu(struct rpmsg_endpoint *ept);

int rpmsg_set_flow_control(struct rpmsg_endpoint *ept, bool pause, u32 dst);

#else

static inline int rpmsg_register_device_override(struct rpmsg_device *rpdev,
						 const char *driver_override)
{
	return -ENXIO;
}

Annotation

Implementation Notes