aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-11-27 22:49:36 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-02 00:36:02 -0500
commite6c39f703a878b8d9427ca7b4dc8f97874d12ae6 (patch)
tree8c85860745e9328f85f23e16f3fdce9cd18853f1 /include/target
parentd30cd1238c2f89662c82d5d2c4686971a6dc3693 (diff)
target: Add DEF_TB_DEFAULT_ATTRIBS macro for virtual device attrs
This helper macro adds the default set of 30 device attributes for virtual devices from existing target_core_configfs.c code, and moves the definitions into a single macro to create the structs necessary for backend drivers. It allows them to populate their own external struct configfs_attribute for se_subsystem_api->tb_cits.tb_dev_attrib_cit.ct_attrs. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_backend_configfs.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/target/target_core_backend_configfs.h b/include/target/target_core_backend_configfs.h
index f91935b5ef24..3247d7530107 100644
--- a/include/target/target_core_backend_configfs.h
+++ b/include/target/target_core_backend_configfs.h
@@ -50,4 +50,71 @@ static struct target_backend_dev_attrib_attribute _backend##_dev_attrib_##_name
50 __CONFIGFS_EATTR_RO(_name, \ 50 __CONFIGFS_EATTR_RO(_name, \
51 _backend##_dev_show_attr_##_name); 51 _backend##_dev_show_attr_##_name);
52 52
53/*
54 * Default list of target backend device attributes as defined by
55 * struct se_dev_attrib
56 */
57
58#define DEF_TB_DEFAULT_ATTRIBS(_backend) \
59 DEF_TB_DEV_ATTRIB(_backend, emulate_model_alias); \
60 TB_DEV_ATTR(_backend, emulate_model_alias, S_IRUGO | S_IWUSR); \
61 DEF_TB_DEV_ATTRIB(_backend, emulate_dpo); \
62 TB_DEV_ATTR(_backend, emulate_dpo, S_IRUGO | S_IWUSR); \
63 DEF_TB_DEV_ATTRIB(_backend, emulate_fua_write); \
64 TB_DEV_ATTR(_backend, emulate_fua_write, S_IRUGO | S_IWUSR); \
65 DEF_TB_DEV_ATTRIB(_backend, emulate_fua_read); \
66 TB_DEV_ATTR(_backend, emulate_fua_read, S_IRUGO | S_IWUSR); \
67 DEF_TB_DEV_ATTRIB(_backend, emulate_write_cache); \
68 TB_DEV_ATTR(_backend, emulate_write_cache, S_IRUGO | S_IWUSR); \
69 DEF_TB_DEV_ATTRIB(_backend, emulate_ua_intlck_ctrl); \
70 TB_DEV_ATTR(_backend, emulate_ua_intlck_ctrl, S_IRUGO | S_IWUSR); \
71 DEF_TB_DEV_ATTRIB(_backend, emulate_tas); \
72 TB_DEV_ATTR(_backend, emulate_tas, S_IRUGO | S_IWUSR); \
73 DEF_TB_DEV_ATTRIB(_backend, emulate_tpu); \
74 TB_DEV_ATTR(_backend, emulate_tpu, S_IRUGO | S_IWUSR); \
75 DEF_TB_DEV_ATTRIB(_backend, emulate_tpws); \
76 TB_DEV_ATTR(_backend, emulate_tpws, S_IRUGO | S_IWUSR); \
77 DEF_TB_DEV_ATTRIB(_backend, emulate_caw); \
78 TB_DEV_ATTR(_backend, emulate_caw, S_IRUGO | S_IWUSR); \
79 DEF_TB_DEV_ATTRIB(_backend, emulate_3pc); \
80 TB_DEV_ATTR(_backend, emulate_3pc, S_IRUGO | S_IWUSR); \
81 DEF_TB_DEV_ATTRIB(_backend, pi_prot_type); \
82 TB_DEV_ATTR(_backend, pi_prot_type, S_IRUGO | S_IWUSR); \
83 DEF_TB_DEV_ATTRIB_RO(_backend, hw_pi_prot_type); \
84 TB_DEV_ATTR_RO(_backend, hw_pi_prot_type); \
85 DEF_TB_DEV_ATTRIB(_backend, pi_prot_format); \
86 TB_DEV_ATTR(_backend, pi_prot_format, S_IRUGO | S_IWUSR); \
87 DEF_TB_DEV_ATTRIB(_backend, enforce_pr_isids); \
88 TB_DEV_ATTR(_backend, enforce_pr_isids, S_IRUGO | S_IWUSR); \
89 DEF_TB_DEV_ATTRIB(_backend, is_nonrot); \
90 TB_DEV_ATTR(_backend, is_nonrot, S_IRUGO | S_IWUSR); \
91 DEF_TB_DEV_ATTRIB(_backend, emulate_rest_reord); \
92 TB_DEV_ATTR(_backend, emulate_rest_reord, S_IRUGO | S_IWUSR); \
93 DEF_TB_DEV_ATTRIB(_backend, force_pr_aptpl); \
94 TB_DEV_ATTR(_backend, force_pr_aptpl, S_IRUGO | S_IWUSR); \
95 DEF_TB_DEV_ATTRIB_RO(_backend, hw_block_size); \
96 TB_DEV_ATTR_RO(_backend, hw_block_size); \
97 DEF_TB_DEV_ATTRIB(_backend, block_size); \
98 TB_DEV_ATTR(_backend, block_size, S_IRUGO | S_IWUSR); \
99 DEF_TB_DEV_ATTRIB_RO(_backend, hw_max_sectors); \
100 TB_DEV_ATTR_RO(_backend, hw_max_sectors); \
101 DEF_TB_DEV_ATTRIB(_backend, fabric_max_sectors); \
102 TB_DEV_ATTR(_backend, fabric_max_sectors, S_IRUGO | S_IWUSR); \
103 DEF_TB_DEV_ATTRIB(_backend, optimal_sectors); \
104 TB_DEV_ATTR(_backend, optimal_sectors, S_IRUGO | S_IWUSR); \
105 DEF_TB_DEV_ATTRIB_RO(_backend, hw_queue_depth); \
106 TB_DEV_ATTR_RO(_backend, hw_queue_depth); \
107 DEF_TB_DEV_ATTRIB(_backend, queue_depth); \
108 TB_DEV_ATTR(_backend, queue_depth, S_IRUGO | S_IWUSR); \
109 DEF_TB_DEV_ATTRIB(_backend, max_unmap_lba_count); \
110 TB_DEV_ATTR(_backend, max_unmap_lba_count, S_IRUGO | S_IWUSR); \
111 DEF_TB_DEV_ATTRIB(_backend, max_unmap_block_desc_count); \
112 TB_DEV_ATTR(_backend, max_unmap_block_desc_count, S_IRUGO | S_IWUSR); \
113 DEF_TB_DEV_ATTRIB(_backend, unmap_granularity); \
114 TB_DEV_ATTR(_backend, unmap_granularity, S_IRUGO | S_IWUSR); \
115 DEF_TB_DEV_ATTRIB(_backend, unmap_granularity_alignment); \
116 TB_DEV_ATTR(_backend, unmap_granularity_alignment, S_IRUGO | S_IWUSR); \
117 DEF_TB_DEV_ATTRIB(_backend, max_write_same_len); \
118 TB_DEV_ATTR(_backend, max_write_same_len, S_IRUGO | S_IWUSR);
119
53#endif /* TARGET_CORE_BACKEND_CONFIGFS_H */ 120#endif /* TARGET_CORE_BACKEND_CONFIGFS_H */