diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-05-30 13:57:16 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2007-06-01 12:58:58 -0400 |
commit | b2c6416736b847b91950bd43cc5153e11a1f83ee (patch) | |
tree | 7d7642d9b62b22aceedf8e86570783364ecd99d1 /drivers/scsi/scsi_transport_iscsi.c | |
parent | 857ae0bdb72999936a28ce621e38e2e288c485da (diff) |
[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/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 5ec2fbea8937..341d4fb5c6f8 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <scsi/scsi_transport_iscsi.h> | 30 | #include <scsi/scsi_transport_iscsi.h> |
31 | #include <scsi/iscsi_if.h> | 31 | #include <scsi/iscsi_if.h> |
32 | 32 | ||
33 | #define ISCSI_SESSION_ATTRS 11 | 33 | #define ISCSI_SESSION_ATTRS 15 |
34 | #define ISCSI_CONN_ATTRS 11 | 34 | #define ISCSI_CONN_ATTRS 11 |
35 | #define ISCSI_HOST_ATTRS 2 | 35 | #define ISCSI_HOST_ATTRS 2 |
36 | #define ISCSI_TRANSPORT_VERSION "2.0-724" | 36 | #define ISCSI_TRANSPORT_VERSION "2.0-724" |
@@ -1196,30 +1196,37 @@ iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS); | |||
1196 | /* | 1196 | /* |
1197 | * iSCSI session attrs | 1197 | * iSCSI session attrs |
1198 | */ | 1198 | */ |
1199 | #define iscsi_session_attr_show(param) \ | 1199 | #define iscsi_session_attr_show(param, perm) \ |
1200 | static ssize_t \ | 1200 | static ssize_t \ |
1201 | show_session_param_##param(struct class_device *cdev, char *buf) \ | 1201 | show_session_param_##param(struct class_device *cdev, char *buf) \ |
1202 | { \ | 1202 | { \ |
1203 | struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ | 1203 | struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \ |
1204 | struct iscsi_transport *t = session->transport; \ | 1204 | struct iscsi_transport *t = session->transport; \ |
1205 | \ | ||
1206 | if (perm && !capable(CAP_SYS_ADMIN)) \ | ||
1207 | return -EACCES; \ | ||
1205 | return t->get_session_param(session, param, buf); \ | 1208 | return t->get_session_param(session, param, buf); \ |
1206 | } | 1209 | } |
1207 | 1210 | ||
1208 | #define iscsi_session_attr(field, param) \ | 1211 | #define iscsi_session_attr(field, param, perm) \ |
1209 | iscsi_session_attr_show(param) \ | 1212 | iscsi_session_attr_show(param, perm) \ |
1210 | static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_param_##param, \ | 1213 | static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_param_##param, \ |
1211 | NULL); | 1214 | NULL); |
1212 | 1215 | ||
1213 | iscsi_session_attr(targetname, ISCSI_PARAM_TARGET_NAME); | 1216 | iscsi_session_attr(targetname, ISCSI_PARAM_TARGET_NAME, 0); |
1214 | iscsi_session_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN); | 1217 | iscsi_session_attr(initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN, 0); |
1215 | iscsi_session_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T); | 1218 | iscsi_session_attr(max_outstanding_r2t, ISCSI_PARAM_MAX_R2T, 0); |
1216 | iscsi_session_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN); | 1219 | iscsi_session_attr(immediate_data, ISCSI_PARAM_IMM_DATA_EN, 0); |
1217 | iscsi_session_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST); | 1220 | iscsi_session_attr(first_burst_len, ISCSI_PARAM_FIRST_BURST, 0); |
1218 | iscsi_session_attr(max_burst_len, ISCSI_PARAM_MAX_BURST); | 1221 | iscsi_session_attr(max_burst_len, ISCSI_PARAM_MAX_BURST, 0); |
1219 | iscsi_session_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN); | 1222 | iscsi_session_attr(data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN, 0); |
1220 | iscsi_session_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN); | 1223 | iscsi_session_attr(data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN, 0); |
1221 | iscsi_session_attr(erl, ISCSI_PARAM_ERL); | 1224 | iscsi_session_attr(erl, ISCSI_PARAM_ERL, 0); |
1222 | iscsi_session_attr(tpgt, ISCSI_PARAM_TPGT); | 1225 | iscsi_session_attr(tpgt, ISCSI_PARAM_TPGT, 0); |
1226 | iscsi_session_attr(username, ISCSI_PARAM_USERNAME, 1); | ||
1227 | iscsi_session_attr(username_in, ISCSI_PARAM_USERNAME_IN, 1); | ||
1228 | iscsi_session_attr(password, ISCSI_PARAM_PASSWORD, 1); | ||
1229 | iscsi_session_attr(password_in, ISCSI_PARAM_PASSWORD_IN, 1); | ||
1223 | 1230 | ||
1224 | #define iscsi_priv_session_attr_show(field, format) \ | 1231 | #define iscsi_priv_session_attr_show(field, format) \ |
1225 | static ssize_t \ | 1232 | static ssize_t \ |
@@ -1433,6 +1440,10 @@ iscsi_register_transport(struct iscsi_transport *tt) | |||
1433 | SETUP_SESSION_RD_ATTR(erl, ISCSI_ERL); | 1440 | SETUP_SESSION_RD_ATTR(erl, ISCSI_ERL); |
1434 | SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME); | 1441 | SETUP_SESSION_RD_ATTR(targetname, ISCSI_TARGET_NAME); |
1435 | SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT); | 1442 | SETUP_SESSION_RD_ATTR(tpgt, ISCSI_TPGT); |
1443 | SETUP_SESSION_RD_ATTR(password, ISCSI_USERNAME); | ||
1444 | SETUP_SESSION_RD_ATTR(password_in, ISCSI_USERNAME_IN); | ||
1445 | SETUP_SESSION_RD_ATTR(username, ISCSI_PASSWORD); | ||
1446 | SETUP_SESSION_RD_ATTR(username_in, ISCSI_PASSWORD_IN); | ||
1436 | SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo); | 1447 | SETUP_PRIV_SESSION_RD_ATTR(recovery_tmo); |
1437 | 1448 | ||
1438 | BUG_ON(count > ISCSI_SESSION_ATTRS); | 1449 | BUG_ON(count > ISCSI_SESSION_ATTRS); |