# HG changeset patch # Parent abf3cf6d05d6ba4cd2f2041ad70463f43404cbf0 diff -r abf3cf6d05d6 -r ad24183d4c78 sys/dev/mmc/mmcsd.c --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -337,6 +337,27 @@ mmcsd_errmsg(int e) return errmsg[e]; } +static void +mmcsd_send_prewrite(struct mmcsd_softc *sc, int num_blocks) +{ +#if 0 + device_t dev = sc->dev; + device_t mmcbr = device_get_parent(dev); + struct mmc_command cmd; + struct mmc_request req; + + memset(&req, 0, sizeof(req)); + memset(&cmd, 0, sizeof(cmd)); + + cmd.mrq = &req; + req.cmd = &cmd; + cmd.opcode = ACMD_SET_WR_BLK_ERASE_COUNT; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + + MMCBUS_WAIT_FOR_APP_REQUEST(mmcbr, dev, &req); +#endif +} + static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp) { @@ -392,6 +413,8 @@ mmcsd_rw(struct mmcsd_softc *sc, struct stop.mrq = &req; req.stop = &stop; } + if (cmd.opcode == MMC_WRITE_MULTIPLE_BLOCK) + mmcsd_send_prewrite(sc, numblocks); MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) {