Commit 01d0e789 authored by Don Brace's avatar Don Brace Committed by Martin K. Petersen

scsi: hpsa: correct enclosure sas address

The original complaint was the lsscsi -t showed the same SAS address of the
two enclosures (SEP devices). In fact the SAS address was being set to the
Enclosure Logical Identifier (ELI).
Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f13cff6c
...@@ -3440,11 +3440,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, ...@@ -3440,11 +3440,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h,
struct ext_report_lun_entry *rle = &rlep->LUN[rle_index]; struct ext_report_lun_entry *rle = &rlep->LUN[rle_index];
u16 bmic_device_index = 0; u16 bmic_device_index = 0;
bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); encl_dev->eli =
encl_dev->sas_address =
hpsa_get_enclosure_logical_identifier(h, scsi3addr); hpsa_get_enclosure_logical_identifier(h, scsi3addr);
bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]);
if (encl_dev->target == -1 || encl_dev->lun == -1) { if (encl_dev->target == -1 || encl_dev->lun == -1) {
rc = IO_OK; rc = IO_OK;
goto out; goto out;
...@@ -9697,7 +9697,24 @@ hpsa_sas_get_linkerrors(struct sas_phy *phy) ...@@ -9697,7 +9697,24 @@ hpsa_sas_get_linkerrors(struct sas_phy *phy)
static int static int
hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier)
{ {
*identifier = rphy->identify.sas_address; struct Scsi_Host *shost = phy_to_shost(rphy);
struct ctlr_info *h;
struct hpsa_scsi_dev_t *sd;
if (!shost)
return -ENXIO;
h = shost_to_hba(shost);
if (!h)
return -ENXIO;
sd = hpsa_find_device_by_sas_rphy(h, rphy);
if (!sd)
return -ENXIO;
*identifier = sd->eli;
return 0; return 0;
} }
......
...@@ -68,6 +68,7 @@ struct hpsa_scsi_dev_t { ...@@ -68,6 +68,7 @@ struct hpsa_scsi_dev_t {
#define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0"
unsigned char device_id[16]; /* from inquiry pg. 0x83 */ unsigned char device_id[16]; /* from inquiry pg. 0x83 */
u64 sas_address; u64 sas_address;
u64 eli; /* from report diags. */
unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ unsigned char vendor[8]; /* bytes 8-15 of inquiry data */
unsigned char model[16]; /* bytes 16-31 of inquiry data */ unsigned char model[16]; /* bytes 16-31 of inquiry data */
unsigned char rev; /* byte 2 of inquiry data */ unsigned char rev; /* byte 2 of inquiry data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment