aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-06-19 21:37:00 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-07-03 22:44:31 -0400
commite4b512e7133f5243f080db8238c5be8434cbcdfd (patch)
tree479e334fb00ad9dfcdbadf22536ccde455e95036
parent6665889c843c774cd35309cf995ba0d302fa6dba (diff)
target: Add se_portal_group->tpg_auth_group
This patch adds an optional /auth/ configfs group to TPG context that can be used by fabrics like iscsi-target for TPG demo-mode authentication. Cc: Dax Kelson <dkelson@gurulabs.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_fabric_configfs.c21
-rw-r--r--include/target/target_core_base.h3
-rw-r--r--include/target/target_core_configfs.h1
-rw-r--r--include/target/target_core_fabric_configfs.h11
4 files changed, 33 insertions, 3 deletions
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
index 04c775cb3e65..eb56eb129563 100644
--- a/drivers/target/target_core_fabric_configfs.c
+++ b/drivers/target/target_core_fabric_configfs.c
@@ -965,6 +965,19 @@ TF_CIT_SETUP(tpg_attrib, &target_fabric_tpg_attrib_item_ops, NULL, NULL);
965 965
966/* End of tfc_tpg_attrib_cit */ 966/* End of tfc_tpg_attrib_cit */
967 967
968/* Start of tfc_tpg_auth_cit */
969
970CONFIGFS_EATTR_OPS(target_fabric_tpg_auth, se_portal_group, tpg_auth_group);
971
972static struct configfs_item_operations target_fabric_tpg_auth_item_ops = {
973 .show_attribute = target_fabric_tpg_auth_attr_show,
974 .store_attribute = target_fabric_tpg_auth_attr_store,
975};
976
977TF_CIT_SETUP(tpg_auth, &target_fabric_tpg_auth_item_ops, NULL, NULL);
978
979/* End of tfc_tpg_attrib_cit */
980
968/* Start of tfc_tpg_param_cit */ 981/* Start of tfc_tpg_param_cit */
969 982
970CONFIGFS_EATTR_OPS(target_fabric_tpg_param, se_portal_group, tpg_param_group); 983CONFIGFS_EATTR_OPS(target_fabric_tpg_param, se_portal_group, tpg_param_group);
@@ -1030,8 +1043,9 @@ static struct config_group *target_fabric_make_tpg(
1030 se_tpg->tpg_group.default_groups[1] = &se_tpg->tpg_np_group; 1043 se_tpg->tpg_group.default_groups[1] = &se_tpg->tpg_np_group;
1031 se_tpg->tpg_group.default_groups[2] = &se_tpg->tpg_acl_group; 1044 se_tpg->tpg_group.default_groups[2] = &se_tpg->tpg_acl_group;
1032 se_tpg->tpg_group.default_groups[3] = &se_tpg->tpg_attrib_group; 1045 se_tpg->tpg_group.default_groups[3] = &se_tpg->tpg_attrib_group;
1033 se_tpg->tpg_group.default_groups[4] = &se_tpg->tpg_param_group; 1046 se_tpg->tpg_group.default_groups[4] = &se_tpg->tpg_auth_group;
1034 se_tpg->tpg_group.default_groups[5] = NULL; 1047 se_tpg->tpg_group.default_groups[5] = &se_tpg->tpg_param_group;
1048 se_tpg->tpg_group.default_groups[6] = NULL;
1035 1049
1036 config_group_init_type_name(&se_tpg->tpg_group, name, 1050 config_group_init_type_name(&se_tpg->tpg_group, name,
1037 &TF_CIT_TMPL(tf)->tfc_tpg_base_cit); 1051 &TF_CIT_TMPL(tf)->tfc_tpg_base_cit);
@@ -1043,6 +1057,8 @@ static struct config_group *target_fabric_make_tpg(
1043 &TF_CIT_TMPL(tf)->tfc_tpg_nacl_cit); 1057 &TF_CIT_TMPL(tf)->tfc_tpg_nacl_cit);
1044 config_group_init_type_name(&se_tpg->tpg_attrib_group, "attrib", 1058 config_group_init_type_name(&se_tpg->tpg_attrib_group, "attrib",
1045 &TF_CIT_TMPL(tf)->tfc_tpg_attrib_cit); 1059 &TF_CIT_TMPL(tf)->tfc_tpg_attrib_cit);
1060 config_group_init_type_name(&se_tpg->tpg_auth_group, "auth",
1061 &TF_CIT_TMPL(tf)->tfc_tpg_auth_cit);
1046 config_group_init_type_name(&se_tpg->tpg_param_group, "param", 1062 config_group_init_type_name(&se_tpg->tpg_param_group, "param",
1047 &TF_CIT_TMPL(tf)->tfc_tpg_param_cit); 1063 &TF_CIT_TMPL(tf)->tfc_tpg_param_cit);
1048 1064
@@ -1202,6 +1218,7 @@ int target_fabric_setup_cits(struct target_fabric_configfs *tf)
1202 target_fabric_setup_tpg_np_cit(tf); 1218 target_fabric_setup_tpg_np_cit(tf);
1203 target_fabric_setup_tpg_np_base_cit(tf); 1219 target_fabric_setup_tpg_np_base_cit(tf);
1204 target_fabric_setup_tpg_attrib_cit(tf); 1220 target_fabric_setup_tpg_attrib_cit(tf);
1221 target_fabric_setup_tpg_auth_cit(tf);
1205 target_fabric_setup_tpg_param_cit(tf); 1222 target_fabric_setup_tpg_param_cit(tf);
1206 target_fabric_setup_tpg_nacl_cit(tf); 1223 target_fabric_setup_tpg_nacl_cit(tf);
1207 target_fabric_setup_tpg_nacl_base_cit(tf); 1224 target_fabric_setup_tpg_nacl_base_cit(tf);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 9fd7a60f47f0..d92ec6765f5d 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -795,11 +795,12 @@ struct se_portal_group {
795 struct target_core_fabric_ops *se_tpg_tfo; 795 struct target_core_fabric_ops *se_tpg_tfo;
796 struct se_wwn *se_tpg_wwn; 796 struct se_wwn *se_tpg_wwn;
797 struct config_group tpg_group; 797 struct config_group tpg_group;
798 struct config_group *tpg_default_groups[6]; 798 struct config_group *tpg_default_groups[7];
799 struct config_group tpg_lun_group; 799 struct config_group tpg_lun_group;
800 struct config_group tpg_np_group; 800 struct config_group tpg_np_group;
801 struct config_group tpg_acl_group; 801 struct config_group tpg_acl_group;
802 struct config_group tpg_attrib_group; 802 struct config_group tpg_attrib_group;
803 struct config_group tpg_auth_group;
803 struct config_group tpg_param_group; 804 struct config_group tpg_param_group;
804}; 805};
805 806
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h
index 612509592ffd..713c5004f4ae 100644
--- a/include/target/target_core_configfs.h
+++ b/include/target/target_core_configfs.h
@@ -23,6 +23,7 @@ struct target_fabric_configfs_template {
23 struct config_item_type tfc_tpg_np_cit; 23 struct config_item_type tfc_tpg_np_cit;
24 struct config_item_type tfc_tpg_np_base_cit; 24 struct config_item_type tfc_tpg_np_base_cit;
25 struct config_item_type tfc_tpg_attrib_cit; 25 struct config_item_type tfc_tpg_attrib_cit;
26 struct config_item_type tfc_tpg_auth_cit;
26 struct config_item_type tfc_tpg_param_cit; 27 struct config_item_type tfc_tpg_param_cit;
27 struct config_item_type tfc_tpg_nacl_cit; 28 struct config_item_type tfc_tpg_nacl_cit;
28 struct config_item_type tfc_tpg_nacl_base_cit; 29 struct config_item_type tfc_tpg_nacl_base_cit;
diff --git a/include/target/target_core_fabric_configfs.h b/include/target/target_core_fabric_configfs.h
index a26fb7586a09..b32a14905cfa 100644
--- a/include/target/target_core_fabric_configfs.h
+++ b/include/target/target_core_fabric_configfs.h
@@ -62,6 +62,17 @@ static struct target_fabric_tpg_attrib_attribute _fabric##_tpg_attrib_##_name =
62 _fabric##_tpg_attrib_show_##_name, \ 62 _fabric##_tpg_attrib_show_##_name, \
63 _fabric##_tpg_attrib_store_##_name); 63 _fabric##_tpg_attrib_store_##_name);
64 64
65CONFIGFS_EATTR_STRUCT(target_fabric_tpg_auth, se_portal_group);
66#define TF_TPG_AUTH_ATTR(_fabric, _name, _mode) \
67static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
68 __CONFIGFS_EATTR(_name, _mode, \
69 _fabric##_tpg_auth_show_##_name, \
70 _fabric##_tpg_auth_store_##_name);
71
72#define TF_TPG_AUTH_ATTR_RO(_fabric, _name) \
73static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
74 __CONFIGFS_EATTR_RO(_name, \
75 _fabric##_tpg_auth_show_##_name);
65 76
66CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group); 77CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group);
67#define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \ 78#define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \