]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/qla2xxx/qla_init.c
[SCSI] lpfc 8.2.4 : Make lpfc legacy I/O port free
[linux-2.6-omap-h63xx.git] / drivers / scsi / qla2xxx / qla_init.c
index 191dafd89be080763c520bfef2b41e62bba8d0f7..03444d6e4d2684117ae21215e0712ffb52482239 100644 (file)
@@ -922,9 +922,9 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
                                        ha->flags.npiv_supported = 1;
                                        if ((!ha->max_npiv_vports) ||
                                            ((ha->max_npiv_vports + 1) %
-                                           MAX_MULTI_ID_FABRIC))
+                                           MIN_MULTI_ID_FABRIC))
                                                ha->max_npiv_vports =
-                                                   MAX_NUM_VPORT_FABRIC;
+                                                   MIN_MULTI_ID_FABRIC - 1;
                                }
 
                                if (ql2xallocfwdump)
@@ -1162,7 +1162,8 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
 
        DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no));
 
-       mid_init_cb->count = ha->max_npiv_vports;
+       mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports);
+       mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
 
        rval = qla2x00_init_firmware(ha, ha->init_cb_size);
        if (rval) {
@@ -2566,14 +2567,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
 
                /* Bypass virtual ports of the same host. */
                if (pha->num_vhosts) {
-                       vp_index = find_next_bit(
-                           (unsigned long *)pha->vp_idx_map,
-                           MAX_MULTI_ID_FABRIC + 1, 1);
-
-                       for (;vp_index <= MAX_MULTI_ID_FABRIC;
-                           vp_index = find_next_bit(
-                           (unsigned long *)pha->vp_idx_map,
-                           MAX_MULTI_ID_FABRIC + 1, vp_index + 1)) {
+                       for_each_mapped_vp_idx(pha, vp_index) {
                                empty_vp_index = 1;
                                found_vp = 0;
                                list_for_each_entry(vha, &pha->vp_list,
@@ -2592,7 +2586,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
                                    new_fcport->d_id.b24 == vha->d_id.b24)
                                        break;
                        }
-                       if (vp_index <= MAX_MULTI_ID_FABRIC)
+
+                       if (vp_index <= pha->max_npiv_vports)
                                continue;
                }