linux - where is the mmc write command data source from? -


i new boot loader world, have question when send write command how assign data source, relate function argument *src? traced source code can't find assign data source in c code.

answer myself: found when #mmc write 1 0x4 2 argument means dev # 1, block # 4, count 2 below function's argument mmc->block_dev.block_write(curr_device, blk, cnt, addr);

but, still want know, is possible assign external data source directly?

is mmc write or mmc read write/read internal memory?

is possible assign external data source, such usb port or sd card?

best & regard.

static unsigned long mmc_bwrite(int dev_num, unsigned long start, lbaint_t blkcnt, const void *src){ int err; struct mmc *mmc = find_mmc_device(dev_num);  if (!mmc) {     printf("mmc device %d not found\n", dev_num);     return 0; }  if (blkcnt > 1)     return mmc_bwrite_multi(mmc, start, blkcnt, src); else if (blkcnt == 1)     return mmc_bwrite_single(mmc, start, src);  return 0; 

}

how should trace code below?

mmc->block_dev.block_write = mmc_bwrite; 

src pointer block of memory internal filesystem, if wish stream data device mmc, need intermediate code buffer stream in memory , pass high-level filesystem write function. should not access mmc_write() directly.

how should trace code below?

mmc->block_dev.block_write = mmc_bwrite;

that merely assignment, not function call. mmc_bwrite pointer function:

mmc_bwrite(int dev_num, unsigned long start, lbaint_t blkcnt, const void *src) 

it method of hooking device driver implementation filesystem @ run-time rather static link. within filesystem, mmc_bwrite() called through mmc->block_dev.block_write rather directly.

mmc->block_dev.block_write(curr_device, blk, cnt, addr); 

is in fact call mmc_bwrite().


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -