mpls: make RTA_OIF optional
[linux/fpc-iii.git] / drivers / mmc / card / queue.h
blob36cddab57d776322c3912241f274e06620a77251
1 #ifndef MMC_QUEUE_H
2 #define MMC_QUEUE_H
4 #define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH)
6 struct request;
7 struct task_struct;
9 struct mmc_blk_request {
10 struct mmc_request mrq;
11 struct mmc_command sbc;
12 struct mmc_command cmd;
13 struct mmc_command stop;
14 struct mmc_data data;
15 int retune_retry_done;
18 enum mmc_packed_type {
19 MMC_PACKED_NONE = 0,
20 MMC_PACKED_WRITE,
23 #define mmc_packed_cmd(type) ((type) != MMC_PACKED_NONE)
24 #define mmc_packed_wr(type) ((type) == MMC_PACKED_WRITE)
26 struct mmc_packed {
27 struct list_head list;
28 u32 cmd_hdr[1024];
29 unsigned int blocks;
30 u8 nr_entries;
31 u8 retries;
32 s16 idx_failure;
35 struct mmc_queue_req {
36 struct request *req;
37 struct mmc_blk_request brq;
38 struct scatterlist *sg;
39 char *bounce_buf;
40 struct scatterlist *bounce_sg;
41 unsigned int bounce_sg_len;
42 struct mmc_async_req mmc_active;
43 enum mmc_packed_type cmd_type;
44 struct mmc_packed *packed;
47 struct mmc_queue {
48 struct mmc_card *card;
49 struct task_struct *thread;
50 struct semaphore thread_sem;
51 unsigned int flags;
52 #define MMC_QUEUE_SUSPENDED (1 << 0)
53 #define MMC_QUEUE_NEW_REQUEST (1 << 1)
55 int (*issue_fn)(struct mmc_queue *, struct request *);
56 void *data;
57 struct request_queue *queue;
58 struct mmc_queue_req mqrq[2];
59 struct mmc_queue_req *mqrq_cur;
60 struct mmc_queue_req *mqrq_prev;
63 extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
64 const char *);
65 extern void mmc_cleanup_queue(struct mmc_queue *);
66 extern void mmc_queue_suspend(struct mmc_queue *);
67 extern void mmc_queue_resume(struct mmc_queue *);
69 extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
70 struct mmc_queue_req *);
71 extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
72 extern void mmc_queue_bounce_post(struct mmc_queue_req *);
74 extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
75 extern void mmc_packed_clean(struct mmc_queue *);
77 extern int mmc_access_rpmb(struct mmc_queue *);
79 #endif