MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aw_mmc_req_ok

Function aw_mmc_req_ok

freebsd/arm/allwinner/aw_mmc.c:922–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920}
921
922static void
923aw_mmc_req_ok(struct aw_mmc_softc *sc)
924{
925 int timeout;
926 struct mmc_command *cmd;
927 uint32_t status;
928
929 timeout = 1000;
930 while (--timeout > 0) {
931 status = AW_MMC_READ_4(sc, AW_MMC_STAR);
932 if ((status & AW_MMC_STAR_CARD_BUSY) == 0)
933 break;
934 DELAY(1000);
935 }
936#ifdef MMCCAM
937 cmd = &sc->ccb->mmcio.cmd;
938#else
939 cmd = sc->aw_req->cmd;
940#endif
941 if (timeout == 0) {
942 cmd->error = MMC_ERR_FAILED;
943 aw_mmc_req_done(sc);
944 return;
945 }
946 if (cmd->flags & MMC_RSP_PRESENT) {
947 if (cmd->flags & MMC_RSP_136) {
948 cmd->resp[0] = AW_MMC_READ_4(sc, AW_MMC_RESP3);
949 cmd->resp[1] = AW_MMC_READ_4(sc, AW_MMC_RESP2);
950 cmd->resp[2] = AW_MMC_READ_4(sc, AW_MMC_RESP1);
951 cmd->resp[3] = AW_MMC_READ_4(sc, AW_MMC_RESP0);
952 } else
953 cmd->resp[0] = AW_MMC_READ_4(sc, AW_MMC_RESP0);
954 }
955 /* All data has been transferred ? */
956 if (cmd->data != NULL && (sc->aw_resid << 2) < cmd->data->len)
957 cmd->error = MMC_ERR_FAILED;
958 aw_mmc_req_done(sc);
959}
960
961static inline void
962set_mmc_error(struct aw_mmc_softc *sc, int error_code)

Callers 1

aw_mmc.cFile · 0.85

Calls 2

aw_mmc_req_doneFunction · 0.85
DELAYFunction · 0.50

Tested by

no test coverage detected