aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c27
-rw-r--r--net/mac80211/driver-ops.h5
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c2
-rw-r--r--net/mac80211/offchannel.c8
-rw-r--r--net/mac80211/trace.h6
-rw-r--r--net/wireless/core.h6
-rw-r--r--net/wireless/mlme.c21
-rw-r--r--net/wireless/nl80211.c36
-rw-r--r--net/wireless/nl80211.h4
-rw-r--r--net/wireless/rdev-ops.h20
-rw-r--r--net/wireless/trace.h52
12 files changed, 63 insertions, 126 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);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 68c27aaf5c93..c6560cc7a9d6 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -738,16 +738,15 @@ static inline int drv_get_antenna(struct ieee80211_local *local,
738static inline int drv_remain_on_channel(struct ieee80211_local *local, 738static inline int drv_remain_on_channel(struct ieee80211_local *local,
739 struct ieee80211_sub_if_data *sdata, 739 struct ieee80211_sub_if_data *sdata,
740 struct ieee80211_channel *chan, 740 struct ieee80211_channel *chan,
741 enum nl80211_channel_type chantype,
742 unsigned int duration) 741 unsigned int duration)
743{ 742{
744 int ret; 743 int ret;
745 744
746 might_sleep(); 745 might_sleep();
747 746
748 trace_drv_remain_on_channel(local, sdata, chan, chantype, duration); 747 trace_drv_remain_on_channel(local, sdata, chan, duration);
749 ret = local->ops->remain_on_channel(&local->hw, &sdata->vif, 748 ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
750 chan, chantype, duration); 749 chan, duration);
751 trace_drv_return_int(local, ret); 750 trace_drv_return_int(local, ret);
752 751
753 return ret; 752 return ret;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d5da0fe14318..fba4b1f425c1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -348,7 +348,6 @@ struct ieee80211_roc_work {
348 struct ieee80211_sub_if_data *sdata; 348 struct ieee80211_sub_if_data *sdata;
349 349
350 struct ieee80211_channel *chan; 350 struct ieee80211_channel *chan;
351 enum nl80211_channel_type chan_type;
352 351
353 bool started, abort, hw_begun, notified; 352 bool started, abort, hw_begun, notified;
354 353
@@ -1048,7 +1047,6 @@ struct ieee80211_local {
1048 1047
1049 /* Temporary remain-on-channel for off-channel operations */ 1048 /* Temporary remain-on-channel for off-channel operations */
1050 struct ieee80211_channel *tmp_channel; 1049 struct ieee80211_channel *tmp_channel;
1051 enum nl80211_channel_type tmp_channel_type;
1052 1050
1053 /* channel contexts */ 1051 /* channel contexts */
1054 struct list_head chanctx_list; 1052 struct list_head chanctx_list;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 70e87600cacc..b229cded4567 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -115,7 +115,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
115 channel_type = NL80211_CHAN_NO_HT; 115 channel_type = NL80211_CHAN_NO_HT;
116 } else if (local->tmp_channel) { 116 } else if (local->tmp_channel) {
117 chan = local->tmp_channel; 117 chan = local->tmp_channel;
118 channel_type = local->tmp_channel_type; 118 channel_type = NL80211_CHAN_NO_HT;
119 } else { 119 } else {
120 chan = local->_oper_channel; 120 chan = local->_oper_channel;
121 channel_type = local->_oper_channel_type; 121 channel_type = local->_oper_channel_type;
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 7f8a36510813..5abddfe3e101 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -205,8 +205,8 @@ void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc)
205 } 205 }
206 } else { 206 } else {
207 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie, 207 cfg80211_ready_on_channel(&roc->sdata->wdev, roc->cookie,
208 roc->chan, roc->chan_type, 208 roc->chan, roc->req_duration,
209 roc->req_duration, GFP_KERNEL); 209 GFP_KERNEL);
210 } 210 }
211 211
212 roc->notified = true; 212 roc->notified = true;
@@ -284,7 +284,6 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
284 duration = 10; 284 duration = 10;
285 285
286 ret = drv_remain_on_channel(local, roc->sdata, roc->chan, 286 ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
287 roc->chan_type,
288 duration); 287 duration);
289 288
290 roc->started = true; 289 roc->started = true;
@@ -321,7 +320,7 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
321 if (!roc->mgmt_tx_cookie) 320 if (!roc->mgmt_tx_cookie)
322 cfg80211_remain_on_channel_expired(&roc->sdata->wdev, 321 cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
323 roc->cookie, roc->chan, 322 roc->cookie, roc->chan,
324 roc->chan_type, GFP_KERNEL); 323 GFP_KERNEL);
325 324
326 list_for_each_entry_safe(dep, tmp, &roc->dependents, list) 325 list_for_each_entry_safe(dep, tmp, &roc->dependents, list)
327 ieee80211_roc_notify_destroy(dep); 326 ieee80211_roc_notify_destroy(dep);
@@ -359,7 +358,6 @@ void ieee80211_sw_roc_work(struct work_struct *work)
359 ieee80211_recalc_idle(local); 358 ieee80211_recalc_idle(local);
360 359
361 local->tmp_channel = roc->chan; 360 local->tmp_channel = roc->chan;
362 local->tmp_channel_type = roc->chan_type;
363 ieee80211_hw_config(local, 0); 361 ieee80211_hw_config(local, 0);
364 362
365 /* tell userspace or send frame */ 363 /* tell userspace or send frame */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index e9579b7a2cd0..bc28346ba207 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1022,15 +1022,14 @@ TRACE_EVENT(drv_remain_on_channel,
1022 TP_PROTO(struct ieee80211_local *local, 1022 TP_PROTO(struct ieee80211_local *local,
1023 struct ieee80211_sub_if_data *sdata, 1023 struct ieee80211_sub_if_data *sdata,
1024 struct ieee80211_channel *chan, 1024 struct ieee80211_channel *chan,
1025 enum nl80211_channel_type chantype, unsigned int duration), 1025 unsigned int duration),
1026 1026
1027 TP_ARGS(local, sdata, chan, chantype, duration), 1027 TP_ARGS(local, sdata, chan, duration),
1028 1028
1029 TP_STRUCT__entry( 1029 TP_STRUCT__entry(
1030 LOCAL_ENTRY 1030 LOCAL_ENTRY
1031 VIF_ENTRY 1031 VIF_ENTRY
1032 __field(int, center_freq) 1032 __field(int, center_freq)
1033 __field(int, channel_type)
1034 __field(unsigned int, duration) 1033 __field(unsigned int, duration)
1035 ), 1034 ),
1036 1035
@@ -1038,7 +1037,6 @@ TRACE_EVENT(drv_remain_on_channel,
1038 LOCAL_ASSIGN; 1037 LOCAL_ASSIGN;
1039 VIF_ASSIGN; 1038 VIF_ASSIGN;
1040 __entry->center_freq = chan->center_freq; 1039 __entry->center_freq = chan->center_freq;
1041 __entry->channel_type = chantype;
1042 __entry->duration = duration; 1040 __entry->duration = duration;
1043 ), 1041 ),
1044 1042
diff --git a/net/wireless/core.h b/net/wireless/core.h
index e53831c876bb..b0a09cf56e06 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -378,10 +378,8 @@ void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
378int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev, 378int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
379 struct wireless_dev *wdev, 379 struct wireless_dev *wdev,
380 struct ieee80211_channel *chan, bool offchan, 380 struct ieee80211_channel *chan, bool offchan,
381 enum nl80211_channel_type channel_type, 381 unsigned int wait, const u8 *buf, size_t len,
382 bool channel_type_valid, unsigned int wait, 382 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
383 const u8 *buf, size_t len, bool no_cck,
384 bool dont_wait_for_ack, u64 *cookie);
385void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa, 383void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
386 const struct ieee80211_ht_cap *ht_capa_mask); 384 const struct ieee80211_ht_cap *ht_capa_mask);
387 385
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 4bfd14f7c592..a9646b53a095 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -579,31 +579,25 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
579 579
580void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, 580void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
581 struct ieee80211_channel *chan, 581 struct ieee80211_channel *chan,
582 enum nl80211_channel_type channel_type,
583 unsigned int duration, gfp_t gfp) 582 unsigned int duration, gfp_t gfp)
584{ 583{
585 struct wiphy *wiphy = wdev->wiphy; 584 struct wiphy *wiphy = wdev->wiphy;
586 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 585 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
587 586
588 trace_cfg80211_ready_on_channel(wdev, cookie, chan, channel_type, 587 trace_cfg80211_ready_on_channel(wdev, cookie, chan, duration);
589 duration); 588 nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, duration, gfp);
590 nl80211_send_remain_on_channel(rdev, wdev, cookie, chan, channel_type,
591 duration, gfp);
592} 589}
593EXPORT_SYMBOL(cfg80211_ready_on_channel); 590EXPORT_SYMBOL(cfg80211_ready_on_channel);
594 591
595void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, 592void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
596 struct ieee80211_channel *chan, 593 struct ieee80211_channel *chan,
597 enum nl80211_channel_type channel_type,
598 gfp_t gfp) 594 gfp_t gfp)
599{ 595{
600 struct wiphy *wiphy = wdev->wiphy; 596 struct wiphy *wiphy = wdev->wiphy;
601 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 597 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
602 598
603 trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan, 599 trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan);
604 channel_type); 600 nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan, gfp);
605 nl80211_send_remain_on_channel_cancel(rdev, wdev, cookie, chan,
606 channel_type, gfp);
607} 601}
608EXPORT_SYMBOL(cfg80211_remain_on_channel_expired); 602EXPORT_SYMBOL(cfg80211_remain_on_channel_expired);
609 603
@@ -758,10 +752,8 @@ void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev)
758int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev, 752int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
759 struct wireless_dev *wdev, 753 struct wireless_dev *wdev,
760 struct ieee80211_channel *chan, bool offchan, 754 struct ieee80211_channel *chan, bool offchan,
761 enum nl80211_channel_type channel_type, 755 unsigned int wait, const u8 *buf, size_t len,
762 bool channel_type_valid, unsigned int wait, 756 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
763 const u8 *buf, size_t len, bool no_cck,
764 bool dont_wait_for_ack, u64 *cookie)
765{ 757{
766 const struct ieee80211_mgmt *mgmt; 758 const struct ieee80211_mgmt *mgmt;
767 u16 stype; 759 u16 stype;
@@ -855,7 +847,6 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
855 847
856 /* Transmit the Action frame as requested by user space */ 848 /* Transmit the Action frame as requested by user space */
857 return rdev_mgmt_tx(rdev, wdev, chan, offchan, 849 return rdev_mgmt_tx(rdev, wdev, chan, offchan,
858 channel_type, channel_type_valid,
859 wait, buf, len, no_cck, dont_wait_for_ack, 850 wait, buf, len, no_cck, dont_wait_for_ack,
860 cookie); 851 cookie);
861} 852}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4c427fa5c450..e880f4494950 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5952,7 +5952,6 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
5952 struct sk_buff *msg; 5952 struct sk_buff *msg;
5953 void *hdr; 5953 void *hdr;
5954 u64 cookie; 5954 u64 cookie;
5955 enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
5956 u32 freq, duration; 5955 u32 freq, duration;
5957 int err; 5956 int err;
5958 5957
@@ -5975,11 +5974,11 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
5975 return -EINVAL; 5974 return -EINVAL;
5976 5975
5977 if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] && 5976 if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] &&
5978 !nl80211_valid_channel_type(info, &channel_type)) 5977 !nl80211_valid_channel_type(info, NULL))
5979 return -EINVAL; 5978 return -EINVAL;
5980 5979
5981 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]); 5980 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
5982 chan = rdev_freq_to_chan(rdev, freq, channel_type); 5981 chan = rdev_freq_to_chan(rdev, freq, NL80211_CHAN_NO_HT);
5983 if (chan == NULL) 5982 if (chan == NULL)
5984 return -EINVAL; 5983 return -EINVAL;
5985 5984
@@ -5995,8 +5994,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
5995 goto free_msg; 5994 goto free_msg;
5996 } 5995 }
5997 5996
5998 err = rdev_remain_on_channel(rdev, wdev, chan, channel_type, duration, 5997 err = rdev_remain_on_channel(rdev, wdev, chan, duration, &cookie);
5999 &cookie);
6000 5998
6001 if (err) 5999 if (err)
6002 goto free_msg; 6000 goto free_msg;
@@ -6216,8 +6214,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
6216 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 6214 struct cfg80211_registered_device *rdev = info->user_ptr[0];
6217 struct wireless_dev *wdev = info->user_ptr[1]; 6215 struct wireless_dev *wdev = info->user_ptr[1];
6218 struct ieee80211_channel *chan; 6216 struct ieee80211_channel *chan;
6219 enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
6220 bool channel_type_valid = false;
6221 u32 freq; 6217 u32 freq;
6222 int err; 6218 int err;
6223 void *hdr = NULL; 6219 void *hdr = NULL;
@@ -6264,11 +6260,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
6264 6260
6265 } 6261 }
6266 6262
6267 if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) { 6263 if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE] &&
6268 if (!nl80211_valid_channel_type(info, &channel_type)) 6264 !nl80211_valid_channel_type(info, NULL))
6269 return -EINVAL; 6265 return -EINVAL;
6270 channel_type_valid = true;
6271 }
6272 6266
6273 offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK]; 6267 offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
6274 6268
@@ -6278,7 +6272,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
6278 no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); 6272 no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
6279 6273
6280 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]); 6274 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
6281 chan = rdev_freq_to_chan(rdev, freq, channel_type); 6275 chan = rdev_freq_to_chan(rdev, freq, NL80211_CHAN_NO_HT);
6282 if (chan == NULL) 6276 if (chan == NULL)
6283 return -EINVAL; 6277 return -EINVAL;
6284 6278
@@ -6296,8 +6290,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
6296 } 6290 }
6297 } 6291 }
6298 6292
6299 err = cfg80211_mlme_mgmt_tx(rdev, wdev, chan, offchan, channel_type, 6293 err = cfg80211_mlme_mgmt_tx(rdev, wdev, chan, offchan, wait,
6300 channel_type_valid, wait,
6301 nla_data(info->attrs[NL80211_ATTR_FRAME]), 6294 nla_data(info->attrs[NL80211_ATTR_FRAME]),
6302 nla_len(info->attrs[NL80211_ATTR_FRAME]), 6295 nla_len(info->attrs[NL80211_ATTR_FRAME]),
6303 no_cck, dont_wait_for_ack, &cookie); 6296 no_cck, dont_wait_for_ack, &cookie);
@@ -8395,7 +8388,6 @@ static void nl80211_send_remain_on_chan_event(
8395 int cmd, struct cfg80211_registered_device *rdev, 8388 int cmd, struct cfg80211_registered_device *rdev,
8396 struct wireless_dev *wdev, u64 cookie, 8389 struct wireless_dev *wdev, u64 cookie,
8397 struct ieee80211_channel *chan, 8390 struct ieee80211_channel *chan,
8398 enum nl80211_channel_type channel_type,
8399 unsigned int duration, gfp_t gfp) 8391 unsigned int duration, gfp_t gfp)
8400{ 8392{
8401 struct sk_buff *msg; 8393 struct sk_buff *msg;
@@ -8416,7 +8408,8 @@ static void nl80211_send_remain_on_chan_event(
8416 wdev->netdev->ifindex)) || 8408 wdev->netdev->ifindex)) ||
8417 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || 8409 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) ||
8418 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) || 8410 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) ||
8419 nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, channel_type) || 8411 nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
8412 NL80211_CHAN_NO_HT) ||
8420 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie)) 8413 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie))
8421 goto nla_put_failure; 8414 goto nla_put_failure;
8422 8415
@@ -8438,23 +8431,20 @@ static void nl80211_send_remain_on_chan_event(
8438void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev, 8431void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
8439 struct wireless_dev *wdev, u64 cookie, 8432 struct wireless_dev *wdev, u64 cookie,
8440 struct ieee80211_channel *chan, 8433 struct ieee80211_channel *chan,
8441 enum nl80211_channel_type channel_type,
8442 unsigned int duration, gfp_t gfp) 8434 unsigned int duration, gfp_t gfp)
8443{ 8435{
8444 nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL, 8436 nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL,
8445 rdev, wdev, cookie, chan, 8437 rdev, wdev, cookie, chan,
8446 channel_type, duration, gfp); 8438 duration, gfp);
8447} 8439}
8448 8440
8449void nl80211_send_remain_on_channel_cancel( 8441void nl80211_send_remain_on_channel_cancel(
8450 struct cfg80211_registered_device *rdev, 8442 struct cfg80211_registered_device *rdev,
8451 struct wireless_dev *wdev, 8443 struct wireless_dev *wdev,
8452 u64 cookie, struct ieee80211_channel *chan, 8444 u64 cookie, struct ieee80211_channel *chan, gfp_t gfp)
8453 enum nl80211_channel_type channel_type, gfp_t gfp)
8454{ 8445{
8455 nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, 8446 nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
8456 rdev, wdev, cookie, chan, 8447 rdev, wdev, cookie, chan, 0, gfp);
8457 channel_type, 0, gfp);
8458} 8448}
8459 8449
8460void nl80211_send_sta_event(struct cfg80211_registered_device *rdev, 8450void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index f6153516068c..7adbd767dbfd 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -76,13 +76,11 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
76void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev, 76void nl80211_send_remain_on_channel(struct cfg80211_registered_device *rdev,
77 struct wireless_dev *wdev, u64 cookie, 77 struct wireless_dev *wdev, u64 cookie,
78 struct ieee80211_channel *chan, 78 struct ieee80211_channel *chan,
79 enum nl80211_channel_type channel_type,
80 unsigned int duration, gfp_t gfp); 79 unsigned int duration, gfp_t gfp);
81void nl80211_send_remain_on_channel_cancel( 80void nl80211_send_remain_on_channel_cancel(
82 struct cfg80211_registered_device *rdev, 81 struct cfg80211_registered_device *rdev,
83 struct wireless_dev *wdev, 82 struct wireless_dev *wdev,
84 u64 cookie, struct ieee80211_channel *chan, 83 u64 cookie, struct ieee80211_channel *chan, gfp_t gfp);
85 enum nl80211_channel_type channel_type, gfp_t gfp);
86 84
87void nl80211_send_sta_event(struct cfg80211_registered_device *rdev, 85void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
88 struct net_device *dev, const u8 *mac_addr, 86 struct net_device *dev, const u8 *mac_addr,
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 6e5fa659068d..ee54a5aa4381 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -600,14 +600,12 @@ static inline int
600rdev_remain_on_channel(struct cfg80211_registered_device *rdev, 600rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
601 struct wireless_dev *wdev, 601 struct wireless_dev *wdev,
602 struct ieee80211_channel *chan, 602 struct ieee80211_channel *chan,
603 enum nl80211_channel_type channel_type,
604 unsigned int duration, u64 *cookie) 603 unsigned int duration, u64 *cookie)
605{ 604{
606 int ret; 605 int ret;
607 trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, channel_type, 606 trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
608 duration);
609 ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan, 607 ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
610 channel_type, duration, cookie); 608 duration, cookie);
611 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); 609 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
612 return ret; 610 return ret;
613} 611}
@@ -626,17 +624,15 @@ rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
626static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, 624static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
627 struct wireless_dev *wdev, 625 struct wireless_dev *wdev,
628 struct ieee80211_channel *chan, bool offchan, 626 struct ieee80211_channel *chan, bool offchan,
629 enum nl80211_channel_type channel_type, 627 unsigned int wait, const u8 *buf, size_t len,
630 bool channel_type_valid, unsigned int wait, 628 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
631 const u8 *buf, size_t len, bool no_cck,
632 bool dont_wait_for_ack, u64 *cookie)
633{ 629{
634 int ret; 630 int ret;
635 trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan, channel_type, 631 trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
636 channel_type_valid, wait, no_cck, dont_wait_for_ack); 632 wait, no_cck, dont_wait_for_ack);
637 ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan, 633 ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
638 channel_type, channel_type_valid, wait, buf, 634 wait, buf, len, no_cck,
639 len, no_cck, dont_wait_for_ack, cookie); 635 dont_wait_for_ack, cookie);
640 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie); 636 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
641 return ret; 637 return ret;
642} 638}
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index f264c20a7090..ed10833f9a3a 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1573,25 +1573,22 @@ DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
1573TRACE_EVENT(rdev_remain_on_channel, 1573TRACE_EVENT(rdev_remain_on_channel,
1574 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, 1574 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1575 struct ieee80211_channel *chan, 1575 struct ieee80211_channel *chan,
1576 enum nl80211_channel_type channel_type, unsigned int duration), 1576 unsigned int duration),
1577 TP_ARGS(wiphy, wdev, chan, channel_type, duration), 1577 TP_ARGS(wiphy, wdev, chan, duration),
1578 TP_STRUCT__entry( 1578 TP_STRUCT__entry(
1579 WIPHY_ENTRY 1579 WIPHY_ENTRY
1580 WDEV_ENTRY 1580 WDEV_ENTRY
1581 CHAN_ENTRY 1581 CHAN_ENTRY
1582 __field(enum nl80211_channel_type, channel_type)
1583 __field(unsigned int, duration) 1582 __field(unsigned int, duration)
1584 ), 1583 ),
1585 TP_fast_assign( 1584 TP_fast_assign(
1586 WIPHY_ASSIGN; 1585 WIPHY_ASSIGN;
1587 WDEV_ASSIGN; 1586 WDEV_ASSIGN;
1588 CHAN_ASSIGN(chan); 1587 CHAN_ASSIGN(chan);
1589 __entry->channel_type = channel_type;
1590 __entry->duration = duration; 1588 __entry->duration = duration;
1591 ), 1589 ),
1592 TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", channel type: %d, duration: %u", 1590 TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", duration: %u",
1593 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->channel_type, 1591 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
1594 __entry->duration)
1595); 1592);
1596 1593
1597TRACE_EVENT(rdev_return_int_cookie, 1594TRACE_EVENT(rdev_return_int_cookie,
@@ -1631,18 +1628,13 @@ TRACE_EVENT(rdev_cancel_remain_on_channel,
1631TRACE_EVENT(rdev_mgmt_tx, 1628TRACE_EVENT(rdev_mgmt_tx,
1632 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, 1629 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1633 struct ieee80211_channel *chan, bool offchan, 1630 struct ieee80211_channel *chan, bool offchan,
1634 enum nl80211_channel_type channel_type, 1631 unsigned int wait, bool no_cck, bool dont_wait_for_ack),
1635 bool channel_type_valid, unsigned int wait, bool no_cck, 1632 TP_ARGS(wiphy, wdev, chan, offchan, wait, no_cck, dont_wait_for_ack),
1636 bool dont_wait_for_ack),
1637 TP_ARGS(wiphy, wdev, chan, offchan, channel_type, channel_type_valid,
1638 wait, no_cck, dont_wait_for_ack),
1639 TP_STRUCT__entry( 1633 TP_STRUCT__entry(
1640 WIPHY_ENTRY 1634 WIPHY_ENTRY
1641 WDEV_ENTRY 1635 WDEV_ENTRY
1642 CHAN_ENTRY 1636 CHAN_ENTRY
1643 __field(bool, offchan) 1637 __field(bool, offchan)
1644 __field(enum nl80211_channel_type, channel_type)
1645 __field(bool, channel_type_valid)
1646 __field(unsigned int, wait) 1638 __field(unsigned int, wait)
1647 __field(bool, no_cck) 1639 __field(bool, no_cck)
1648 __field(bool, dont_wait_for_ack) 1640 __field(bool, dont_wait_for_ack)
@@ -1652,18 +1644,14 @@ TRACE_EVENT(rdev_mgmt_tx,
1652 WDEV_ASSIGN; 1644 WDEV_ASSIGN;
1653 CHAN_ASSIGN(chan); 1645 CHAN_ASSIGN(chan);
1654 __entry->offchan = offchan; 1646 __entry->offchan = offchan;
1655 __entry->channel_type = channel_type;
1656 __entry->channel_type_valid = channel_type_valid;
1657 __entry->wait = wait; 1647 __entry->wait = wait;
1658 __entry->no_cck = no_cck; 1648 __entry->no_cck = no_cck;
1659 __entry->dont_wait_for_ack = dont_wait_for_ack; 1649 __entry->dont_wait_for_ack = dont_wait_for_ack;
1660 ), 1650 ),
1661 TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s, " 1651 TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s,"
1662 "channel type: %d, channel type valid: %s, wait: %u, " 1652 " wait: %u, no cck: %s, dont wait for ack: %s",
1663 "no cck: %s, dont wait for ack: %s",
1664 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, 1653 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
1665 BOOL_TO_STR(__entry->offchan), __entry->channel_type, 1654 BOOL_TO_STR(__entry->offchan), __entry->wait,
1666 BOOL_TO_STR(__entry->channel_type_valid), __entry->wait,
1667 BOOL_TO_STR(__entry->no_cck), 1655 BOOL_TO_STR(__entry->no_cck),
1668 BOOL_TO_STR(__entry->dont_wait_for_ack)) 1656 BOOL_TO_STR(__entry->dont_wait_for_ack))
1669); 1657);
@@ -1894,47 +1882,41 @@ TRACE_EVENT(cfg80211_michael_mic_failure,
1894TRACE_EVENT(cfg80211_ready_on_channel, 1882TRACE_EVENT(cfg80211_ready_on_channel,
1895 TP_PROTO(struct wireless_dev *wdev, u64 cookie, 1883 TP_PROTO(struct wireless_dev *wdev, u64 cookie,
1896 struct ieee80211_channel *chan, 1884 struct ieee80211_channel *chan,
1897 enum nl80211_channel_type channel_type, unsigned int duration), 1885 unsigned int duration),
1898 TP_ARGS(wdev, cookie, chan, channel_type, duration), 1886 TP_ARGS(wdev, cookie, chan, duration),
1899 TP_STRUCT__entry( 1887 TP_STRUCT__entry(
1900 WDEV_ENTRY 1888 WDEV_ENTRY
1901 __field(u64, cookie) 1889 __field(u64, cookie)
1902 CHAN_ENTRY 1890 CHAN_ENTRY
1903 __field(enum nl80211_channel_type, channel_type)
1904 __field(unsigned int, duration) 1891 __field(unsigned int, duration)
1905 ), 1892 ),
1906 TP_fast_assign( 1893 TP_fast_assign(
1907 WDEV_ASSIGN; 1894 WDEV_ASSIGN;
1908 __entry->cookie = cookie; 1895 __entry->cookie = cookie;
1909 CHAN_ASSIGN(chan); 1896 CHAN_ASSIGN(chan);
1910 __entry->channel_type = channel_type;
1911 __entry->duration = duration; 1897 __entry->duration = duration;
1912 ), 1898 ),
1913 TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d, duration: %u", 1899 TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
1914 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG, 1900 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
1915 __entry->channel_type, __entry->duration) 1901 __entry->duration)
1916); 1902);
1917 1903
1918TRACE_EVENT(cfg80211_ready_on_channel_expired, 1904TRACE_EVENT(cfg80211_ready_on_channel_expired,
1919 TP_PROTO(struct wireless_dev *wdev, u64 cookie, 1905 TP_PROTO(struct wireless_dev *wdev, u64 cookie,
1920 struct ieee80211_channel *chan, 1906 struct ieee80211_channel *chan),
1921 enum nl80211_channel_type channel_type), 1907 TP_ARGS(wdev, cookie, chan),
1922 TP_ARGS(wdev, cookie, chan, channel_type),
1923 TP_STRUCT__entry( 1908 TP_STRUCT__entry(
1924 WDEV_ENTRY 1909 WDEV_ENTRY
1925 __field(u64, cookie) 1910 __field(u64, cookie)
1926 CHAN_ENTRY 1911 CHAN_ENTRY
1927 __field(enum nl80211_channel_type, channel_type)
1928 ), 1912 ),
1929 TP_fast_assign( 1913 TP_fast_assign(
1930 WDEV_ASSIGN; 1914 WDEV_ASSIGN;
1931 __entry->cookie = cookie; 1915 __entry->cookie = cookie;
1932 CHAN_ASSIGN(chan); 1916 CHAN_ASSIGN(chan);
1933 __entry->channel_type = channel_type;
1934 ), 1917 ),
1935 TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d", 1918 TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
1936 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG, 1919 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
1937 __entry->channel_type)
1938); 1920);
1939 1921
1940TRACE_EVENT(cfg80211_new_sta, 1922TRACE_EVENT(cfg80211_new_sta,