Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc Responses are actually in host order (except S...



details:   https://anonhg.NetBSD.org/src/rev/7e430bf59afc
branches:  trunk
changeset: 780434:7e430bf59afc
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jul 23 13:32:19 2012 +0000

description:
Responses are actually in host order (except SCR which is return in
big endian so that's convert to host order).

diffstat:

 sys/dev/sdmmc/sdhc.c      |  6 +++---
 sys/dev/sdmmc/sdmmc_mem.c |  6 ++----
 sys/dev/sdmmc/sdmmcreg.h  |  6 +++---
 3 files changed, 8 insertions(+), 10 deletions(-)

diffs (76 lines):

diff -r 8338245c0d91 -r 7e430bf59afc sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Mon Jul 23 13:05:48 2012 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Mon Jul 23 13:32:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.24 2012/07/21 16:14:05 skrll Exp $  */
+/*     $NetBSD: sdhc.c,v 1.25 2012/07/23 13:32:19 matt Exp $   */
 /*     $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $        */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.24 2012/07/21 16:14:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.25 2012/07/23 13:32:19 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1024,7 +1024,7 @@
                }
        }
        mutex_exit(&hp->host_mtx);
-       DPRINTF(1,("%s: resp = %08x\n", HDEVNAME(hp), be32toh(cmd->c_resp[0])));
+       DPRINTF(1,("%s: resp = %08x\n", HDEVNAME(hp), cmd->c_resp[0]));
 
        /*
         * If the command has data to transfer in any direction,
diff -r 8338245c0d91 -r 7e430bf59afc sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Mon Jul 23 13:05:48 2012 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Mon Jul 23 13:32:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_mem.c,v 1.21 2012/07/20 02:04:13 matt Exp $      */
+/*     $NetBSD: sdmmc_mem.c,v 1.22 2012/07/23 13:32:19 matt Exp $      */
 /*     $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $      */
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.21 2012/07/20 02:04:13 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.22 2012/07/23 13:32:19 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -934,8 +934,6 @@
        resp[1] = be32toh(sf->raw_scr[0]);              // MSW
        resp[0] |= (resp[1] & 0xff) << 24;
        resp[1] >>= 8;
-       resp[0] = htobe32(resp[0]);
-       resp[1] = htobe32(resp[1]);
 
        ver = SCR_STRUCTURE(resp);
        sf->scr.sd_spec = SCR_SD_SPEC(resp);
diff -r 8338245c0d91 -r 7e430bf59afc sys/dev/sdmmc/sdmmcreg.h
--- a/sys/dev/sdmmc/sdmmcreg.h  Mon Jul 23 13:05:48 2012 +0000
+++ b/sys/dev/sdmmc/sdmmcreg.h  Mon Jul 23 13:32:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmcreg.h,v 1.10 2012/07/20 02:04:13 matt Exp $       */
+/*     $NetBSD: sdmmcreg.h,v 1.11 2012/07/23 13:32:19 matt Exp $       */
 /*     $OpenBSD: sdmmcreg.h,v 1.4 2009/01/09 10:55:22 jsg Exp $        */
 
 /*
@@ -331,10 +331,10 @@
        src += start / 32;
        start %= 32;
 
-       uint32_t dst = be32toh(src[0]) >> start;
+       uint32_t dst = src[0] >> start;
 
        if (__predict_false((start + len - 1) / 32 != start / 32)) {
-               dst |= be32toh(src[1]) << (32 - start);
+               dst |= src[1] << (32 - start);
        }
 
        return dst & (__BIT(len) - 1);



Home | Main Index | Thread Index | Old Index