Skip to content

Commit

Permalink
scsi: smartpqi: Add extended report physical LUNs
Browse files Browse the repository at this point in the history
Add support for the new extended formats in the data returned from the
Report Physical LUNs command for controllers that enable this feature.

The new formats allow the reporting of 16-byte WWIDs.

Link: https://lore.kernel.org/r/20210928235442.201875-8-don.brace@microchip.com
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Acked-by: John Donnelly <john.p.donnelly@oracle.com>
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Mike McGowen authored and Martin K. Petersen committed Oct 5, 2021
1 parent 4f3cefc commit 28ca6d8
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 59 deletions.
37 changes: 28 additions & 9 deletions drivers/scsi/smartpqi/smartpqi.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ struct pqi_config_table_firmware_features {
#define PQI_FIRMWARE_FEATURE_RAID_BYPASS_ON_ENCRYPTED_NVME 15
#define PQI_FIRMWARE_FEATURE_UNIQUE_WWID_IN_REPORT_PHYS_LUN 16
#define PQI_FIRMWARE_FEATURE_FW_TRIAGE 17
#define PQI_FIRMWARE_FEATURE_MAXIMUM 17
#define PQI_FIRMWARE_FEATURE_RPL_EXTENDED_FORMAT_4_5 18
#define PQI_FIRMWARE_FEATURE_MAXIMUM 18

struct pqi_config_table_debug {
struct pqi_config_table_section_header header;
Expand Down Expand Up @@ -943,19 +944,21 @@ struct report_lun_header {
#define CISS_REPORT_LOG_FLAG_QUEUE_DEPTH (1 << 5)
#define CISS_REPORT_LOG_FLAG_DRIVE_TYPE_MIX (1 << 6)

#define CISS_REPORT_PHYS_FLAG_OTHER (1 << 1)
#define CISS_REPORT_PHYS_FLAG_EXTENDED_FORMAT_2 0x2
#define CISS_REPORT_PHYS_FLAG_EXTENDED_FORMAT_4 0x4
#define CISS_REPORT_PHYS_FLAG_EXTENDED_FORMAT_MASK 0xf

struct report_log_lun_extended_entry {
struct report_log_lun {
u8 lunid[8];
u8 volume_id[16];
};

struct report_log_lun_extended {
struct report_log_lun_list {
struct report_lun_header header;
struct report_log_lun_extended_entry lun_entries[1];
struct report_log_lun lun_entries[1];
};

struct report_phys_lun_extended_entry {
struct report_phys_lun_8byte_wwid {
u8 lunid[8];
__be64 wwid;
u8 device_type;
Expand All @@ -965,12 +968,27 @@ struct report_phys_lun_extended_entry {
u32 aio_handle;
};

struct report_phys_lun_16byte_wwid {
u8 lunid[8];
u8 wwid[16];
u8 device_type;
u8 device_flags;
u8 lun_count; /* number of LUNs in a multi-LUN device */
u8 redundant_paths;
u32 aio_handle;
};

/* for device_flags field of struct report_phys_lun_extended_entry */
#define CISS_REPORT_PHYS_DEV_FLAG_AIO_ENABLED 0x8

struct report_phys_lun_extended {
struct report_phys_lun_8byte_wwid_list {
struct report_lun_header header;
struct report_phys_lun_8byte_wwid lun_entries[1];
};

struct report_phys_lun_16byte_wwid_list {
struct report_lun_header header;
struct report_phys_lun_extended_entry lun_entries[1];
struct report_phys_lun_16byte_wwid lun_entries[1];
};

struct raid_map_disk_data {
Expand Down Expand Up @@ -1077,7 +1095,7 @@ struct pqi_scsi_dev {
int target;
int lun;
u8 scsi3addr[8];
__be64 wwid;
u8 wwid[16];
u8 volume_id[16];
u8 is_physical_device : 1;
u8 is_external_raid_device : 1;
Expand Down Expand Up @@ -1316,6 +1334,7 @@ struct pqi_ctrl_info {
u8 tmf_iu_timeout_supported : 1;
u8 unique_wwid_in_report_phys_lun_supported : 1;
u8 firmware_triage_supported : 1;
u8 rpl_extended_format_4_5_supported : 1;
u8 enable_r1_writes : 1;
u8 enable_r5_writes : 1;
u8 enable_r6_writes : 1;
Expand Down
Loading

0 comments on commit 28ca6d8

Please sign in to comment.