aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-21 13:22:25 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:49:35 -0500
commit8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9 (patch)
tree751497c11ae0b02cd90113a379e1fc35c84783ac /net/mac80211
parentc17bff87bed4bda1835ee41dc908e926414d8d85 (diff)
cfg80211: consolidate passive-scan and no-ibss flags
These two flags are used for the same purpose, just combine them into a no-ir flag to annotate no initiating radiation is allowed. Old userspace sending either flag will have it treated as the no-ir flag. To be considerate to older userspace we also send both the no-ir flag and the old no-ibss flags. Newer userspace will have to be aware of older kernels. Update all places in the tree using these flags with the following semantic patch: @@ @@ -NL80211_RRF_PASSIVE_SCAN +NL80211_RRF_NO_IR @@ @@ -NL80211_RRF_NO_IBSS +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_PASSIVE_SCAN +IEEE80211_CHAN_NO_IR @@ @@ -IEEE80211_CHAN_NO_IBSS +IEEE80211_CHAN_NO_IR @@ @@ -NL80211_RRF_NO_IR | NL80211_RRF_NO_IR +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR +IEEE80211_CHAN_NO_IR @@ @@ -(NL80211_RRF_NO_IR) +NL80211_RRF_NO_IR @@ @@ -(IEEE80211_CHAN_NO_IR) +IEEE80211_CHAN_NO_IR Along with some hand-optimisations in documentation, to remove duplicates and to fix some indentation. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [do all the driver updates in one go] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/scan.c10
-rw-r--r--net/mac80211/tx.c3
2 files changed, 6 insertions, 7 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 5ad66a83ef7f..c22cbb57b49d 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -526,7 +526,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
526 ieee80211_hw_config(local, 0); 526 ieee80211_hw_config(local, 0);
527 527
528 if ((req->channels[0]->flags & 528 if ((req->channels[0]->flags &
529 IEEE80211_CHAN_PASSIVE_SCAN) || 529 IEEE80211_CHAN_NO_IR) ||
530 !local->scan_req->n_ssids) { 530 !local->scan_req->n_ssids) {
531 next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; 531 next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
532 } else { 532 } else {
@@ -572,7 +572,7 @@ ieee80211_scan_get_channel_time(struct ieee80211_channel *chan)
572 * TODO: channel switching also consumes quite some time, 572 * TODO: channel switching also consumes quite some time,
573 * add that delay as well to get a better estimation 573 * add that delay as well to get a better estimation
574 */ 574 */
575 if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) 575 if (chan->flags & IEEE80211_CHAN_NO_IR)
576 return IEEE80211_PASSIVE_CHANNEL_TIME; 576 return IEEE80211_PASSIVE_CHANNEL_TIME;
577 return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME; 577 return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
578} 578}
@@ -696,7 +696,7 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
696 * 696 *
697 * In any case, it is not necessary for a passive scan. 697 * In any case, it is not necessary for a passive scan.
698 */ 698 */
699 if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN || 699 if (chan->flags & IEEE80211_CHAN_NO_IR ||
700 !local->scan_req->n_ssids) { 700 !local->scan_req->n_ssids) {
701 *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; 701 *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
702 local->next_scan_state = SCAN_DECISION; 702 local->next_scan_state = SCAN_DECISION;
@@ -881,7 +881,7 @@ int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
881 struct ieee80211_channel *tmp_ch = 881 struct ieee80211_channel *tmp_ch =
882 &local->hw.wiphy->bands[band]->channels[i]; 882 &local->hw.wiphy->bands[band]->channels[i];
883 883
884 if (tmp_ch->flags & (IEEE80211_CHAN_NO_IBSS | 884 if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR |
885 IEEE80211_CHAN_DISABLED)) 885 IEEE80211_CHAN_DISABLED))
886 continue; 886 continue;
887 887
@@ -895,7 +895,7 @@ int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
895 895
896 local->int_scan_req->n_channels = n_ch; 896 local->int_scan_req->n_channels = n_ch;
897 } else { 897 } else {
898 if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IBSS | 898 if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IR |
899 IEEE80211_CHAN_DISABLED))) 899 IEEE80211_CHAN_DISABLED)))
900 goto unlock; 900 goto unlock;
901 901
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c558b246ef00..5ad2e8b1f92c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1724,8 +1724,7 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1724 * radar detection by itself. We can do that later by adding a 1724 * radar detection by itself. We can do that later by adding a
1725 * monitor flag interfaces used for AP support. 1725 * monitor flag interfaces used for AP support.
1726 */ 1726 */
1727 if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR | 1727 if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
1728 IEEE80211_CHAN_PASSIVE_SCAN)))
1729 goto fail_rcu; 1728 goto fail_rcu;
1730 1729
1731 ieee80211_xmit(sdata, skb, chan->band); 1730 ieee80211_xmit(sdata, skb, chan->band);