diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2007-11-12 13:30:58 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:45 -0500 |
commit | eb66dc60be5a72bc940458a5adfd400e4d810d49 (patch) | |
tree | 677baf5655d9ae312e877cab4adb33a1319e9993 /drivers/scsi/qla2xxx/qla_init.c | |
parent | 06e23b7470ca7974b0ca8150c5415b55b5ea2a99 (diff) |
[SCSI] qla2xxx: Correct NPIV support for recent ISPs.
Firmware will export to software the maximum number of vports
supported for any given firmware version and ISP type. Use this
information rather than the current hardcoding of limitations
within the driver.
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, 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 | ||