diff options
author | Sakthivel K <Sakthivel.SaravananKamalRaju@pmcs.com> | 2013-03-19 08:37:35 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-10 10:47:50 -0400 |
commit | a33a0155dae5a8fdc85a9853ca06d6d57b90a4d9 (patch) | |
tree | 1936f52d402010319644277393ed3181c13889e9 /drivers/scsi | |
parent | a70b8fc3a582694073c3676dba6a39e4e77f8727 (diff) |
[SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
Individual WWN read operations based on controller.
PM8081 - Read WWN from Flash VPD.
PM8088/89 - Read WWN from EEPROM.
PM8001 - Read WWN from NVM.
Signed-off-by: Sakthivel K <Sakthivel.SaravananKamalRaju@pmcs.com>
Signed-off-by: Anand Kumar S <AnandKumar.Santhanam@pmcs.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_init.c | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 0c14dc04194b..055f7d0e15d8 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c | |||
@@ -605,21 +605,50 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, | |||
605 | */ | 605 | */ |
606 | static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha) | 606 | static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha) |
607 | { | 607 | { |
608 | u8 i; | 608 | u8 i, j; |
609 | #ifdef PM8001_READ_VPD | 609 | #ifdef PM8001_READ_VPD |
610 | /* For new SPC controllers WWN is stored in flash vpd | ||
611 | * For SPC/SPCve controllers WWN is stored in EEPROM | ||
612 | * For Older SPC WWN is stored in NVMD | ||
613 | */ | ||
610 | DECLARE_COMPLETION_ONSTACK(completion); | 614 | DECLARE_COMPLETION_ONSTACK(completion); |
611 | struct pm8001_ioctl_payload payload; | 615 | struct pm8001_ioctl_payload payload; |
616 | u16 deviceid; | ||
617 | pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid); | ||
612 | pm8001_ha->nvmd_completion = &completion; | 618 | pm8001_ha->nvmd_completion = &completion; |
613 | payload.minor_function = 0; | 619 | |
614 | payload.length = 128; | 620 | if (pm8001_ha->chip_id == chip_8001) { |
615 | payload.func_specific = kzalloc(128, GFP_KERNEL); | 621 | if (deviceid == 0x8081) { |
622 | payload.minor_function = 4; | ||
623 | payload.length = 4096; | ||
624 | } else { | ||
625 | payload.minor_function = 0; | ||
626 | payload.length = 128; | ||
627 | } | ||
628 | } else { | ||
629 | payload.minor_function = 1; | ||
630 | payload.length = 4096; | ||
631 | } | ||
632 | payload.offset = 0; | ||
633 | payload.func_specific = kzalloc(payload.length, GFP_KERNEL); | ||
616 | PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload); | 634 | PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload); |
617 | wait_for_completion(&completion); | 635 | wait_for_completion(&completion); |
636 | |||
637 | for (i = 0, j = 0; i <= 7; i++, j++) { | ||
638 | if (pm8001_ha->chip_id == chip_8001) { | ||
639 | if (deviceid == 0x8081) | ||
640 | pm8001_ha->sas_addr[j] = | ||
641 | payload.func_specific[0x704 + i]; | ||
642 | } else | ||
643 | pm8001_ha->sas_addr[j] = | ||
644 | payload.func_specific[0x804 + i]; | ||
645 | } | ||
646 | |||
618 | for (i = 0; i < pm8001_ha->chip->n_phy; i++) { | 647 | for (i = 0; i < pm8001_ha->chip->n_phy; i++) { |
619 | memcpy(&pm8001_ha->phy[i].dev_sas_addr, pm8001_ha->sas_addr, | 648 | memcpy(&pm8001_ha->phy[i].dev_sas_addr, |
620 | SAS_ADDR_SIZE); | 649 | pm8001_ha->sas_addr, SAS_ADDR_SIZE); |
621 | PM8001_INIT_DBG(pm8001_ha, | 650 | PM8001_INIT_DBG(pm8001_ha, |
622 | pm8001_printk("phy %d sas_addr = %016llx \n", i, | 651 | pm8001_printk("phy %d sas_addr = %016llx\n", i, |
623 | pm8001_ha->phy[i].dev_sas_addr)); | 652 | pm8001_ha->phy[i].dev_sas_addr)); |
624 | } | 653 | } |
625 | #else | 654 | #else |