summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sdmmc/sdmmc_mem.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index 916385123d4..c8cdaaa1e5b 100644
--- a/sys/dev/sdmmc/sdmmc_mem.c
+++ b/sys/dev/sdmmc/sdmmc_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_mem.c,v 1.3 2006/06/01 21:53:41 uwe Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.4 2006/06/29 01:40:51 uwe Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -131,7 +131,7 @@ sdmmc_mem_scan(struct sdmmc_softc *sc)
}
/* In MMC mode, find the next available RCA. */
- next_rca = 0;
+ next_rca = 1;
if (!ISSET(sc->sc_flags, SMF_SD_MODE))
SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list)
next_rca++;
@@ -169,6 +169,13 @@ sdmmc_mem_scan(struct sdmmc_softc *sc)
(void)sdmmc_select_card(sc, NULL);
#endif
+ /*
+ * If this is a memory-only card, the card responding
+ * first becomes an alias for SDIO function 0.
+ */
+ if (sc->sc_fn0 == NULL)
+ sc->sc_fn0 = sf;
+
SIMPLEQ_INSERT_TAIL(&sc->sf_head, sf, sf_list);
}