summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc/sdmmc_mem.c
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2010-02-10 23:33:08 +0000
committerdrahn <drahn@openbsd.org>2010-02-10 23:33:08 +0000
commit1c89afa7a19f60f32fa24012e861af5bc97ec914 (patch)
tree7836919fd83b39741298ad983e633e23eb0cad3d /sys/dev/sdmmc/sdmmc_mem.c
parentpkcs#11 is no longer optional; improve wording; ok jmc@ (diff)
downloadwireguard-openbsd-1c89afa7a19f60f32fa24012e861af5bc97ec914.tar.xz
wireguard-openbsd-1c89afa7a19f60f32fa24012e861af5bc97ec914.zip
Only allow the common voltages of the card and the host when writing the OCR
back to the card. fixes a problem where the controller supported lower voltages than the card. With variable name change requested miod, ok miod@ krw@
Diffstat (limited to 'sys/dev/sdmmc/sdmmc_mem.c')
-rw-r--r--sys/dev/sdmmc/sdmmc_mem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index d7980b58d3d..8750b53c715 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.13 2009/10/03 18:42:36 kettenis Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.14 2010/02/10 23:33:08 drahn Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -96,6 +96,8 @@ sdmmc_mem_enable(struct sdmmc_softc *sc)
/* Tell the card(s) to enter the idle state (again). */
sdmmc_go_idle_state(sc);
+ host_ocr &= card_ocr; /* only allow the common voltages */
+
if (sdmmc_send_if_cond(sc, card_ocr) == 0)
host_ocr |= SD_OCR_SDHC_CAP;