下面就驱动移植时需要注意的地方进行分析。
static void s3cmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
mrq所指的struct mmc_request中的值在mmc_blk_issue_rq函数中被设置:
brq.mrq.cmd = &brq.cmd;
brq.mrq.data = &brq.data;
brq.cmd.arg = req->sector << 9;
brq.cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
brq.data.blksz = 1 << md->block_bits;
brq.data.blocks = req->nr_sectors >> (md->block_bits - 9);
brq.stop.opcode = MMC_STOP_TRANSMISSION;
brq.stop.arg = 0;
brq.stop.flags = MMC_RSP_R1B | MMC_CMD_AC;
...
brq.data.sg = mq->sg;
brq.data.sg_len = blk_rq_map_sg(req->q, req, brq.data.sg);//从指定的要求中获得全部的段,然后把他们填写到给定的表中
mmc_wait_for_req(card->host, &brq.mrq);
brq.data.sg是个struct scatterlist数组。指明了读/写的各个段的长度,及其偏移地址
--------------------胡乱记一下,有待整理-----------------------------------------
阅读(859) | 评论(0) | 转发(1) |