From 2b9411e29fbcfc03ebddddadfd50204f1e78ee5c Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Wed, 5 Sep 2007 23:00:27 +0000 Subject: Add missing bits that made bg scanning lame: o update ic_lastdata to reflect time of last outbound frame o outbound traffic must preempt/cancel bg scanning to avoid delays This stuff was somehow missed in the initial import. Reviewed by: thompsa, avatar, sephe (earlier version) Approved by: re (blanket wireless) --- sys/dev/ral/rt2560.c | 6 ++++++ sys/dev/ral/rt2661.c | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'sys/dev/ral') diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index d799be4130914..b3bb76ad623ab 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -2005,6 +2005,11 @@ rt2560_start(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } + /* + * Cancel any background scan. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + ieee80211_cancel_scan(ic); if (m0->m_len < sizeof (struct ether_header) && !(m0 = m_pullup(m0, sizeof (struct ether_header)))) @@ -2057,6 +2062,7 @@ rt2560_start(struct ifnet *ifp) } sc->sc_tx_timer = 5; + ic->ic_lastdata = ticks; callout_reset(&sc->watchdog_ch, hz, rt2560_watchdog, sc); } diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index fde5738c47e75..b7086f532e7ab 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -1766,6 +1766,11 @@ rt2661_start(struct ifnet *ifp) IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) break; + /* + * Cancel any background scan. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + ieee80211_cancel_scan(ic); if (m0->m_len < sizeof (struct ether_header) && !(m0 = m_pullup(m0, sizeof (struct ether_header)))) @@ -1819,6 +1824,7 @@ rt2661_start(struct ifnet *ifp) } sc->sc_tx_timer = 5; + ic->ic_lastdata = ticks; callout_reset(&sc->watchdog_ch, hz, rt2661_watchdog, sc); } -- cgit v1.3