diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-02-25 18:25:21 (GMT) |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 10:55:28 (GMT) |
commit | 150fc6fc725055b400a8865e6785dc8dd0a2225d (patch) | |
tree | 800fe37980919606017c603c77d8d7384beaa7dc /drivers/scsi/isci/phy.c | |
parent | 7392d27580df2d14b5c3b1a1d7989c06457a819d (diff) | |
download | linux-fsl-qoriq-150fc6fc725055b400a8865e6785dc8dd0a2225d.tar.xz |
isci: fix sas address reporting
Undo the open coded and incorrect translation of the oem parameter sas
address to its libsas expected format.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/phy.c')
-rw-r--r-- | drivers/scsi/isci/phy.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index fbda570..1eefaae 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/phy.c @@ -75,14 +75,15 @@ void isci_phy_init( struct isci_host *isci_host, int index) { - struct scic_sds_controller *controller = isci_host->core_controller; + struct scic_sds_controller *scic = isci_host->core_controller; struct scic_sds_phy *scic_phy; - union scic_oem_parameters oem_parameters; + union scic_oem_parameters oem; enum sci_status status = SCI_SUCCESS; + u64 sas_addr; /*--------------- SCU_Phy Initialization Stuff -----------------------*/ - status = scic_controller_get_phy_handle(controller, index, &scic_phy); + status = scic_controller_get_phy_handle(scic, index, &scic_phy); if (status == SCI_SUCCESS) { sci_object_set_association(scic_phy, (void *)phy); phy->sci_phy_handle = scic_phy; @@ -90,24 +91,13 @@ void isci_phy_init( dev_err(&isci_host->pdev->dev, "failed scic_controller_get_phy_handle\n"); - scic_oem_parameters_get(controller, &oem_parameters); - - phy->sas_addr[0] = oem_parameters.sds1.phys[index].sas_address.low - & 0xFF; - phy->sas_addr[1] = (oem_parameters.sds1.phys[index].sas_address.low - >> 8) & 0xFF; - phy->sas_addr[2] = (oem_parameters.sds1.phys[index].sas_address.low - >> 16) & 0xFF; - phy->sas_addr[3] = (oem_parameters.sds1.phys[index].sas_address.low - >> 24) & 0xFF; - phy->sas_addr[4] = oem_parameters.sds1.phys[index].sas_address.high - & 0xFF; - phy->sas_addr[5] = (oem_parameters.sds1.phys[index].sas_address.high - >> 8) & 0xFF; - phy->sas_addr[6] = (oem_parameters.sds1.phys[index].sas_address.high - >> 16) & 0xFF; - phy->sas_addr[7] = (oem_parameters.sds1.phys[index].sas_address.high - >> 24) & 0xFF; + scic_oem_parameters_get(scic, &oem); + sas_addr = oem.sds1.phys[index].sas_address.high; + sas_addr <<= 32; + sas_addr |= oem.sds1.phys[index].sas_address.low; + swab64s(&sas_addr); + + memcpy(phy->sas_addr, &sas_addr, sizeof(sas_addr)); phy->isci_port = NULL; phy->sas_phy.enabled = 0; |