blob: c1a69ac6fff054da3c52791e1b5348d822a94558 [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;
22};
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024struct mmc_queue {
25 struct mmc_card *card;
Christoph Hellwig87598a22006-11-13 20:23:52 +010026 struct task_struct *thread;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 struct semaphore thread_sem;
28 unsigned int flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 int (*issue_fn)(struct mmc_queue *, struct request *);
30 void *data;
31 struct request_queue *queue;
Per Forlin97868a22011-07-09 17:12:36 -040032 struct mmc_queue_req mqrq[1];
33 struct mmc_queue_req *mqrq_cur;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034};
35
Adrian Hunterd09408a2011-06-23 13:40:28 +030036extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
37 const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070038extern void mmc_cleanup_queue(struct mmc_queue *);
39extern void mmc_queue_suspend(struct mmc_queue *);
40extern void mmc_queue_resume(struct mmc_queue *);
41
Per Forlin97868a22011-07-09 17:12:36 -040042extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
43 struct mmc_queue_req *);
44extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
45extern void mmc_queue_bounce_post(struct mmc_queue_req *);
Pierre Ossman98ccf142007-05-12 00:26:16 +020046
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#endif