Search Linux Wireless

[PATCH v3 7/7] mac80211: add DFS support to monitor interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



AP mode uses monitor interfaces to transmit
management frames which were blocked for "radar
channels" until now.

Stop dropping packets if we are on 'radar channel'
and the DFS is enabled.

Signed-off-by: Victor Goldenshtein <victorg@xxxxxx>
---
 net/mac80211/tx.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index acf712f..d1b6f9a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1583,6 +1583,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
 	struct ieee80211_sub_if_data *tmp_sdata, *sdata;
 	u16 len_rthdr;
 	int hdrlen;
+	bool dfs_supported = (local->hw.wiphy->features & NL80211_FEATURE_DFS);
 
 	/*
 	 * Frame injection is not allowed if beaconing is not allowed
@@ -1595,13 +1596,13 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
 	 * flag.
 	 *
 	 * Since AP mode uses monitor interfaces to inject/TX management
-	 * frames we can make AP mode the exception to this rule once it
-	 * supports radar detection as its implementation can deal with
-	 * radar detection by itself. We can do that later by adding a
-	 * monitor flag interfaces used for AP support.
+	 * frames we can make AP mode the exception to this rule, in the
+	 * case the driver supports radar detection, allow usage of radar
+	 * channels.
 	 */
-	if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
-	     IEEE80211_CHAN_PASSIVE_SCAN)))
+	if ((!(chan->flags & IEEE80211_CHAN_RADAR) || !dfs_supported) &&
+	    ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
+			     IEEE80211_CHAN_PASSIVE_SCAN))))
 		goto fail;
 
 	/* check for not even having the fixed radiotap header part */
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux