aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2i
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2011-07-25 14:48:42 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-08-27 10:36:03 -0400
commit3128c6c73cdf3df92c3165bfb785ae50114d18bf (patch)
tree49af7993064b0140bda96c795a47fa336525d02c /drivers/scsi/bnx2i
parented1086e041b4870313dd0c0755f4bbc3b62d0d08 (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/bnx2i')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index cffd4d75df56..2d529c9fa1ad 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -2177,6 +2177,30 @@ static int bnx2i_nl_set_path(struct Scsi_Host *shost, struct iscsi_path *params)
2177 return 0; 2177 return 0;
2178} 2178}
2179 2179
2180static mode_t bnx2i_attr_is_visible(int param_type, int param)
2181{
2182 switch (param_type) {
2183 case ISCSI_PARAM:
2184 switch (param) {
2185 case ISCSI_PARAM_MAX_RECV_DLENGTH:
2186 case ISCSI_PARAM_MAX_XMIT_DLENGTH:
2187 case ISCSI_PARAM_HDRDGST_EN:
2188 case ISCSI_PARAM_DATADGST_EN:
2189 case ISCSI_PARAM_CONN_ADDRESS:
2190 case ISCSI_PARAM_CONN_PORT:
2191 case ISCSI_PARAM_EXP_STATSN:
2192 case ISCSI_PARAM_PERSISTENT_ADDRESS:
2193 case ISCSI_PARAM_PERSISTENT_PORT:
2194 case ISCSI_PARAM_PING_TMO:
2195 case ISCSI_PARAM_RECV_TMO:
2196 return S_IRUGO;
2197 default:
2198 return 0;
2199 }
2200 }
2201
2202 return 0;
2203}
2180 2204
2181/* 2205/*
2182 * 'Scsi_Host_Template' structure and 'iscsi_tranport' structure template 2206 * 'Scsi_Host_Template' structure and 'iscsi_tranport' structure template
@@ -2207,11 +2231,7 @@ struct iscsi_transport bnx2i_iscsi_transport = {
2207 CAP_MULTI_R2T | CAP_DATADGST | 2231 CAP_MULTI_R2T | CAP_DATADGST |
2208 CAP_DATA_PATH_OFFLOAD | 2232 CAP_DATA_PATH_OFFLOAD |
2209 CAP_TEXT_NEGO, 2233 CAP_TEXT_NEGO,
2210 .param_mask = ISCSI_MAX_RECV_DLENGTH | 2234 .param_mask = ISCSI_INITIAL_R2T_EN |
2211 ISCSI_MAX_XMIT_DLENGTH |
2212 ISCSI_HDRDGST_EN |
2213 ISCSI_DATADGST_EN |
2214 ISCSI_INITIAL_R2T_EN |
2215 ISCSI_MAX_R2T | 2235 ISCSI_MAX_R2T |
2216 ISCSI_IMM_DATA_EN | 2236 ISCSI_IMM_DATA_EN |
2217 ISCSI_FIRST_BURST | 2237 ISCSI_FIRST_BURST |
@@ -2219,17 +2239,11 @@ struct iscsi_transport bnx2i_iscsi_transport = {
2219 ISCSI_PDU_INORDER_EN | 2239 ISCSI_PDU_INORDER_EN |
2220 ISCSI_DATASEQ_INORDER_EN | 2240 ISCSI_DATASEQ_INORDER_EN |
2221 ISCSI_ERL | 2241 ISCSI_ERL |
2222 ISCSI_CONN_PORT |
2223 ISCSI_CONN_ADDRESS |
2224 ISCSI_EXP_STATSN |
2225 ISCSI_PERSISTENT_PORT |
2226 ISCSI_PERSISTENT_ADDRESS |
2227 ISCSI_TARGET_NAME | ISCSI_TPGT | 2242 ISCSI_TARGET_NAME | ISCSI_TPGT |
2228 ISCSI_USERNAME | ISCSI_PASSWORD | 2243 ISCSI_USERNAME | ISCSI_PASSWORD |
2229 ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | 2244 ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
2230 ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | 2245 ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
2231 ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | 2246 ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO |
2232 ISCSI_PING_TMO | ISCSI_RECV_TMO |
2233 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, 2247 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME,
2234 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | 2248 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS |
2235 ISCSI_HOST_NETDEV_NAME, 2249 ISCSI_HOST_NETDEV_NAME,
@@ -2238,6 +2252,7 @@ struct iscsi_transport bnx2i_iscsi_transport = {
2238 .create_conn = bnx2i_conn_create, 2252 .create_conn = bnx2i_conn_create,
2239 .bind_conn = bnx2i_conn_bind, 2253 .bind_conn = bnx2i_conn_bind,
2240 .destroy_conn = bnx2i_conn_destroy, 2254 .destroy_conn = bnx2i_conn_destroy,
2255 .attr_is_visible = bnx2i_attr_is_visible,
2241 .set_param = iscsi_set_param, 2256 .set_param = iscsi_set_param,
2242 .get_conn_param = iscsi_conn_get_param, 2257 .get_conn_param = iscsi_conn_get_param,
2243 .get_session_param = iscsi_session_get_param, 2258 .get_session_param = iscsi_session_get_param,