diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2011-07-25 14:48:42 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 10:36:03 -0400 |
commit | 3128c6c73cdf3df92c3165bfb785ae50114d18bf (patch) | |
tree | 49af7993064b0140bda96c795a47fa336525d02c /drivers/scsi/cxgbi | |
parent | ed1086e041b4870313dd0c0755f4bbc3b62d0d08 (diff) |
[SCSI] iscsi cls: sysfs group is_visible callout for conn attrs
The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and drivers to use the attribute container
sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/cxgbi')
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 8 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 8 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 26 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.h | 1 |
4 files changed, 31 insertions, 12 deletions
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index bd22041e2789..c13b3f0a4f03 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | |||
@@ -106,25 +106,21 @@ static struct iscsi_transport cxgb3i_iscsi_transport = { | |||
106 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST | 106 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST |
107 | | CAP_DATADGST | CAP_DIGEST_OFFLOAD | | 107 | | CAP_DATADGST | CAP_DIGEST_OFFLOAD | |
108 | CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO, | 108 | CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO, |
109 | .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH | | 109 | .param_mask = |
110 | ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN | | ||
111 | ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | | 110 | ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | |
112 | ISCSI_IMM_DATA_EN | ISCSI_FIRST_BURST | | 111 | ISCSI_IMM_DATA_EN | ISCSI_FIRST_BURST | |
113 | ISCSI_MAX_BURST | ISCSI_PDU_INORDER_EN | | 112 | ISCSI_MAX_BURST | ISCSI_PDU_INORDER_EN | |
114 | ISCSI_DATASEQ_INORDER_EN | ISCSI_ERL | | 113 | ISCSI_DATASEQ_INORDER_EN | ISCSI_ERL | |
115 | ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS | | ||
116 | ISCSI_EXP_STATSN | ISCSI_PERSISTENT_PORT | | ||
117 | ISCSI_PERSISTENT_ADDRESS | | ||
118 | ISCSI_TARGET_NAME | ISCSI_TPGT | | 114 | ISCSI_TARGET_NAME | ISCSI_TPGT | |
119 | ISCSI_USERNAME | ISCSI_PASSWORD | | 115 | ISCSI_USERNAME | ISCSI_PASSWORD | |
120 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | | 116 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | |
121 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | | 117 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | |
122 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | | 118 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | |
123 | ISCSI_PING_TMO | ISCSI_RECV_TMO | | ||
124 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, | 119 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, |
125 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 120 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |
126 | ISCSI_HOST_INITIATOR_NAME | | 121 | ISCSI_HOST_INITIATOR_NAME | |
127 | ISCSI_HOST_NETDEV_NAME, | 122 | ISCSI_HOST_NETDEV_NAME, |
123 | .attr_is_visible = cxgbi_attr_is_visible, | ||
128 | .get_host_param = cxgbi_get_host_param, | 124 | .get_host_param = cxgbi_get_host_param, |
129 | .set_host_param = cxgbi_set_host_param, | 125 | .set_host_param = cxgbi_set_host_param, |
130 | /* session management */ | 126 | /* session management */ |
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index ae13c4993aa3..89fca4b0787c 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | |||
@@ -107,25 +107,21 @@ static struct iscsi_transport cxgb4i_iscsi_transport = { | |||
107 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST | | 107 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST | |
108 | CAP_DATADGST | CAP_DIGEST_OFFLOAD | | 108 | CAP_DATADGST | CAP_DIGEST_OFFLOAD | |
109 | CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO, | 109 | CAP_PADDING_OFFLOAD | CAP_TEXT_NEGO, |
110 | .param_mask = ISCSI_MAX_RECV_DLENGTH | ISCSI_MAX_XMIT_DLENGTH | | 110 | .param_mask = |
111 | ISCSI_HDRDGST_EN | ISCSI_DATADGST_EN | | ||
112 | ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | | 111 | ISCSI_INITIAL_R2T_EN | ISCSI_MAX_R2T | |
113 | ISCSI_IMM_DATA_EN | ISCSI_FIRST_BURST | | 112 | ISCSI_IMM_DATA_EN | ISCSI_FIRST_BURST | |
114 | ISCSI_MAX_BURST | ISCSI_PDU_INORDER_EN | | 113 | ISCSI_MAX_BURST | ISCSI_PDU_INORDER_EN | |
115 | ISCSI_DATASEQ_INORDER_EN | ISCSI_ERL | | 114 | ISCSI_DATASEQ_INORDER_EN | ISCSI_ERL | |
116 | ISCSI_CONN_PORT | ISCSI_CONN_ADDRESS | | ||
117 | ISCSI_EXP_STATSN | ISCSI_PERSISTENT_PORT | | ||
118 | ISCSI_PERSISTENT_ADDRESS | | ||
119 | ISCSI_TARGET_NAME | ISCSI_TPGT | | 115 | ISCSI_TARGET_NAME | ISCSI_TPGT | |
120 | ISCSI_USERNAME | ISCSI_PASSWORD | | 116 | ISCSI_USERNAME | ISCSI_PASSWORD | |
121 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | | 117 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | |
122 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | | 118 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | |
123 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | | 119 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | |
124 | ISCSI_PING_TMO | ISCSI_RECV_TMO | | ||
125 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, | 120 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, |
126 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 121 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |
127 | ISCSI_HOST_INITIATOR_NAME | | 122 | ISCSI_HOST_INITIATOR_NAME | |
128 | ISCSI_HOST_NETDEV_NAME, | 123 | ISCSI_HOST_NETDEV_NAME, |
124 | .attr_is_visible = cxgbi_attr_is_visible, | ||
129 | .get_host_param = cxgbi_get_host_param, | 125 | .get_host_param = cxgbi_get_host_param, |
130 | .set_host_param = cxgbi_set_host_param, | 126 | .set_host_param = cxgbi_set_host_param, |
131 | /* session management */ | 127 | /* session management */ |
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 77ac217ad5ce..e5f4f968ed7b 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -2566,6 +2566,32 @@ void cxgbi_iscsi_cleanup(struct iscsi_transport *itp, | |||
2566 | } | 2566 | } |
2567 | EXPORT_SYMBOL_GPL(cxgbi_iscsi_cleanup); | 2567 | EXPORT_SYMBOL_GPL(cxgbi_iscsi_cleanup); |
2568 | 2568 | ||
2569 | mode_t cxgbi_attr_is_visible(int param_type, int param) | ||
2570 | { | ||
2571 | switch (param_type) { | ||
2572 | case ISCSI_PARAM: | ||
2573 | switch (param) { | ||
2574 | case ISCSI_PARAM_MAX_RECV_DLENGTH: | ||
2575 | case ISCSI_PARAM_MAX_XMIT_DLENGTH: | ||
2576 | case ISCSI_PARAM_HDRDGST_EN: | ||
2577 | case ISCSI_PARAM_DATADGST_EN: | ||
2578 | case ISCSI_PARAM_CONN_ADDRESS: | ||
2579 | case ISCSI_PARAM_CONN_PORT: | ||
2580 | case ISCSI_PARAM_EXP_STATSN: | ||
2581 | case ISCSI_PARAM_PERSISTENT_ADDRESS: | ||
2582 | case ISCSI_PARAM_PERSISTENT_PORT: | ||
2583 | case ISCSI_PARAM_PING_TMO: | ||
2584 | case ISCSI_PARAM_RECV_TMO: | ||
2585 | return S_IRUGO; | ||
2586 | default: | ||
2587 | return 0; | ||
2588 | } | ||
2589 | } | ||
2590 | |||
2591 | return 0; | ||
2592 | } | ||
2593 | EXPORT_SYMBOL_GPL(cxgbi_attr_is_visible); | ||
2594 | |||
2569 | static int __init libcxgbi_init_module(void) | 2595 | static int __init libcxgbi_init_module(void) |
2570 | { | 2596 | { |
2571 | sw_tag_idx_bits = (__ilog2_u32(ISCSI_ITT_MASK)) + 1; | 2597 | sw_tag_idx_bits = (__ilog2_u32(ISCSI_ITT_MASK)) + 1; |
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h index 9267844519c9..5d453a0dba1f 100644 --- a/drivers/scsi/cxgbi/libcxgbi.h +++ b/drivers/scsi/cxgbi/libcxgbi.h | |||
@@ -709,6 +709,7 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *); | |||
709 | 709 | ||
710 | void cxgbi_cleanup_task(struct iscsi_task *task); | 710 | void cxgbi_cleanup_task(struct iscsi_task *task); |
711 | 711 | ||
712 | mode_t cxgbi_attr_is_visible(int param_type, int param); | ||
712 | void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); | 713 | void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); |
713 | int cxgbi_set_conn_param(struct iscsi_cls_conn *, | 714 | int cxgbi_set_conn_param(struct iscsi_cls_conn *, |
714 | enum iscsi_param, char *, int); | 715 | enum iscsi_param, char *, int); |