4 #define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH)
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;
15 int retune_retry_done;
18 enum mmc_packed_type {
23 #define mmc_packed_cmd(type) ((type) != MMC_PACKED_NONE)
24 #define mmc_packed_wr(type) ((type) == MMC_PACKED_WRITE)
27 struct list_head list;
35 struct mmc_queue_req {
37 struct mmc_blk_request brq;
38 struct scatterlist *sg;
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;
48 struct mmc_card *card;
49 struct task_struct *thread;
50 struct semaphore thread_sem;
52 #define MMC_QUEUE_SUSPENDED (1 << 0)
53 #define MMC_QUEUE_NEW_REQUEST (1 << 1)
55 int (*issue_fn)(struct mmc_queue *, struct request *);
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;
61 #ifdef CONFIG_MMC_SIMULATE_MAX_SPEED
62 atomic_t max_write_speed;
63 atomic_t max_read_speed;
66 atomic_long_t cache_used;
67 unsigned long cache_jiffies;
72 * There is one mmc_blk_data per slot.
77 struct mmc_queue queue;
78 struct list_head part;
81 #define MMC_BLK_CMD23 (1 << 0) /* Can do SET_BLOCK_COUNT for multiblock */
82 #define MMC_BLK_REL_WR (1 << 1) /* MMC Reliable write support */
83 #define MMC_BLK_PACKED_CMD (1 << 2) /* MMC packed command support */
86 unsigned int read_only;
87 unsigned int part_type;
88 unsigned int name_idx;
89 unsigned int reset_done;
90 #define MMC_BLK_READ BIT(0)
91 #define MMC_BLK_WRITE BIT(1)
92 #define MMC_BLK_DISCARD BIT(2)
93 #define MMC_BLK_SECDISCARD BIT(3)
94 #define MMC_BLK_RPMB BIT(4)
97 * Only set in main mmc_blk_data associated
98 * with mmc_card with mmc_set_drvdata, and keeps
99 * track of the current selected device partition.
101 unsigned int part_curr;
102 struct device_attribute force_ro;
103 struct device_attribute power_ro_lock;
107 extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
109 extern void mmc_cleanup_queue(struct mmc_queue *);
110 extern void mmc_queue_suspend(struct mmc_queue *);
111 extern void mmc_queue_resume(struct mmc_queue *);
113 extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
114 struct mmc_queue_req *);
115 extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
116 extern void mmc_queue_bounce_post(struct mmc_queue_req *);
118 extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
119 extern void mmc_packed_clean(struct mmc_queue *);
121 extern int mmc_access_rpmb(struct mmc_queue *);
122 void mmc_blk_emmc_remove(struct mmc_card *card);
123 void mmc_blk_emmc_add(struct mmc_card *card, size_t data_size);