mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
scsi: smartpqi: Add support for long firmware version
Add support for new "long" firmware version which requires minor driver changes to expose. Link: https://lore.kernel.org/r/161549374508.25025.15467221395888158022.stgit@brunhilda Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
f6cc2a774a
commit
598bef8d79
@@ -7228,13 +7228,24 @@ static int pqi_get_ctrl_product_details(struct pqi_ctrl_info *ctrl_info)
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
memcpy(ctrl_info->firmware_version, identify->firmware_version,
|
||||
sizeof(identify->firmware_version));
|
||||
ctrl_info->firmware_version[sizeof(identify->firmware_version)] = '\0';
|
||||
snprintf(ctrl_info->firmware_version +
|
||||
strlen(ctrl_info->firmware_version),
|
||||
sizeof(ctrl_info->firmware_version),
|
||||
"-%u", get_unaligned_le16(&identify->firmware_build_number));
|
||||
if (get_unaligned_le32(&identify->extra_controller_flags) &
|
||||
BMIC_IDENTIFY_EXTRA_FLAGS_LONG_FW_VERSION_SUPPORTED) {
|
||||
memcpy(ctrl_info->firmware_version,
|
||||
identify->firmware_version_long,
|
||||
sizeof(identify->firmware_version_long));
|
||||
} else {
|
||||
memcpy(ctrl_info->firmware_version,
|
||||
identify->firmware_version_short,
|
||||
sizeof(identify->firmware_version_short));
|
||||
ctrl_info->firmware_version
|
||||
[sizeof(identify->firmware_version_short)] = '\0';
|
||||
snprintf(ctrl_info->firmware_version +
|
||||
strlen(ctrl_info->firmware_version),
|
||||
sizeof(ctrl_info->firmware_version) -
|
||||
sizeof(identify->firmware_version_short),
|
||||
"-%u",
|
||||
get_unaligned_le16(&identify->firmware_build_number));
|
||||
}
|
||||
|
||||
memcpy(ctrl_info->model, identify->product_id,
|
||||
sizeof(identify->product_id));
|
||||
@@ -9612,13 +9623,23 @@ static void __attribute__((unused)) verify_structures(void)
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
configuration_signature) != 1);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
firmware_version) != 5);
|
||||
firmware_version_short) != 5);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
extended_logical_unit_count) != 154);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
firmware_build_number) != 190);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
vendor_id) != 200);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
product_id) != 208);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
extra_controller_flags) != 286);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
controller_mode) != 292);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
spare_part_number) != 293);
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_controller,
|
||||
firmware_version_long) != 325);
|
||||
|
||||
BUILD_BUG_ON(offsetof(struct bmic_identify_physical_device,
|
||||
phys_bay_in_box) != 115);
|
||||
|
||||
Reference in New Issue
Block a user