iwlwifi: add test to determine if interface in monitor mode
authorChatre, Reinette <reinette.chatre@intel.com>
Fri, 23 Jan 2009 21:45:09 +0000 (13:45 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:01:31 +0000 (16:01 -0500)
mac80211 sets driver in monitor mode through configuring the
RX filters. We cannot trust priv->iw_mode to be accurate
regarding monitor mode as iw_mode is only set in add_interface,
which is not called by mac80211 when in monitor mode.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-core.c

index 9f284ebb6c28de8e8a24dcee2b38b2f1c86ef31c..ef4a7c54c736f97e806e0a01d927d9b7cfdeed96 100644 (file)
@@ -698,6 +698,18 @@ static u8 iwl_count_chain_bitmap(u32 chain_bitmap)
        return res;
 }
 
+/**
+ * iwl_is_monitor_mode - Determine if interface in monitor mode
+ *
+ * priv->iw_mode is set in add_interface, but add_interface is
+ * never called for monitor mode. The only way mac80211 informs us about
+ * monitor mode is through configuring filters (call to configure_filter).
+ */
+static bool iwl_is_monitor_mode(struct iwl_priv *priv)
+{
+       return !!(priv->staging_rxon.filter_flags & RXON_FILTER_PROMISC_MSK);
+}
+
 /**
  * iwl_set_rxon_chain - Set up Rx chain usage in "staging" RXON image
  *
This page took 0.025142 seconds and 5 git commands to generate.