struct fw_mgmt_ioc_get_intf_version {
- __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
+ __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_LEN];
+ __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_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
__u8 load_method;
__u8 status;
__u16 major;
} __packed;
struct fw_mgmt_ioc_backend_fw_update {
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
__u8 status;
} __packed;
intf_load.minor = 0;
strncpy((char *)&intf_load.firmware_tag, firmware_tag,
- GB_FIRMWARE_U_TAG_MAX_LEN);
+ GB_FIRMWARE_U_TAG_MAX_SIZE);
ret = ioctl(fd, FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE, &intf_load);
if (ret < 0) {
printf("Getting Backend Firmware Version\n");
strncpy((char *)&backend_fw_info.firmware_tag, firmware_tag,
- GB_FIRMWARE_U_TAG_MAX_LEN);
+ GB_FIRMWARE_U_TAG_MAX_SIZE);
retry_fw_version:
ret = ioctl(fd, FW_MGMT_IOC_GET_BACKEND_FW, &backend_fw_info);
printf("Updating Backend Firmware\n");
strncpy((char *)&backend_update.firmware_tag, firmware_tag,
- GB_FIRMWARE_U_TAG_MAX_LEN);
+ GB_FIRMWARE_U_TAG_MAX_SIZE);
retry_fw_update:
backend_update.status = 0;
#define FW_NAME_PREFIX "gmp_"
/* Length of the string in format: "FW_NAME_PREFIX""%08x_%08x_%08x_%08x_%s.tftf" */
-#define FW_NAME_LEN 56
+#define FW_NAME_SIZE 56
/* Firmware Management Protocol specific functions */
int fw_mgmt_init(void);
u8 firmware_id;
bool disabled;
bool timedout;
- char name[FW_NAME_LEN];
+ char name[FW_NAME_SIZE];
const struct firmware *fw;
struct list_head node;
tag = (const char *)request->firmware_tag;
/* firmware_tag should be null-terminated */
- if (strnlen(tag, GB_FIRMWARE_TAG_MAX_LEN) == GB_FIRMWARE_TAG_MAX_LEN) {
+ if (strnlen(tag, GB_FIRMWARE_TAG_MAX_SIZE) == GB_FIRMWARE_TAG_MAX_SIZE) {
dev_err(fw_download->parent,
"firmware-tag is not null-terminated\n");
return -EINVAL;
fw_info->minor = le16_to_cpu(response.minor);
strncpy(fw_info->firmware_tag, response.firmware_tag,
- GB_FIRMWARE_TAG_MAX_LEN);
+ GB_FIRMWARE_TAG_MAX_SIZE);
/*
* The firmware-tag should be NULL terminated, otherwise throw error but
* don't fail.
*/
- if (fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_LEN - 1] != '\0') {
+ if (fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') {
dev_err(fw_mgmt->parent,
"fw-version: firmware-tag is not NULL terminated\n");
- fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_LEN - 1] = '\0';
+ fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] = '\0';
}
return 0;
}
request.load_method = load_method;
- strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_LEN);
+ strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_SIZE);
/*
* The firmware-tag should be NULL terminated, otherwise throw error and
* fail.
*/
- if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_LEN - 1] != '\0') {
+ if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') {
dev_err(fw_mgmt->parent, "load-and-validate: firmware-tag is not NULL terminated\n");
return -EINVAL;
}
int ret;
strncpy(request.firmware_tag, fw_info->firmware_tag,
- GB_FIRMWARE_TAG_MAX_LEN);
+ GB_FIRMWARE_TAG_MAX_SIZE);
/*
* The firmware-tag should be NULL terminated, otherwise throw error and
* fail.
*/
- if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_LEN - 1] != '\0') {
+ if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') {
dev_err(fw_mgmt->parent, "backend-version: firmware-tag is not NULL terminated\n");
return -EINVAL;
}
struct gb_fw_mgmt_backend_fw_update_request request;
int ret;
- strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_LEN);
+ strncpy(request.firmware_tag, tag, GB_FIRMWARE_TAG_MAX_SIZE);
/*
* The firmware-tag should be NULL terminated, otherwise throw error and
* fail.
*/
- if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_LEN - 1] != '\0') {
+ if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') {
dev_err(fw_mgmt->parent, "backend-update: firmware-tag is not NULL terminated\n");
return -EINVAL;
}
#include <linux/ioctl.h>
#include <linux/types.h>
-#define GB_FIRMWARE_U_TAG_MAX_LEN 10
+#define GB_FIRMWARE_U_TAG_MAX_SIZE 10
#define GB_FW_U_LOAD_METHOD_UNIPRO 0x01
#define GB_FW_U_LOAD_METHOD_INTERNAL 0x02
/* IOCTL support */
struct fw_mgmt_ioc_get_intf_version {
- __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
+ __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_LEN];
+ __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_U_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE];
__u8 load_method;
__u8 status;
__u16 major;
} __attribute__ ((__packed__));
struct fw_mgmt_ioc_backend_fw_update {
- __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE];
__u8 status;
} __attribute__ ((__packed__));
#define GB_FW_DOWNLOAD_TYPE_FETCH_FIRMWARE 0x02
#define GB_FW_DOWNLOAD_TYPE_RELEASE_FIRMWARE 0x03
-#define GB_FIRMWARE_TAG_MAX_LEN 10
+#define GB_FIRMWARE_TAG_MAX_SIZE 10
/* firmware download find firmware request/response */
struct gb_fw_download_find_firmware_request {
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
} __packed;
struct gb_fw_download_find_firmware_response {
/* firmware management interface firmware version request has no payload */
struct gb_fw_mgmt_interface_fw_version_response {
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
__le16 major;
__le16 minor;
} __packed;
struct gb_fw_mgmt_load_and_validate_fw_request {
__u8 request_id;
__u8 load_method;
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
} __packed;
/* firmware management load and validate firmware response has no payload*/
/* firmware management backend firmware version request/response */
struct gb_fw_mgmt_backend_fw_version_request {
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
} __packed;
struct gb_fw_mgmt_backend_fw_version_response {
/* firmware management backend firmware update request */
struct gb_fw_mgmt_backend_fw_update_request {
__u8 request_id;
- __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN];
+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
} __packed;
/* firmware management backend firmware update response has no payload */