3 #include <linux/transport_class.h>
6 struct transport_container raid_attrs;
9 struct raid_function_template {
11 int (*is_raid)(struct device *);
12 void (*get_resync)(struct device *);
13 void (*get_state)(struct device *);
24 struct list_head component_list;
27 enum raid_state state;
31 #define DEFINE_RAID_ATTRIBUTE(type, attr) \
33 raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
34 struct class_device *cdev = \
35 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
36 struct raid_data *rd; \
38 rd = class_get_devdata(cdev); \
42 raid_get_##attr(struct raid_template *r, struct device *dev) { \
43 struct class_device *cdev = \
44 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
45 struct raid_data *rd; \
47 rd = class_get_devdata(cdev); \
51 DEFINE_RAID_ATTRIBUTE(int, level)
52 DEFINE_RAID_ATTRIBUTE(int, resync)
53 DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
55 struct raid_template *raid_class_attach(struct raid_function_template *);
56 void raid_class_release(struct raid_template *);
58 void raid_component_add(struct raid_template *, struct device *,