aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdheer Chandravanshi <adheer.chandravanshi@qlogic.com>2013-09-17 07:54:45 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 04:57:59 -0400
commit244c079b81c836ee0ed75eedf1e1322e733ea7c8 (patch)
tree4cb8c41a528edbdde36803652424b76e85889605
parent33519aecafc01a48fef6735d55f9879d3c4070cd (diff)
[SCSI] qla4xxx: Support setting of local CHAP index for flash target entry
Support setting of CHAP_OUT_IDX param for the target entry in flash. Setting of valid local CHAP index with enable CHAP AUTH for that flash target entry and disabling CHAP AUTH will invalidate the CHAP index for the flash target entry. Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h4
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 51d1a70f8b45..1243e5942b76 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -539,6 +539,10 @@ struct qla_flt_region {
539#define ENABLE_INTERNAL_LOOPBACK 0x04 539#define ENABLE_INTERNAL_LOOPBACK 0x04
540#define ENABLE_EXTERNAL_LOOPBACK 0x08 540#define ENABLE_EXTERNAL_LOOPBACK 0x08
541 541
542/* generic defines to enable/disable params */
543#define QL4_PARAM_DISABLE 0
544#define QL4_PARAM_ENABLE 1
545
542/*************************************************************************/ 546/*************************************************************************/
543 547
544/* Host Adapter Initialization Control Block (from host) */ 548/* Host Adapter Initialization Control Block (from host) */
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a8847a31273d..057d06861ad7 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -6684,10 +6684,13 @@ qla4xxx_sysfs_ddb_set_param(struct iscsi_bus_flash_session *fnode_sess,
6684 struct Scsi_Host *shost = iscsi_flash_session_to_shost(fnode_sess); 6684 struct Scsi_Host *shost = iscsi_flash_session_to_shost(fnode_sess);
6685 struct scsi_qla_host *ha = to_qla_host(shost); 6685 struct scsi_qla_host *ha = to_qla_host(shost);
6686 struct iscsi_flashnode_param_info *fnode_param; 6686 struct iscsi_flashnode_param_info *fnode_param;
6687 struct ql4_chap_table chap_tbl;
6687 struct nlattr *attr; 6688 struct nlattr *attr;
6689 uint16_t chap_out_idx = INVALID_ENTRY;
6688 int rc = QLA_ERROR; 6690 int rc = QLA_ERROR;
6689 uint32_t rem = len; 6691 uint32_t rem = len;
6690 6692
6693 memset((void *)&chap_tbl, 0, sizeof(chap_tbl));
6691 nla_for_each_attr(attr, data, len, rem) { 6694 nla_for_each_attr(attr, data, len, rem) {
6692 fnode_param = nla_data(attr); 6695 fnode_param = nla_data(attr);
6693 6696
@@ -6729,6 +6732,10 @@ qla4xxx_sysfs_ddb_set_param(struct iscsi_bus_flash_session *fnode_sess,
6729 break; 6732 break;
6730 case ISCSI_FLASHNODE_CHAP_AUTH_EN: 6733 case ISCSI_FLASHNODE_CHAP_AUTH_EN:
6731 fnode_sess->chap_auth_en = fnode_param->value[0]; 6734 fnode_sess->chap_auth_en = fnode_param->value[0];
6735 /* Invalidate chap index if chap auth is disabled */
6736 if (!fnode_sess->chap_auth_en)
6737 fnode_sess->chap_out_idx = INVALID_ENTRY;
6738
6732 break; 6739 break;
6733 case ISCSI_FLASHNODE_SNACK_REQ_EN: 6740 case ISCSI_FLASHNODE_SNACK_REQ_EN:
6734 fnode_conn->snack_req_en = fnode_param->value[0]; 6741 fnode_conn->snack_req_en = fnode_param->value[0];
@@ -6867,6 +6874,17 @@ qla4xxx_sysfs_ddb_set_param(struct iscsi_bus_flash_session *fnode_sess,
6867 fnode_conn->exp_statsn = 6874 fnode_conn->exp_statsn =
6868 *(uint32_t *)fnode_param->value; 6875 *(uint32_t *)fnode_param->value;
6869 break; 6876 break;
6877 case ISCSI_FLASHNODE_CHAP_OUT_IDX:
6878 chap_out_idx = *(uint16_t *)fnode_param->value;
6879 if (!qla4xxx_get_uni_chap_at_index(ha,
6880 chap_tbl.name,
6881 chap_tbl.secret,
6882 chap_out_idx)) {
6883 fnode_sess->chap_out_idx = chap_out_idx;
6884 /* Enable chap auth if chap index is valid */
6885 fnode_sess->chap_auth_en = QL4_PARAM_ENABLE;
6886 }
6887 break;
6870 default: 6888 default:
6871 ql4_printk(KERN_ERR, ha, 6889 ql4_printk(KERN_ERR, ha,
6872 "%s: No such sysfs attribute\n", __func__); 6890 "%s: No such sysfs attribute\n", __func__);