Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <davem@davemloft.net>

+44 -22
+5 -6
include/net/mac80211.h
··· 1004 1004 struct ieee80211_tx_info { 1005 1005 /* common information */ 1006 1006 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 */ 1013 1012 1014 1013 union { 1015 1014 struct {
+1 -1
net/mac80211/cfg.c
··· 3450 3450 3451 3451 spin_lock_irqsave(&local->ack_status_lock, spin_flags); 3452 3452 id = idr_alloc(&local->ack_status_frames, ack_skb, 3453 - 1, 0x40, GFP_ATOMIC); 3453 + 1, 0x2000, GFP_ATOMIC); 3454 3454 spin_unlock_irqrestore(&local->ack_status_lock, spin_flags); 3455 3455 3456 3456 if (id < 0) {
+4 -4
net/mac80211/mlme.c
··· 8 8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 9 9 * Copyright 2013-2014 Intel Mobile Communications GmbH 10 10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2019 Intel Corporation 11 + * Copyright (C) 2018 - 2020 Intel Corporation 12 12 */ 13 13 14 14 #include <linux/delay.h> ··· 1311 1311 if (!res) { 1312 1312 ch_switch.timestamp = timestamp; 1313 1313 ch_switch.device_timestamp = device_timestamp; 1314 - ch_switch.block_tx = beacon ? csa_ie.mode : 0; 1314 + ch_switch.block_tx = csa_ie.mode; 1315 1315 ch_switch.chandef = csa_ie.chandef; 1316 1316 ch_switch.count = csa_ie.count; 1317 1317 ch_switch.delay = csa_ie.max_switch_time; ··· 1404 1404 1405 1405 sdata->vif.csa_active = true; 1406 1406 sdata->csa_chandef = csa_ie.chandef; 1407 - sdata->csa_block_tx = ch_switch.block_tx; 1407 + sdata->csa_block_tx = csa_ie.mode; 1408 1408 ifmgd->csa_ignored_same_chan = false; 1409 1409 1410 1410 if (sdata->csa_block_tx) ··· 1438 1438 * reset when the disconnection worker runs. 1439 1439 */ 1440 1440 sdata->vif.csa_active = true; 1441 - sdata->csa_block_tx = ch_switch.block_tx; 1441 + sdata->csa_block_tx = csa_ie.mode; 1442 1442 1443 1443 ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work); 1444 1444 mutex_unlock(&local->chanctx_mtx);
+1 -1
net/mac80211/tx.c
··· 2442 2442 2443 2443 spin_lock_irqsave(&local->ack_status_lock, flags); 2444 2444 id = idr_alloc(&local->ack_status_frames, ack_skb, 2445 - 1, 0x40, GFP_ATOMIC); 2445 + 1, 0x2000, GFP_ATOMIC); 2446 2446 spin_unlock_irqrestore(&local->ack_status_lock, flags); 2447 2447 2448 2448 if (id >= 0) {
+26 -8
net/mac80211/util.c
··· 1063 1063 elem_parse_failed = true; 1064 1064 break; 1065 1065 case WLAN_EID_VHT_OPERATION: 1066 - if (elen >= sizeof(struct ieee80211_vht_operation)) 1066 + if (elen >= sizeof(struct ieee80211_vht_operation)) { 1067 1067 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; 1070 1073 break; 1071 1074 case WLAN_EID_OPMODE_NOTIF: 1072 - if (elen > 0) 1075 + if (elen > 0) { 1073 1076 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; 1076 1082 break; 1077 1083 case WLAN_EID_MESH_ID: 1078 1084 elems->mesh_id = pos; ··· 2993 2987 int cf0, cf1; 2994 2988 int ccfs0, ccfs1, ccfs2; 2995 2989 int ccf0, ccf1; 2990 + u32 vht_cap; 2991 + bool support_80_80 = false; 2992 + bool support_160 = false; 2996 2993 2997 2994 if (!oper || !htop) 2998 2995 return false; 2999 2996 2997 + vht_cap = hw->wiphy->bands[chandef->chan->band]->vht_cap.cap; 2998 + support_160 = (vht_cap & (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK | 2999 + IEEE80211_VHT_CAP_EXT_NSS_BW_MASK)); 3000 + support_80_80 = ((vht_cap & 3001 + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) || 3002 + (vht_cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ && 3003 + vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) || 3004 + ((vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >> 3005 + IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT > 1)); 3000 3006 ccfs0 = oper->center_freq_seg0_idx; 3001 3007 ccfs1 = oper->center_freq_seg1_idx; 3002 3008 ccfs2 = (le16_to_cpu(htop->operation_mode) & ··· 3036 3018 unsigned int diff; 3037 3019 3038 3020 diff = abs(ccf1 - ccf0); 3039 - if (diff == 8) { 3021 + if ((diff == 8) && support_160) { 3040 3022 new.width = NL80211_CHAN_WIDTH_160; 3041 3023 new.center_freq1 = cf1; 3042 - } else if (diff > 8) { 3024 + } else if ((diff > 8) && support_80_80) { 3043 3025 new.width = NL80211_CHAN_WIDTH_80P80; 3044 3026 new.center_freq2 = cf1; 3045 3027 }
+6 -2
net/wireless/ethtool.c
··· 7 7 void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 8 8 { 9 9 struct wireless_dev *wdev = dev->ieee80211_ptr; 10 + struct device *pdev = wiphy_dev(wdev->wiphy); 10 11 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)); 13 17 14 18 strlcpy(info->version, init_utsname()->release, sizeof(info->version)); 15 19
+1
net/wireless/nl80211.c
··· 437 437 [NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG }, 438 438 [NL80211_ATTR_CONTROL_PORT_OVER_NL80211] = { .type = NLA_FLAG }, 439 439 [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG }, 440 + [NL80211_ATTR_STATUS_CODE] = { .type = NLA_U16 }, 440 441 [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, 441 442 [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, 442 443 [NL80211_ATTR_PID] = { .type = NLA_U32 },