aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2014-06-05 02:12:57 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-23 05:05:35 -0400
commitb49328361bab10d786e321aeae79b4429fdff38c (patch)
treea92a5a0032a44114cd2e21b5c00507d4812c1031 /net/mac80211/tx.c
parentb7ffbd7ef6751f6cde73082346e365738daf00d2 (diff)
mac80211: allow tx via monitor iface when DFS
Allow send frames using monitor interface when DFS chandef and we pass CAC (beaconing allowed). This fix problem when old kernel and new backports used, in such case hostapd create/use also monitor interface. Before this patch all frames hostapd send using monitor iface were dropped when AP was configured on DFS channel. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8170d9945d6d..3c80bf29b050 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1620,12 +1620,12 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1620{ 1620{
1621 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 1621 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1622 struct ieee80211_chanctx_conf *chanctx_conf; 1622 struct ieee80211_chanctx_conf *chanctx_conf;
1623 struct ieee80211_channel *chan;
1624 struct ieee80211_radiotap_header *prthdr = 1623 struct ieee80211_radiotap_header *prthdr =
1625 (struct ieee80211_radiotap_header *)skb->data; 1624 (struct ieee80211_radiotap_header *)skb->data;
1626 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1625 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1627 struct ieee80211_hdr *hdr; 1626 struct ieee80211_hdr *hdr;
1628 struct ieee80211_sub_if_data *tmp_sdata, *sdata; 1627 struct ieee80211_sub_if_data *tmp_sdata, *sdata;
1628 struct cfg80211_chan_def *chandef;
1629 u16 len_rthdr; 1629 u16 len_rthdr;
1630 int hdrlen; 1630 int hdrlen;
1631 1631
@@ -1723,9 +1723,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1723 } 1723 }
1724 1724
1725 if (chanctx_conf) 1725 if (chanctx_conf)
1726 chan = chanctx_conf->def.chan; 1726 chandef = &chanctx_conf->def;
1727 else if (!local->use_chanctx) 1727 else if (!local->use_chanctx)
1728 chan = local->_oper_chandef.chan; 1728 chandef = &local->_oper_chandef;
1729 else 1729 else
1730 goto fail_rcu; 1730 goto fail_rcu;
1731 1731
@@ -1745,10 +1745,11 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1745 * radar detection by itself. We can do that later by adding a 1745 * radar detection by itself. We can do that later by adding a
1746 * monitor flag interfaces used for AP support. 1746 * monitor flag interfaces used for AP support.
1747 */ 1747 */
1748 if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR))) 1748 if (!cfg80211_reg_can_beacon(local->hw.wiphy, chandef,
1749 sdata->vif.type))
1749 goto fail_rcu; 1750 goto fail_rcu;
1750 1751
1751 ieee80211_xmit(sdata, skb, chan->band); 1752 ieee80211_xmit(sdata, skb, chandef->chan->band);
1752 rcu_read_unlock(); 1753 rcu_read_unlock();
1753 1754
1754 return NETDEV_TX_OK; 1755 return NETDEV_TX_OK;