=================================================================== RCS file: /cvs/funnyos/dev/sdmmc/sdmmc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- funnyos/dev/sdmmc/sdmmc.c 2007/12/21 17:45:26 1.2 +++ funnyos/dev/sdmmc/sdmmc.c 2007/12/25 14:10:51 1.3 @@ -1,21 +1,43 @@ /* - * $Id: sdmmc.c,v 1.2 2007/12/21 17:45:26 nbrk Exp $ + * $Id: sdmmc.c,v 1.3 2007/12/25 14:10:51 nbrk Exp $ */ #include +#include #include -struct sdmmc_cmdframe -sdmmc_command(uint8_t cmd, uint32_t arg, uint8_t crc) +#include + +/* + * SD/MMC device. + */ +struct sdmmc_dd { + struct sdmmc_bus_handle *sd_sbhp; + +}; + +int sdmmc_attach(struct device *, uint32_t, uint8_t); + + + +struct driver sdmmc_dr = { + sizeof(struct sdmmc_dd), + sdmmc_attach, + NULL, + NULL +}; + + +int +sdmmc_attach(struct device *self, uint32_t loc, uint8_t flags) { - /* - * Construct command frame and return it. - */ - struct sdmmc_cmdframe cmdframe; + struct sdmmc_dd *ddp = self->dv_devdata; + ddp->sd_sbhp = self->dv_parent->dv_aux; - cmdframe.sc_cmd = CMDFRAME_CMD(cmd); - cmdframe.sc_arg = arg; - cmdframe.sc_crc = cmd != 0 ? CMDFRAME_CRC(crc) : crc; + printf("SD/MMC generic device\n"); - return(cmdframe); + sdmmc_init(ddp->sd_sbhp); + + return(0); } +