Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375423
b: refs/heads/master
c: a33a015
h: refs/heads/master
i:
  375421: 4f5275b
  375419: c351da3
  375415: bed9c18
  375407: 71b81cb
  375391: 90e35d5
  375359: 85ad5a7
  375295: 2ea8356
v: v3
  • Loading branch information
Sakthivel K authored and James Bottomley committed May 10, 2013
1 parent 9e0c4ac commit e1cb875
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a70b8fc3a582694073c3676dba6a39e4e77f8727
refs/heads/master: a33a0155dae5a8fdc85a9853ca06d6d57b90a4d9
43 changes: 36 additions & 7 deletions trunk/drivers/scsi/pm8001/pm8001_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,21 +605,50 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost,
*/
static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
{
u8 i;
u8 i, j;
#ifdef PM8001_READ_VPD
/* For new SPC controllers WWN is stored in flash vpd
* For SPC/SPCve controllers WWN is stored in EEPROM
* For Older SPC WWN is stored in NVMD
*/
DECLARE_COMPLETION_ONSTACK(completion);
struct pm8001_ioctl_payload payload;
u16 deviceid;
pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid);
pm8001_ha->nvmd_completion = &completion;
payload.minor_function = 0;
payload.length = 128;
payload.func_specific = kzalloc(128, GFP_KERNEL);

if (pm8001_ha->chip_id == chip_8001) {
if (deviceid == 0x8081) {
payload.minor_function = 4;
payload.length = 4096;
} else {
payload.minor_function = 0;
payload.length = 128;
}
} else {
payload.minor_function = 1;
payload.length = 4096;
}
payload.offset = 0;
payload.func_specific = kzalloc(payload.length, GFP_KERNEL);
PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload);
wait_for_completion(&completion);

for (i = 0, j = 0; i <= 7; i++, j++) {
if (pm8001_ha->chip_id == chip_8001) {
if (deviceid == 0x8081)
pm8001_ha->sas_addr[j] =
payload.func_specific[0x704 + i];
} else
pm8001_ha->sas_addr[j] =
payload.func_specific[0x804 + i];
}

for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
memcpy(&pm8001_ha->phy[i].dev_sas_addr, pm8001_ha->sas_addr,
SAS_ADDR_SIZE);
memcpy(&pm8001_ha->phy[i].dev_sas_addr,
pm8001_ha->sas_addr, SAS_ADDR_SIZE);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("phy %d sas_addr = %016llx \n", i,
pm8001_printk("phy %d sas_addr = %016llx\n", i,
pm8001_ha->phy[i].dev_sas_addr));
}
#else
Expand Down

0 comments on commit e1cb875

Please sign in to comment.