diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 986501759ad4..87f9abc71460 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1308,8 +1308,12 @@ qla2x00_init_rings(scsi_qla_host_t *vha) | |||
1308 | 1308 | ||
1309 | DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no)); | 1309 | DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no)); |
1310 | 1310 | ||
1311 | if (ha->flags.npiv_supported) | 1311 | if (ha->flags.npiv_supported) { |
1312 | if (ha->operating_mode == LOOP) | ||
1313 | ha->max_npiv_vports = MIN_MULTI_ID_FABRIC - 1; | ||
1312 | mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports); | 1314 | mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports); |
1315 | } | ||
1316 | |||
1313 | 1317 | ||
1314 | mid_init_cb->options = __constant_cpu_to_le16(BIT_1); | 1318 | mid_init_cb->options = __constant_cpu_to_le16(BIT_1); |
1315 | 1319 | ||
@@ -2610,6 +2614,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, | |||
2610 | port_id_t wrap, nxt_d_id; | 2614 | port_id_t wrap, nxt_d_id; |
2611 | struct qla_hw_data *ha = vha->hw; | 2615 | struct qla_hw_data *ha = vha->hw; |
2612 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); | 2616 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); |
2617 | struct scsi_qla_host *tvp; | ||
2613 | 2618 | ||
2614 | rval = QLA_SUCCESS; | 2619 | rval = QLA_SUCCESS; |
2615 | 2620 | ||
@@ -2709,7 +2714,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, | |||
2709 | /* Bypass virtual ports of the same host. */ | 2714 | /* Bypass virtual ports of the same host. */ |
2710 | found = 0; | 2715 | found = 0; |
2711 | if (ha->num_vhosts) { | 2716 | if (ha->num_vhosts) { |
2712 | list_for_each_entry(vp, &ha->vp_list, list) { | 2717 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
2713 | if (new_fcport->d_id.b24 == vp->d_id.b24) { | 2718 | if (new_fcport->d_id.b24 == vp->d_id.b24) { |
2714 | found = 1; | 2719 | found = 1; |
2715 | break; | 2720 | break; |
@@ -2832,6 +2837,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
2832 | uint16_t first_loop_id; | 2837 | uint16_t first_loop_id; |
2833 | struct qla_hw_data *ha = vha->hw; | 2838 | struct qla_hw_data *ha = vha->hw; |
2834 | struct scsi_qla_host *vp; | 2839 | struct scsi_qla_host *vp; |
2840 | struct scsi_qla_host *tvp; | ||
2835 | 2841 | ||
2836 | rval = QLA_SUCCESS; | 2842 | rval = QLA_SUCCESS; |
2837 | 2843 | ||
@@ -2856,7 +2862,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
2856 | /* Check for loop ID being already in use. */ | 2862 | /* Check for loop ID being already in use. */ |
2857 | found = 0; | 2863 | found = 0; |
2858 | fcport = NULL; | 2864 | fcport = NULL; |
2859 | list_for_each_entry(vp, &ha->vp_list, list) { | 2865 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
2860 | list_for_each_entry(fcport, &vp->vp_fcports, list) { | 2866 | list_for_each_entry(fcport, &vp->vp_fcports, list) { |
2861 | if (fcport->loop_id == dev->loop_id && | 2867 | if (fcport->loop_id == dev->loop_id && |
2862 | fcport != dev) { | 2868 | fcport != dev) { |
@@ -3291,6 +3297,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3291 | uint8_t status = 0; | 3297 | uint8_t status = 0; |
3292 | struct qla_hw_data *ha = vha->hw; | 3298 | struct qla_hw_data *ha = vha->hw; |
3293 | struct scsi_qla_host *vp; | 3299 | struct scsi_qla_host *vp; |
3300 | struct scsi_qla_host *tvp; | ||
3294 | struct req_que *req = ha->req_q_map[0]; | 3301 | struct req_que *req = ha->req_q_map[0]; |
3295 | 3302 | ||
3296 | if (vha->flags.online) { | 3303 | if (vha->flags.online) { |
@@ -3306,7 +3313,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3306 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { | 3313 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { |
3307 | atomic_set(&vha->loop_state, LOOP_DOWN); | 3314 | atomic_set(&vha->loop_state, LOOP_DOWN); |
3308 | qla2x00_mark_all_devices_lost(vha, 0); | 3315 | qla2x00_mark_all_devices_lost(vha, 0); |
3309 | list_for_each_entry(vp, &ha->vp_list, list) | 3316 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) |
3310 | qla2x00_mark_all_devices_lost(vp, 0); | 3317 | qla2x00_mark_all_devices_lost(vp, 0); |
3311 | } else { | 3318 | } else { |
3312 | if (!atomic_read(&vha->loop_down_timer)) | 3319 | if (!atomic_read(&vha->loop_down_timer)) |
@@ -3403,7 +3410,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3403 | DEBUG(printk(KERN_INFO | 3410 | DEBUG(printk(KERN_INFO |
3404 | "qla2x00_abort_isp(%ld): succeeded.\n", | 3411 | "qla2x00_abort_isp(%ld): succeeded.\n", |
3405 | vha->host_no)); | 3412 | vha->host_no)); |
3406 | list_for_each_entry(vp, &ha->vp_list, list) { | 3413 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
3407 | if (vp->vp_idx) | 3414 | if (vp->vp_idx) |
3408 | qla2x00_vp_abort_isp(vp); | 3415 | qla2x00_vp_abort_isp(vp); |
3409 | } | 3416 | } |
@@ -3428,7 +3435,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3428 | static int | 3435 | static int |
3429 | qla2x00_restart_isp(scsi_qla_host_t *vha) | 3436 | qla2x00_restart_isp(scsi_qla_host_t *vha) |
3430 | { | 3437 | { |
3431 | uint8_t status = 0; | 3438 | int status = 0; |
3432 | uint32_t wait_time; | 3439 | uint32_t wait_time; |
3433 | struct qla_hw_data *ha = vha->hw; | 3440 | struct qla_hw_data *ha = vha->hw; |
3434 | struct req_que *req = ha->req_q_map[0]; | 3441 | struct req_que *req = ha->req_q_map[0]; |