summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2007-11-16 21:34:29 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2007-11-16 21:34:29 +0000
commitba7d7359a1ffd343e89e8e5b3d517daacffa01f4 (patch)
tree0efe7ad7db3009aefd8d3dd9d0ece727664b4557
parentacaaaf1ee53db7c9e9d3d6a9ba19fcf67b482a8c (diff)
clear host to mcu mailbox after loading microcode.
otherwise, talking to the bbp through the mcu may fail.
-rw-r--r--sys/dev/ic/rt2860.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index a09edfd907d..5d7131b7778 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.2 2007/11/16 01:35:53 deraadt Exp $ */
+/* $OpenBSD: rt2860.c,v 1.3 2007/11/16 21:34:28 damien Exp $ */
/*-
* Copyright (c) 2007
@@ -2369,6 +2369,10 @@ rt2860_init(struct ifnet *ifp)
rt2860_stop(ifp, 1);
return ETIMEDOUT;
}
+
+ /* clear Host to MCU mailbox */
+ RAL_WRITE(sc, RT2860_H2M_BBPAGENT, 0);
+ RAL_WRITE(sc, RT2860_H2M_MAILBOX, 0);
if ((error = rt2860_bbp_init(sc)) != 0) {
rt2860_stop(ifp, 1);
@@ -2432,7 +2436,7 @@ rt2860_init(struct ifnet *ifp)
/* set RTS threshold */
tmp = RAL_READ(sc, RT2860_TX_RTS_CFG);
tmp &= ~0xffff00;
- tmp |= (ic->ic_rtsthreshold & 0xffff) << 8;
+ tmp |= ic->ic_rtsthreshold << 8;
/* enable Tx/Rx DMA engine */
RAL_WRITE(sc, RT2860_MAC_SYS_CTRL, RT2860_MAC_TX_EN);
@@ -2644,7 +2648,8 @@ rt2860_setup_beacon(struct rt2860_softc *sc)
txwi.txop = RT2860_TX_TXOP_HT;
txwi.flags = RT2860_TX_TS;
- RAL_WRITE_REGION_1(sc, RT2860_BCN_BASE(0), (u_int8_t *)&txwi, 16);
+ RAL_WRITE_REGION_1(sc, RT2860_BCN_BASE(0),
+ (u_int8_t *)&txwi, 16);
RAL_WRITE_REGION_1(sc, RT2860_BCN_BASE(0) + 16,
mtod(m, uint8_t *), m->m_pkthdr.len);