From 527eef962e3440e0484314868471050b85af5543 Mon Sep 17 00:00:00 2001 From: sam 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/ath/if_ath.c | 16 +++++++--------- sys/dev/iwi/if_iwi.c | 6 ++++++ sys/dev/ral/rt2560.c | 6 ++++++ sys/dev/ral/rt2661.c | 6 ++++++ sys/dev/usb/if_rum.c | 6 ++++++ sys/dev/usb/if_ural.c | 6 ++++++ 6 files changed, 37 insertions(+), 9 deletions(-) (limited to 'sys') diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 1bc9eeb..5c46505 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1579,6 +1579,12 @@ ath_start(struct ifnet *ifp) ATH_TXBUF_UNLOCK(sc); break; } + /* + * Cancel any background scan. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + ieee80211_cancel_scan(ic); + STAILQ_INIT(&frags); /* * Find the node for the destination so we can do @@ -1605,15 +1611,6 @@ ath_start(struct ifnet *ifp) * the frame back when the time is right. */ ieee80211_pwrsave(ni, m); - /* - * If we're in power save mode 'cuz of a bg - * scan cancel it so the traffic can flow. - * The packet we just queued will automatically - * get sent when we drop out of power save. - * XXX locking - */ - if (ic->ic_flags & IEEE80211_F_SCAN) - ieee80211_cancel_scan(ic); goto reclaim; } /* calculate priority so we can find the tx queue */ @@ -1752,6 +1749,7 @@ ath_start(struct ifnet *ifp) } ifp->if_timer = 5; + ic->ic_lastdata = ticks; #if 0 /* * Flush stale frames from the fast-frame staging queue. diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 205d66c..aaf7d1b 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -1917,6 +1917,11 @@ iwi_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))) == NULL) { @@ -1978,6 +1983,7 @@ iwi_start(struct ifnet *ifp) } sc->sc_tx_timer = 5; + ic->ic_lastdata = ticks; } IWI_UNLOCK(sc); diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index d799be4..b3bb76a 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 fde5738..b7086f5 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); } diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index ca80573..e2c5a18 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1406,6 +1406,11 @@ rum_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)))) @@ -1436,6 +1441,7 @@ rum_start(struct ifnet *ifp) } sc->sc_tx_timer = 5; + ic->ic_lastdata = ticks; callout_reset(&sc->watchdog_ch, hz, rum_watchdog, sc); } } diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 9dc052b..47de4d7 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -1472,6 +1472,11 @@ ural_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)))) @@ -1502,6 +1507,7 @@ ural_start(struct ifnet *ifp) } sc->sc_tx_timer = 5; + ic->ic_lastdata = ticks; callout_reset(&sc->watchdog_ch, hz, ural_watchdog, sc); } } -- cgit v1.1