ath9k: Fix monitor mode handling
authorSujith <Sujith.Manoharan@atheros.com>
Fri, 8 Jan 2010 05:06:13 +0000 (10:36 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 12 Jan 2010 19:02:06 +0000 (14:02 -0500)
mac80211 passes appropriate flags indicating whether
monitor mode is being used. Use this to set the HW opmode.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index 1f7222aef89f04801832280d66bb798af1fa41a1..b39c7bc411438031b65a0e206b4f66afd51c71d5 100644 (file)
@@ -1581,6 +1581,14 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
                }
        }
 
+       if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
+               if (conf->flags & IEEE80211_CONF_MONITOR) {
+                       ath_print(common, ATH_DBG_CONFIG,
+                                 "HW opmode set to Monitor mode\n");
+                       sc->sc_ah->opmode = NL80211_IFTYPE_MONITOR;
+               }
+       }
+
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
                struct ieee80211_channel *curchan = hw->conf.channel;
                int pos = curchan->hw_value;