include/linux/greybus/greybus_protocols.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/greybus/greybus_protocols.h
Extension
.h
Size
60863 bytes
Lines
2175
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 gb_operation_msg_hdr {
	__le16	size;		/* Size in bytes of header + payload */
	__le16	operation_id;	/* Operation unique id */
	__u8	type;		/* E.g GB_I2C_TYPE_* or GB_GPIO_TYPE_* */
	__u8	result;		/* Result of request (in responses only) */
	__u8	pad[2];		/* must be zero (ignore when read) */
} __packed;


/* Generic request types */
#define GB_REQUEST_TYPE_CPORT_SHUTDOWN		0x00
#define GB_REQUEST_TYPE_INVALID			0x7f

struct gb_cport_shutdown_request {
	__u8 phase;
} __packed;


/* Control Protocol */

/* Greybus control request types */
#define GB_CONTROL_TYPE_VERSION			0x01
#define GB_CONTROL_TYPE_PROBE_AP		0x02
#define GB_CONTROL_TYPE_GET_MANIFEST_SIZE	0x03
#define GB_CONTROL_TYPE_GET_MANIFEST		0x04
#define GB_CONTROL_TYPE_CONNECTED		0x05
#define GB_CONTROL_TYPE_DISCONNECTED		0x06
#define GB_CONTROL_TYPE_TIMESYNC_ENABLE		0x07
#define GB_CONTROL_TYPE_TIMESYNC_DISABLE	0x08
#define GB_CONTROL_TYPE_TIMESYNC_AUTHORITATIVE	0x09
/*	Unused					0x0a */
#define GB_CONTROL_TYPE_BUNDLE_VERSION		0x0b
#define GB_CONTROL_TYPE_DISCONNECTING		0x0c
#define GB_CONTROL_TYPE_TIMESYNC_GET_LAST_EVENT	0x0d
#define GB_CONTROL_TYPE_MODE_SWITCH		0x0e
#define GB_CONTROL_TYPE_BUNDLE_SUSPEND		0x0f
#define GB_CONTROL_TYPE_BUNDLE_RESUME		0x10
#define GB_CONTROL_TYPE_BUNDLE_DEACTIVATE	0x11
#define GB_CONTROL_TYPE_BUNDLE_ACTIVATE		0x12
#define GB_CONTROL_TYPE_INTF_SUSPEND_PREPARE		0x13
#define GB_CONTROL_TYPE_INTF_DEACTIVATE_PREPARE	0x14
#define GB_CONTROL_TYPE_INTF_HIBERNATE_ABORT	0x15

struct gb_control_version_request {
	__u8	major;
	__u8	minor;
} __packed;

struct gb_control_version_response {
	__u8	major;
	__u8	minor;
} __packed;

struct gb_control_bundle_version_request {
	__u8	bundle_id;
} __packed;

struct gb_control_bundle_version_response {
	__u8	major;
	__u8	minor;
} __packed;

/* Control protocol manifest get size request has no payload*/
struct gb_control_get_manifest_size_response {
	__le16			size;
} __packed;

/* Control protocol manifest get request has no payload */
struct gb_control_get_manifest_response {
	__u8			data[0];
} __packed;

/* Control protocol [dis]connected request */
struct gb_control_connected_request {
	__le16			cport_id;
} __packed;

struct gb_control_disconnecting_request {
	__le16			cport_id;
} __packed;
/* disconnecting response has no payload */

struct gb_control_disconnected_request {
	__le16			cport_id;
} __packed;
/* Control protocol [dis]connected response has no payload */

/*
 * All Bundle power management operations use the same request and response
 * layout and status codes.

Annotation

Implementation Notes