get the emmc capacity in kernel
4.19\drivers\mmc\core\Mmc.c
static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
if (card->ext_csd.rev >= 2) {
card->ext_csd.sectors =
ext_csd[EXT_CSD_SEC_CNT + 0] << 0 |
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
funcs to process mmc core request:
struct mmc_host_ops