summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/greybus_firmware.h
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-07-26 00:38:08 +0300
committerGreg Kroah-Hartman <gregkh@google.com>2016-07-27 02:16:15 +0300
commit5e10f0047a1b79e6c8ac1ee0e9a0165e7d0bc7d6 (patch)
tree6cdedb0ee56fc7dc3452708208658c1f9ef7e0fa /drivers/staging/greybus/greybus_firmware.h
parent911415ae6ee29cb76e018e8df8715c743a3a3d63 (diff)
downloadlinux-5e10f0047a1b79e6c8ac1ee0e9a0165e7d0bc7d6.tar.xz
greybus: firmware: Add 'status' byte to backend fw version response
The backend processor may not be ready to return the version of firmware it is running by the time AP requests for it. The greybus specification is updated to return 1-byte 'status' to return the error type, RETRY is one of them. This patch implements that in greybus now. Note that the version structure was common across interface and backend version requests earlier, but that is changing as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/greybus_firmware.h')
-rw-r--r--drivers/staging/greybus/greybus_firmware.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/staging/greybus/greybus_firmware.h b/drivers/staging/greybus/greybus_firmware.h
index 1b6882186459..82796512075b 100644
--- a/drivers/staging/greybus/greybus_firmware.h
+++ b/drivers/staging/greybus/greybus_firmware.h
@@ -72,14 +72,29 @@
#define GB_FW_U_BACKEND_FW_STATUS_FAIL_FETCH 0x03
#define GB_FW_U_BACKEND_FW_STATUS_FAIL_WRITE 0x04
#define GB_FW_U_BACKEND_FW_STATUS_INT 0x05
+#define GB_FW_U_BACKEND_FW_STATUS_RETRY 0x06
+#define GB_FW_U_BACKEND_FW_STATUS_NOT_SUPPORTED 0x07
+
+#define GB_FW_U_BACKEND_VERSION_STATUS_SUCCESS 0x01
+#define GB_FW_U_BACKEND_VERSION_STATUS_NOT_AVAILABLE 0x02
+#define GB_FW_U_BACKEND_VERSION_STATUS_NOT_SUPPORTED 0x03
+#define GB_FW_U_BACKEND_VERSION_STATUS_RETRY 0x04
+#define GB_FW_U_BACKEND_VERSION_STATUS_FAIL_INT 0x05
/* IOCTL support */
-struct fw_mgmt_ioc_get_fw {
+struct fw_mgmt_ioc_get_intf_version {
__u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
__u16 major;
__u16 minor;
} __attribute__ ((__packed__));
+struct fw_mgmt_ioc_get_backend_version {
+ __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
+ __u16 major;
+ __u16 minor;
+ __u8 status;
+} __attribute__ ((__packed__));
+
struct fw_mgmt_ioc_intf_load_and_validate {
__u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
__u8 load_method;
@@ -94,8 +109,8 @@ struct fw_mgmt_ioc_backend_fw_update {
} __attribute__ ((__packed__));
#define FW_MGMT_IOCTL_BASE 'F'
-#define FW_MGMT_IOC_GET_INTF_FW _IOR(FW_MGMT_IOCTL_BASE, 0, struct fw_mgmt_ioc_get_fw)
-#define FW_MGMT_IOC_GET_BACKEND_FW _IOWR(FW_MGMT_IOCTL_BASE, 1, struct fw_mgmt_ioc_get_fw)
+#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)