Skip to content

Commit b32cb6f

Browse files
committed
Merge tag 'mac80211-for-net-2020-02-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says: ==================== Just a few fixes: * avoid running out of tracking space for frames that need to be reported to userspace by using more bits * fix beacon handling suppression by adding some relevant elements to the CRC calculation * fix quiet mode in action frames * fix crash in ethtool for virt_wifi and similar * add a missing policy entry * fix 160 & 80+80 bandwidth to take local capabilities into account ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 907e51e + 33181ea commit b32cb6f

File tree

7 files changed

+44
-22
lines changed

7 files changed

+44
-22
lines changed

include/net/mac80211.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,12 +1004,11 @@ ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
10041004
struct ieee80211_tx_info {
10051005
/* common information */
10061006
u32 flags;
1007-
u8 band;
1008-
1009-
u8 hw_queue;
1010-
1011-
u16 ack_frame_id:6;
1012-
u16 tx_time_est:10;
1007+
u32 band:3,
1008+
ack_frame_id:13,
1009+
hw_queue:4,
1010+
tx_time_est:10;
1011+
/* 2 free bits */
10131012

10141013
union {
10151014
struct {

net/mac80211/cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3450,7 +3450,7 @@ int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
34503450

34513451
spin_lock_irqsave(&local->ack_status_lock, spin_flags);
34523452
id = idr_alloc(&local->ack_status_frames, ack_skb,
3453-
1, 0x40, GFP_ATOMIC);
3453+
1, 0x2000, GFP_ATOMIC);
34543454
spin_unlock_irqrestore(&local->ack_status_lock, spin_flags);
34553455

34563456
if (id < 0) {

net/mac80211/mlme.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Copyright 2007, Michael Wu <[email protected]>
99
* Copyright 2013-2014 Intel Mobile Communications GmbH
1010
* Copyright (C) 2015 - 2017 Intel Deutschland GmbH
11-
* Copyright (C) 2018 - 2019 Intel Corporation
11+
* Copyright (C) 2018 - 2020 Intel Corporation
1212
*/
1313

1414
#include <linux/delay.h>
@@ -1311,7 +1311,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
13111311
if (!res) {
13121312
ch_switch.timestamp = timestamp;
13131313
ch_switch.device_timestamp = device_timestamp;
1314-
ch_switch.block_tx = beacon ? csa_ie.mode : 0;
1314+
ch_switch.block_tx = csa_ie.mode;
13151315
ch_switch.chandef = csa_ie.chandef;
13161316
ch_switch.count = csa_ie.count;
13171317
ch_switch.delay = csa_ie.max_switch_time;
@@ -1404,7 +1404,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
14041404

14051405
sdata->vif.csa_active = true;
14061406
sdata->csa_chandef = csa_ie.chandef;
1407-
sdata->csa_block_tx = ch_switch.block_tx;
1407+
sdata->csa_block_tx = csa_ie.mode;
14081408
ifmgd->csa_ignored_same_chan = false;
14091409

14101410
if (sdata->csa_block_tx)
@@ -1438,7 +1438,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
14381438
* reset when the disconnection worker runs.
14391439
*/
14401440
sdata->vif.csa_active = true;
1441-
sdata->csa_block_tx = ch_switch.block_tx;
1441+
sdata->csa_block_tx = csa_ie.mode;
14421442

14431443
ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work);
14441444
mutex_unlock(&local->chanctx_mtx);

net/mac80211/tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ static int ieee80211_store_ack_skb(struct ieee80211_local *local,
24422442

24432443
spin_lock_irqsave(&local->ack_status_lock, flags);
24442444
id = idr_alloc(&local->ack_status_frames, ack_skb,
2445-
1, 0x40, GFP_ATOMIC);
2445+
1, 0x2000, GFP_ATOMIC);
24462446
spin_unlock_irqrestore(&local->ack_status_lock, flags);
24472447

24482448
if (id >= 0) {

net/mac80211/util.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,16 +1063,22 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
10631063
elem_parse_failed = true;
10641064
break;
10651065
case WLAN_EID_VHT_OPERATION:
1066-
if (elen >= sizeof(struct ieee80211_vht_operation))
1066+
if (elen >= sizeof(struct ieee80211_vht_operation)) {
10671067
elems->vht_operation = (void *)pos;
1068-
else
1069-
elem_parse_failed = true;
1068+
if (calc_crc)
1069+
crc = crc32_be(crc, pos - 2, elen + 2);
1070+
break;
1071+
}
1072+
elem_parse_failed = true;
10701073
break;
10711074
case WLAN_EID_OPMODE_NOTIF:
1072-
if (elen > 0)
1075+
if (elen > 0) {
10731076
elems->opmode_notif = pos;
1074-
else
1075-
elem_parse_failed = true;
1077+
if (calc_crc)
1078+
crc = crc32_be(crc, pos - 2, elen + 2);
1079+
break;
1080+
}
1081+
elem_parse_failed = true;
10761082
break;
10771083
case WLAN_EID_MESH_ID:
10781084
elems->mesh_id = pos;
@@ -2987,10 +2993,22 @@ bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw,
29872993
int cf0, cf1;
29882994
int ccfs0, ccfs1, ccfs2;
29892995
int ccf0, ccf1;
2996+
u32 vht_cap;
2997+
bool support_80_80 = false;
2998+
bool support_160 = false;
29902999

29913000
if (!oper || !htop)
29923001
return false;
29933002

3003+
vht_cap = hw->wiphy->bands[chandef->chan->band]->vht_cap.cap;
3004+
support_160 = (vht_cap & (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK |
3005+
IEEE80211_VHT_CAP_EXT_NSS_BW_MASK));
3006+
support_80_80 = ((vht_cap &
3007+
IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) ||
3008+
(vht_cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
3009+
vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) ||
3010+
((vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >>
3011+
IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT > 1));
29943012
ccfs0 = oper->center_freq_seg0_idx;
29953013
ccfs1 = oper->center_freq_seg1_idx;
29963014
ccfs2 = (le16_to_cpu(htop->operation_mode) &
@@ -3018,10 +3036,10 @@ bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw,
30183036
unsigned int diff;
30193037

30203038
diff = abs(ccf1 - ccf0);
3021-
if (diff == 8) {
3039+
if ((diff == 8) && support_160) {
30223040
new.width = NL80211_CHAN_WIDTH_160;
30233041
new.center_freq1 = cf1;
3024-
} else if (diff > 8) {
3042+
} else if ((diff > 8) && support_80_80) {
30253043
new.width = NL80211_CHAN_WIDTH_80P80;
30263044
new.center_freq2 = cf1;
30273045
}

net/wireless/ethtool.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
88
{
99
struct wireless_dev *wdev = dev->ieee80211_ptr;
10+
struct device *pdev = wiphy_dev(wdev->wiphy);
1011

11-
strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name,
12-
sizeof(info->driver));
12+
if (pdev->driver)
13+
strlcpy(info->driver, pdev->driver->name,
14+
sizeof(info->driver));
15+
else
16+
strlcpy(info->driver, "N/A", sizeof(info->driver));
1317

1418
strlcpy(info->version, init_utsname()->release, sizeof(info->version));
1519

net/wireless/nl80211.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
437437
[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG },
438438
[NL80211_ATTR_CONTROL_PORT_OVER_NL80211] = { .type = NLA_FLAG },
439439
[NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG },
440+
[NL80211_ATTR_STATUS_CODE] = { .type = NLA_U16 },
440441
[NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 },
441442
[NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
442443
[NL80211_ATTR_PID] = { .type = NLA_U32 },

0 commit comments

Comments
 (0)