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
commit658cc34395e3780dc46d6ffdc61c95130d362661 (patch)
tree2a56eb0438b75e2ddc44970ff8be4d7af97e65fa /include/driver.h
parent873c1d746ea291cdf0b73dbcc1f7f289984472f2 (diff)
downloadbarebox-658cc34395e3780dc46d6ffdc61c95130d362661.tar.gz
barebox-658cc34395e3780dc46d6ffdc61c95130d362661.tar.xz
svn_rev_118
thousands of things
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/include/driver.h b/include/driver.h
index 428a3b961a..23e84a04c3 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -10,6 +10,7 @@ struct memarea_info;
struct device_d {
char name[MAX_DRIVER_NAME];
+ char id[MAX_DRIVER_NAME];
unsigned long size;
@@ -17,36 +18,46 @@ struct device_d {
* SDRAM.
*/
unsigned long map_base;
- unsigned long map_flags;
void *platform_data;
+ void *priv;
/* The driver for this device */
struct driver_d *driver;
struct device_d *next;
-
- struct partition *part;
};
struct driver_d {
char name[MAX_DRIVER_NAME];
- void *priv;
-
struct driver_d *next;
int (*probe) (struct device_d *);
- ssize_t (*read) (struct device_d*, void* buf, size_t count, unsigned long offset);
- ssize_t (*write) (struct device_d*, void* buf, size_t count, unsigned long offset);
- ssize_t (*erase) (struct device_d*, struct memarea_info *);
+ ssize_t (*read) (struct device_d*, void* buf, size_t count, ulong offset, ulong flags);
+ ssize_t (*write) (struct device_d*, void* buf, size_t count, ulong offset, ulong flags);
+ ssize_t (*erase) (struct device_d*, size_t count, unsigned long offset);
+
+ void (*info) (struct device_d *);
+ void (*shortinfo) (struct device_d *);
};
+#define RW_SIZE(x) (x)
+#define RW_SIZE_MASK 0x7
+
int register_driver(struct driver_d *);
int register_device(struct device_d *);
void unregister_device(struct device_d *);
struct device_d *device_from_spec_str(const char *str, char **endp);
struct device_d *get_device_by_name(char *name);
+
+ssize_t read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
+ssize_t write(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
+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);
+
#endif /* DRIVER_H */