hisi_sas: Add phy SAS ADDR initialization
authorJohn Garry <john.garry@huawei.com>
Tue, 17 Nov 2015 16:50:38 +0000 (00:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 26 Nov 2015 03:12:55 +0000 (22:12 -0500)
The SAS address for the HBA comes from the device tree.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c

index 315fe4640d889d78625866aca6d75d2557c89670..c50384f60be693d598754a85af38a3bc9cb61c90 100644 (file)
@@ -39,6 +39,7 @@
 
 struct hisi_sas_phy {
        struct asd_sas_phy      sas_phy;
+       u64             dev_sas_addr;
 };
 
 struct hisi_sas_port {
index d10bf24ecebd1d5c750d6402f61541c8568c8b9f..8cd1b551abb6a6c23c8bc7770c448e1565c1765f 100644 (file)
@@ -281,6 +281,16 @@ err_out:
        return NULL;
 }
 
+static void hisi_sas_init_add(struct hisi_hba *hisi_hba)
+{
+       int i;
+
+       for (i = 0; i < hisi_hba->n_phy; i++)
+               memcpy(&hisi_hba->phy[i].dev_sas_addr,
+                      hisi_hba->sas_addr,
+                      SAS_ADDR_SIZE);
+}
+
 int hisi_sas_probe(struct platform_device *pdev,
                         const struct hisi_sas_hw *hw)
 {
@@ -334,6 +344,8 @@ int hisi_sas_probe(struct platform_device *pdev,
                sha->sas_port[i] = &hisi_hba->port[i].sas_port;
        }
 
+       hisi_sas_init_add(hisi_hba);
+
        rc = scsi_add_host(shost, &pdev->dev);
        if (rc)
                goto err_out_ha;