提交 4788e732 编写于 作者: J Jitendra Bhivare 提交者: Martin K. Petersen

scsi: be2iscsi: Modify IOCTL to fetch user configured IQN

Add version 1 of GET_HBA_NAME to fetch port specific IQN first.
If it fails use version 0 to get the IQN.

To use this old IQN names of interfaces needs to be cleared from
the iscsiadm database.
Signed-off-by: NJitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 c5905bf8
...@@ -762,11 +762,15 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, ...@@ -762,11 +762,15 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
} }
break; break;
case ISCSI_HOST_PARAM_INITIATOR_NAME: case ISCSI_HOST_PARAM_INITIATOR_NAME:
status = beiscsi_get_initiator_name(phba, buf); /* try fetching user configured name first */
status = beiscsi_get_initiator_name(phba, buf, true);
if (status < 0) { if (status < 0) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, status = beiscsi_get_initiator_name(phba, buf, false);
"BS_%d : Retreiving Initiator Name Failed\n"); if (status < 0) {
return 0; beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
"BS_%d : Retreiving Initiator Name Failed\n");
status = 0;
}
} }
break; break;
case ISCSI_HOST_PARAM_PORT_STATE: case ISCSI_HOST_PARAM_PORT_STATE:
......
...@@ -339,12 +339,14 @@ int beiscsi_modify_eq_delay(struct beiscsi_hba *phba, ...@@ -339,12 +339,14 @@ int beiscsi_modify_eq_delay(struct beiscsi_hba *phba,
* beiscsi_get_initiator_name - read initiator name from flash * beiscsi_get_initiator_name - read initiator name from flash
* @phba: device priv structure * @phba: device priv structure
* @name: buffer pointer * @name: buffer pointer
* @cfg: fetch user configured
* *
*/ */
int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name) int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name, bool cfg)
{ {
struct be_dma_mem nonemb_cmd; struct be_dma_mem nonemb_cmd;
struct be_cmd_hba_name resp; struct be_cmd_hba_name resp;
struct be_cmd_hba_name *req;
int rc; int rc;
rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI_INI, rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI_INI,
...@@ -352,6 +354,9 @@ int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name) ...@@ -352,6 +354,9 @@ int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name)
if (rc) if (rc)
return rc; return rc;
req = nonemb_cmd.va;
if (cfg)
req->hdr.version = 1;
rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL,
&resp, sizeof(resp)); &resp, sizeof(resp));
if (rc) { if (rc) {
......
...@@ -178,7 +178,7 @@ int beiscsi_mgmt_invalidate_icds(struct beiscsi_hba *phba, ...@@ -178,7 +178,7 @@ int beiscsi_mgmt_invalidate_icds(struct beiscsi_hba *phba,
struct invldt_cmd_tbl *inv_tbl, struct invldt_cmd_tbl *inv_tbl,
unsigned int nents); unsigned int nents);
int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name); int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name, bool cfg);
int beiscsi_if_en_dhcp(struct beiscsi_hba *phba, u32 ip_type); int beiscsi_if_en_dhcp(struct beiscsi_hba *phba, u32 ip_type);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册