aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c7
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c5
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c1
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c16
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c1
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c3
9 files changed, 10 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index d615f9f7506a..74091d33ed6c 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2976,7 +2976,6 @@ static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev,
2976static int ath6kl_remain_on_channel(struct wiphy *wiphy, 2976static int ath6kl_remain_on_channel(struct wiphy *wiphy,
2977 struct wireless_dev *wdev, 2977 struct wireless_dev *wdev,
2978 struct ieee80211_channel *chan, 2978 struct ieee80211_channel *chan,
2979 enum nl80211_channel_type channel_type,
2980 unsigned int duration, 2979 unsigned int duration,
2981 u64 *cookie) 2980 u64 *cookie)
2982{ 2981{
@@ -3135,10 +3134,8 @@ static bool ath6kl_is_p2p_go_ssid(const u8 *buf, size_t len)
3135 3134
3136static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 3135static int ath6kl_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
3137 struct ieee80211_channel *chan, bool offchan, 3136 struct ieee80211_channel *chan, bool offchan,
3138 enum nl80211_channel_type channel_type, 3137 unsigned int wait, const u8 *buf, size_t len,
3139 bool channel_type_valid, unsigned int wait, 3138 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
3140 const u8 *buf, size_t len, bool no_cck,
3141 bool dont_wait_for_ack, u64 *cookie)
3142{ 3139{
3143 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev); 3140 struct ath6kl_vif *vif = ath6kl_vif_from_wdev(wdev);
3144 struct ath6kl *ar = ath6kl_priv(vif->ndev); 3141 struct ath6kl *ar = ath6kl_priv(vif->ndev);
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index c30ab4b11d61..0e05c41cdcfc 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -474,7 +474,7 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
474 return -EINVAL; 474 return -EINVAL;
475 } 475 }
476 id = vif->last_roc_id; 476 id = vif->last_roc_id;
477 cfg80211_ready_on_channel(&vif->wdev, id, chan, NL80211_CHAN_NO_HT, 477 cfg80211_ready_on_channel(&vif->wdev, id, chan,
478 dur, GFP_ATOMIC); 478 dur, GFP_ATOMIC);
479 479
480 return 0; 480 return 0;
@@ -513,8 +513,7 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
513 else 513 else
514 id = vif->last_roc_id; /* timeout on uncanceled r-o-c */ 514 id = vif->last_roc_id; /* timeout on uncanceled r-o-c */
515 vif->last_cancel_roc_id = 0; 515 vif->last_cancel_roc_id = 0;
516 cfg80211_remain_on_channel_expired(&vif->wdev, id, chan, 516 cfg80211_remain_on_channel_expired(&vif->wdev, id, chan, GFP_ATOMIC);
517 NL80211_CHAN_NO_HT, GFP_ATOMIC);
518 517
519 return 0; 518 return 0;
520} 519}
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 8141f91c3725..29c571a56251 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -789,7 +789,6 @@ struct iwl_priv {
789 /* remain-on-channel offload support */ 789 /* remain-on-channel offload support */
790 struct ieee80211_channel *hw_roc_channel; 790 struct ieee80211_channel *hw_roc_channel;
791 struct delayed_work hw_roc_disable_work; 791 struct delayed_work hw_roc_disable_work;
792 enum nl80211_channel_type hw_roc_chantype;
793 int hw_roc_duration; 792 int hw_roc_duration;
794 bool hw_roc_setup, hw_roc_start_notified; 793 bool hw_roc_setup, hw_roc_start_notified;
795 794
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index e75d80341f28..852edb02e5f6 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -1034,7 +1034,6 @@ done:
1034static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw, 1034static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
1035 struct ieee80211_vif *vif, 1035 struct ieee80211_vif *vif,
1036 struct ieee80211_channel *channel, 1036 struct ieee80211_channel *channel,
1037 enum nl80211_channel_type channel_type,
1038 int duration) 1037 int duration)
1039{ 1038{
1040 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); 1039 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
@@ -1066,7 +1065,6 @@ static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
1066 } 1065 }
1067 1066
1068 priv->hw_roc_channel = channel; 1067 priv->hw_roc_channel = channel;
1069 priv->hw_roc_chantype = channel_type;
1070 /* convert from ms to TU */ 1068 /* convert from ms to TU */
1071 priv->hw_roc_duration = DIV_ROUND_UP(1000 * duration, 1024); 1069 priv->hw_roc_duration = DIV_ROUND_UP(1000 * duration, 1024);
1072 priv->hw_roc_start_notified = false; 1070 priv->hw_roc_start_notified = false;
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 3baa51f1bb83..b0338543547b 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1455,7 +1455,6 @@ static void hw_roc_done(struct work_struct *work)
1455static int mac80211_hwsim_roc(struct ieee80211_hw *hw, 1455static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
1456 struct ieee80211_vif *vif, 1456 struct ieee80211_vif *vif,
1457 struct ieee80211_channel *chan, 1457 struct ieee80211_channel *chan,
1458 enum nl80211_channel_type channel_type,
1459 int duration) 1458 int duration)
1460{ 1459{
1461 struct mac80211_hwsim_data *hwsim = hw->priv; 1460 struct mac80211_hwsim_data *hwsim = hw->priv;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 8e829b251d83..f69190b492aa 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -180,10 +180,8 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
180static int 180static int
181mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 181mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
182 struct ieee80211_channel *chan, bool offchan, 182 struct ieee80211_channel *chan, bool offchan,
183 enum nl80211_channel_type channel_type, 183 unsigned int wait, const u8 *buf, size_t len,
184 bool channel_type_valid, unsigned int wait, 184 bool no_cck, bool dont_wait_for_ack, u64 *cookie)
185 const u8 *buf, size_t len, bool no_cck,
186 bool dont_wait_for_ack, u64 *cookie)
187{ 185{
188 struct sk_buff *skb; 186 struct sk_buff *skb;
189 u16 pkt_len; 187 u16 pkt_len;
@@ -253,7 +251,6 @@ static int
253mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy, 251mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
254 struct wireless_dev *wdev, 252 struct wireless_dev *wdev,
255 struct ieee80211_channel *chan, 253 struct ieee80211_channel *chan,
256 enum nl80211_channel_type channel_type,
257 unsigned int duration, u64 *cookie) 254 unsigned int duration, u64 *cookie)
258{ 255{
259 struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); 256 struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
@@ -271,15 +268,14 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
271 } 268 }
272 269
273 ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET, chan, 270 ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_SET, chan,
274 &channel_type, duration); 271 duration);
275 272
276 if (!ret) { 273 if (!ret) {
277 *cookie = random32() | 1; 274 *cookie = random32() | 1;
278 priv->roc_cfg.cookie = *cookie; 275 priv->roc_cfg.cookie = *cookie;
279 priv->roc_cfg.chan = *chan; 276 priv->roc_cfg.chan = *chan;
280 priv->roc_cfg.chan_type = channel_type;
281 277
282 cfg80211_ready_on_channel(wdev, *cookie, chan, channel_type, 278 cfg80211_ready_on_channel(wdev, *cookie, chan,
283 duration, GFP_ATOMIC); 279 duration, GFP_ATOMIC);
284 280
285 wiphy_dbg(wiphy, "info: ROC, cookie = 0x%llx\n", *cookie); 281 wiphy_dbg(wiphy, "info: ROC, cookie = 0x%llx\n", *cookie);
@@ -302,13 +298,11 @@ mwifiex_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
302 return -ENOENT; 298 return -ENOENT;
303 299
304 ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE, 300 ret = mwifiex_remain_on_chan_cfg(priv, HostCmd_ACT_GEN_REMOVE,
305 &priv->roc_cfg.chan, 301 &priv->roc_cfg.chan, 0);
306 &priv->roc_cfg.chan_type, 0);
307 302
308 if (!ret) { 303 if (!ret) {
309 cfg80211_remain_on_channel_expired(wdev, cookie, 304 cfg80211_remain_on_channel_expired(wdev, cookie,
310 &priv->roc_cfg.chan, 305 &priv->roc_cfg.chan,
311 priv->roc_cfg.chan_type,
312 GFP_ATOMIC); 306 GFP_ATOMIC);
313 307
314 memset(&priv->roc_cfg, 0, sizeof(struct mwifiex_roc_cfg)); 308 memset(&priv->roc_cfg, 0, sizeof(struct mwifiex_roc_cfg));
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 81f8772dcb07..771717df1c59 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -371,7 +371,6 @@ struct wps {
371struct mwifiex_roc_cfg { 371struct mwifiex_roc_cfg {
372 u64 cookie; 372 u64 cookie;
373 struct ieee80211_channel chan; 373 struct ieee80211_channel chan;
374 enum nl80211_channel_type chan_type;
375}; 374};
376 375
377struct mwifiex_adapter; 376struct mwifiex_adapter;
@@ -1016,7 +1015,6 @@ int mwifiex_get_ver_ext(struct mwifiex_private *priv);
1016 1015
1017int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action, 1016int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
1018 struct ieee80211_channel *chan, 1017 struct ieee80211_channel *chan,
1019 enum nl80211_channel_type *channel_type,
1020 unsigned int duration); 1018 unsigned int duration);
1021 1019
1022int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role); 1020int mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role);
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 8132119e1a21..78dfa31c908c 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -424,7 +424,6 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
424 cfg80211_remain_on_channel_expired(priv->wdev, 424 cfg80211_remain_on_channel_expired(priv->wdev,
425 priv->roc_cfg.cookie, 425 priv->roc_cfg.cookie,
426 &priv->roc_cfg.chan, 426 &priv->roc_cfg.chan,
427 priv->roc_cfg.chan_type,
428 GFP_ATOMIC); 427 GFP_ATOMIC);
429 428
430 memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg)); 429 memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg));
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 552d72ed055a..24af6ba7d8a1 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1046,7 +1046,6 @@ mwifiex_get_ver_ext(struct mwifiex_private *priv)
1046int 1046int
1047mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action, 1047mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
1048 struct ieee80211_channel *chan, 1048 struct ieee80211_channel *chan,
1049 enum nl80211_channel_type *ct,
1050 unsigned int duration) 1049 unsigned int duration)
1051{ 1050{
1052 struct host_cmd_ds_remain_on_chan roc_cfg; 1051 struct host_cmd_ds_remain_on_chan roc_cfg;
@@ -1056,7 +1055,7 @@ mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action,
1056 roc_cfg.action = cpu_to_le16(action); 1055 roc_cfg.action = cpu_to_le16(action);
1057 if (action == HostCmd_ACT_GEN_SET) { 1056 if (action == HostCmd_ACT_GEN_SET) {
1058 roc_cfg.band_cfg = chan->band; 1057 roc_cfg.band_cfg = chan->band;
1059 sc = mwifiex_chan_type_to_sec_chan_offset(*ct); 1058 sc = mwifiex_chan_type_to_sec_chan_offset(NL80211_CHAN_NO_HT);
1060 roc_cfg.band_cfg |= (sc << 2); 1059 roc_cfg.band_cfg |= (sc << 2);
1061 1060
1062 roc_cfg.channel = 1061 roc_cfg.channel =