diff options
author | Don Brace <don.brace@microsemi.com> | 2018-07-03 18:34:48 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-07-10 22:25:03 -0400 |
commit | 01d0e789a14aa735ddcfddd468ef06d4f917e06d (patch) | |
tree | 02bdd66f41ec67364e1b18be721e196ddfdf8491 | |
parent | f13cff6c25bd8986627365346d123312ee7baa78 (diff) |
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: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/hpsa.c | 25 | ||||
-rw-r--r-- | drivers/scsi/hpsa.h | 1 |
2 files changed, 22 insertions, 4 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 15c7f3b6f35e..58bb70b886d7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3440,11 +3440,11 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, | |||
3440 | struct ext_report_lun_entry *rle = &rlep->LUN[rle_index]; | 3440 | struct ext_report_lun_entry *rle = &rlep->LUN[rle_index]; |
3441 | u16 bmic_device_index = 0; | 3441 | u16 bmic_device_index = 0; |
3442 | 3442 | ||
3443 | bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); | 3443 | encl_dev->eli = |
3444 | |||
3445 | encl_dev->sas_address = | ||
3446 | hpsa_get_enclosure_logical_identifier(h, scsi3addr); | 3444 | hpsa_get_enclosure_logical_identifier(h, scsi3addr); |
3447 | 3445 | ||
3446 | bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); | ||
3447 | |||
3448 | if (encl_dev->target == -1 || encl_dev->lun == -1) { | 3448 | if (encl_dev->target == -1 || encl_dev->lun == -1) { |
3449 | rc = IO_OK; | 3449 | rc = IO_OK; |
3450 | goto out; | 3450 | goto out; |
@@ -9697,7 +9697,24 @@ hpsa_sas_get_linkerrors(struct sas_phy *phy) | |||
9697 | static int | 9697 | static int |
9698 | hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) | 9698 | hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) |
9699 | { | 9699 | { |
9700 | *identifier = rphy->identify.sas_address; | 9700 | struct Scsi_Host *shost = phy_to_shost(rphy); |
9701 | struct ctlr_info *h; | ||
9702 | struct hpsa_scsi_dev_t *sd; | ||
9703 | |||
9704 | if (!shost) | ||
9705 | return -ENXIO; | ||
9706 | |||
9707 | h = shost_to_hba(shost); | ||
9708 | |||
9709 | if (!h) | ||
9710 | return -ENXIO; | ||
9711 | |||
9712 | sd = hpsa_find_device_by_sas_rphy(h, rphy); | ||
9713 | if (!sd) | ||
9714 | return -ENXIO; | ||
9715 | |||
9716 | *identifier = sd->eli; | ||
9717 | |||
9701 | return 0; | 9718 | return 0; |
9702 | } | 9719 | } |
9703 | 9720 | ||
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index fb9f5e7f8209..59e023696fff 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h | |||
@@ -68,6 +68,7 @@ struct hpsa_scsi_dev_t { | |||
68 | #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" | 68 | #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" |
69 | unsigned char device_id[16]; /* from inquiry pg. 0x83 */ | 69 | unsigned char device_id[16]; /* from inquiry pg. 0x83 */ |
70 | u64 sas_address; | 70 | u64 sas_address; |
71 | u64 eli; /* from report diags. */ | ||
71 | unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ | 72 | unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ |
72 | unsigned char model[16]; /* bytes 16-31 of inquiry data */ | 73 | unsigned char model[16]; /* bytes 16-31 of inquiry data */ |
73 | unsigned char rev; /* byte 2 of inquiry data */ | 74 | unsigned char rev; /* byte 2 of inquiry data */ |