blob: 1a637d2e2ca693d298570c875e52c248bd0028d9 [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 Forlin04296b72011-07-01 18:55:31 +020032 struct mmc_queue_req mqrq[2];
Per Forlin97868a22011-07-09 17:12:36 -040033 struct mmc_queue_req *mqrq_cur;
Per Forlin04296b72011-07-01 18:55:31 +020034 struct mmc_queue_req *mqrq_prev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070035};
36
Adrian Hunterd09408a2011-06-23 13:40:28 +030037extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
38 const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039extern void mmc_cleanup_queue(struct mmc_queue *);
40extern void mmc_queue_suspend(struct mmc_queue *);
41extern void mmc_queue_resume(struct mmc_queue *);
42
Per Forlin97868a22011-07-09 17:12:36 -040043extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
44 struct mmc_queue_req *);
45extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
46extern void mmc_queue_bounce_post(struct mmc_queue_req *);
Pierre Ossman98ccf142007-05-12 00:26:16 +020047
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif