summaryrefslogtreecommitdiffstats
path: root/include/driver.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:43 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:43 +0200
commit2897414d147ea376fc852645d3b60b421544daf1 (patch)
tree6268d876c722af668d1b1cbcefdb5d8e96441a29 /include/driver.h
parent5b71cb53f927a80ddb79f152f79f2c340028ac7c (diff)
downloadbarebox-2897414d147ea376fc852645d3b60b421544daf1.tar.gz
barebox-2897414d147ea376fc852645d3b60b421544daf1.tar.xz
svn_rev_319
add some comments
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/driver.h b/include/driver.h
index b5fb495bcc..30c6e8e7fd 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -10,13 +10,16 @@
#define DEVICE_TYPE_ETHER 1
#define DEVICE_TYPE_STDIO 2
#define DEVICE_TYPE_DRAM 3
-#define DEVICE_TYPE_FS 4
-#define MAX_DEVICE_TYPE 4
+#define DEVICE_TYPE_BLOCK 4
+#define DEVICE_TYPE_FS 5
+#define MAX_DEVICE_TYPE 5
#include <param.h>
struct device_d {
- char name[MAX_DRIVER_NAME];
+ char name[MAX_DRIVER_NAME]; /* The name of this device. Used to match
+ * to the corresponding driver.
+ */
char id[MAX_DRIVER_NAME];
unsigned long size;
@@ -32,8 +35,7 @@ struct device_d {
* points to the type specific device, i.e. eth_device
*/
- /* The driver for this device */
- struct driver_d *driver;
+ struct driver_d *driver; /* The driver for this device */
struct device_d *next;
@@ -43,8 +45,9 @@ struct device_d {
};
struct driver_d {
- char name[MAX_DRIVER_NAME];
-
+ char name[MAX_DRIVER_NAME]; /* The name of this driver. Used to match to
+ * the corresponding device.
+ */
struct driver_d *next;
int (*probe) (struct device_d *);
@@ -56,9 +59,6 @@ struct driver_d {
void (*info) (struct device_d *);
void (*shortinfo) (struct device_d *);
- int (*get) (struct device_d*, struct param_d *);
- int (*set) (struct device_d*, struct param_d *, value_t val);
-
unsigned long type;
void *type_data; /* In case this driver is of a specific type, i.e. a filesystem
* driver, this pointer points to the corresponding data struct
@@ -77,6 +77,7 @@ struct device_d *get_device_by_name(char *name);
struct device_d *get_device_by_type(ulong type, struct device_d *last);
struct device_d *get_device_by_id(const char *id);
struct device_d *get_first_device(void);
+int get_free_deviceid(char *id, char *id_template);
struct driver_d *get_driver_by_name(char *name);