3 * Copyright (c) 2007 Kevin Wolf
5 * This program is free software. It comes without any warranty, to
6 * the extent permitted by applicable law. You can redistribute it
7 * and/or modify it under the terms of the Do What The Fuck You Want
8 * To Public License, Version 2, as published by Sam Hocevar. See
9 * http://sam.zoy.org/projects/COPYING.WTFPL for more details.
12 #ifndef CDI_H_INCLUDED
13 #define CDI_H_INCLUDED
15 #include <cdi/lists.h>
17 #define CDI_STANDALONE
30 cdi_device_type_t type
;
32 struct cdi_driver
*driver
;
37 cdi_device_type_t type
;
41 void (*init_device
)(struct cdi_device
*device
);
42 void (*remove_device
)(struct cdi_device
*device
);
44 void (*destroy
)(struct cdi_driver
*driver
);
48 * Has to be called before any other calls to CDI functions. Initialized the CDI
51 * Subsequent calls don't have any effect on the progam.
56 * Executes all registered drivers. This function does not necessarily return to
59 void cdi_run_drivers(void);
62 * Initializes the data structures for a driver.
64 void cdi_driver_init(struct cdi_driver
* driver
);
67 * Destroys the data structures for a driver.
69 void cdi_driver_destroy(struct cdi_driver
* driver
);
72 * Registers the driver for a new device.
74 * \param driver Driver to be registered
76 void cdi_driver_register(struct cdi_driver
* driver
);