aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c4
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.h2
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c2
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--include/linux/nl80211.h24
-rw-r--r--include/net/cfg80211.h25
-rw-r--r--net/mac80211/agg-tx.c2
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/debugfs.c4
-rw-r--r--net/mac80211/ibss.c2
-rw-r--r--net/mac80211/mlme.c2
-rw-r--r--net/mac80211/sta_info.c2
-rw-r--r--net/rfkill/core.c8
-rw-r--r--net/wireless/mlme.c11
-rw-r--r--net/wireless/nl80211.c34
-rw-r--r--net/wireless/nl80211.h5
-rw-r--r--net/wireless/reg.c39
17 files changed, 132 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 86aeef4b9d7..7089f8160ad 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1488,7 +1488,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
1488} 1488}
1489 1489
1490static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, 1490static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
1491 char *name, 1491 const char *name,
1492 enum nl80211_iftype type, 1492 enum nl80211_iftype type,
1493 u32 *flags, 1493 u32 *flags,
1494 struct vif_params *params) 1494 struct vif_params *params)
@@ -3477,7 +3477,7 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
3477 ar->num_vif--; 3477 ar->num_vif--;
3478} 3478}
3479 3479
3480struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, char *name, 3480struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
3481 enum nl80211_iftype type, 3481 enum nl80211_iftype type,
3482 u8 fw_vif_idx, u8 nw_type) 3482 u8 fw_vif_idx, u8 nw_type)
3483{ 3483{
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index 56b1ebe7981..780f77775a9 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -25,7 +25,7 @@ enum ath6kl_cfg_suspend_mode {
25 ATH6KL_CFG_SUSPEND_SCHED_SCAN, 25 ATH6KL_CFG_SUSPEND_SCHED_SCAN,
26}; 26};
27 27
28struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, char *name, 28struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
29 enum nl80211_iftype type, 29 enum nl80211_iftype type,
30 u8 fw_vif_idx, u8 nw_type); 30 u8 fw_vif_idx, u8 nw_type);
31void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, 31void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index aa619186d9b..c24824f8c8a 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1636,7 +1636,7 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
1636 * create a new virtual interface with the given name 1636 * create a new virtual interface with the given name
1637 */ 1637 */
1638struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 1638struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1639 char *name, 1639 const char *name,
1640 enum nl80211_iftype type, 1640 enum nl80211_iftype type,
1641 u32 *flags, 1641 u32 *flags,
1642 struct vif_params *params) 1642 struct vif_params *params)
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 92e57f653a3..90b64b01544 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1033,7 +1033,7 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
1033 struct mwifiex_bssdescriptor *bss_desc); 1033 struct mwifiex_bssdescriptor *bss_desc);
1034 1034
1035struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 1035struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1036 char *name, 1036 const char *name,
1037 enum nl80211_iftype type, 1037 enum nl80211_iftype type,
1038 u32 *flags, 1038 u32 *flags,
1039 struct vif_params *params); 1039 struct vif_params *params);
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 45841627934..7df9b500c80 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -573,6 +573,11 @@
573 * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by 573 * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
574 * its %NL80211_ATTR_WDEV identifier. 574 * its %NL80211_ATTR_WDEV identifier.
575 * 575 *
576 * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
577 * notify userspace that AP has rejected the connection request from a
578 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
579 * is used for this.
580 *
576 * @NL80211_CMD_MAX: highest used command number 581 * @NL80211_CMD_MAX: highest used command number
577 * @__NL80211_CMD_AFTER_LAST: internal use 582 * @__NL80211_CMD_AFTER_LAST: internal use
578 */ 583 */
@@ -719,6 +724,8 @@ enum nl80211_commands {
719 NL80211_CMD_START_P2P_DEVICE, 724 NL80211_CMD_START_P2P_DEVICE,
720 NL80211_CMD_STOP_P2P_DEVICE, 725 NL80211_CMD_STOP_P2P_DEVICE,
721 726
727 NL80211_CMD_CONN_FAILED,
728
722 /* add new commands above here */ 729 /* add new commands above here */
723 730
724 /* used to define NL80211_CMD_MAX below */ 731 /* used to define NL80211_CMD_MAX below */
@@ -1262,6 +1269,10 @@ enum nl80211_commands {
1262 * was used to provide the hint. For the different types of 1269 * was used to provide the hint. For the different types of
1263 * allowed user regulatory hints see nl80211_user_reg_hint_type. 1270 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1264 * 1271 *
1272 * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
1273 * the connection request from a station. nl80211_connect_failed_reason
1274 * enum has different reasons of connection failure.
1275 *
1265 * @NL80211_ATTR_MAX: highest attribute number currently defined 1276 * @NL80211_ATTR_MAX: highest attribute number currently defined
1266 * @__NL80211_ATTR_AFTER_LAST: internal use 1277 * @__NL80211_ATTR_AFTER_LAST: internal use
1267 */ 1278 */
@@ -1517,6 +1528,8 @@ enum nl80211_attrs {
1517 1528
1518 NL80211_ATTR_USER_REG_HINT_TYPE, 1529 NL80211_ATTR_USER_REG_HINT_TYPE,
1519 1530
1531 NL80211_ATTR_CONN_FAILED_REASON,
1532
1520 /* add attributes here, update the policy in nl80211.c */ 1533 /* add attributes here, update the policy in nl80211.c */
1521 1534
1522 __NL80211_ATTR_AFTER_LAST, 1535 __NL80211_ATTR_AFTER_LAST,
@@ -3045,4 +3058,15 @@ enum nl80211_probe_resp_offload_support_attr {
3045 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, 3058 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
3046}; 3059};
3047 3060
3061/**
3062 * enum nl80211_connect_failed_reason - connection request failed reasons
3063 * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
3064 * handled by the AP is reached.
3065 * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist.
3066 */
3067enum nl80211_connect_failed_reason {
3068 NL80211_CONN_FAIL_MAX_CLIENTS,
3069 NL80211_CONN_FAIL_BLOCKED_CLIENT,
3070};
3071
3048#endif /* __LINUX_NL80211_H */ 3072#endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 903683b1e5b..ab78b53bd6f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1580,9 +1580,7 @@ struct cfg80211_gtk_rekey_data {
1580 * @set_cqm_txe_config: Configure connection quality monitor TX error 1580 * @set_cqm_txe_config: Configure connection quality monitor TX error
1581 * thresholds. 1581 * thresholds.
1582 * @sched_scan_start: Tell the driver to start a scheduled scan. 1582 * @sched_scan_start: Tell the driver to start a scheduled scan.
1583 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled 1583 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan.
1584 * scan. The driver_initiated flag specifies whether the driver
1585 * itself has informed that the scan has stopped.
1586 * 1584 *
1587 * @mgmt_frame_register: Notify driver that a management frame type was 1585 * @mgmt_frame_register: Notify driver that a management frame type was
1588 * registered. Note that this callback may not sleep, and cannot run 1586 * registered. Note that this callback may not sleep, and cannot run
@@ -1630,7 +1628,7 @@ struct cfg80211_ops {
1630 void (*set_wakeup)(struct wiphy *wiphy, bool enabled); 1628 void (*set_wakeup)(struct wiphy *wiphy, bool enabled);
1631 1629
1632 struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, 1630 struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy,
1633 char *name, 1631 const char *name,
1634 enum nl80211_iftype type, 1632 enum nl80211_iftype type,
1635 u32 *flags, 1633 u32 *flags,
1636 struct vif_params *params); 1634 struct vif_params *params);
@@ -3363,6 +3361,25 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
3363void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); 3361void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3364 3362
3365/** 3363/**
3364 * cfg80211_conn_failed - connection request failed notification
3365 *
3366 * @dev: the netdev
3367 * @mac_addr: the station's address
3368 * @reason: the reason for connection failure
3369 * @gfp: allocation flags
3370 *
3371 * Whenever a station tries to connect to an AP and if the station
3372 * could not connect to the AP as the AP has rejected the connection
3373 * for some reasons, this function is called.
3374 *
3375 * The reason for connection failure can be any of the value from
3376 * nl80211_connect_failed_reason enum
3377 */
3378void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3379 enum nl80211_connect_failed_reason reason,
3380 gfp_t gfp);
3381
3382/**
3366 * cfg80211_rx_mgmt - notification of received, unprocessed management frame 3383 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
3367 * @wdev: wireless device receiving the frame 3384 * @wdev: wireless device receiving the frame
3368 * @freq: Frequency on which the frame was received in MHz 3385 * @freq: Frequency on which the frame was received in MHz
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index d0deb3edae2..3195a6307f5 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -869,7 +869,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
869 869
870 } else { 870 } else {
871 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR, 871 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR,
872 true); 872 false);
873 } 873 }
874 874
875 out: 875 out:
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9bd56a74498..05f3a313db8 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -20,7 +20,8 @@
20#include "rate.h" 20#include "rate.h"
21#include "mesh.h" 21#include "mesh.h"
22 22
23static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, char *name, 23static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
24 const char *name,
24 enum nl80211_iftype type, 25 enum nl80211_iftype type,
25 u32 *flags, 26 u32 *flags,
26 struct vif_params *params) 27 struct vif_params *params)
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 97173f8144d..466f4b45dd9 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -70,6 +70,7 @@ DEBUGFS_READONLY_FILE(wep_iv, "%#08x",
70DEBUGFS_READONLY_FILE(rate_ctrl_alg, "%s", 70DEBUGFS_READONLY_FILE(rate_ctrl_alg, "%s",
71 local->rate_ctrl ? local->rate_ctrl->ops->name : "hw/driver"); 71 local->rate_ctrl ? local->rate_ctrl->ops->name : "hw/driver");
72 72
73#ifdef CONFIG_PM
73static ssize_t reset_write(struct file *file, const char __user *user_buf, 74static ssize_t reset_write(struct file *file, const char __user *user_buf,
74 size_t count, loff_t *ppos) 75 size_t count, loff_t *ppos)
75{ 76{
@@ -88,6 +89,7 @@ static const struct file_operations reset_ops = {
88 .open = simple_open, 89 .open = simple_open,
89 .llseek = noop_llseek, 90 .llseek = noop_llseek,
90}; 91};
92#endif
91 93
92static ssize_t hwflags_read(struct file *file, char __user *user_buf, 94static ssize_t hwflags_read(struct file *file, char __user *user_buf,
93 size_t count, loff_t *ppos) 95 size_t count, loff_t *ppos)
@@ -245,7 +247,9 @@ void debugfs_hw_add(struct ieee80211_local *local)
245 DEBUGFS_ADD(total_ps_buffered); 247 DEBUGFS_ADD(total_ps_buffered);
246 DEBUGFS_ADD(wep_iv); 248 DEBUGFS_ADD(wep_iv);
247 DEBUGFS_ADD(queues); 249 DEBUGFS_ADD(queues);
250#ifdef CONFIG_PM
248 DEBUGFS_ADD_MODE(reset, 0200); 251 DEBUGFS_ADD_MODE(reset, 0200);
252#endif
249 DEBUGFS_ADD(hwflags); 253 DEBUGFS_ADD(hwflags);
250 DEBUGFS_ADD(user_power); 254 DEBUGFS_ADD(user_power);
251 DEBUGFS_ADD(power); 255 DEBUGFS_ADD(power);
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 7c082517f0c..5f3620f0bc0 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -278,7 +278,7 @@ static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
278 if (auth && !sdata->u.ibss.auth_frame_registrations) { 278 if (auth && !sdata->u.ibss.auth_frame_registrations) {
279 ibss_dbg(sdata, 279 ibss_dbg(sdata,
280 "TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n", 280 "TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n",
281 sdata->vif.addr, sdata->u.ibss.bssid, addr); 281 sdata->vif.addr, addr, sdata->u.ibss.bssid);
282 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, NULL, 0, 282 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, NULL, 0,
283 addr, sdata->u.ibss.bssid, NULL, 0, 0); 283 addr, sdata->u.ibss.bssid, NULL, 0, 0);
284 } 284 }
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2dbd9e1e358..e714ed8bb19 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1399,7 +1399,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1399 sta = sta_info_get(sdata, ifmgd->bssid); 1399 sta = sta_info_get(sdata, ifmgd->bssid);
1400 if (sta) { 1400 if (sta) {
1401 set_sta_flag(sta, WLAN_STA_BLOCK_BA); 1401 set_sta_flag(sta, WLAN_STA_BLOCK_BA);
1402 ieee80211_sta_tear_down_BA_sessions(sta, tx); 1402 ieee80211_sta_tear_down_BA_sessions(sta, false);
1403 } 1403 }
1404 mutex_unlock(&local->sta_mtx); 1404 mutex_unlock(&local->sta_mtx);
1405 1405
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 9c8cd8b8f75..797dd36a220 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -738,7 +738,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
738 * will be sufficient. 738 * will be sufficient.
739 */ 739 */
740 set_sta_flag(sta, WLAN_STA_BLOCK_BA); 740 set_sta_flag(sta, WLAN_STA_BLOCK_BA);
741 ieee80211_sta_tear_down_BA_sessions(sta, true); 741 ieee80211_sta_tear_down_BA_sessions(sta, false);
742 742
743 ret = sta_info_hash_del(local, sta); 743 ret = sta_info_hash_del(local, sta);
744 if (ret) 744 if (ret)
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index c275bad1206..a5c95274127 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -270,6 +270,7 @@ static bool __rfkill_set_hw_state(struct rfkill *rfkill,
270static void rfkill_set_block(struct rfkill *rfkill, bool blocked) 270static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
271{ 271{
272 unsigned long flags; 272 unsigned long flags;
273 bool prev, curr;
273 int err; 274 int err;
274 275
275 if (unlikely(rfkill->dev.power.power_state.event & PM_EVENT_SLEEP)) 276 if (unlikely(rfkill->dev.power.power_state.event & PM_EVENT_SLEEP))
@@ -284,6 +285,8 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
284 rfkill->ops->query(rfkill, rfkill->data); 285 rfkill->ops->query(rfkill, rfkill->data);
285 286
286 spin_lock_irqsave(&rfkill->lock, flags); 287 spin_lock_irqsave(&rfkill->lock, flags);
288 prev = rfkill->state & RFKILL_BLOCK_SW;
289
287 if (rfkill->state & RFKILL_BLOCK_SW) 290 if (rfkill->state & RFKILL_BLOCK_SW)
288 rfkill->state |= RFKILL_BLOCK_SW_PREV; 291 rfkill->state |= RFKILL_BLOCK_SW_PREV;
289 else 292 else
@@ -313,10 +316,13 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
313 } 316 }
314 rfkill->state &= ~RFKILL_BLOCK_SW_SETCALL; 317 rfkill->state &= ~RFKILL_BLOCK_SW_SETCALL;
315 rfkill->state &= ~RFKILL_BLOCK_SW_PREV; 318 rfkill->state &= ~RFKILL_BLOCK_SW_PREV;
319 curr = rfkill->state & RFKILL_BLOCK_SW;
316 spin_unlock_irqrestore(&rfkill->lock, flags); 320 spin_unlock_irqrestore(&rfkill->lock, flags);
317 321
318 rfkill_led_trigger_event(rfkill); 322 rfkill_led_trigger_event(rfkill);
319 rfkill_event(rfkill); 323
324 if (prev != curr)
325 rfkill_event(rfkill);
320} 326}
321 327
322#ifdef CONFIG_RFKILL_INPUT 328#ifdef CONFIG_RFKILL_INPUT
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 8fd0242ee16..3df195a3e33 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -612,6 +612,17 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp)
612} 612}
613EXPORT_SYMBOL(cfg80211_del_sta); 613EXPORT_SYMBOL(cfg80211_del_sta);
614 614
615void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
616 enum nl80211_connect_failed_reason reason,
617 gfp_t gfp)
618{
619 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
620 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
621
622 nl80211_send_conn_failed_event(rdev, dev, mac_addr, reason, gfp);
623}
624EXPORT_SYMBOL(cfg80211_conn_failed);
625
615struct cfg80211_mgmt_registration { 626struct cfg80211_mgmt_registration {
616 struct list_head list; 627 struct list_head list;
617 628
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 222189b6ed5..f1047aea868 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8364,6 +8364,40 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev,
8364 nlmsg_free(msg); 8364 nlmsg_free(msg);
8365} 8365}
8366 8366
8367void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev,
8368 struct net_device *dev, const u8 *mac_addr,
8369 enum nl80211_connect_failed_reason reason,
8370 gfp_t gfp)
8371{
8372 struct sk_buff *msg;
8373 void *hdr;
8374
8375 msg = nlmsg_new(NLMSG_GOODSIZE, gfp);
8376 if (!msg)
8377 return;
8378
8379 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONN_FAILED);
8380 if (!hdr) {
8381 nlmsg_free(msg);
8382 return;
8383 }
8384
8385 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
8386 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
8387 nla_put_u32(msg, NL80211_ATTR_CONN_FAILED_REASON, reason))
8388 goto nla_put_failure;
8389
8390 genlmsg_end(msg, hdr);
8391
8392 genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
8393 nl80211_mlme_mcgrp.id, gfp);
8394 return;
8395
8396 nla_put_failure:
8397 genlmsg_cancel(msg, hdr);
8398 nlmsg_free(msg);
8399}
8400
8367static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, 8401static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
8368 const u8 *addr, gfp_t gfp) 8402 const u8 *addr, gfp_t gfp)
8369{ 8403{
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index 9f2616fffb4..f6153516068 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -91,6 +91,11 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev,
91 struct net_device *dev, const u8 *mac_addr, 91 struct net_device *dev, const u8 *mac_addr,
92 gfp_t gfp); 92 gfp_t gfp);
93 93
94void nl80211_send_conn_failed_event(struct cfg80211_registered_device *rdev,
95 struct net_device *dev, const u8 *mac_addr,
96 enum nl80211_connect_failed_reason reason,
97 gfp_t gfp);
98
94int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, 99int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
95 struct wireless_dev *wdev, u32 nlpid, 100 struct wireless_dev *wdev, u32 nlpid,
96 int freq, int sig_dbm, 101 int freq, int sig_dbm,
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ad04e54014..844823973da 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -504,9 +504,11 @@ static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range,
504 * 504 *
505 * This lets us know if a specific frequency rule is or is not relevant to 505 * This lets us know if a specific frequency rule is or is not relevant to
506 * a specific frequency's band. Bands are device specific and artificial 506 * a specific frequency's band. Bands are device specific and artificial
507 * definitions (the "2.4 GHz band" and the "5 GHz band"), however it is 507 * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"),
508 * safe for now to assume that a frequency rule should not be part of a 508 * however it is safe for now to assume that a frequency rule should not be
509 * frequency's band if the start freq or end freq are off by more than 2 GHz. 509 * part of a frequency's band if the start freq or end freq are off by more
510 * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the
511 * 60 GHz band.
510 * This resolution can be lowered and should be considered as we add 512 * This resolution can be lowered and should be considered as we add
511 * regulatory rule support for other "bands". 513 * regulatory rule support for other "bands".
512 **/ 514 **/
@@ -514,9 +516,16 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
514 u32 freq_khz) 516 u32 freq_khz)
515{ 517{
516#define ONE_GHZ_IN_KHZ 1000000 518#define ONE_GHZ_IN_KHZ 1000000
517 if (abs(freq_khz - freq_range->start_freq_khz) <= (2 * ONE_GHZ_IN_KHZ)) 519 /*
520 * From 802.11ad: directional multi-gigabit (DMG):
521 * Pertaining to operation in a frequency band containing a channel
522 * with the Channel starting frequency above 45 GHz.
523 */
524 u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ?
525 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
526 if (abs(freq_khz - freq_range->start_freq_khz) <= limit)
518 return true; 527 return true;
519 if (abs(freq_khz - freq_range->end_freq_khz) <= (2 * ONE_GHZ_IN_KHZ)) 528 if (abs(freq_khz - freq_range->end_freq_khz) <= limit)
520 return true; 529 return true;
521 return false; 530 return false;
522#undef ONE_GHZ_IN_KHZ 531#undef ONE_GHZ_IN_KHZ
@@ -2193,7 +2202,6 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd)
2193static int __set_regdom(const struct ieee80211_regdomain *rd) 2202static int __set_regdom(const struct ieee80211_regdomain *rd)
2194{ 2203{
2195 const struct ieee80211_regdomain *intersected_rd = NULL; 2204 const struct ieee80211_regdomain *intersected_rd = NULL;
2196 struct cfg80211_registered_device *rdev = NULL;
2197 struct wiphy *request_wiphy; 2205 struct wiphy *request_wiphy;
2198 /* Some basic sanity checks first */ 2206 /* Some basic sanity checks first */
2199 2207
@@ -2305,24 +2313,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2305 return 0; 2313 return 0;
2306 } 2314 }
2307 2315
2308 if (!intersected_rd) 2316 return -EINVAL;
2309 return -EINVAL;
2310
2311 rdev = wiphy_to_dev(request_wiphy);
2312
2313 rdev->country_ie_alpha2[0] = rd->alpha2[0];
2314 rdev->country_ie_alpha2[1] = rd->alpha2[1];
2315 rdev->env = last_request->country_ie_env;
2316
2317 BUG_ON(intersected_rd == rd);
2318
2319 kfree(rd);
2320 rd = NULL;
2321
2322 reset_regdomains(false);
2323 cfg80211_regdomain = intersected_rd;
2324
2325 return 0;
2326} 2317}
2327 2318
2328 2319