aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_mgmt.c
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@gmail.com>2013-09-28 18:35:44 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 04:58:06 -0400
commit843ae752eea769899d3c2008d7f2b2e094ddb6cc (patch)
tree221d9768c1441a7be4509e030d9a958e8c1a6473 /drivers/scsi/be2iscsi/be_mgmt.c
parent92665a6628902246368494972a38d84b1b091cb8 (diff)
[SCSI] be2iscsi: Config parameters update for Dual Chute Support
On the adapter iSCSI protocol can be loaded on either one or both the CHUTE.Check on which CHUTE iSCSI Protocol is loaded and get configuration parameters based on which driver initization is done. For BE-X family iSCSI protocol is loaded only on single chute. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_mgmt.c')
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c77
1 files changed, 60 insertions, 17 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 2efad040b6ae..c46a60b883eb 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -278,6 +278,18 @@ unsigned int mgmt_get_session_info(struct beiscsi_hba *phba,
278 return tag; 278 return tag;
279} 279}
280 280
281/**
282 * mgmt_get_fw_config()- Get the FW config for the function
283 * @ctrl: ptr to Ctrl Info
284 * @phba: ptr to the dev priv structure
285 *
286 * Get the FW config and resources available for the function.
287 * The resources are created based on the count received here.
288 *
289 * return
290 * Success: 0
291 * Failure: Non-Zero Value
292 **/
281int mgmt_get_fw_config(struct be_ctrl_info *ctrl, 293int mgmt_get_fw_config(struct be_ctrl_info *ctrl,
282 struct beiscsi_hba *phba) 294 struct beiscsi_hba *phba)
283{ 295{
@@ -291,31 +303,62 @@ int mgmt_get_fw_config(struct be_ctrl_info *ctrl,
291 be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); 303 be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
292 304
293 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 305 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
294 OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req)); 306 OPCODE_COMMON_QUERY_FIRMWARE_CONFIG,
307 EMBED_MBX_MAX_PAYLOAD_SIZE);
295 status = be_mbox_notify(ctrl); 308 status = be_mbox_notify(ctrl);
296 if (!status) { 309 if (!status) {
310 uint8_t ulp_num = 0;
297 struct be_fw_cfg *pfw_cfg; 311 struct be_fw_cfg *pfw_cfg;
298 pfw_cfg = req; 312 pfw_cfg = req;
313
314 for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++)
315 if (pfw_cfg->ulp[ulp_num].ulp_mode &
316 BEISCSI_ULP_ISCSI_INI_MODE)
317 set_bit(ulp_num,
318 &phba->fw_config.ulp_supported);
319
299 phba->fw_config.phys_port = pfw_cfg->phys_port; 320 phba->fw_config.phys_port = pfw_cfg->phys_port;
300 phba->fw_config.iscsi_icd_start = 321 for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) {
301 pfw_cfg->ulp[0].icd_base; 322 if (test_bit(ulp_num, &phba->fw_config.ulp_supported)) {
302 phba->fw_config.iscsi_icd_count = 323
303 pfw_cfg->ulp[0].icd_count; 324 phba->fw_config.iscsi_cid_start[ulp_num] =
304 phba->fw_config.iscsi_cid_start = 325 pfw_cfg->ulp[ulp_num].sq_base;
305 pfw_cfg->ulp[0].sq_base; 326 phba->fw_config.iscsi_cid_count[ulp_num] =
306 phba->fw_config.iscsi_cid_count = 327 pfw_cfg->ulp[ulp_num].sq_count;
307 pfw_cfg->ulp[0].sq_count; 328
308 if (phba->fw_config.iscsi_cid_count > (BE2_MAX_SESSIONS / 2)) { 329 phba->fw_config.iscsi_icd_start[ulp_num] =
309 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 330 pfw_cfg->ulp[ulp_num].icd_base;
310 "BG_%d : FW reported MAX CXNS as %d\t" 331 phba->fw_config.iscsi_icd_count[ulp_num] =
311 "Max Supported = %d.\n", 332 pfw_cfg->ulp[ulp_num].icd_count;
312 phba->fw_config.iscsi_cid_count, 333
313 BE2_MAX_SESSIONS); 334 phba->fw_config.iscsi_chain_start[ulp_num] =
314 phba->fw_config.iscsi_cid_count = BE2_MAX_SESSIONS / 2; 335 pfw_cfg->chain_icd[ulp_num].chain_base;
336 phba->fw_config.iscsi_chain_count[ulp_num] =
337 pfw_cfg->chain_icd[ulp_num].chain_count;
338
339 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
340 "BG_%d : Function loaded on ULP : %d\n"
341 "\tiscsi_cid_count : %d\n"
342 "\t iscsi_icd_count : %d\n",
343 ulp_num,
344 phba->fw_config.
345 iscsi_cid_count[ulp_num],
346 phba->fw_config.
347 iscsi_icd_count[ulp_num]);
348 }
315 } 349 }
350
351 phba->fw_config.dual_ulp_aware = (pfw_cfg->function_mode &
352 BEISCSI_FUNC_DUA_MODE);
353
354 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
355 "BG_%d : DUA Mode : 0x%x\n",
356 phba->fw_config.dual_ulp_aware);
357
316 } else { 358 } else {
317 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT, 359 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
318 "BG_%d : Failed in mgmt_get_fw_config\n"); 360 "BG_%d : Failed in mgmt_get_fw_config\n");
361 status = -EINVAL;
319 } 362 }
320 363
321 spin_unlock(&ctrl->mbox_lock); 364 spin_unlock(&ctrl->mbox_lock);