summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@qlogic.com>2012-02-09 11:15:57 -0800
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 08:33:13 -0600
commit642ef983861a6a7ba41e9d7c0aa4da8f6d5af5bf (patch)
tree5688c1503783f8b530bd83f5928271de8dbb9677 /drivers/scsi/qla2xxx/qla_init.c
parent7a67735b07aa1bf61b8535eec6f6fb6474cf7926 (diff)
[SCSI] qla2xxx: Add ha->max_fibre_devices to keep track of the maximum number of targets.
Add a field to the qla_hw_data struct to allow us to set the maximum number of fabric devices on a per adapter basis based on ISP type. [jejb: fix up missing rval = QLA_SUCCESS to prevent uninit var warning] Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 24b2d1118593..2627c87a4a34 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2567,8 +2567,7 @@ qla2x00_configure_loop(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_disc, vha, 0x2015,
"Loop resync needed, failing.\n");
rval = QLA_FUNCTION_FAILED;
- }
- else
+ } else
rval = qla2x00_configure_local_loop(vha);
}
@@ -2642,7 +2641,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
found_devs = 0;
new_fcport = NULL;
- entries = MAX_FIBRE_DEVICES;
+ entries = MAX_FIBRE_DEVICES_LOOP;
ql_dbg(ql_dbg_disc, vha, 0x2016,
"Getting FCAL position map.\n");
@@ -2650,7 +2649,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
qla2x00_get_fcal_position_map(vha, NULL);
/* Get list of logged in devices. */
- memset(ha->gid_list, 0, GID_LIST_SIZE);
+ memset(ha->gid_list, 0, qla2x00_gid_list_size(ha));
rval = qla2x00_get_id_list(vha, ha->gid_list, ha->gid_list_dma,
&entries);
if (rval != QLA_SUCCESS)
@@ -3134,7 +3133,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
/* Try GID_PT to get device list, else GAN. */
if (!ha->swl)
- ha->swl = kcalloc(MAX_FIBRE_DEVICES, sizeof(sw_info_t),
+ ha->swl = kcalloc(ha->max_fibre_devices, sizeof(sw_info_t),
GFP_KERNEL);
swl = ha->swl;
if (!swl) {
@@ -3142,7 +3141,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
ql_dbg(ql_dbg_disc, vha, 0x2054,
"GID_PT allocations failed, fallback on GA_NXT.\n");
} else {
- memset(swl, 0, MAX_FIBRE_DEVICES * sizeof(sw_info_t));
+ memset(swl, 0, ha->max_fibre_devices * sizeof(sw_info_t));
if (qla2x00_gid_pt(vha, swl) != QLA_SUCCESS) {
swl = NULL;
} else if (qla2x00_gpn_id(vha, swl) != QLA_SUCCESS) {