blob: d2a1eb4b9f9fade36848726f4e36fc4db1463cca [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef MMC_QUEUE_H
2#define MMC_QUEUE_H
3
4struct request;
5struct task_struct;
6
Per Forlin97868a22011-07-09 17:12:36 -04007struct mmc_blk_request {
8 struct mmc_request mrq;
9 struct mmc_command sbc;
10 struct mmc_command cmd;
11 struct mmc_command stop;
12 struct mmc_data data;
13};
14
15struct mmc_queue_req {
16 struct request *req;
17 struct mmc_blk_request brq;
18 struct scatterlist *sg;
19 char *bounce_buf;
20 struct scatterlist *bounce_sg;
21 unsigned int bounce_sg_len;
Per Forlinee8a43a2011-07-01 18:55:33 +020022 struct mmc_async_req mmc_active;
Per Forlin97868a22011-07-09 17:12:36 -040023};
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025struct mmc_queue {
26 struct mmc_card *card;
Christoph Hellwig87598a22006-11-13 20:23:52 +010027 struct task_struct *thread;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 struct semaphore thread_sem;
29 unsigned int flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 int (*issue_fn)(struct mmc_queue *, struct request *);
31 void *data;
32 struct request_queue *queue;
Per Forlin04296b72011-07-01 18:55:31 +020033 struct mmc_queue_req mqrq[2];
Per Forlin97868a22011-07-09 17:12:36 -040034 struct mmc_queue_req *mqrq_cur;
Per Forlin04296b72011-07-01 18:55:31 +020035 struct mmc_queue_req *mqrq_prev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036};
37
Adrian Hunterd09408a2011-06-23 13:40:28 +030038extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
39 const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040extern void mmc_cleanup_queue(struct mmc_queue *);
41extern void mmc_queue_suspend(struct mmc_queue *);
42extern void mmc_queue_resume(struct mmc_queue *);
43
Per Forlin97868a22011-07-09 17:12:36 -040044extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
45 struct mmc_queue_req *);
46extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
47extern void mmc_queue_bounce_post(struct mmc_queue_req *);
Pierre Ossman98ccf142007-05-12 00:26:16 +020048
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif