aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 191dafd89be0..03444d6e4d26 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -922,9 +922,9 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
922 ha->flags.npiv_supported = 1; 922 ha->flags.npiv_supported = 1;
923 if ((!ha->max_npiv_vports) || 923 if ((!ha->max_npiv_vports) ||
924 ((ha->max_npiv_vports + 1) % 924 ((ha->max_npiv_vports + 1) %
925 MAX_MULTI_ID_FABRIC)) 925 MIN_MULTI_ID_FABRIC))
926 ha->max_npiv_vports = 926 ha->max_npiv_vports =
927 MAX_NUM_VPORT_FABRIC; 927 MIN_MULTI_ID_FABRIC - 1;
928 } 928 }
929 929
930 if (ql2xallocfwdump) 930 if (ql2xallocfwdump)
@@ -1162,7 +1162,8 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
1162 1162
1163 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); 1163 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no));
1164 1164
1165 mid_init_cb->count = ha->max_npiv_vports; 1165 mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports);
1166 mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
1166 1167
1167 rval = qla2x00_init_firmware(ha, ha->init_cb_size); 1168 rval = qla2x00_init_firmware(ha, ha->init_cb_size);
1168 if (rval) { 1169 if (rval) {
@@ -2566,14 +2567,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2566 2567
2567 /* Bypass virtual ports of the same host. */ 2568 /* Bypass virtual ports of the same host. */
2568 if (pha->num_vhosts) { 2569 if (pha->num_vhosts) {
2569 vp_index = find_next_bit( 2570 for_each_mapped_vp_idx(pha, vp_index) {
2570 (unsigned long *)pha->vp_idx_map,
2571 MAX_MULTI_ID_FABRIC + 1, 1);
2572
2573 for (;vp_index <= MAX_MULTI_ID_FABRIC;
2574 vp_index = find_next_bit(
2575 (unsigned long *)pha->vp_idx_map,
2576 MAX_MULTI_ID_FABRIC + 1, vp_index + 1)) {
2577 empty_vp_index = 1; 2571 empty_vp_index = 1;
2578 found_vp = 0; 2572 found_vp = 0;
2579 list_for_each_entry(vha, &pha->vp_list, 2573 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)
2592 new_fcport->d_id.b24 == vha->d_id.b24) 2586 new_fcport->d_id.b24 == vha->d_id.b24)
2593 break; 2587 break;
2594 } 2588 }
2595 if (vp_index <= MAX_MULTI_ID_FABRIC) 2589
2590 if (vp_index <= pha->max_npiv_vports)
2596 continue; 2591 continue;
2597 } 2592 }
2598 2593