include/linux/greybus/greybus_manifest.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/greybus/greybus_manifest.h
Extension
.h
Size
4902 bytes
Lines
182
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 greybus_descriptor_string {
	__u8	length;
	__u8	id;
	__u8	string[];
} __packed;

/*
 * An interface descriptor describes information about an interface as a whole,
 * *not* the functions within it.
 */
struct greybus_descriptor_interface {
	__u8	vendor_stringid;
	__u8	product_stringid;
	__u8	features;
	__u8	pad;
} __packed;

/*
 * An bundle descriptor defines an identification number and a class for
 * each bundle.
 *
 * @id: Uniquely identifies a bundle within a interface, its sole purpose is to
 * allow CPort descriptors to specify which bundle they are associated with.
 * The first bundle will have id 0, second will have 1 and so on.
 *
 * The largest CPort id associated with an bundle (defined by a
 * CPort descriptor in the manifest) is used to determine how to
 * encode the device id and module number in UniPro packets
 * that use the bundle.
 *
 * @class: It is used by kernel to know the functionality provided by the
 * bundle and will be matched against drivers functinality while probing greybus
 * driver. It should contain one of the values defined in
 * 'enum greybus_class_type'.
 *
 */
struct greybus_descriptor_bundle {
	__u8	id;	/* interface-relative id (0..) */
	__u8	class;
	__u8	pad[2];
} __packed;

/*
 * A CPort descriptor indicates the id of the bundle within the
 * module it's associated with, along with the CPort id used to
 * address the CPort.  The protocol id defines the format of messages
 * exchanged using the CPort.
 */
struct greybus_descriptor_cport {
	__le16	id;
	__u8	bundle;
	__u8	protocol_id;	/* enum greybus_protocol */
} __packed;

struct greybus_descriptor_header {
	__le16	size;
	__u8	type;		/* enum greybus_descriptor_type */
	__u8	pad;
} __packed;

struct greybus_descriptor {
	struct greybus_descriptor_header		header;
	union {
		struct greybus_descriptor_string	string;
		struct greybus_descriptor_interface	interface;
		struct greybus_descriptor_bundle	bundle;
		struct greybus_descriptor_cport		cport;
	};
} __packed;

struct greybus_manifest_header {
	__le16	size;
	__u8	version_major;
	__u8	version_minor;
} __packed;

struct greybus_manifest {
	struct greybus_manifest_header		header;
	struct greybus_descriptor		descriptors[];
} __packed;

#endif /* __GREYBUS_MANIFEST_H */

Annotation

Implementation Notes