summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-07-26 13:00:29 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-07-26 13:00:29 +0000
commitcb06cc132ba61ad3618695715996267d0966be83 (patch)
tree2408a9c5b95d0fe8e4855ee0f5e5c9e2430e49f7 /sys/dev/pci
parent635a0733afddf26b12fb5bedc7c7dfbeaec51123 (diff)
Fix byteswap errors in rtwn(4) and urtwn(4) introduced by me on June 17.
Repairs urtwn(4) on macppc. Problem reported by juanfra@. ok millert@ deraadt@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_rtwn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c
index a50eec59b52..93d6abec640 100644
--- a/sys/dev/pci/if_rtwn.c
+++ b/sys/dev/pci/if_rtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtwn.c,v 1.23 2016/07/21 08:38:33 stsp Exp $ */
+/* $OpenBSD: if_rtwn.c,v 1.24 2016/07/26 13:00:28 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -742,16 +742,20 @@ uint16_t
rtwn_pci_read_2(void *cookie, uint16_t addr)
{
struct rtwn_pci_softc *sc = cookie;
+ uint16_t val;
- return bus_space_read_2(sc->sc_st, sc->sc_sh, addr);
+ val = bus_space_read_2(sc->sc_st, sc->sc_sh, addr);
+ return le16toh(val);
}
uint32_t
rtwn_pci_read_4(void *cookie, uint16_t addr)
{
struct rtwn_pci_softc *sc = cookie;
+ uint32_t val;
- return bus_space_read_4(sc->sc_st, sc->sc_sh, addr);
+ val = bus_space_read_4(sc->sc_st, sc->sc_sh, addr);
+ return le32toh(val);
}
void