aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/queue.h
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2016-12-08 05:23:49 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2016-12-12 10:30:05 -0500
commitf397c8d80a5e413984bd9ccdf4161c7156b365ce (patch)
tree9767f0418fe8ef53d6571fefc8b7b53558b7fce0 /drivers/mmc/core/queue.h
parentff6af28faff53a7389230026b83e543385f7b21d (diff)
mmc: block: Move files to core
Once upon a time it made sense to keep the mmc block device driver and its related code, in its own directory called card. Over time, more an more functions/structures have become shared through generic mmc header files, between the core and the card directory. In other words, the relationship between them has become closer. By sharing functions/structures via generic header files, it becomes easy for outside users to abuse them. In a way to avoid that from happen, let's move the files from card directory into the core directory, as it enables us to move definitions of functions/structures into mmc core specific header files. Note, this is only the first step in providing a cleaner mmc interface for outside users. Following changes will do the actual cleanup, as that is not part of this change. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/mmc/core/queue.h')
-rw-r--r--drivers/mmc/core/queue.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h
new file mode 100644
index 000000000000..dac8c3d010dd
--- /dev/null
+++ b/drivers/mmc/core/queue.h
@@ -0,0 +1,64 @@
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