diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/agg-tx.c | 2 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/debugfs.c | 4 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
-rw-r--r-- | net/rfkill/core.c | 8 | ||||
-rw-r--r-- | net/wireless/mlme.c | 11 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 34 | ||||
-rw-r--r-- | net/wireless/nl80211.h | 5 | ||||
-rw-r--r-- | net/wireless/reg.c | 39 |
11 files changed, 82 insertions, 30 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index d0deb3edae21..3195a6307f50 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 9bd56a744982..05f3a313db88 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 | ||
23 | static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, char *name, | 23 | static 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 97173f8144d4..466f4b45dd94 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -70,6 +70,7 @@ DEBUGFS_READONLY_FILE(wep_iv, "%#08x", | |||
70 | DEBUGFS_READONLY_FILE(rate_ctrl_alg, "%s", | 70 | DEBUGFS_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 | ||
73 | static ssize_t reset_write(struct file *file, const char __user *user_buf, | 74 | static 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 | ||
92 | static ssize_t hwflags_read(struct file *file, char __user *user_buf, | 94 | static 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 7c082517f0c7..5f3620f0bc0a 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 2dbd9e1e3583..e714ed8bb198 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 9c8cd8b8f753..797dd36a220d 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 c275bad12068..a5c952741279 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -270,6 +270,7 @@ static bool __rfkill_set_hw_state(struct rfkill *rfkill, | |||
270 | static void rfkill_set_block(struct rfkill *rfkill, bool blocked) | 270 | static 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 8fd0242ee169..3df195a3e336 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 | } |
613 | EXPORT_SYMBOL(cfg80211_del_sta); | 613 | EXPORT_SYMBOL(cfg80211_del_sta); |
614 | 614 | ||
615 | void 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 | } | ||
624 | EXPORT_SYMBOL(cfg80211_conn_failed); | ||
625 | |||
615 | struct cfg80211_mgmt_registration { | 626 | struct 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 222189b6ed53..f1047aea868a 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 | ||
8367 | void 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 | |||
8367 | static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | 8401 | static 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 9f2616fffb40..f6153516068c 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 | ||
94 | void 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 | |||
94 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 99 | int 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 1ad04e54014c..844823973daf 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) | |||
2193 | static int __set_regdom(const struct ieee80211_regdomain *rd) | 2202 | static 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 | ||