diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-05-30 17:57:16 (GMT) |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2007-06-01 16:58:58 (GMT) |
commit | b2c6416736b847b91950bd43cc5153e11a1f83ee (patch) | |
tree | 7d7642d9b62b22aceedf8e86570783364ecd99d1 /drivers/scsi/libiscsi.c | |
parent | 857ae0bdb72999936a28ce621e38e2e288c485da (diff) | |
download | linux-b2c6416736b847b91950bd43cc5153e11a1f83ee.tar.xz |
[SCSI] iscsi class, iscsi_tcp, ib_iser: add sysfs chap file
The attached patches add sysfs files for the chap settings
to the iscsi transport class, iscsi_tcp and ib_iser. This is
needed for software iscsi because there are times when iscsid
can die and it will need to reread the values it was using.
And it is needed by qla4xxx for basic management opertaions.
This patch does not hook in qla4xxx yet, because I am not sure
the mbx command to use.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Roland Dreier <rdreier@cisco.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 0a9c64e..63981ed 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1461,6 +1461,10 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds); iscsi_pool_free(&session->cmdpool, (void**)session->cmds); + kfree(session->password); + kfree(session->password_in); + kfree(session->username); + kfree(session->username_in); kfree(session->targetname); kfree(session->hwaddress); kfree(session->initiatorname); @@ -1869,6 +1873,30 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn, case ISCSI_PARAM_EXP_STATSN: sscanf(buf, "%u", &conn->exp_statsn); break; + case ISCSI_PARAM_USERNAME: + kfree(session->username); + session->username = kstrdup(buf, GFP_KERNEL); + if (!session->username) + return -ENOMEM; + break; + case ISCSI_PARAM_USERNAME_IN: + kfree(session->username_in); + session->username_in = kstrdup(buf, GFP_KERNEL); + if (!session->username_in) + return -ENOMEM; + break; + case ISCSI_PARAM_PASSWORD: + kfree(session->password); + session->password = kstrdup(buf, GFP_KERNEL); + if (!session->password) + return -ENOMEM; + break; + case ISCSI_PARAM_PASSWORD_IN: + kfree(session->password_in); + session->password_in = kstrdup(buf, GFP_KERNEL); + if (!session->password_in) + return -ENOMEM; + break; case ISCSI_PARAM_TARGET_NAME: /* this should not change between logins */ if (session->targetname) @@ -1942,6 +1970,18 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session, case ISCSI_PARAM_TPGT: len = sprintf(buf, "%d\n", session->tpgt); break; + case ISCSI_PARAM_USERNAME: + len = sprintf(buf, "%s\n", session->username); + break; + case ISCSI_PARAM_USERNAME_IN: + len = sprintf(buf, "%s\n", session->username_in); + break; + case ISCSI_PARAM_PASSWORD: + len = sprintf(buf, "%s\n", session->password); + break; + case ISCSI_PARAM_PASSWORD_IN: + len = sprintf(buf, "%s\n", session->password_in); + break; default: return -ENOSYS; } |