3 extern struct page *mem_map;
4 typedef struct pm_message {
17 unsigned int cmd_flags;
19 inline __attribute__ ((always_inline))
20 void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen)
24 ((((unsigned long)(buf) - 0x80000000) >> 12) -
25 ((0x0C000000 >> 12))));
26 sg->offset = ((unsigned long)(buf) & ~(~((1UL << 12) - 1)));
28 inline __attribute__ ((always_inline))
29 void sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen)
31 memset(sg, 0, sizeof(*sg));
32 sg_set_buf(sg, buf, buflen);
38 struct device_driver drv;
39 int (*probe) (struct mmc_card *);
40 void (*remove) (struct mmc_card *);
41 int (*suspend) (struct mmc_card *, pm_message_t);
42 int (*resume) (struct mmc_card *);
45 struct mmc_card *card;
46 int (*issue_fn) (struct mmc_queue *, struct request *);
50 struct mmc_queue queue;
53 unsigned int mmc_sd_num_wr_blocks(struct mmc_card *card)
56 struct scatterlist sg;
57 sg_init_one(&sg, &blocks, 4);
59 int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
61 struct mmc_blk_data *md = mq->data;
62 struct mmc_card *card = md->queue.card;
63 if (((req)->cmd_flags & 1) != 0 && ((card)->state & (1 << 3))) {
65 blocks = mmc_sd_num_wr_blocks(card);
66 if (blocks != (unsigned int) - 1) {
74 struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
76 struct mmc_blk_data *md;
77 md->queue.issue_fn = mmc_blk_issue_rq;
79 int mmc_blk_probe(struct mmc_card *card)
81 struct mmc_blk_data *md;
82 md = mmc_blk_alloc(card);
84 static void mmc_blk_remove(struct mmc_card *card)
87 static struct mmc_driver mmc_driver = {
88 .probe = mmc_blk_probe
91 __attribute__ ((__used__))
94 mmc_unregister_driver(&mmc_driver);