linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath5k: fix missing output in monitor mode after ifconfig up
@ 2009-08-01 22:33 Joerg Albert
  2009-08-02  3:20 ` Bob Copeland
  0 siblings, 1 reply; 8+ messages in thread
From: Joerg Albert @ 2009-08-01 22:33 UTC (permalink / raw)
  To: John W. Linville
  Cc: ath5k-devel, Luis R. Rodriguez, linux-wireless, Bob Copeland

Let ath5k_chan_set() call ath5k_reset() if ath5k_config() was told
that the channel changed. This fixes the bug that we don't
get any packets in monitor mode after:

ifconfig wlan0 down
iwconfig wlan0 mode monitor channel 1
ifconfig wlan0 up

but they arrive after

iwconfig wlan0 channel 2

Signed-off-by: Joerg Albert <jal2@gmx.de>
---
  drivers/net/wireless/ath/ath5k/base.c |   17 +++++++++--------
  1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 3a1c156..09ca89c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -289,7 +289,8 @@ static unsigned int ath5k_copy_channels(struct ath5k_hw *ah,
                                 unsigned int max);
  static int     ath5k_setup_bands(struct ieee80211_hw *hw);
  static int     ath5k_chan_set(struct ath5k_softc *sc,
-                               struct ieee80211_channel *chan);
+                              struct ieee80211_channel *chan,
+                              int chan_changed);
  static void    ath5k_setcurmode(struct ath5k_softc *sc,
                                 unsigned int mode);
  static void    ath5k_mode_setup(struct ath5k_softc *sc);
@@ -1079,14 +1080,13 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
   * Called with sc->lock.
   */
  static int
-ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
+ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan,
+              int chan_changed)
  {
-       ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "(%u MHz) -> (%u MHz)\n",
-               sc->curchan->center_freq, chan->center_freq);
-
-       if (chan->center_freq != sc->curchan->center_freq ||
-               chan->hw_value != sc->curchan->hw_value) {
+       ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "(%u MHz) -> (%u MHz) chan_changed %x\n",
+                 sc->curchan->center_freq, chan->center_freq, chan_changed);

+       if (chan_changed) {
                 /*
                  * To switch channels clear any pending DMA operations;
                  * wait long enough for the RX fifo to drain, reset the
@@ -2811,7 +2811,8 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)

         mutex_lock(&sc->lock);

-       ret = ath5k_chan_set(sc, conf->channel);
+       ret = ath5k_chan_set(sc, conf->channel,
+                            changed & IEEE80211_CONF_CHANGE_CHANNEL);
         if (ret < 0)
                 goto unlock;

-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-04 23:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-01 22:33 [PATCH] ath5k: fix missing output in monitor mode after ifconfig up Joerg Albert
2009-08-02  3:20 ` Bob Copeland
2009-08-02  7:36   ` Joerg Albert
2009-08-02  7:50   ` [PATCH v2] " Joerg Albert
2009-08-04 15:13     ` Bob Copeland
2009-08-04 15:41     ` John W. Linville
2009-08-04 23:46       ` Joerg Albert
2009-08-04 23:52       ` [PATCH v3] " Joerg Albert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).