aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-08 12:31:02 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-26 06:42:58 -0500
commit42d97a599eb6b2aab3a401b3e5799a399d6c7652 (patch)
tree1905b71c2092ad299503515dd0d59fa74573cd12 /net/mac80211/cfg.c
parent028e8da0723a6f6a00d9d1e3dae9ad448a28987e (diff)
cfg80211: remove remain-on-channel channel type
As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 18926aea480c..ac0241e3539b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2236,7 +2236,6 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
2236static int ieee80211_start_roc_work(struct ieee80211_local *local, 2236static int ieee80211_start_roc_work(struct ieee80211_local *local,
2237 struct ieee80211_sub_if_data *sdata, 2237 struct ieee80211_sub_if_data *sdata,
2238 struct ieee80211_channel *channel, 2238 struct ieee80211_channel *channel,
2239 enum nl80211_channel_type channel_type,
2240 unsigned int duration, u64 *cookie, 2239 unsigned int duration, u64 *cookie,
2241 struct sk_buff *txskb) 2240 struct sk_buff *txskb)
2242{ 2241{
@@ -2254,7 +2253,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2254 return -ENOMEM; 2253 return -ENOMEM;
2255 2254
2256 roc->chan = channel; 2255 roc->chan = channel;
2257 roc->chan_type = channel_type;
2258 roc->duration = duration; 2256 roc->duration = duration;
2259 roc->req_duration = duration; 2257 roc->req_duration = duration;
2260 roc->frame = txskb; 2258 roc->frame = txskb;
@@ -2287,8 +2285,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2287 if (!duration) 2285 if (!duration)
2288 duration = 10; 2286 duration = 10;
2289 2287
2290 ret = drv_remain_on_channel(local, sdata, channel, channel_type, 2288 ret = drv_remain_on_channel(local, sdata, channel, duration);
2291 duration);
2292 if (ret) { 2289 if (ret) {
2293 kfree(roc); 2290 kfree(roc);
2294 return ret; 2291 return ret;
@@ -2299,8 +2296,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2299 2296
2300 out_check_combine: 2297 out_check_combine:
2301 list_for_each_entry(tmp, &local->roc_list, list) { 2298 list_for_each_entry(tmp, &local->roc_list, list) {
2302 if (tmp->chan != channel || tmp->chan_type != channel_type || 2299 if (tmp->chan != channel || tmp->sdata != sdata)
2303 tmp->sdata != sdata)
2304 continue; 2300 continue;
2305 2301
2306 /* 2302 /*
@@ -2417,7 +2413,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2417static int ieee80211_remain_on_channel(struct wiphy *wiphy, 2413static int ieee80211_remain_on_channel(struct wiphy *wiphy,
2418 struct wireless_dev *wdev, 2414 struct wireless_dev *wdev,
2419 struct ieee80211_channel *chan, 2415 struct ieee80211_channel *chan,
2420 enum nl80211_channel_type channel_type,
2421 unsigned int duration, 2416 unsigned int duration,
2422 u64 *cookie) 2417 u64 *cookie)
2423{ 2418{
@@ -2426,7 +2421,7 @@ static int ieee80211_remain_on_channel(struct wiphy *wiphy,
2426 int ret; 2421 int ret;
2427 2422
2428 mutex_lock(&local->mtx); 2423 mutex_lock(&local->mtx);
2429 ret = ieee80211_start_roc_work(local, sdata, chan, channel_type, 2424 ret = ieee80211_start_roc_work(local, sdata, chan,
2430 duration, cookie, NULL); 2425 duration, cookie, NULL);
2431 mutex_unlock(&local->mtx); 2426 mutex_unlock(&local->mtx);
2432 2427
@@ -2519,10 +2514,8 @@ static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
2519 2514
2520static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 2515static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2521 struct ieee80211_channel *chan, bool offchan, 2516 struct ieee80211_channel *chan, bool offchan,
2522 enum nl80211_channel_type channel_type, 2517 unsigned int wait, const u8 *buf, size_t len,
2523 bool channel_type_valid, unsigned int wait, 2518 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
2524 const u8 *buf, size_t len, bool no_cck,
2525 bool dont_wait_for_ack, u64 *cookie)
2526{ 2519{
2527 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 2520 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
2528 struct ieee80211_local *local = sdata->local; 2521 struct ieee80211_local *local = sdata->local;
@@ -2591,14 +2584,10 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2591 rcu_read_lock(); 2584 rcu_read_lock();
2592 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 2585 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
2593 2586
2594 if (chanctx_conf) { 2587 if (chanctx_conf)
2595 need_offchan = chan != chanctx_conf->channel; 2588 need_offchan = chan != chanctx_conf->channel;
2596 if (channel_type_valid && 2589 else
2597 channel_type != chanctx_conf->channel_type)
2598 need_offchan = true;
2599 } else {
2600 need_offchan = true; 2590 need_offchan = true;
2601 }
2602 rcu_read_unlock(); 2591 rcu_read_unlock();
2603 } 2592 }
2604 2593
@@ -2633,7 +2622,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
2633 local->hw.offchannel_tx_hw_queue; 2622 local->hw.offchannel_tx_hw_queue;
2634 2623
2635 /* This will handle all kinds of coalescing and immediate TX */ 2624 /* This will handle all kinds of coalescing and immediate TX */
2636 ret = ieee80211_start_roc_work(local, sdata, chan, channel_type, 2625 ret = ieee80211_start_roc_work(local, sdata, chan,
2637 wait, cookie, skb); 2626 wait, cookie, skb);
2638 if (ret) 2627 if (ret)
2639 kfree_skb(skb); 2628 kfree_skb(skb);