2 * transport_class.h - a generic container for all transport classes
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
6 * This file is licensed under GPLv2
9 #ifndef _TRANSPORT_CLASS_H_
10 #define _TRANSPORT_CLASS_H_
12 #include <linux/device.h>
13 #include <linux/attribute_container.h>
15 struct transport_class {
17 int (*setup)(struct device *);
18 int (*configure)(struct device *);
19 int (*remove)(struct device *);
22 #define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
23 struct transport_class cls = { \
33 struct anon_transport_class {
34 struct transport_class tclass;
35 struct attribute_container container;
38 #define DECLARE_ANON_TRANSPORT_CLASS(cls, mtch, cfg) \
39 struct anon_transport_class cls = { \
48 #define class_to_transport_class(x) \
49 container_of(x, struct transport_class, class)
51 void transport_remove_device(struct device *);
52 void transport_add_device(struct device *);
53 void transport_setup_device(struct device *);
54 void transport_configure_device(struct device *);
55 void transport_destroy_device(struct device *);
58 transport_register_device(struct device *dev)
60 transport_setup_device(dev);
61 transport_add_device(dev);
65 transport_unregister_device(struct device *dev)
67 transport_remove_device(dev);
68 transport_destroy_device(dev);
71 int transport_class_register(struct transport_class *);
72 int anon_transport_class_register(struct anon_transport_class *);
73 void transport_class_unregister(struct transport_class *);
74 void anon_transport_class_unregister(struct anon_transport_class *);