summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/queue.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 10:55:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 10:55:56 -0800
commitb9f98bd4034a3196ff068eb0fa376c5f41077480 (patch)
tree827e9ffd3c1fad20f97267c860f81789c2d48c37 /drivers/mmc/core/queue.h
parenta829a8445f09036404060f4d6489cb13433f4304 (diff)
parentf397c8d80a5e413984bd9ccdf4161c7156b365ce (diff)
downloadblackbird-op-linux-b9f98bd4034a3196ff068eb0fa376c5f41077480.tar.gz
blackbird-op-linux-b9f98bd4034a3196ff068eb0fa376c5f41077480.zip
Merge tag 'mmc-v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull another MMC update from Ulf Hansson: "Here's a second pull request for MMC for v4.10. As a matter of fact it's only one change that moves some mmc files around. I thought it was a good idea to get this into v4.10, as it gives us a nice and fresh base for v4.11. Summary: MMC core: - Move files from the card directory to the core directory to enable future clean-ups of the generic mmc header files and interfaces" * tag 'mmc-v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: block: Move files to core
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 @@
+#ifndef MMC_QUEUE_H
+#define MMC_QUEUE_H
+
+static inline bool mmc_req_is_special(struct request *req)
+{
+ return req &&
+ (req_op(req) == REQ_OP_FLUSH ||
+ req_op(req) == REQ_OP_DISCARD ||
+ req_op(req) == REQ_OP_SECURE_ERASE);
+}
+
+struct request;
+struct task_struct;
+struct mmc_blk_data;
+
+struct mmc_blk_request {
+ struct mmc_request mrq;
+ struct mmc_command sbc;
+ struct mmc_command cmd;
+ struct mmc_command stop;
+ struct mmc_data data;
+ int retune_retry_done;
+};
+
+struct mmc_queue_req {
+ struct request *req;
+ struct mmc_blk_request brq;
+ struct scatterlist *sg;
+ char *bounce_buf;
+ struct scatterlist *bounce_sg;
+ unsigned int bounce_sg_len;
+ struct mmc_async_req mmc_active;
+};
+
+struct mmc_queue {
+ struct mmc_card *card;
+ struct task_struct *thread;
+ struct semaphore thread_sem;
+ unsigned int flags;
+#define MMC_QUEUE_SUSPENDED (1 << 0)
+#define MMC_QUEUE_NEW_REQUEST (1 << 1)
+ bool asleep;
+ struct mmc_blk_data *blkdata;
+ struct request_queue *queue;
+ struct mmc_queue_req *mqrq;
+ struct mmc_queue_req *mqrq_cur;
+ struct mmc_queue_req *mqrq_prev;
+ int qdepth;
+};
+
+extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
+ const char *);
+extern void mmc_cleanup_queue(struct mmc_queue *);
+extern void mmc_queue_suspend(struct mmc_queue *);
+extern void mmc_queue_resume(struct mmc_queue *);
+
+extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
+ struct mmc_queue_req *);
+extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
+extern void mmc_queue_bounce_post(struct mmc_queue_req *);
+
+extern int mmc_access_rpmb(struct mmc_queue *);
+
+#endif
OpenPOWER on IntegriCloud