summaryrefslogtreecommitdiffstats
path: root/include/driver.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:24 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:24 +0200
commit55ebf67d3ec2b0727f86a54157a2740e9e8472c3 (patch)
tree01fde5994de0c51b4701750464c73f750c6b754e /include/driver.h
parent4eae36cc43b290ed74929d925987d8f2fe8a888e (diff)
downloadbarebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.gz
barebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.xz
svn_rev_120
implement initcalls
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 23e84a04c3..848f844ec2 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -8,6 +8,11 @@
struct memarea_info;
+#define DEVICE_TYPE_UNKNOWN 0
+#define DEVICE_TYPE_ETHER 1
+#define DEVICE_TYPE_STDIO 2
+#define MAX_DEVICE_TYPE 2
+
struct device_d {
char name[MAX_DRIVER_NAME];
char id[MAX_DRIVER_NAME];
@@ -26,6 +31,8 @@ struct device_d {
struct driver_d *driver;
struct device_d *next;
+
+ unsigned long type;
};
struct driver_d {
@@ -40,6 +47,9 @@ struct driver_d {
void (*info) (struct device_d *);
void (*shortinfo) (struct device_d *);
+
+ unsigned long type;
+ void *type_data;
};
#define RW_SIZE(x) (x)
@@ -59,5 +69,8 @@ ssize_t erase(struct device_d *dev, size_t count, unsigned long offset);
ssize_t mem_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
ssize_t mem_write(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
+int register_device_type_handler(int(*handle)(struct device_d *), ulong device_type);
+//void unregister_device_type_handler(struct device_d *);
+
#endif /* DRIVER_H */