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/iscsi_tcp.c | |
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/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 7724414588fa..1dcb4d183bc9 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -872,6 +872,31 @@ static void iscsi_sw_tcp_session_destroy(struct iscsi_cls_session *cls_session) | |||
872 | iscsi_host_free(shost); | 872 | iscsi_host_free(shost); |
873 | } | 873 | } |
874 | 874 | ||
875 | static mode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) | ||
876 | { | ||
877 | switch (param_type) { | ||
878 | case ISCSI_PARAM: | ||
879 | switch (param) { | ||
880 | case ISCSI_PARAM_MAX_RECV_DLENGTH: | ||
881 | case ISCSI_PARAM_MAX_XMIT_DLENGTH: | ||
882 | case ISCSI_PARAM_HDRDGST_EN: | ||
883 | case ISCSI_PARAM_DATADGST_EN: | ||
884 | case ISCSI_PARAM_CONN_ADDRESS: | ||
885 | case ISCSI_PARAM_CONN_PORT: | ||
886 | case ISCSI_PARAM_EXP_STATSN: | ||
887 | case ISCSI_PARAM_PERSISTENT_ADDRESS: | ||
888 | case ISCSI_PARAM_PERSISTENT_PORT: | ||
889 | case ISCSI_PARAM_PING_TMO: | ||
890 | case ISCSI_PARAM_RECV_TMO: | ||
891 | return S_IRUGO; | ||
892 | default: | ||
893 | return 0; | ||
894 | } | ||
895 | } | ||
896 | |||
897 | return 0; | ||
898 | } | ||
899 | |||
875 | static int iscsi_sw_tcp_slave_alloc(struct scsi_device *sdev) | 900 | static int iscsi_sw_tcp_slave_alloc(struct scsi_device *sdev) |
876 | { | 901 | { |
877 | set_bit(QUEUE_FLAG_BIDI, &sdev->request_queue->queue_flags); | 902 | set_bit(QUEUE_FLAG_BIDI, &sdev->request_queue->queue_flags); |
@@ -910,11 +935,7 @@ static struct iscsi_transport iscsi_sw_tcp_transport = { | |||
910 | .name = "tcp", | 935 | .name = "tcp", |
911 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST | 936 | .caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST |
912 | | CAP_DATADGST, | 937 | | CAP_DATADGST, |
913 | .param_mask = ISCSI_MAX_RECV_DLENGTH | | 938 | .param_mask = ISCSI_INITIAL_R2T_EN | |
914 | ISCSI_MAX_XMIT_DLENGTH | | ||
915 | ISCSI_HDRDGST_EN | | ||
916 | ISCSI_DATADGST_EN | | ||
917 | ISCSI_INITIAL_R2T_EN | | ||
918 | ISCSI_MAX_R2T | | 939 | ISCSI_MAX_R2T | |
919 | ISCSI_IMM_DATA_EN | | 940 | ISCSI_IMM_DATA_EN | |
920 | ISCSI_FIRST_BURST | | 941 | ISCSI_FIRST_BURST | |
@@ -922,17 +943,11 @@ static struct iscsi_transport iscsi_sw_tcp_transport = { | |||
922 | ISCSI_PDU_INORDER_EN | | 943 | ISCSI_PDU_INORDER_EN | |
923 | ISCSI_DATASEQ_INORDER_EN | | 944 | ISCSI_DATASEQ_INORDER_EN | |
924 | ISCSI_ERL | | 945 | ISCSI_ERL | |
925 | ISCSI_CONN_PORT | | ||
926 | ISCSI_CONN_ADDRESS | | ||
927 | ISCSI_EXP_STATSN | | ||
928 | ISCSI_PERSISTENT_PORT | | ||
929 | ISCSI_PERSISTENT_ADDRESS | | ||
930 | ISCSI_TARGET_NAME | ISCSI_TPGT | | 946 | ISCSI_TARGET_NAME | ISCSI_TPGT | |
931 | ISCSI_USERNAME | ISCSI_PASSWORD | | 947 | ISCSI_USERNAME | ISCSI_PASSWORD | |
932 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | | 948 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | |
933 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | | 949 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | |
934 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | | 950 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | |
935 | ISCSI_PING_TMO | ISCSI_RECV_TMO | | ||
936 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, | 951 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, |
937 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 952 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |
938 | ISCSI_HOST_INITIATOR_NAME | | 953 | ISCSI_HOST_INITIATOR_NAME | |
@@ -944,6 +959,7 @@ static struct iscsi_transport iscsi_sw_tcp_transport = { | |||
944 | .create_conn = iscsi_sw_tcp_conn_create, | 959 | .create_conn = iscsi_sw_tcp_conn_create, |
945 | .bind_conn = iscsi_sw_tcp_conn_bind, | 960 | .bind_conn = iscsi_sw_tcp_conn_bind, |
946 | .destroy_conn = iscsi_sw_tcp_conn_destroy, | 961 | .destroy_conn = iscsi_sw_tcp_conn_destroy, |
962 | .attr_is_visible = iscsi_sw_tcp_attr_is_visible, | ||
947 | .set_param = iscsi_sw_tcp_conn_set_param, | 963 | .set_param = iscsi_sw_tcp_conn_set_param, |
948 | .get_conn_param = iscsi_sw_tcp_conn_get_param, | 964 | .get_conn_param = iscsi_sw_tcp_conn_get_param, |
949 | .get_session_param = iscsi_session_get_param, | 965 | .get_session_param = iscsi_session_get_param, |