drivers/staging/greybus/Documentation/firmware/firmware-management

Source file repositories/reference/linux-study-clean/drivers/staging/greybus/Documentation/firmware/firmware-management

File Facts

System
Linux kernel
Corpus path
drivers/staging/greybus/Documentation/firmware/firmware-management
Extension
[no extension]
Size
11769 bytes
Lines
334
Domain
Driver Families
Bucket
drivers/staging
Inferred role
Driver Families: drivers/staging
Status
atlas-only

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct fw_mgmt_ioc_get_intf_version {
	__u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE];
	__u16 major;
	__u16 minor;
} __attribute__ ((__packed__));

struct fw_mgmt_ioc_get_backend_version {
	__u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE];
	__u16 major;
	__u16 minor;
	__u8 status;
} __attribute__ ((__packed__));

struct fw_mgmt_ioc_intf_load_and_validate {
	__u8			firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
	__u8			load_method;
	__u8			status;
	__u16			major;
	__u16			minor;
} __packed;

struct fw_mgmt_ioc_backend_fw_update {
	__u8			firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
	__u8			status;
} __packed;

#define FW_MGMT_IOCTL_BASE			'S'
#define FW_MGMT_IOC_GET_INTF_FW			_IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_intf_version)
#define FW_MGMT_IOC_GET_BACKEND_FW		_IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_backend_version)
#define FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE	_IOWR(FW_MGMT_IOCTL_BASE, 2, struct fw_mgmt_ioc_intf_load_and_validate)
#define FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE	_IOWR(FW_MGMT_IOCTL_BASE, 3, struct fw_mgmt_ioc_backend_fw_update)
#define FW_MGMT_IOC_SET_TIMEOUT_MS		_IOW(FW_MGMT_IOCTL_BASE, 4, unsigned int)
#define FW_MGMT_IOC_MODE_SWITCH			_IO(FW_MGMT_IOCTL_BASE, 5)

1. FW_MGMT_IOC_GET_INTF_FW:

   This ioctl shall be used by the user to get the version and firmware-tag of
   the currently running Interface Firmware. All the fields of the 'struct
   fw_mgmt_ioc_get_fw' are filled by the kernel.

2. FW_MGMT_IOC_GET_BACKEND_FW:

   This ioctl shall be used by the user to get the version of a currently
   running Backend Interface Firmware identified by a firmware-tag. The user is
   required to fill the 'firmware_tag' field of the 'struct fw_mgmt_ioc_get_fw'
   in this case. The 'major' and 'minor' fields are set by the kernel in
   response.

3. FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE:

   This ioctl shall be used by the user to load an Interface Firmware package on
   an Interface. The user needs to fill the 'firmware_tag' and 'load_method'
   fields of the 'struct fw_mgmt_ioc_intf_load_and_validate'. The 'status',
   'major' and 'minor' fields are set by the kernel in response.

4. FW_MGMT_IOC_INTF_BACKEND_FW_UPDATE:

   This ioctl shall be used by the user to request an Interface to update a
   Backend Interface Firmware.  The user is required to fill the 'firmware_tag'
   field of the 'struct fw_mgmt_ioc_get_fw' in this case. The 'status' field is
   set by the kernel in response.

5. FW_MGMT_IOC_SET_TIMEOUT_MS:

   This ioctl shall be used by the user to increase the timeout interval within
   which the firmware must get loaded by the Module. The default timeout is 1
   second. The user needs to pass the timeout in milliseconds.

6. FW_MGMT_IOC_MODE_SWITCH:

Annotation

Implementation Notes