aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c33
-rw-r--r--net/mac80211/mlme.c12
-rw-r--r--net/mac80211/rx.c5
-rw-r--r--net/mac80211/status.c2
-rw-r--r--net/mac80211/util.c27
-rw-r--r--net/wireless/core.c6
-rw-r--r--net/wireless/nl80211.c45
-rw-r--r--net/wireless/util.c25
8 files changed, 98 insertions, 57 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index fd6860d7f557..ff090ef1ea2c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -428,11 +428,13 @@ void sta_set_rate_info_tx(struct sta_info *sta,
428 rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift); 428 rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift);
429 } 429 }
430 if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) 430 if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
431 rinfo->flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; 431 rinfo->bw = RATE_INFO_BW_40;
432 if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) 432 else if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
433 rinfo->flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH; 433 rinfo->bw = RATE_INFO_BW_80;
434 if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH) 434 else if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH)
435 rinfo->flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH; 435 rinfo->bw = RATE_INFO_BW_160;
436 else
437 rinfo->bw = RATE_INFO_BW_20;
436 if (rate->flags & IEEE80211_TX_RC_SHORT_GI) 438 if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
437 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 439 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
438} 440}
@@ -459,16 +461,21 @@ void sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo)
459 rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift); 461 rinfo->legacy = DIV_ROUND_UP(brate, 1 << shift);
460 } 462 }
461 463
462 if (sta->last_rx_rate_flag & RX_FLAG_40MHZ)
463 rinfo->flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
464 if (sta->last_rx_rate_flag & RX_FLAG_SHORT_GI) 464 if (sta->last_rx_rate_flag & RX_FLAG_SHORT_GI)
465 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; 465 rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
466 if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_80MHZ) 466
467 rinfo->flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH; 467 if (sta->last_rx_rate_flag & RX_FLAG_5MHZ)
468 if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_80P80MHZ) 468 rinfo->bw = RATE_INFO_BW_5;
469 rinfo->flags |= RATE_INFO_FLAGS_80P80_MHZ_WIDTH; 469 else if (sta->last_rx_rate_flag & RX_FLAG_10MHZ)
470 if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_160MHZ) 470 rinfo->bw = RATE_INFO_BW_10;
471 rinfo->flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH; 471 else if (sta->last_rx_rate_flag & RX_FLAG_40MHZ)
472 rinfo->bw = RATE_INFO_BW_40;
473 else if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_80MHZ)
474 rinfo->bw = RATE_INFO_BW_80;
475 else if (sta->last_rx_rate_vht_flag & RX_VHT_FLAG_160MHZ)
476 rinfo->bw = RATE_INFO_BW_160;
477 else
478 rinfo->bw = RATE_INFO_BW_20;
472} 479}
473 480
474static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev, 481static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c0711082a2b8..1875181ebd94 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2453,6 +2453,12 @@ static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
2453 sdata_assert_lock(sdata); 2453 sdata_assert_lock(sdata);
2454 2454
2455 if (!assoc) { 2455 if (!assoc) {
2456 /*
2457 * we are not authenticated yet, the only timer that could be
2458 * running is the timeout for the authentication response which
2459 * which is not relevant anymore.
2460 */
2461 del_timer_sync(&sdata->u.mgd.timer);
2456 sta_info_destroy_addr(sdata, auth_data->bss->bssid); 2462 sta_info_destroy_addr(sdata, auth_data->bss->bssid);
2457 2463
2458 memset(sdata->u.mgd.bssid, 0, ETH_ALEN); 2464 memset(sdata->u.mgd.bssid, 0, ETH_ALEN);
@@ -2760,6 +2766,12 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
2760 sdata_assert_lock(sdata); 2766 sdata_assert_lock(sdata);
2761 2767
2762 if (!assoc) { 2768 if (!assoc) {
2769 /*
2770 * we are not associated yet, the only timer that could be
2771 * running is the timeout for the association response which
2772 * which is not relevant anymore.
2773 */
2774 del_timer_sync(&sdata->u.mgd.timer);
2763 sta_info_destroy_addr(sdata, assoc_data->bss->bssid); 2775 sta_info_destroy_addr(sdata, assoc_data->bss->bssid);
2764 2776
2765 memset(sdata->u.mgd.bssid, 0, ETH_ALEN); 2777 memset(sdata->u.mgd.bssid, 0, ETH_ALEN);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 3a1a3ba40bd8..3d79d498e7f6 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -361,9 +361,6 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
361 u16 known = local->hw.radiotap_vht_details; 361 u16 known = local->hw.radiotap_vht_details;
362 362
363 rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_VHT); 363 rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_VHT);
364 /* known field - how to handle 80+80? */
365 if (status->vht_flag & RX_VHT_FLAG_80P80MHZ)
366 known &= ~IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
367 put_unaligned_le16(known, pos); 364 put_unaligned_le16(known, pos);
368 pos += 2; 365 pos += 2;
369 /* flags */ 366 /* flags */
@@ -378,8 +375,6 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
378 /* bandwidth */ 375 /* bandwidth */
379 if (status->vht_flag & RX_VHT_FLAG_80MHZ) 376 if (status->vht_flag & RX_VHT_FLAG_80MHZ)
380 *pos++ = 4; 377 *pos++ = 4;
381 else if (status->vht_flag & RX_VHT_FLAG_80P80MHZ)
382 *pos++ = 0; /* marked not known above */
383 else if (status->vht_flag & RX_VHT_FLAG_160MHZ) 378 else if (status->vht_flag & RX_VHT_FLAG_160MHZ)
384 *pos++ = 11; 379 *pos++ = 11;
385 else if (status->flag & RX_FLAG_40MHZ) 380 else if (status->flag & RX_FLAG_40MHZ)
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 788707f05516..e679b7c9b160 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -730,7 +730,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
730 struct ieee80211_bar *bar; 730 struct ieee80211_bar *bar;
731 int rtap_len; 731 int rtap_len;
732 int shift = 0; 732 int shift = 0;
733 int tid = IEEE80211_NUM_TIDS;; 733 int tid = IEEE80211_NUM_TIDS;
734 734
735 rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); 735 rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
736 736
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 83ba6cd9cf8d..fbd37d43dfce 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2541,7 +2541,9 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
2541 ri.mcs = status->rate_idx; 2541 ri.mcs = status->rate_idx;
2542 ri.flags |= RATE_INFO_FLAGS_MCS; 2542 ri.flags |= RATE_INFO_FLAGS_MCS;
2543 if (status->flag & RX_FLAG_40MHZ) 2543 if (status->flag & RX_FLAG_40MHZ)
2544 ri.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; 2544 ri.bw = RATE_INFO_BW_40;
2545 else
2546 ri.bw = RATE_INFO_BW_20;
2545 if (status->flag & RX_FLAG_SHORT_GI) 2547 if (status->flag & RX_FLAG_SHORT_GI)
2546 ri.flags |= RATE_INFO_FLAGS_SHORT_GI; 2548 ri.flags |= RATE_INFO_FLAGS_SHORT_GI;
2547 } else if (status->flag & RX_FLAG_VHT) { 2549 } else if (status->flag & RX_FLAG_VHT) {
@@ -2549,13 +2551,13 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
2549 ri.mcs = status->rate_idx; 2551 ri.mcs = status->rate_idx;
2550 ri.nss = status->vht_nss; 2552 ri.nss = status->vht_nss;
2551 if (status->flag & RX_FLAG_40MHZ) 2553 if (status->flag & RX_FLAG_40MHZ)
2552 ri.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; 2554 ri.bw = RATE_INFO_BW_40;
2553 if (status->vht_flag & RX_VHT_FLAG_80MHZ) 2555 else if (status->vht_flag & RX_VHT_FLAG_80MHZ)
2554 ri.flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH; 2556 ri.bw = RATE_INFO_BW_80;
2555 if (status->vht_flag & RX_VHT_FLAG_80P80MHZ) 2557 else if (status->vht_flag & RX_VHT_FLAG_160MHZ)
2556 ri.flags |= RATE_INFO_FLAGS_80P80_MHZ_WIDTH; 2558 ri.bw = RATE_INFO_BW_160;
2557 if (status->vht_flag & RX_VHT_FLAG_160MHZ) 2559 else
2558 ri.flags |= RATE_INFO_FLAGS_160_MHZ_WIDTH; 2560 ri.bw = RATE_INFO_BW_20;
2559 if (status->flag & RX_FLAG_SHORT_GI) 2561 if (status->flag & RX_FLAG_SHORT_GI)
2560 ri.flags |= RATE_INFO_FLAGS_SHORT_GI; 2562 ri.flags |= RATE_INFO_FLAGS_SHORT_GI;
2561 } else { 2563 } else {
@@ -2563,10 +2565,15 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
2563 int shift = 0; 2565 int shift = 0;
2564 int bitrate; 2566 int bitrate;
2565 2567
2566 if (status->flag & RX_FLAG_10MHZ) 2568 if (status->flag & RX_FLAG_10MHZ) {
2567 shift = 1; 2569 shift = 1;
2568 if (status->flag & RX_FLAG_5MHZ) 2570 ri.bw = RATE_INFO_BW_10;
2571 } else if (status->flag & RX_FLAG_5MHZ) {
2569 shift = 2; 2572 shift = 2;
2573 ri.bw = RATE_INFO_BW_5;
2574 } else {
2575 ri.bw = RATE_INFO_BW_20;
2576 }
2570 2577
2571 sband = local->hw.wiphy->bands[status->band]; 2578 sband = local->hw.wiphy->bands[status->band];
2572 bitrate = sband->bitrates[status->rate_idx].bitrate; 2579 bitrate = sband->bitrates[status->rate_idx].bitrate;
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 456e4c38c279..3af0ecf1cc16 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <net/genetlink.h> 22#include <net/genetlink.h>
23#include <net/cfg80211.h> 23#include <net/cfg80211.h>
24#include <net/rtnetlink.h>
25#include "nl80211.h" 24#include "nl80211.h"
26#include "core.h" 25#include "core.h"
27#include "sysfs.h" 26#include "sysfs.h"
@@ -964,10 +963,6 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
964} 963}
965EXPORT_SYMBOL(cfg80211_stop_iface); 964EXPORT_SYMBOL(cfg80211_stop_iface);
966 965
967static const struct rtnl_link_ops wireless_link_ops = {
968 .kind = "wlan",
969};
970
971static int cfg80211_netdev_notifier_call(struct notifier_block *nb, 966static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
972 unsigned long state, void *ptr) 967 unsigned long state, void *ptr)
973{ 968{
@@ -986,7 +981,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
986 switch (state) { 981 switch (state) {
987 case NETDEV_POST_INIT: 982 case NETDEV_POST_INIT:
988 SET_NETDEV_DEVTYPE(dev, &wiphy_type); 983 SET_NETDEV_DEVTYPE(dev, &wiphy_type);
989 dev->rtnl_link_ops = &wireless_link_ops;
990 break; 984 break;
991 case NETDEV_REGISTER: 985 case NETDEV_REGISTER:
992 /* 986 /*
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4ed9039bd5f9..4fc812f2b583 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3580,6 +3580,7 @@ static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
3580 struct nlattr *rate; 3580 struct nlattr *rate;
3581 u32 bitrate; 3581 u32 bitrate;
3582 u16 bitrate_compat; 3582 u16 bitrate_compat;
3583 enum nl80211_attrs rate_flg;
3583 3584
3584 rate = nla_nest_start(msg, attr); 3585 rate = nla_nest_start(msg, attr);
3585 if (!rate) 3586 if (!rate)
@@ -3596,12 +3597,36 @@ static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
3596 nla_put_u16(msg, NL80211_RATE_INFO_BITRATE, bitrate_compat)) 3597 nla_put_u16(msg, NL80211_RATE_INFO_BITRATE, bitrate_compat))
3597 return false; 3598 return false;
3598 3599
3600 switch (info->bw) {
3601 case RATE_INFO_BW_5:
3602 rate_flg = NL80211_RATE_INFO_5_MHZ_WIDTH;
3603 break;
3604 case RATE_INFO_BW_10:
3605 rate_flg = NL80211_RATE_INFO_10_MHZ_WIDTH;
3606 break;
3607 default:
3608 WARN_ON(1);
3609 /* fall through */
3610 case RATE_INFO_BW_20:
3611 rate_flg = 0;
3612 break;
3613 case RATE_INFO_BW_40:
3614 rate_flg = NL80211_RATE_INFO_40_MHZ_WIDTH;
3615 break;
3616 case RATE_INFO_BW_80:
3617 rate_flg = NL80211_RATE_INFO_80_MHZ_WIDTH;
3618 break;
3619 case RATE_INFO_BW_160:
3620 rate_flg = NL80211_RATE_INFO_160_MHZ_WIDTH;
3621 break;
3622 }
3623
3624 if (rate_flg && nla_put_flag(msg, rate_flg))
3625 return false;
3626
3599 if (info->flags & RATE_INFO_FLAGS_MCS) { 3627 if (info->flags & RATE_INFO_FLAGS_MCS) {
3600 if (nla_put_u8(msg, NL80211_RATE_INFO_MCS, info->mcs)) 3628 if (nla_put_u8(msg, NL80211_RATE_INFO_MCS, info->mcs))
3601 return false; 3629 return false;
3602 if (info->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH &&
3603 nla_put_flag(msg, NL80211_RATE_INFO_40_MHZ_WIDTH))
3604 return false;
3605 if (info->flags & RATE_INFO_FLAGS_SHORT_GI && 3630 if (info->flags & RATE_INFO_FLAGS_SHORT_GI &&
3606 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) 3631 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI))
3607 return false; 3632 return false;
@@ -3610,18 +3635,6 @@ static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
3610 return false; 3635 return false;
3611 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_NSS, info->nss)) 3636 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_NSS, info->nss))
3612 return false; 3637 return false;
3613 if (info->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH &&
3614 nla_put_flag(msg, NL80211_RATE_INFO_40_MHZ_WIDTH))
3615 return false;
3616 if (info->flags & RATE_INFO_FLAGS_80_MHZ_WIDTH &&
3617 nla_put_flag(msg, NL80211_RATE_INFO_80_MHZ_WIDTH))
3618 return false;
3619 if (info->flags & RATE_INFO_FLAGS_80P80_MHZ_WIDTH &&
3620 nla_put_flag(msg, NL80211_RATE_INFO_80P80_MHZ_WIDTH))
3621 return false;
3622 if (info->flags & RATE_INFO_FLAGS_160_MHZ_WIDTH &&
3623 nla_put_flag(msg, NL80211_RATE_INFO_160_MHZ_WIDTH))
3624 return false;
3625 if (info->flags & RATE_INFO_FLAGS_SHORT_GI && 3638 if (info->flags & RATE_INFO_FLAGS_SHORT_GI &&
3626 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) 3639 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI))
3627 return false; 3640 return false;
@@ -11784,7 +11797,7 @@ void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
11784 return; 11797 return;
11785 11798
11786 if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0, 11799 if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0,
11787 rdev, dev, mac_addr, sinfo)) { 11800 rdev, dev, mac_addr, sinfo) < 0) {
11788 nlmsg_free(msg); 11801 nlmsg_free(msg);
11789 return; 11802 return;
11790 } 11803 }
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 1d2fcfad06cc..97c744eeac4f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1073,10 +1073,24 @@ static u32 cfg80211_calculate_bitrate_vht(struct rate_info *rate)
1073 if (WARN_ON_ONCE(rate->mcs > 9)) 1073 if (WARN_ON_ONCE(rate->mcs > 9))
1074 return 0; 1074 return 0;
1075 1075
1076 idx = rate->flags & (RATE_INFO_FLAGS_160_MHZ_WIDTH | 1076 switch (rate->bw) {
1077 RATE_INFO_FLAGS_80P80_MHZ_WIDTH) ? 3 : 1077 case RATE_INFO_BW_160:
1078 rate->flags & RATE_INFO_FLAGS_80_MHZ_WIDTH ? 2 : 1078 idx = 3;
1079 rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH ? 1 : 0; 1079 break;
1080 case RATE_INFO_BW_80:
1081 idx = 2;
1082 break;
1083 case RATE_INFO_BW_40:
1084 idx = 1;
1085 break;
1086 case RATE_INFO_BW_5:
1087 case RATE_INFO_BW_10:
1088 default:
1089 WARN_ON(1);
1090 /* fall through */
1091 case RATE_INFO_BW_20:
1092 idx = 0;
1093 }
1080 1094
1081 bitrate = base[idx][rate->mcs]; 1095 bitrate = base[idx][rate->mcs];
1082 bitrate *= rate->nss; 1096 bitrate *= rate->nss;
@@ -1107,8 +1121,7 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate)
1107 modulation = rate->mcs & 7; 1121 modulation = rate->mcs & 7;
1108 streams = (rate->mcs >> 3) + 1; 1122 streams = (rate->mcs >> 3) + 1;
1109 1123
1110 bitrate = (rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH) ? 1124 bitrate = (rate->bw == RATE_INFO_BW_40) ? 13500000 : 6500000;
1111 13500000 : 6500000;
1112 1125
1113 if (modulation < 4) 1126 if (modulation < 4)
1114 bitrate *= (modulation + 1); 1127 bitrate *= (modulation + 1);