diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2007-12-07 19:37:05 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2007-12-07 19:37:05 +0000 |
commit | d813f7d14ab2f4e4517becc58112687971944377 (patch) | |
tree | e9a70628a47e253e40655b8ad153e14c6cee9754 /sys/dev | |
parent | 4336448dc52a44407a0e14db7d05d74e821a18f3 (diff) |
In hostap mode, update beacon to reflect ERP IE changes.
Fix channel 126 settings.
Workarounds for various hardware bugs.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/rt2860.c | 19 | ||||
-rw-r--r-- | sys/dev/ic/rt2860reg.h | 10 | ||||
-rw-r--r-- | sys/dev/ic/rt2860var.h | 3 |
3 files changed, 21 insertions, 11 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c index f0b452d9ae6..16b5b0dc0d0 100644 --- a/sys/dev/ic/rt2860.c +++ b/sys/dev/ic/rt2860.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860.c,v 1.7 2007/12/04 22:26:55 deraadt Exp $ */ +/* $OpenBSD: rt2860.c,v 1.8 2007/12/07 19:37:04 damien Exp $ */ /*- * Copyright (c) 2007 @@ -1178,9 +1178,11 @@ rt2860_intr(void *arg) if (r & RT2860_TX_DONE_INT0) rt2860_tx_intr(sc, 0); - if (r & RT2860_MAC_INT_1) - /* TBD pre-TBTT */; - + if (r & RT2860_MAC_INT_1) { /* Pre-TBTT */ + if ((sc->sc_flags & RT2860_UPD_BEACON) && + rt2860_setup_beacon(sc) == 0) + sc->sc_flags &= ~RT2860_UPD_BEACON; + } if (r & RT2860_MAC_INT_0) /* TBD TBTT */; @@ -1835,6 +1837,7 @@ void rt2860_select_chan_group(struct rt2860_softc *sc, int group) { uint32_t tmp; + uint8_t bbp66; rt2860_mcu_bbp_write(sc, 62, 0x37 - sc->lna[group]); rt2860_mcu_bbp_write(sc, 63, 0x37 - sc->lna[group]); @@ -1864,7 +1867,8 @@ rt2860_select_chan_group(struct rt2860_softc *sc, int group) } RAL_WRITE(sc, RT2860_TX_PIN_CFG, tmp); - rt2860_mcu_bbp_write(sc, 66, 0x2e + sc->lna[group]); + bbp66 = (group == 0) ? 0x2e + sc->lna[0] : 0x4c; + rt2860_mcu_bbp_write(sc, 66, bbp66); } void @@ -1968,6 +1972,9 @@ rt2860_updateslot(struct ieee80211com *ic) struct rt2860_softc *sc = ic->ic_softc; uint32_t tmp; + if (ic->ic_opmode == IEEE80211_M_HOSTAP) + sc->sc_flags |= RT2860_UPD_BEACON; + tmp = RAL_READ(sc, RT2860_BKOFF_SLOT_CFG); tmp &= ~0xff; tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; @@ -2699,6 +2706,8 @@ rt2860_stop(struct ifnet *ifp, int disable) rt2860_reset_tx_ring(sc, &sc->txq[qid]); rt2860_reset_rx_ring(sc, &sc->rxq); + sc->sc_flags &= ~RT2860_UPD_BEACON; + /* for CardBus, power down the socket */ if (disable && sc->sc_disable != NULL) { if (sc->sc_flags & RT2860_ENABLED) { diff --git a/sys/dev/ic/rt2860reg.h b/sys/dev/ic/rt2860reg.h index d8060053c7f..d13ec022aa2 100644 --- a/sys/dev/ic/rt2860reg.h +++ b/sys/dev/ic/rt2860reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860reg.h,v 1.3 2007/11/19 21:26:19 damien Exp $ */ +/* $OpenBSD: rt2860reg.h,v 1.4 2007/12/07 19:37:04 damien Exp $ */ /*- * Copyright (c) 2007 @@ -812,13 +812,13 @@ struct rt2860_rxwi { { RT2860_TX_SW_CFG0, 0x00040a06 }, \ { RT2860_TX_SW_CFG1, 0x00080606 }, \ { RT2860_TX_LINK_CFG, 0x00001020 }, \ - { RT2860_TX_TIMEOUT_CFG, 0x00182090 }, \ + { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ { RT2860_LED_CFG, 0x7f031e46 }, \ { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ { RT2860_WMM_CWMAX_CFG, 0x000034aa }, \ { RT2860_MAX_PCNT, 0x1f3fbf9f }, \ - { RT2860_TX_RTY_CFG, 0x6bb80408 }, \ + { RT2860_TX_RTY_CFG, 0x47d01f0f }, \ { RT2860_AUTO_RSP_CFG, 0x00000013 }, \ { RT2860_CCK_PROT_CFG, 0x05740003 }, \ { RT2860_OFDM_PROT_CFG, 0x05740003 }, \ @@ -826,7 +826,7 @@ struct rt2860_rxwi { { RT2860_GF40_PROT_CFG, 0x03f44084 }, \ { RT2860_MM20_PROT_CFG, 0x01744004 }, \ { RT2860_MM40_PROT_CFG, 0x03f54084 }, \ - { RT2860_TXOP_CTRL_CFG, 0x000024bf }, \ + { RT2860_TXOP_CTRL_CFG, 0x0000243f }, \ { RT2860_TX_RTS_CFG, 0x00092b20 }, \ { RT2860_EXP_ACK_TIME, 0x002400ca } @@ -884,7 +884,7 @@ struct rt2860_rxwi { { 118, 0x100bb3, 0x13028f, 0x05e014, 0x001404 }, \ { 120, 0x100bb1, 0x1300e0, 0x05e014, 0x001400 }, \ { 124, 0x100bb1, 0x1300e0, 0x05e014, 0x001404 }, \ - { 126, 0x100bb1, 0x1300e0, 0x05e014, 0x00140e }, \ + { 126, 0x100bb1, 0x1300e0, 0x05e014, 0x001406 }, \ { 128, 0x100bb1, 0x1300e0, 0x05e014, 0x001408 }, \ { 132, 0x100bb1, 0x1300e1, 0x05e014, 0x001402 }, \ { 134, 0x100bb1, 0x1300e1, 0x05e014, 0x001404 }, \ diff --git a/sys/dev/ic/rt2860var.h b/sys/dev/ic/rt2860var.h index 3e7b91fc049..42705a14157 100644 --- a/sys/dev/ic/rt2860var.h +++ b/sys/dev/ic/rt2860var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860var.h,v 1.3 2007/11/19 21:26:19 damien Exp $ */ +/* $OpenBSD: rt2860var.h,v 1.4 2007/12/07 19:37:04 damien Exp $ */ /*- * Copyright (c) 2007 @@ -117,6 +117,7 @@ struct rt2860_softc { int sc_flags; #define RT2860_ENABLED (1 << 0) #define RT2860_FWLOADED (1 << 1) +#define RT2860_UPD_BEACON (1 << 2) struct rt2860_tx_ring txq[6]; struct rt2860_rx_ring rxq; |