[SCSI] qla2xxx: Fallback to 'golden-firmware' operation on supported ISPs.
[deliverable/linux.git] / drivers / scsi / qla2xxx / qla_sup.c
index 2a9b3f83ba678ac94af25003d29a05f389b9413a..6260505dceb5ff20fc00e8305734453c08872a38 100644 (file)
@@ -702,32 +702,35 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
                        break;
                case FLT_REG_VPD_0:
                        ha->flt_region_vpd_nvram = start;
-                       if (!(PCI_FUNC(ha->pdev->devfn) & 1))
+                       if (ha->flags.port0)
                                ha->flt_region_vpd = start;
                        break;
                case FLT_REG_VPD_1:
-                       if (PCI_FUNC(ha->pdev->devfn) & 1)
+                       if (!ha->flags.port0)
                                ha->flt_region_vpd = start;
                        break;
                case FLT_REG_NVRAM_0:
-                       if (!(PCI_FUNC(ha->pdev->devfn) & 1))
+                       if (ha->flags.port0)
                                ha->flt_region_nvram = start;
                        break;
                case FLT_REG_NVRAM_1:
-                       if (PCI_FUNC(ha->pdev->devfn) & 1)
+                       if (!ha->flags.port0)
                                ha->flt_region_nvram = start;
                        break;
                case FLT_REG_FDT:
                        ha->flt_region_fdt = start;
                        break;
                case FLT_REG_NPIV_CONF_0:
-                       if (!(PCI_FUNC(ha->pdev->devfn) & 1))
+                       if (ha->flags.port0)
                                ha->flt_region_npiv_conf = start;
                        break;
                case FLT_REG_NPIV_CONF_1:
-                       if (PCI_FUNC(ha->pdev->devfn) & 1)
+                       if (!ha->flags.port0)
                                ha->flt_region_npiv_conf = start;
                        break;
+               case FLT_REG_GOLD_FW:
+                       ha->flt_region_gold_fw = start;
+                       break;
                }
        }
        goto done;
@@ -745,12 +748,12 @@ no_flash_data:
        ha->flt_region_fw = def_fw[def];
        ha->flt_region_boot = def_boot[def];
        ha->flt_region_vpd_nvram = def_vpd_nvram[def];
-       ha->flt_region_vpd = !(PCI_FUNC(ha->pdev->devfn) & 1) ?
+       ha->flt_region_vpd = ha->flags.port0 ?
            def_vpd0[def]: def_vpd1[def];
-       ha->flt_region_nvram = !(PCI_FUNC(ha->pdev->devfn) & 1) ?
+       ha->flt_region_nvram = ha->flags.port0 ?
            def_nvram0[def]: def_nvram1[def];
        ha->flt_region_fdt = def_fdt[def];
-       ha->flt_region_npiv_conf = !(PCI_FUNC(ha->pdev->devfn) & 1) ?
+       ha->flt_region_npiv_conf = ha->flags.port0 ?
            def_npiv_conf0[def]: def_npiv_conf1[def];
 done:
        DEBUG2(qla_printk(KERN_DEBUG, ha, "FLT[%s]: boot=0x%x fw=0x%x "
@@ -920,12 +923,13 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
 
        entry = data + sizeof(struct qla_npiv_header);
        cnt = le16_to_cpu(hdr.entries);
-       ha->flex_port_count = cnt;
        for (i = 0; cnt; cnt--, entry++, i++) {
                uint16_t flags;
                struct fc_vport_identifiers vid;
                struct fc_vport *vport;
 
+               memcpy(&ha->npiv_info[i], entry, sizeof(struct qla_npiv_entry));
+
                flags = le16_to_cpu(entry->flags);
                if (flags == 0xffff)
                        continue;
@@ -939,9 +943,7 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
                vid.port_name = wwn_to_u64(entry->port_name);
                vid.node_name = wwn_to_u64(entry->node_name);
 
-               memcpy(&ha->npiv_info[i], entry, sizeof(struct qla_npiv_entry));
-
-               DEBUG2(qla_printk(KERN_DEBUG, ha, "NPIV[%02x]: wwpn=%llx "
+               DEBUG2(qla_printk(KERN_INFO, ha, "NPIV[%02x]: wwpn=%llx "
                        "wwnn=%llx vf_id=0x%x Q_qos=0x%x F_qos=0x%x.\n", cnt,
                        vid.port_name, vid.node_name, le16_to_cpu(entry->vf_id),
                        entry->q_qos, entry->f_qos));
@@ -957,7 +959,6 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
        }
 done:
        kfree(data);
-       ha->npiv_info = NULL;
 }
 
 static int
This page took 0.057585 seconds and 5 git commands to generate.