Loading...
Note: File does not exist in v4.6.
1#ifndef MMC_QUEUE_H
2#define MMC_QUEUE_H
3
4static inline bool mmc_req_is_special(struct request *req)
5{
6 return req &&
7 (req_op(req) == REQ_OP_FLUSH ||
8 req_op(req) == REQ_OP_DISCARD ||
9 req_op(req) == REQ_OP_SECURE_ERASE);
10}
11
12struct request;
13struct task_struct;
14struct mmc_blk_data;
15
16struct mmc_blk_request {
17 struct mmc_request mrq;
18 struct mmc_command sbc;
19 struct mmc_command cmd;
20 struct mmc_command stop;
21 struct mmc_data data;
22 int retune_retry_done;
23};
24
25struct mmc_queue_req {
26 struct request *req;
27 struct mmc_blk_request brq;
28 struct scatterlist *sg;
29 char *bounce_buf;
30 struct scatterlist *bounce_sg;
31 unsigned int bounce_sg_len;
32 struct mmc_async_req mmc_active;
33};
34
35struct mmc_queue {
36 struct mmc_card *card;
37 struct task_struct *thread;
38 struct semaphore thread_sem;
39 unsigned int flags;
40#define MMC_QUEUE_SUSPENDED (1 << 0)
41#define MMC_QUEUE_NEW_REQUEST (1 << 1)
42 bool asleep;
43 struct mmc_blk_data *blkdata;
44 struct request_queue *queue;
45 struct mmc_queue_req *mqrq;
46 struct mmc_queue_req *mqrq_cur;
47 struct mmc_queue_req *mqrq_prev;
48 int qdepth;
49};
50
51extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
52 const char *);
53extern void mmc_cleanup_queue(struct mmc_queue *);
54extern void mmc_queue_suspend(struct mmc_queue *);
55extern void mmc_queue_resume(struct mmc_queue *);
56
57extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
58 struct mmc_queue_req *);
59extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
60extern void mmc_queue_bounce_post(struct mmc_queue_req *);
61
62extern int mmc_access_rpmb(struct mmc_queue *);
63
64#endif