typedef struct { } spinlock_t; extern struct page *mem_map; typedef struct pm_message { } pm_message_t; struct device_driver { const char *name; }; struct page { unsigned long flags; }; struct scatterlist { struct page *page; unsigned int offset; }; struct request { unsigned int cmd_flags; }; inline __attribute__ ((always_inline)) void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen) { sg->page = (mem_map + ((((unsigned long)(buf) - 0x80000000) >> 12) - ((0x0C000000 >> 12)))); sg->offset = ((unsigned long)(buf) & ~(~((1UL << 12) - 1))); } inline __attribute__ ((always_inline)) void sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen) { memset(sg, 0, sizeof(*sg)); sg_set_buf(sg, buf, buflen); }; struct mmc_card { unsigned int state; }; struct mmc_driver { struct device_driver drv; int (*probe) (struct mmc_card *); void (*remove) (struct mmc_card *); int (*suspend) (struct mmc_card *, pm_message_t); int (*resume) (struct mmc_card *); }; struct mmc_queue { struct mmc_card *card; int (*issue_fn) (struct mmc_queue *, struct request *); void *data; }; struct mmc_blk_data { struct mmc_queue queue; }; static unsigned int mmc_sd_num_wr_blocks(struct mmc_card *card) { unsigned int blocks; struct scatterlist sg; sg_init_one(&sg, &blocks, 4); } int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) { struct mmc_blk_data *md = mq->data; struct mmc_card *card = md->queue.card; if (((req)->cmd_flags & 1) != 0 && ((card)->state & (1 << 3))) { unsigned int blocks; blocks = mmc_sd_num_wr_blocks(card); if (blocks != (unsigned int) - 1) { do { local_irq_disable(); } while (0); } } } struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) { struct mmc_blk_data *md; md->queue.issue_fn = mmc_blk_issue_rq; } int mmc_blk_probe(struct mmc_card *card) { struct mmc_blk_data *md; md = mmc_blk_alloc(card); } static void mmc_blk_remove(struct mmc_card *card) { } static struct mmc_driver mmc_driver = { .probe = mmc_blk_probe }; void __attribute__ ((__used__)) mmc_blk_exit(void) { mmc_unregister_driver(&mmc_driver); }