diff options
author | Uwe Stuehler <uwe@cvs.openbsd.org> | 2006-06-29 01:40:52 +0000 |
---|---|---|
committer | Uwe Stuehler <uwe@cvs.openbsd.org> | 2006-06-29 01:40:52 +0000 |
commit | 653b08ffa85a622af0d040374dd6ff5ce428fa96 (patch) | |
tree | cc0b9637c36ebe104d0beeb17763200c830bef08 /sys | |
parent | ab28017e80d1632470f6fe75747b9686212d69db (diff) |
- Assign RCAs beginning at 1 since 0 is used to deselect all cards.
- Always set the "SDIO function 0" pointer to something, even if it is
a memory-only card to avoid further special cases in SDIO drivers.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_mem.c | 11 |
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); } |