Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / transport_class.h
index 57e6020..1d6cc22 100644 (file)
 #include <linux/device.h>
 #include <linux/attribute_container.h>
 
+struct transport_container;
+
 struct transport_class {
        struct class class;
-       int (*setup)(struct device *);
-       int (*configure)(struct device *);
-       int (*remove)(struct device *);
+       int (*setup)(struct transport_container *, struct device *,
+                    struct class_device *);
+       int (*configure)(struct transport_container *, struct device *,
+                        struct class_device *);
+       int (*remove)(struct transport_container *, struct device *,
+                     struct class_device *);
 };
 
 #define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg)                  \
@@ -48,6 +53,14 @@ struct anon_transport_class cls = {                          \
 #define class_to_transport_class(x) \
        container_of(x, struct transport_class, class)
 
+struct transport_container {
+       struct attribute_container ac;
+       struct attribute_group *statistics;
+};
+
+#define attribute_container_to_transport_container(x) \
+       container_of(x, struct transport_container, ac)
+
 void transport_remove_device(struct device *);
 void transport_add_device(struct device *);
 void transport_setup_device(struct device *);
@@ -68,6 +81,16 @@ transport_unregister_device(struct device *dev)
        transport_destroy_device(dev);
 }
 
+static inline int transport_container_register(struct transport_container *tc)
+{
+       return attribute_container_register(&tc->ac);
+}
+
+static inline int transport_container_unregister(struct transport_container *tc)
+{
+       return attribute_container_unregister(&tc->ac);
+}
+
 int transport_class_register(struct transport_class *);
 int anon_transport_class_register(struct anon_transport_class *);
 void transport_class_unregister(struct transport_class *);