diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-04-07 01:33:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:11 -0400 |
commit | e5b68a61e15ca8e200c60cfd4dbe1818e6beb4e1 (patch) | |
tree | 3efb29e4cca6868e7a5775589d877fb6e30639ac /drivers/scsi/qla2xxx/qla_init.c | |
parent | e337d9070e5821e7c8e5973679bdd34376263bd1 (diff) |
[SCSI] qla2xxx: Use port number to compute nvram/vpd parameter offsets.
Read adapter's physical port number from interrupt pin register
and use it instead of pci function number to offset into the
nvram to obtain the port's configuration parameters.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4952fc19aa20..33e924810666 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -3573,14 +3573,15 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) | |||
3573 | nv = ha->nvram; | 3573 | nv = ha->nvram; |
3574 | 3574 | ||
3575 | /* Determine NVRAM starting address. */ | 3575 | /* Determine NVRAM starting address. */ |
3576 | ha->nvram_size = sizeof(struct nvram_24xx); | 3576 | if (ha->flags.port0) { |
3577 | ha->nvram_base = FA_NVRAM_FUNC0_ADDR; | 3577 | ha->nvram_base = FA_NVRAM_FUNC0_ADDR; |
3578 | ha->vpd_size = FA_NVRAM_VPD_SIZE; | 3578 | ha->vpd_base = FA_NVRAM_VPD0_ADDR; |
3579 | ha->vpd_base = FA_NVRAM_VPD0_ADDR; | 3579 | } else { |
3580 | if (PCI_FUNC(ha->pdev->devfn)) { | ||
3581 | ha->nvram_base = FA_NVRAM_FUNC1_ADDR; | 3580 | ha->nvram_base = FA_NVRAM_FUNC1_ADDR; |
3582 | ha->vpd_base = FA_NVRAM_VPD1_ADDR; | 3581 | ha->vpd_base = FA_NVRAM_VPD1_ADDR; |
3583 | } | 3582 | } |
3583 | ha->nvram_size = sizeof(struct nvram_24xx); | ||
3584 | ha->vpd_size = FA_NVRAM_VPD_SIZE; | ||
3584 | 3585 | ||
3585 | /* Get VPD data into cache */ | 3586 | /* Get VPD data into cache */ |
3586 | ha->vpd = ha->nvram + VPD_OFFSET; | 3587 | ha->vpd = ha->nvram + VPD_OFFSET; |
@@ -3619,7 +3620,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) | |||
3619 | nv->exchange_count = __constant_cpu_to_le16(0); | 3620 | nv->exchange_count = __constant_cpu_to_le16(0); |
3620 | nv->hard_address = __constant_cpu_to_le16(124); | 3621 | nv->hard_address = __constant_cpu_to_le16(124); |
3621 | nv->port_name[0] = 0x21; | 3622 | nv->port_name[0] = 0x21; |
3622 | nv->port_name[1] = 0x00 + PCI_FUNC(ha->pdev->devfn); | 3623 | nv->port_name[1] = 0x00 + ha->port_no; |
3623 | nv->port_name[2] = 0x00; | 3624 | nv->port_name[2] = 0x00; |
3624 | nv->port_name[3] = 0xe0; | 3625 | nv->port_name[3] = 0xe0; |
3625 | nv->port_name[4] = 0x8b; | 3626 | nv->port_name[4] = 0x8b; |
@@ -4348,7 +4349,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
4348 | nv->execution_throttle = __constant_cpu_to_le16(0xFFFF); | 4349 | nv->execution_throttle = __constant_cpu_to_le16(0xFFFF); |
4349 | nv->exchange_count = __constant_cpu_to_le16(0); | 4350 | nv->exchange_count = __constant_cpu_to_le16(0); |
4350 | nv->port_name[0] = 0x21; | 4351 | nv->port_name[0] = 0x21; |
4351 | nv->port_name[1] = 0x00 + PCI_FUNC(ha->pdev->devfn); | 4352 | nv->port_name[1] = 0x00 + ha->port_no; |
4352 | nv->port_name[2] = 0x00; | 4353 | nv->port_name[2] = 0x00; |
4353 | nv->port_name[3] = 0xe0; | 4354 | nv->port_name[3] = 0xe0; |
4354 | nv->port_name[4] = 0x8b; | 4355 | nv->port_name[4] = 0x8b; |
@@ -4382,7 +4383,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
4382 | nv->enode_mac[2] = 0x03; | 4383 | nv->enode_mac[2] = 0x03; |
4383 | nv->enode_mac[3] = 0x04; | 4384 | nv->enode_mac[3] = 0x04; |
4384 | nv->enode_mac[4] = 0x05; | 4385 | nv->enode_mac[4] = 0x05; |
4385 | nv->enode_mac[5] = 0x06 + PCI_FUNC(ha->pdev->devfn); | 4386 | nv->enode_mac[5] = 0x06 + ha->port_no; |
4386 | 4387 | ||
4387 | rval = 1; | 4388 | rval = 1; |
4388 | } | 4389 | } |
@@ -4415,7 +4416,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
4415 | icb->enode_mac[2] = 0x03; | 4416 | icb->enode_mac[2] = 0x03; |
4416 | icb->enode_mac[3] = 0x04; | 4417 | icb->enode_mac[3] = 0x04; |
4417 | icb->enode_mac[4] = 0x05; | 4418 | icb->enode_mac[4] = 0x05; |
4418 | icb->enode_mac[5] = 0x06 + PCI_FUNC(ha->pdev->devfn); | 4419 | icb->enode_mac[5] = 0x06 + ha->port_no; |
4419 | } | 4420 | } |
4420 | 4421 | ||
4421 | /* Use extended-initialization control block. */ | 4422 | /* Use extended-initialization control block. */ |