summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-02-17 10:25:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-17 10:25:24 +0100
commit06f66dc0546b36c22282a2f55b790ffa426a9f35 (patch)
tree14d845bfbe2d38fdebe814fdca678f74ce253bb5 /include
parent4e0f084ea15d8797e77b54251eedbdd20c5ebd70 (diff)
parente3a9e1fd6267d1e144144d91bd679a083ae6b04b (diff)
downloadbarebox-06f66dc0546b36c22282a2f55b790ffa426a9f35.tar.gz
barebox-06f66dc0546b36c22282a2f55b790ffa426a9f35.tar.xz
Merge branch 'pu/block' into next
Diffstat (limited to 'include')
-rw-r--r--include/block.h16
-rw-r--r--include/linux/list.h11
2 files changed, 20 insertions, 7 deletions
diff --git a/include/block.h b/include/block.h
index aaab4e3b36..cfa4cb9ef1 100644
--- a/include/block.h
+++ b/include/block.h
@@ -8,21 +8,23 @@ struct block_device;
struct block_device_ops {
int (*read)(struct block_device *, void *buf, int block, int num_blocks);
int (*write)(struct block_device *, const void *buf, int block, int num_blocks);
+ int (*read_start)(struct block_device *, void *buf, int block, int num_blocks);
+ int (*read_done)(struct block_device *);
};
+struct chunk;
+
struct block_device {
struct device_d *dev;
struct block_device_ops *ops;
int blockbits;
int num_blocks;
- void *rdbuf; /* read buffer */
int rdbufsize;
- int rdblock; /* start block in read buffer */
- int rdblockend; /* end block in read buffer */
- void *wrbuf; /* write buffer */
- int wrblock; /* start block in write buffer */
- int wrbufblocks; /* number of blocks currently in write buffer */
- int wrbufsize; /* size of write buffer in blocks */
+ int blkmask;
+
+ struct list_head buffered_blocks;
+ struct list_head idle_blocks;
+
struct cdev cdev;
};
diff --git a/include/linux/list.h b/include/linux/list.h
index 1a4cbc49a2..15ed499cae 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -272,6 +272,17 @@ static inline void list_splice_init(struct list_head *list,
list_entry((ptr)->next, type, member)
/**
+ * list_last_entry - get the last element from a list
+ * @head: the list head to take the element from.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_last_entry(head, type, member) \
+ list_entry((head)->prev, type, member)
+
+/**
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.