aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c9
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c19
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c10
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c6
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h2
6 files changed, 24 insertions, 25 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index f4c57227ec18..ee9d40152430 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -244,12 +244,6 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
244 if (ha->optrom_state != QLA_SWAITING) 244 if (ha->optrom_state != QLA_SWAITING)
245 break; 245 break;
246 246
247 if (start & 0xfff) {
248 qla_printk(KERN_WARNING, ha,
249 "Invalid start region 0x%x/0x%x.\n", start, size);
250 return -EINVAL;
251 }
252
253 ha->optrom_region_start = start; 247 ha->optrom_region_start = start;
254 ha->optrom_region_size = start + size > ha->optrom_size ? 248 ha->optrom_region_size = start + size > ha->optrom_size ?
255 ha->optrom_size - start : size; 249 ha->optrom_size - start : size;
@@ -303,8 +297,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
303 else if (start == (ha->flt_region_boot * 4) || 297 else if (start == (ha->flt_region_boot * 4) ||
304 start == (ha->flt_region_fw * 4)) 298 start == (ha->flt_region_fw * 4))
305 valid = 1; 299 valid = 1;
306 else if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && 300 else if (IS_QLA25XX(ha) || IS_QLA81XX(ha))
307 start == (ha->flt_region_vpd_nvram * 4))
308 valid = 1; 301 valid = 1;
309 if (!valid) { 302 if (!valid) {
310 qla_printk(KERN_WARNING, ha, 303 qla_printk(KERN_WARNING, ha,
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)
3428static int 3435static int
3429qla2x00_restart_isp(scsi_qla_host_t *vha) 3436qla2x00_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];
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 4c7504cb3990..4aab7acf7525 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2685,6 +2685,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
2685 uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); 2685 uint16_t stat = le16_to_cpu(rptid_entry->vp_idx);
2686 struct qla_hw_data *ha = vha->hw; 2686 struct qla_hw_data *ha = vha->hw;
2687 scsi_qla_host_t *vp; 2687 scsi_qla_host_t *vp;
2688 scsi_qla_host_t *tvp;
2688 2689
2689 if (rptid_entry->entry_status != 0) 2690 if (rptid_entry->entry_status != 0)
2690 return; 2691 return;
@@ -2710,7 +2711,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
2710 if (MSB(stat) == 1) 2711 if (MSB(stat) == 1)
2711 return; 2712 return;
2712 2713
2713 list_for_each_entry(vp, &ha->vp_list, list) 2714 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
2714 if (vp_idx == vp->vp_idx) 2715 if (vp_idx == vp->vp_idx)
2715 break; 2716 break;
2716 if (!vp) 2717 if (!vp)
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 3f23932210c4..785c61279e6e 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -69,9 +69,10 @@ static scsi_qla_host_t *
69qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) 69qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
70{ 70{
71 scsi_qla_host_t *vha; 71 scsi_qla_host_t *vha;
72 struct scsi_qla_host *tvha;
72 73
73 /* Locate matching device in database. */ 74 /* Locate matching device in database. */
74 list_for_each_entry(vha, &ha->vp_list, list) { 75 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
75 if (!memcmp(port_name, vha->port_name, WWN_SIZE)) 76 if (!memcmp(port_name, vha->port_name, WWN_SIZE))
76 return vha; 77 return vha;
77 } 78 }
@@ -194,11 +195,11 @@ qla24xx_configure_vp(scsi_qla_host_t *vha)
194void 195void
195qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) 196qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
196{ 197{
197 scsi_qla_host_t *vha; 198 scsi_qla_host_t *vha, *tvha;
198 struct qla_hw_data *ha = rsp->hw; 199 struct qla_hw_data *ha = rsp->hw;
199 int i = 0; 200 int i = 0;
200 201
201 list_for_each_entry(vha, &ha->vp_list, list) { 202 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
202 if (vha->vp_idx) { 203 if (vha->vp_idx) {
203 switch (mb[0]) { 204 switch (mb[0]) {
204 case MBA_LIP_OCCURRED: 205 case MBA_LIP_OCCURRED:
@@ -300,6 +301,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
300 int ret; 301 int ret;
301 struct qla_hw_data *ha = vha->hw; 302 struct qla_hw_data *ha = vha->hw;
302 scsi_qla_host_t *vp; 303 scsi_qla_host_t *vp;
304 struct scsi_qla_host *tvp;
303 305
304 if (vha->vp_idx) 306 if (vha->vp_idx)
305 return; 307 return;
@@ -308,7 +310,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
308 310
309 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); 311 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
310 312
311 list_for_each_entry(vp, &ha->vp_list, list) { 313 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
312 if (vp->vp_idx) 314 if (vp->vp_idx)
313 ret = qla2x00_do_dpc_vp(vp); 315 ret = qla2x00_do_dpc_vp(vp);
314 } 316 }
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2f5f72531e23..3ddfa889e949 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2222,10 +2222,6 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
2222{ 2222{
2223 char name[16]; 2223 char name[16];
2224 2224
2225 ha->init_cb_size = sizeof(init_cb_t);
2226 if (IS_QLA2XXX_MIDTYPE(ha))
2227 ha->init_cb_size = sizeof(struct mid_init_cb_24xx);
2228
2229 ha->init_cb = dma_alloc_coherent(&ha->pdev->dev, ha->init_cb_size, 2225 ha->init_cb = dma_alloc_coherent(&ha->pdev->dev, ha->init_cb_size,
2230 &ha->init_cb_dma, GFP_KERNEL); 2226 &ha->init_cb_dma, GFP_KERNEL);
2231 if (!ha->init_cb) 2227 if (!ha->init_cb)
@@ -2568,7 +2564,7 @@ qla2x00_do_work(struct scsi_qla_host *vha)
2568void qla2x00_relogin(struct scsi_qla_host *vha) 2564void qla2x00_relogin(struct scsi_qla_host *vha)
2569{ 2565{
2570 fc_port_t *fcport; 2566 fc_port_t *fcport;
2571 uint8_t status; 2567 int status;
2572 uint16_t next_loopid = 0; 2568 uint16_t next_loopid = 0;
2573 struct qla_hw_data *ha = vha->hw; 2569 struct qla_hw_data *ha = vha->hw;
2574 2570
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 79f7053da99b..a772eab2f0ea 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.03.00-k3" 10#define QLA2XXX_VERSION "8.03.00-k4"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 3 13#define QLA_DRIVER_MINOR_VER 3