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

Merge tag 'mac80211-next-for-net-next-2020-11-13' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Some updates:
* injection/radiotap updates for new test capabilities
* remove WDS support - even years ago when we turned
it off by default it was already basically unusable
* support for HE (802.11ax) rates for beacons
* support for some vendor-specific HE rates
* many other small features/cleanups

* tag 'mac80211-next-for-net-next-2020-11-13' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next: (21 commits)
nl80211: fix kernel-doc warning in the new SAE attribute
cfg80211: remove WDS code
mac80211: remove WDS-related code
rt2x00: remove WDS code
b43legacy: remove WDS code
b43: remove WDS code
carl9170: remove WDS code
ath9k: remove WDS code
wireless: remove CONFIG_WIRELESS_WDS
mac80211: assure that certain drivers adhere to DONT_REORDER flag
mac80211: don't overwrite QoS TID of injected frames
mac80211: adhere to Tx control flag that prevents frame reordering
mac80211: add radiotap flag to assure frames are not reordered
mac80211: save HE oper info in BSS config for mesh
cfg80211: add support to configure HE MCS for beacon rate
nl80211: fix beacon tx rate mask validation
nl80211/cfg80211: fix potential infinite loop
cfg80211: Add support to calculate and report 4096-QAM HE rates
cfg80211: Add support to configure SAE PWE value to drivers
ieee80211: Add definition for WFA DPP
...
====================

Link: https://lore.kernel.org/r/20201113101148.25268-1-johannes@sipsolutions.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+198 -347
-13
drivers/net/wireless/Kconfig
··· 18 18 19 19 if WLAN 20 20 21 - config WIRELESS_WDS 22 - bool "mac80211-based legacy WDS support" if EXPERT 23 - help 24 - This option enables the deprecated WDS support, the newer 25 - mac80211-based 4-addr AP/client support supersedes it with 26 - a much better feature set (HT, VHT, ...) 27 - 28 - We plan to remove this option and code, so if you find 29 - that you have to enable it, please let us know on the 30 - linux-wireless@vger.kernel.org mailing list, so we can 31 - help you migrate to 4-addr AP/client (or, if it's really 32 - necessary, give up on our plan of removing it). 33 - 34 21 source "drivers/net/wireless/admtek/Kconfig" 35 22 source "drivers/net/wireless/ath/Kconfig" 36 23 source "drivers/net/wireless/atmel/Kconfig"
-1
drivers/net/wireless/ath/ath9k/ath9k.h
··· 661 661 int naps; /* number of AP vifs */ 662 662 int nmeshes; /* number of mesh vifs */ 663 663 int nstations; /* number of station vifs */ 664 - int nwds; /* number of WDS vifs */ 665 664 int nadhocs; /* number of adhoc vifs */ 666 665 int nocbs; /* number of OCB vifs */ 667 666 int nbcnvifs; /* number of beaconing vifs */
+2 -2
drivers/net/wireless/ath/ath9k/debug.c
··· 735 735 ath9k_calculate_iter_data(sc, ctx, &iter_data); 736 736 737 737 seq_printf(file, 738 - "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i", 738 + "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i", 739 739 i++, (int)(ctx->assigned), iter_data.naps, 740 740 iter_data.nstations, 741 - iter_data.nmeshes, iter_data.nwds); 741 + iter_data.nmeshes); 742 742 seq_printf(file, " ADHOC: %i OCB: %i TOTAL: %hi BEACON-VIF: %hi\n", 743 743 iter_data.nadhocs, iter_data.nocbs, sc->cur_chan->nvifs, 744 744 sc->nbcnvifs);
-19
drivers/net/wireless/ath/ath9k/init.c
··· 832 832 BIT(NL80211_IFTYPE_P2P_GO) }, 833 833 }; 834 834 835 - #ifdef CONFIG_WIRELESS_WDS 836 - static const struct ieee80211_iface_limit wds_limits[] = { 837 - { .max = 2048, .types = BIT(NL80211_IFTYPE_WDS) }, 838 - }; 839 - #endif 840 - 841 835 #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT 842 836 843 837 static const struct ieee80211_iface_limit if_limits_multi[] = { ··· 868 874 BIT(NL80211_CHAN_WIDTH_40), 869 875 #endif 870 876 }, 871 - #ifdef CONFIG_WIRELESS_WDS 872 - { 873 - .limits = wds_limits, 874 - .n_limits = ARRAY_SIZE(wds_limits), 875 - .max_interfaces = 2048, 876 - .num_different_channels = 1, 877 - .beacon_int_infra_match = true, 878 - }, 879 - #endif 880 877 }; 881 878 882 879 #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT ··· 882 897 ieee80211_hw_set(hw, QUEUE_CONTROL); 883 898 hw->queues = ATH9K_NUM_TX_QUEUES; 884 899 hw->offchannel_tx_hw_queue = hw->queues - 1; 885 - hw->wiphy->interface_modes &= ~ BIT(NL80211_IFTYPE_WDS); 886 900 hw->wiphy->iface_combinations = if_comb_multi; 887 901 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb_multi); 888 902 hw->wiphy->max_scan_ssids = 255; ··· 937 953 BIT(NL80211_IFTYPE_STATION) | 938 954 BIT(NL80211_IFTYPE_ADHOC) | 939 955 BIT(NL80211_IFTYPE_MESH_POINT) | 940 - #ifdef CONFIG_WIRELESS_WDS 941 - BIT(NL80211_IFTYPE_WDS) | 942 - #endif 943 956 BIT(NL80211_IFTYPE_OCB); 944 957 945 958 if (ath9k_is_chanctx_enabled())
-5
drivers/net/wireless/ath/ath9k/main.c
··· 973 973 if (vif->bss_conf.enable_beacon) 974 974 ath9k_vif_iter_set_beacon(iter_data, vif); 975 975 break; 976 - case NL80211_IFTYPE_WDS: 977 - iter_data->nwds++; 978 - break; 979 976 default: 980 977 break; 981 978 } ··· 1133 1136 ah->opmode = NL80211_IFTYPE_MESH_POINT; 1134 1137 else if (iter_data.nocbs) 1135 1138 ah->opmode = NL80211_IFTYPE_OCB; 1136 - else if (iter_data.nwds) 1137 - ah->opmode = NL80211_IFTYPE_AP; 1138 1139 else if (iter_data.nadhocs) 1139 1140 ah->opmode = NL80211_IFTYPE_ADHOC; 1140 1141 else
-4
drivers/net/wireless/ath/carl9170/mac.c
··· 329 329 /* iwlagn 802.11n STA Workaround */ 330 330 rx_ctrl |= AR9170_MAC_RX_CTRL_PASS_TO_HOST; 331 331 break; 332 - case NL80211_IFTYPE_WDS: 333 - cam_mode |= AR9170_MAC_CAM_AP_WDS; 334 - rx_ctrl |= AR9170_MAC_RX_CTRL_PASS_TO_HOST; 335 - break; 336 332 case NL80211_IFTYPE_STATION: 337 333 cam_mode |= AR9170_MAC_CAM_STA; 338 334 rx_ctrl |= AR9170_MAC_RX_CTRL_PASS_TO_HOST;
-1
drivers/net/wireless/ath/carl9170/main.c
··· 646 646 case NL80211_IFTYPE_MESH_POINT: 647 647 case NL80211_IFTYPE_AP: 648 648 if ((vif->type == NL80211_IFTYPE_STATION) || 649 - (vif->type == NL80211_IFTYPE_WDS) || 650 649 (vif->type == NL80211_IFTYPE_AP) || 651 650 (vif->type == NL80211_IFTYPE_MESH_POINT)) 652 651 break;
+1 -5
drivers/net/wireless/broadcom/b43/main.c
··· 4961 4961 struct b43_wldev *dev; 4962 4962 int err = -EOPNOTSUPP; 4963 4963 4964 - /* TODO: allow WDS/AP devices to coexist */ 4964 + /* TODO: allow AP devices to coexist */ 4965 4965 4966 4966 if (vif->type != NL80211_IFTYPE_AP && 4967 4967 vif->type != NL80211_IFTYPE_MESH_POINT && 4968 4968 vif->type != NL80211_IFTYPE_STATION && 4969 - vif->type != NL80211_IFTYPE_WDS && 4970 4969 vif->type != NL80211_IFTYPE_ADHOC) 4971 4970 return -EOPNOTSUPP; 4972 4971 ··· 5575 5576 BIT(NL80211_IFTYPE_AP) | 5576 5577 BIT(NL80211_IFTYPE_MESH_POINT) | 5577 5578 BIT(NL80211_IFTYPE_STATION) | 5578 - #ifdef CONFIG_WIRELESS_WDS 5579 - BIT(NL80211_IFTYPE_WDS) | 5580 - #endif 5581 5579 BIT(NL80211_IFTYPE_ADHOC); 5582 5580 5583 5581 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+1 -5
drivers/net/wireless/broadcom/b43legacy/main.c
··· 3381 3381 unsigned long flags; 3382 3382 int err = -EOPNOTSUPP; 3383 3383 3384 - /* TODO: allow WDS/AP devices to coexist */ 3384 + /* TODO: allow AP devices to coexist */ 3385 3385 3386 3386 if (vif->type != NL80211_IFTYPE_AP && 3387 3387 vif->type != NL80211_IFTYPE_STATION && 3388 - vif->type != NL80211_IFTYPE_WDS && 3389 3388 vif->type != NL80211_IFTYPE_ADHOC) 3390 3389 return -EOPNOTSUPP; 3391 3390 ··· 3804 3805 hw->wiphy->interface_modes = 3805 3806 BIT(NL80211_IFTYPE_AP) | 3806 3807 BIT(NL80211_IFTYPE_STATION) | 3807 - #ifdef CONFIG_WIRELESS_WDS 3808 - BIT(NL80211_IFTYPE_WDS) | 3809 - #endif 3810 3808 BIT(NL80211_IFTYPE_ADHOC); 3811 3809 hw->queues = 1; /* FIXME: hardware has more queues */ 3812 3810 hw->max_rates = 2;
-1
drivers/net/wireless/ralink/rt2x00/rt2x00config.c
··· 32 32 break; 33 33 case NL80211_IFTYPE_AP: 34 34 case NL80211_IFTYPE_MESH_POINT: 35 - case NL80211_IFTYPE_WDS: 36 35 conf.sync = TSF_SYNC_AP_NONE; 37 36 break; 38 37 case NL80211_IFTYPE_STATION:
+1 -5
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
··· 194 194 195 195 if (vif->type != NL80211_IFTYPE_AP && 196 196 vif->type != NL80211_IFTYPE_ADHOC && 197 - vif->type != NL80211_IFTYPE_MESH_POINT && 198 - vif->type != NL80211_IFTYPE_WDS) 197 + vif->type != NL80211_IFTYPE_MESH_POINT) 199 198 return; 200 199 201 200 /* ··· 1435 1436 BIT(NL80211_IFTYPE_ADHOC) | 1436 1437 #ifdef CONFIG_MAC80211_MESH 1437 1438 BIT(NL80211_IFTYPE_MESH_POINT) | 1438 - #endif 1439 - #ifdef CONFIG_WIRELESS_WDS 1440 - BIT(NL80211_IFTYPE_WDS) | 1441 1439 #endif 1442 1440 BIT(NL80211_IFTYPE_AP); 1443 1441
+1 -2
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
··· 408 408 409 409 if (vif->type != NL80211_IFTYPE_AP && 410 410 vif->type != NL80211_IFTYPE_ADHOC && 411 - vif->type != NL80211_IFTYPE_MESH_POINT && 412 - vif->type != NL80211_IFTYPE_WDS) 411 + vif->type != NL80211_IFTYPE_MESH_POINT) 413 412 return; 414 413 415 414 set_bit(DELAYED_UPDATE_BEACON, &intf->delayed_flags);
+3
include/linux/ieee80211.h
··· 3417 3417 #define WLAN_AKM_SUITE_FT_PSK_SHA384 SUITE(0x000FAC, 19) 3418 3418 #define WLAN_AKM_SUITE_PSK_SHA384 SUITE(0x000FAC, 20) 3419 3419 3420 + #define WLAN_AKM_SUITE_WFA_DPP SUITE(WLAN_OUI_WFA, 2) 3421 + 3420 3422 #define WLAN_MAX_KEY_LEN 32 3421 3423 3422 3424 #define WLAN_PMK_NAME_LEN 16 ··· 3429 3427 3430 3428 #define WLAN_OUI_WFA 0x506f9a 3431 3429 #define WLAN_OUI_TYPE_WFA_P2P 9 3430 + #define WLAN_OUI_TYPE_WFA_DPP 0x1A 3432 3431 #define WLAN_OUI_MICROSOFT 0x0050f2 3433 3432 #define WLAN_OUI_TYPE_MICROSOFT_WPA 1 3434 3433 #define WLAN_OUI_TYPE_MICROSOFT_WMM 2
+16 -5
include/net/cfg80211.h
··· 1008 1008 * @sae_pwd: password for SAE authentication (for devices supporting SAE 1009 1009 * offload) 1010 1010 * @sae_pwd_len: length of SAE password (for devices supporting SAE offload) 1011 + * @sae_pwe: The mechanisms allowed for SAE PWE derivation: 1012 + * 1013 + * NL80211_SAE_PWE_UNSPECIFIED 1014 + * Not-specified, used to indicate userspace did not specify any 1015 + * preference. The driver should follow its internal policy in 1016 + * such a scenario. 1017 + * 1018 + * NL80211_SAE_PWE_HUNT_AND_PECK 1019 + * Allow hunting-and-pecking loop only 1020 + * 1021 + * NL80211_SAE_PWE_HASH_TO_ELEMENT 1022 + * Allow hash-to-element only 1023 + * 1024 + * NL80211_SAE_PWE_BOTH 1025 + * Allow either hunting-and-pecking loop or hash-to-element 1011 1026 */ 1012 1027 struct cfg80211_crypto_settings { 1013 1028 u32 wpa_versions; ··· 1041 1026 const u8 *psk; 1042 1027 const u8 *sae_pwd; 1043 1028 u8 sae_pwd_len; 1029 + enum nl80211_sae_pwe_mechanism sae_pwe; 1044 1030 }; 1045 1031 1046 1032 /** ··· 3752 3736 * @get_tx_power: store the current TX power into the dbm variable; 3753 3737 * return 0 if successful 3754 3738 * 3755 - * @set_wds_peer: set the WDS peer for a WDS interface 3756 - * 3757 3739 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 3758 3740 * functions to adjust rfkill hw state 3759 3741 * ··· 4071 4057 enum nl80211_tx_power_setting type, int mbm); 4072 4058 int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, 4073 4059 int *dbm); 4074 - 4075 - int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, 4076 - const u8 *addr); 4077 4060 4078 4061 void (*rfkill_poll)(struct wiphy *wiphy); 4079 4062
+1
include/net/ieee80211_radiotap.h
··· 118 118 IEEE80211_RADIOTAP_F_TX_RTS = 0x0004, 119 119 IEEE80211_RADIOTAP_F_TX_NOACK = 0x0008, 120 120 IEEE80211_RADIOTAP_F_TX_NOSEQNO = 0x0010, 121 + IEEE80211_RADIOTAP_F_TX_ORDER = 0x0020, 121 122 }; 122 123 123 124 /* for IEEE80211_RADIOTAP_MCS "have" flags */
+6 -1
include/net/mac80211.h
··· 621 621 * nontransmitted BSSIDs 622 622 * @profile_periodicity: the least number of beacon frames need to be received 623 623 * in order to discover all the nontransmitted BSSIDs in the set. 624 - * @he_oper: HE operation information of the AP we are connected to 624 + * @he_oper: HE operation information of the BSS (AP/Mesh) or of the AP we are 625 + * connected to (STA) 625 626 * @he_obss_pd: OBSS Packet Detection parameters. 626 627 * @he_bss_color: BSS coloring settings, if BSS supports HE 627 628 * @fils_discovery: FILS discovery configuration ··· 857 856 * it can be sent out. 858 857 * @IEEE80211_TX_CTRL_NO_SEQNO: Do not overwrite the sequence number that 859 858 * has already been assigned to this frame. 859 + * @IEEE80211_TX_CTRL_DONT_REORDER: This frame should not be reordered 860 + * relative to other frames that have this flag set, independent 861 + * of their QoS TID or other priority field values. 860 862 * 861 863 * These flags are used in tx_info->control.flags. 862 864 */ ··· 872 868 IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5), 873 869 IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6), 874 870 IEEE80211_TX_CTRL_NO_SEQNO = BIT(7), 871 + IEEE80211_TX_CTRL_DONT_REORDER = BIT(8), 875 872 }; 876 873 877 874 /*
+35 -3
include/uapi/linux/nl80211.h
··· 757 757 * of any other interfaces, and other interfaces will again take 758 758 * precedence when they are used. 759 759 * 760 - * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. 760 + * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface 761 + * (no longer supported). 761 762 * 762 763 * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform 763 764 * multicast to unicast conversion. When enabled, all multicast packets ··· 1751 1750 * specify just a single bitrate, which is to be used for the beacon. 1752 1751 * The driver must also specify support for this with the extended 1753 1752 * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, 1754 - * NL80211_EXT_FEATURE_BEACON_RATE_HT and 1755 - * NL80211_EXT_FEATURE_BEACON_RATE_VHT. 1753 + * NL80211_EXT_FEATURE_BEACON_RATE_HT, 1754 + * NL80211_EXT_FEATURE_BEACON_RATE_VHT and 1755 + * NL80211_EXT_FEATURE_BEACON_RATE_HE. 1756 1756 * 1757 1757 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain 1758 1758 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. ··· 2529 2527 * override mask. Used with NL80211_ATTR_S1G_CAPABILITY in 2530 2528 * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. 2531 2529 * 2530 + * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE 2531 + * derivation in WPA3-Personal networks which are using SAE authentication. 2532 + * This is a u8 attribute that encapsulates one of the values from 2533 + * &enum nl80211_sae_pwe_mechanism. 2534 + * 2532 2535 * @NUM_NL80211_ATTR: total number of nl80211_attrs available 2533 2536 * @NL80211_ATTR_MAX: highest attribute number currently defined 2534 2537 * @__NL80211_ATTR_AFTER_LAST: internal use ··· 3022 3015 3023 3016 NL80211_ATTR_S1G_CAPABILITY, 3024 3017 NL80211_ATTR_S1G_CAPABILITY_MASK, 3018 + 3019 + NL80211_ATTR_SAE_PWE, 3025 3020 3026 3021 /* add attributes here, update the policy in nl80211.c */ 3027 3022 ··· 5905 5896 * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports 5906 5897 * unsolicited broadcast probe response transmission 5907 5898 * 5899 + * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate 5900 + * configuration (AP/mesh) with HE rates. 5901 + * 5908 5902 * @NUM_NL80211_EXT_FEATURES: number of extended features. 5909 5903 * @MAX_NL80211_EXT_FEATURES: highest extended feature index. 5910 5904 */ ··· 5968 5956 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP, 5969 5957 NL80211_EXT_FEATURE_FILS_DISCOVERY, 5970 5958 NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP, 5959 + NL80211_EXT_FEATURE_BEACON_RATE_HE, 5971 5960 5972 5961 /* add new features before the definition below */ 5973 5962 NUM_NL80211_EXT_FEATURES, ··· 7136 7123 __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST, 7137 7124 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX = 7138 7125 __NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1 7126 + }; 7127 + 7128 + /** 7129 + * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE 7130 + * derivation. Applicable only when WPA3-Personal SAE authentication is 7131 + * used. 7132 + * 7133 + * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that 7134 + * attribute is not present from userspace. 7135 + * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only 7136 + * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only 7137 + * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element 7138 + * can be used. 7139 + */ 7140 + enum nl80211_sae_pwe_mechanism { 7141 + NL80211_SAE_PWE_UNSPECIFIED, 7142 + NL80211_SAE_PWE_HUNT_AND_PECK, 7143 + NL80211_SAE_PWE_HASH_TO_ELEMENT, 7144 + NL80211_SAE_PWE_BOTH, 7139 7145 }; 7140 7146 #endif /* __LINUX_NL80211_H */
-11
net/mac80211/cfg.c
··· 2708 2708 return 0; 2709 2709 } 2710 2710 2711 - static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, 2712 - const u8 *addr) 2713 - { 2714 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2715 - 2716 - memcpy(&sdata->u.wds.remote_addr, addr, ETH_ALEN); 2717 - 2718 - return 0; 2719 - } 2720 - 2721 2711 static void ieee80211_rfkill_poll(struct wiphy *wiphy) 2722 2712 { 2723 2713 struct ieee80211_local *local = wiphy_priv(wiphy); ··· 4128 4138 .set_wiphy_params = ieee80211_set_wiphy_params, 4129 4139 .set_tx_power = ieee80211_set_tx_power, 4130 4140 .get_tx_power = ieee80211_get_tx_power, 4131 - .set_wds_peer = ieee80211_set_wds_peer, 4132 4141 .rfkill_poll = ieee80211_rfkill_poll, 4133 4142 CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) 4134 4143 CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
+1 -2
net/mac80211/chan.c
··· 275 275 case NL80211_IFTYPE_NAN: 276 276 continue; 277 277 case NL80211_IFTYPE_ADHOC: 278 - case NL80211_IFTYPE_WDS: 279 278 case NL80211_IFTYPE_MESH_POINT: 280 279 case NL80211_IFTYPE_OCB: 281 280 width = vif->bss_conf.chandef.width; 282 281 break; 282 + case NL80211_IFTYPE_WDS: 283 283 case NL80211_IFTYPE_UNSPECIFIED: 284 284 case NUM_NL80211_IFTYPES: 285 285 case NL80211_IFTYPE_MONITOR: ··· 743 743 continue; 744 744 case NL80211_IFTYPE_AP: 745 745 case NL80211_IFTYPE_ADHOC: 746 - case NL80211_IFTYPE_WDS: 747 746 case NL80211_IFTYPE_MESH_POINT: 748 747 case NL80211_IFTYPE_OCB: 749 748 break;
-11
net/mac80211/debugfs_netdev.c
··· 574 574 IEEE80211_IF_FILE_RW(tsf); 575 575 576 576 577 - /* WDS attributes */ 578 - IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC); 579 - 580 577 #ifdef CONFIG_MAC80211_MESH 581 578 IEEE80211_IF_FILE(estab_plinks, u.mesh.estab_plinks, ATOMIC); 582 579 ··· 698 701 DEBUGFS_ADD_MODE(tsf, 0600); 699 702 } 700 703 701 - static void add_wds_files(struct ieee80211_sub_if_data *sdata) 702 - { 703 - DEBUGFS_ADD(peer); 704 - } 705 - 706 704 #ifdef CONFIG_MAC80211_MESH 707 705 708 706 static void add_mesh_files(struct ieee80211_sub_if_data *sdata) ··· 796 804 break; 797 805 case NL80211_IFTYPE_AP_VLAN: 798 806 add_vlan_files(sdata); 799 - break; 800 - case NL80211_IFTYPE_WDS: 801 - add_wds_files(sdata); 802 807 break; 803 808 default: 804 809 break;
+1 -1
net/mac80211/debugfs_sta.c
··· 274 274 "Q limit[low/high]: VO: %u/%u VI: %u/%u BE: %u/%u BK: %u/%u\n", 275 275 q_depth[0], q_depth[1], q_depth[2], q_depth[3], 276 276 q_limit_l[0], q_limit_h[0], q_limit_l[1], q_limit_h[1], 277 - q_limit_l[2], q_limit_h[2], q_limit_l[3], q_limit_h[3]), 277 + q_limit_l[2], q_limit_h[2], q_limit_l[3], q_limit_h[3]); 278 278 279 279 rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); 280 280 kfree(buf);
-6
net/mac80211/ieee80211_i.h
··· 311 311 bool multicast_to_unicast; 312 312 }; 313 313 314 - struct ieee80211_if_wds { 315 - struct sta_info *sta; 316 - u8 remote_addr[ETH_ALEN]; 317 - }; 318 - 319 314 struct ieee80211_if_vlan { 320 315 struct list_head list; /* write-protected with RTNL and local->mtx */ 321 316 ··· 980 985 981 986 union { 982 987 struct ieee80211_if_ap ap; 983 - struct ieee80211_if_wds wds; 984 988 struct ieee80211_if_vlan vlan; 985 989 struct ieee80211_if_managed mgd; 986 990 struct ieee80211_if_ibss ibss;
+6 -46
net/mac80211/iface.c
··· 230 230 type2 == NL80211_IFTYPE_MONITOR || 231 231 type1 == NL80211_IFTYPE_P2P_DEVICE || 232 232 type2 == NL80211_IFTYPE_P2P_DEVICE || 233 - (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_WDS) || 234 - (type1 == NL80211_IFTYPE_WDS && 235 - (type2 == NL80211_IFTYPE_WDS || 236 - type2 == NL80211_IFTYPE_AP)) || 237 233 (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_AP_VLAN) || 238 234 (type1 == NL80211_IFTYPE_AP_VLAN && 239 235 (type2 == NL80211_IFTYPE_AP || ··· 413 417 * (because if we remove a STA after ops->remove_interface() 414 418 * the driver will have removed the vif info already!) 415 419 * 416 - * In WDS mode a station must exist here and be flushed, for 417 - * AP_VLANs stations may exist since there's nothing else that 420 + * For AP_VLANs stations may exist since there's nothing else that 418 421 * would have removed them, but in other modes there shouldn't 419 422 * be any stations. 420 423 */ 421 424 flushed = sta_info_flush(sdata); 422 - WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP_VLAN && 423 - ((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) || 424 - (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1))); 425 + WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP_VLAN && flushed > 0); 425 426 426 427 /* don't count this interface for allmulti while it is down */ 427 428 if (sdata->flags & IEEE80211_SDATA_ALLMULTI) ··· 545 552 * When we get here, the interface is marked down. 546 553 * Free the remaining keys, if there are any 547 554 * (which can happen in AP mode if userspace sets 548 - * keys before the interface is operating, and maybe 549 - * also in WDS mode) 555 + * keys before the interface is operating) 550 556 * 551 557 * Force the key freeing to always synchronize_net() 552 558 * to wait for the RX path in case it is using this ··· 1012 1020 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 1013 1021 struct net_device *dev = wdev->netdev; 1014 1022 struct ieee80211_local *local = sdata->local; 1015 - struct sta_info *sta; 1016 1023 u32 changed = 0; 1017 1024 int res; 1018 1025 u32 hw_reconf_flags = 0; 1019 1026 1020 1027 switch (sdata->vif.type) { 1021 - case NL80211_IFTYPE_WDS: 1022 - if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) 1023 - return -ENOLINK; 1024 - break; 1025 1028 case NL80211_IFTYPE_AP_VLAN: { 1026 1029 struct ieee80211_sub_if_data *master; 1027 1030 ··· 1065 1078 case NUM_NL80211_IFTYPES: 1066 1079 case NL80211_IFTYPE_P2P_CLIENT: 1067 1080 case NL80211_IFTYPE_P2P_GO: 1081 + case NL80211_IFTYPE_WDS: 1068 1082 /* cannot happen */ 1069 1083 WARN_ON(1); 1070 1084 break; ··· 1184 1196 case NL80211_IFTYPE_OCB: 1185 1197 netif_carrier_off(dev); 1186 1198 break; 1187 - case NL80211_IFTYPE_WDS: 1188 1199 case NL80211_IFTYPE_P2P_DEVICE: 1189 1200 case NL80211_IFTYPE_NAN: 1190 1201 break; ··· 1205 1218 set_bit(SDATA_STATE_RUNNING, &sdata->state); 1206 1219 1207 1220 switch (sdata->vif.type) { 1208 - case NL80211_IFTYPE_WDS: 1209 - /* Create STA entry for the WDS peer */ 1210 - sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, 1211 - GFP_KERNEL); 1212 - if (!sta) { 1213 - res = -ENOMEM; 1214 - goto err_del_interface; 1215 - } 1216 - 1217 - sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); 1218 - sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); 1219 - sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); 1220 - 1221 - res = sta_info_insert(sta); 1222 - if (res) { 1223 - /* STA has been freed */ 1224 - goto err_del_interface; 1225 - } 1226 - 1227 - rate_control_rate_init(sta); 1228 - netif_carrier_on(dev); 1229 - break; 1230 1221 case NL80211_IFTYPE_P2P_DEVICE: 1231 1222 rcu_assign_pointer(local->p2p_sdata, sdata); 1232 1223 break; ··· 1541 1576 sdata->u.mntr.flags = MONITOR_FLAG_CONTROL | 1542 1577 MONITOR_FLAG_OTHER_BSS; 1543 1578 break; 1544 - case NL80211_IFTYPE_WDS: 1545 - sdata->vif.bss_conf.bssid = NULL; 1546 - break; 1547 1579 case NL80211_IFTYPE_NAN: 1548 1580 idr_init(&sdata->u.nan.function_inst_ids); 1549 1581 spin_lock_init(&sdata->u.nan.func_lock); ··· 1551 1589 sdata->vif.bss_conf.bssid = sdata->vif.addr; 1552 1590 break; 1553 1591 case NL80211_IFTYPE_UNSPECIFIED: 1592 + case NL80211_IFTYPE_WDS: 1554 1593 case NUM_NL80211_IFTYPES: 1555 1594 WARN_ON(1); 1556 1595 break; ··· 1596 1633 case NL80211_IFTYPE_OCB: 1597 1634 /* 1598 1635 * Could probably support everything 1599 - * but WDS here (WDS do_open can fail 1600 - * under memory pressure, which this 1601 - * code isn't prepared to handle). 1636 + * but here. 1602 1637 */ 1603 1638 break; 1604 1639 case NL80211_IFTYPE_P2P_CLIENT: ··· 1689 1728 case NL80211_IFTYPE_MONITOR: 1690 1729 /* doesn't matter */ 1691 1730 break; 1692 - case NL80211_IFTYPE_WDS: 1693 1731 case NL80211_IFTYPE_AP_VLAN: 1694 1732 /* match up with an AP interface */ 1695 1733 list_for_each_entry(sdata, &local->interfaces, list) {
-8
net/mac80211/main.c
··· 931 931 return -EINVAL; 932 932 } 933 933 } else { 934 - /* 935 - * WDS is currently prohibited when channel contexts are used 936 - * because there's no clear definition of which channel WDS 937 - * type interfaces use 938 - */ 939 - if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)) 940 - return -EINVAL; 941 - 942 934 /* DFS is not supported with multi-channel combinations yet */ 943 935 for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) { 944 936 const struct ieee80211_iface_combination *comb;
+30
net/mac80211/mesh.c
··· 667 667 } 668 668 } 669 669 670 + static void 671 + ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata, 672 + u8 *ie, u8 ie_len) 673 + { 674 + struct ieee80211_supported_band *sband; 675 + const u8 *cap; 676 + const struct ieee80211_he_operation *he_oper = NULL; 677 + 678 + sband = ieee80211_get_sband(sdata); 679 + if (!sband) 680 + return; 681 + 682 + if (!ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT) || 683 + sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || 684 + sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || 685 + sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) 686 + return; 687 + 688 + sdata->vif.bss_conf.he_support = true; 689 + 690 + cap = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_OPERATION, ie, ie_len); 691 + if (cap && cap[1] >= ieee80211_he_oper_size(&cap[3])) 692 + he_oper = (void *)(cap + 3); 693 + 694 + if (he_oper) 695 + sdata->vif.bss_conf.he_oper.params = 696 + __le32_to_cpu(he_oper->he_oper_params); 697 + } 698 + 670 699 /** 671 700 * ieee80211_fill_mesh_addresses - fill addresses of a locally originated mesh frame 672 701 * @hdr: 802.11 frame header ··· 972 943 973 944 bcn->tail_len = skb->len; 974 945 memcpy(bcn->tail, skb->data, bcn->tail_len); 946 + ieee80211_mesh_update_bss_params(sdata, bcn->tail, bcn->tail_len); 975 947 bcn->meshconf = (struct ieee80211_meshconf_ie *) 976 948 (bcn->tail + ifmsh->meshconf_offset); 977 949
-15
net/mac80211/pm.c
··· 150 150 case NL80211_IFTYPE_STATION: 151 151 ieee80211_mgd_quiesce(sdata); 152 152 break; 153 - case NL80211_IFTYPE_WDS: 154 - /* tear down aggregation sessions and remove STAs */ 155 - mutex_lock(&local->sta_mtx); 156 - sta = sdata->u.wds.sta; 157 - if (sta && sta->uploaded) { 158 - enum ieee80211_sta_state state; 159 - 160 - state = sta->sta_state; 161 - for (; state > IEEE80211_STA_NOTEXIST; state--) 162 - WARN_ON(drv_sta_state(local, sta->sdata, 163 - sta, state, 164 - state - 1)); 165 - } 166 - mutex_unlock(&local->sta_mtx); 167 - break; 168 153 default: 169 154 break; 170 155 }
-5
net/mac80211/rx.c
··· 1477 1477 if (unlikely((ieee80211_is_data(hdr->frame_control) || 1478 1478 ieee80211_is_pspoll(hdr->frame_control)) && 1479 1479 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC && 1480 - rx->sdata->vif.type != NL80211_IFTYPE_WDS && 1481 1480 rx->sdata->vif.type != NL80211_IFTYPE_OCB && 1482 1481 (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC)))) { 1483 1482 /* ··· 4079 4080 return false; 4080 4081 4081 4082 return true; 4082 - case NL80211_IFTYPE_WDS: 4083 - if (bssid || !ieee80211_is_data(hdr->frame_control)) 4084 - return false; 4085 - return ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2); 4086 4083 case NL80211_IFTYPE_P2P_DEVICE: 4087 4084 return ieee80211_is_public_action(hdr, skb->len) || 4088 4085 ieee80211_is_probe_req(hdr->frame_control) ||
+11 -28
net/mac80211/tx.c
··· 319 319 if (tx->sdata->vif.type == NL80211_IFTYPE_OCB) 320 320 return TX_CONTINUE; 321 321 322 - if (tx->sdata->vif.type == NL80211_IFTYPE_WDS) 323 - return TX_CONTINUE; 324 - 325 322 if (tx->flags & IEEE80211_TX_PS_BUFFERED) 326 323 return TX_CONTINUE; 327 324 ··· 2110 2113 info->flags |= IEEE80211_TX_CTL_NO_ACK; 2111 2114 if (txflags & IEEE80211_RADIOTAP_F_TX_NOSEQNO) 2112 2115 info->control.flags |= IEEE80211_TX_CTRL_NO_SEQNO; 2116 + if (txflags & IEEE80211_RADIOTAP_F_TX_ORDER) 2117 + info->control.flags |= 2118 + IEEE80211_TX_CTRL_DONT_REORDER; 2113 2119 break; 2114 2120 2115 2121 case IEEE80211_RADIOTAP_RATE: ··· 2279 2279 payload[7]); 2280 2280 } 2281 2281 2282 - /* 2283 - * Initialize skb->priority for QoS frames. This is put in the TID field 2284 - * of the frame before passing it to the driver. 2282 + /* Initialize skb->priority for QoS frames. If the DONT_REORDER flag 2283 + * is set, stick to the default value for skb->priority to assure 2284 + * frames injected with this flag are not reordered relative to each 2285 + * other. 2285 2286 */ 2286 - if (ieee80211_is_data_qos(hdr->frame_control)) { 2287 + if (ieee80211_is_data_qos(hdr->frame_control) && 2288 + !(info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { 2287 2289 u8 *p = ieee80211_get_qos_ctl(hdr); 2288 2290 skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; 2289 2291 } ··· 2297 2295 * we handle as though they are non-injected frames. 2298 2296 * This code here isn't entirely correct, the local MAC address 2299 2297 * isn't always enough to find the interface to use; for proper 2300 - * VLAN/WDS support we will need a different mechanism (which 2301 - * likely isn't going to be monitor interfaces). 2298 + * VLAN support we have an nl80211-based mechanism. 2302 2299 * 2303 2300 * This is necessary, for example, for old hostapd versions that 2304 2301 * don't use nl80211-based management TX/RX. ··· 2308 2307 if (!ieee80211_sdata_running(tmp_sdata)) 2309 2308 continue; 2310 2309 if (tmp_sdata->vif.type == NL80211_IFTYPE_MONITOR || 2311 - tmp_sdata->vif.type == NL80211_IFTYPE_AP_VLAN || 2312 - tmp_sdata->vif.type == NL80211_IFTYPE_WDS) 2310 + tmp_sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 2313 2311 continue; 2314 2312 if (ether_addr_equal(tmp_sdata->vif.addr, hdr->addr2)) { 2315 2313 sdata = tmp_sdata; ··· 2401 2401 return 0; 2402 2402 } 2403 2403 sta = sta_info_get_bss(sdata, skb->data); 2404 - break; 2405 - case NL80211_IFTYPE_WDS: 2406 - sta = sta_info_get(sdata, sdata->u.wds.remote_addr); 2407 2404 break; 2408 2405 #ifdef CONFIG_MAC80211_MESH 2409 2406 case NL80211_IFTYPE_MESH_POINT: ··· 2576 2579 memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); 2577 2580 hdrlen = 24; 2578 2581 band = chanctx_conf->def.chan->band; 2579 - break; 2580 - case NL80211_IFTYPE_WDS: 2581 - fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); 2582 - /* RA TA DA SA */ 2583 - memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN); 2584 - memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN); 2585 - memcpy(hdr.addr3, skb->data, ETH_ALEN); 2586 - memcpy(hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); 2587 - hdrlen = 30; 2588 - /* 2589 - * This is the exception! WDS style interfaces are prohibited 2590 - * when channel contexts are in used so this must be valid 2591 - */ 2592 - band = local->hw.conf.chandef.chan->band; 2593 2582 break; 2594 2583 #ifdef CONFIG_MAC80211_MESH 2595 2584 case NL80211_IFTYPE_MESH_POINT:
+1 -1
net/mac80211/util.c
··· 2514 2514 return res; 2515 2515 } 2516 2516 break; 2517 - case NL80211_IFTYPE_WDS: 2518 2517 case NL80211_IFTYPE_AP_VLAN: 2519 2518 case NL80211_IFTYPE_MONITOR: 2520 2519 case NL80211_IFTYPE_P2P_DEVICE: ··· 2523 2524 case NUM_NL80211_IFTYPES: 2524 2525 case NL80211_IFTYPE_P2P_CLIENT: 2525 2526 case NL80211_IFTYPE_P2P_GO: 2527 + case NL80211_IFTYPE_WDS: 2526 2528 WARN_ON(1); 2527 2529 break; 2528 2530 }
+13 -5
net/mac80211/wme.c
··· 118 118 struct ieee80211_hdr *hdr) 119 119 { 120 120 struct ieee80211_local *local = sdata->local; 121 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 121 122 u8 *p; 122 123 123 - if (local->hw.queues < IEEE80211_NUM_ACS) 124 + if ((info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) || 125 + local->hw.queues < IEEE80211_NUM_ACS) 124 126 return 0; 125 127 126 128 if (!ieee80211_is_data(hdr->frame_control)) { ··· 143 141 u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, 144 142 struct sta_info *sta, struct sk_buff *skb) 145 143 { 144 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 146 145 struct mac80211_qos_map *qos_map; 147 146 bool qos; 148 147 ··· 156 153 else 157 154 qos = false; 158 155 159 - if (!qos) { 156 + if (!qos || (info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { 160 157 skb->priority = 0; /* required for correct WPA/11i MIC */ 161 158 return IEEE80211_AC_BE; 162 159 } ··· 205 202 case NL80211_IFTYPE_AP: 206 203 ra = skb->data; 207 204 break; 208 - case NL80211_IFTYPE_WDS: 209 - ra = sdata->u.wds.remote_addr; 210 - break; 211 205 case NL80211_IFTYPE_STATION: 212 206 /* might be a TDLS station */ 213 207 sta = sta_info_get(sdata, skb->data); ··· 248 248 return; 249 249 250 250 p = ieee80211_get_qos_ctl(hdr); 251 + 252 + /* don't overwrite the QoS field of injected frames */ 253 + if (info->flags & IEEE80211_TX_CTL_INJECTED) { 254 + /* do take into account Ack policy of injected frames */ 255 + if (*p & IEEE80211_QOS_CTL_ACK_POLICY_NOACK) 256 + info->flags |= IEEE80211_TX_CTL_NO_ACK; 257 + return; 258 + } 251 259 252 260 /* set up the first byte */ 253 261
+3 -3
net/wireless/chan.c
··· 530 530 case NL80211_IFTYPE_P2P_CLIENT: 531 531 case NL80211_IFTYPE_MONITOR: 532 532 case NL80211_IFTYPE_AP_VLAN: 533 - case NL80211_IFTYPE_WDS: 534 533 case NL80211_IFTYPE_P2P_DEVICE: 535 534 case NL80211_IFTYPE_NAN: 536 535 break; 536 + case NL80211_IFTYPE_WDS: 537 537 case NL80211_IFTYPE_UNSPECIFIED: 538 538 case NUM_NL80211_IFTYPES: 539 539 WARN_ON(1); ··· 677 677 case NL80211_IFTYPE_P2P_CLIENT: 678 678 case NL80211_IFTYPE_MONITOR: 679 679 case NL80211_IFTYPE_AP_VLAN: 680 - case NL80211_IFTYPE_WDS: 681 680 case NL80211_IFTYPE_P2P_DEVICE: 682 681 /* Can NAN type be considered as beaconing interface? */ 683 682 case NL80211_IFTYPE_NAN: 684 683 break; 685 684 case NL80211_IFTYPE_UNSPECIFIED: 685 + case NL80211_IFTYPE_WDS: 686 686 case NUM_NL80211_IFTYPES: 687 687 WARN_ON(1); 688 688 } ··· 1324 1324 break; 1325 1325 case NL80211_IFTYPE_MONITOR: 1326 1326 case NL80211_IFTYPE_AP_VLAN: 1327 - case NL80211_IFTYPE_WDS: 1328 1327 case NL80211_IFTYPE_P2P_DEVICE: 1329 1328 case NL80211_IFTYPE_NAN: 1330 1329 /* these interface types don't really have a channel */ 1331 1330 return; 1332 1331 case NL80211_IFTYPE_UNSPECIFIED: 1332 + case NL80211_IFTYPE_WDS: 1333 1333 case NUM_NL80211_IFTYPES: 1334 1334 WARN_ON(1); 1335 1335 }
+1 -7
net/wireless/core.c
··· 631 631 return -EINVAL; 632 632 } 633 633 634 - #ifndef CONFIG_WIRELESS_WDS 635 634 if (WARN_ON(all_iftypes & BIT(NL80211_IFTYPE_WDS))) 636 635 return -EINVAL; 637 - #endif 638 636 639 637 /* You can't even choose that many! */ 640 638 if (WARN_ON(cnt < c->max_interfaces)) ··· 673 675 !(wiphy->nan_supported_bands & BIT(NL80211_BAND_2GHZ))))) 674 676 return -EINVAL; 675 677 676 - #ifndef CONFIG_WIRELESS_WDS 677 678 if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))) 678 679 return -EINVAL; 679 - #endif 680 680 681 681 if (WARN_ON(wiphy->pmsr_capa && !wiphy->pmsr_capa->ftm.supported)) 682 682 return -EINVAL; ··· 1198 1202 case NL80211_IFTYPE_OCB: 1199 1203 __cfg80211_leave_ocb(rdev, dev); 1200 1204 break; 1201 - case NL80211_IFTYPE_WDS: 1202 - /* must be handled by mac80211/driver, has no APIs */ 1203 - break; 1204 1205 case NL80211_IFTYPE_P2P_DEVICE: 1205 1206 case NL80211_IFTYPE_NAN: 1206 1207 /* cannot happen, has no netdev */ ··· 1207 1214 /* nothing to do */ 1208 1215 break; 1209 1216 case NL80211_IFTYPE_UNSPECIFIED: 1217 + case NL80211_IFTYPE_WDS: 1210 1218 case NUM_NL80211_IFTYPES: 1211 1219 /* invalid */ 1212 1220 break;
+44 -41
net/wireless/nl80211.c
··· 715 715 NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), 716 716 [NL80211_ATTR_S1G_CAPABILITY_MASK] = 717 717 NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), 718 + [NL80211_ATTR_SAE_PWE] = 719 + NLA_POLICY_RANGE(NLA_U8, NL80211_SAE_PWE_HUNT_AND_PECK, 720 + NL80211_SAE_PWE_BOTH), 718 721 }; 719 722 720 723 /* policy for the key attributes */ ··· 1885 1882 if (nla_put_u32(msg, i, NL80211_CMD_SET_CHANNEL)) 1886 1883 goto nla_put_failure; 1887 1884 } 1888 - CMD(set_wds_peer, SET_WDS_PEER); 1889 1885 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) { 1890 1886 CMD(tdls_mgmt, TDLS_MGMT); 1891 1887 CMD(tdls_oper, TDLS_OPER); ··· 2862 2860 static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev) 2863 2861 { 2864 2862 /* 2865 - * You can only set the channel explicitly for WDS interfaces, 2866 - * all others have their channel managed via their respective 2863 + * You can only set the channel explicitly for some interfaces, 2864 + * most have their channel managed via their respective 2867 2865 * "establish a connection" command (connect, join, ...) 2868 2866 * 2869 2867 * For AP/GO and mesh mode, the channel can be set with the ··· 3066 3064 struct net_device *netdev = info->user_ptr[1]; 3067 3065 3068 3066 return __nl80211_set_channel(rdev, netdev, info); 3069 - } 3070 - 3071 - static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info) 3072 - { 3073 - struct cfg80211_registered_device *rdev = info->user_ptr[0]; 3074 - struct net_device *dev = info->user_ptr[1]; 3075 - struct wireless_dev *wdev = dev->ieee80211_ptr; 3076 - const u8 *bssid; 3077 - 3078 - if (!info->attrs[NL80211_ATTR_MAC]) 3079 - return -EINVAL; 3080 - 3081 - if (netif_running(dev)) 3082 - return -EBUSY; 3083 - 3084 - if (!rdev->ops->set_wds_peer) 3085 - return -EOPNOTSUPP; 3086 - 3087 - if (wdev->iftype != NL80211_IFTYPE_WDS) 3088 - return -EOPNOTSUPP; 3089 - 3090 - bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 3091 - return rdev_set_wds_peer(rdev, dev, bssid); 3092 3067 } 3093 3068 3094 3069 static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) ··· 4574 4595 struct nlattr *attrs[], 4575 4596 enum nl80211_attrs attr, 4576 4597 struct cfg80211_bitrate_mask *mask, 4577 - struct net_device *dev) 4598 + struct net_device *dev, 4599 + bool default_all_enabled) 4578 4600 { 4579 4601 struct nlattr *tb[NL80211_TXRATE_MAX + 1]; 4580 4602 struct cfg80211_registered_device *rdev = info->user_ptr[0]; ··· 4589 4609 /* Default to all rates enabled */ 4590 4610 for (i = 0; i < NUM_NL80211_BANDS; i++) { 4591 4611 const struct ieee80211_sta_he_cap *he_cap; 4612 + 4613 + if (!default_all_enabled) 4614 + break; 4592 4615 4593 4616 sband = rdev->wiphy.bands[i]; 4594 4617 ··· 4660 4677 mask->control[band].ht_mcs)) 4661 4678 return -EINVAL; 4662 4679 } 4680 + 4663 4681 if (tb[NL80211_TXRATE_VHT]) { 4664 4682 if (!vht_set_mcs_mask( 4665 4683 sband, ··· 4668 4684 mask->control[band].vht_mcs)) 4669 4685 return -EINVAL; 4670 4686 } 4687 + 4671 4688 if (tb[NL80211_TXRATE_GI]) { 4672 4689 mask->control[band].gi = 4673 4690 nla_get_u8(tb[NL80211_TXRATE_GI]); ··· 4680 4695 nla_data(tb[NL80211_TXRATE_HE]), 4681 4696 mask->control[band].he_mcs)) 4682 4697 return -EINVAL; 4698 + 4683 4699 if (tb[NL80211_TXRATE_HE_GI]) 4684 4700 mask->control[band].he_gi = 4685 4701 nla_get_u8(tb[NL80211_TXRATE_HE_GI]); ··· 4722 4736 enum nl80211_band band, 4723 4737 struct cfg80211_bitrate_mask *beacon_rate) 4724 4738 { 4725 - u32 count_ht, count_vht, i; 4739 + u32 count_ht, count_vht, count_he, i; 4726 4740 u32 rate = beacon_rate->control[band].legacy; 4727 4741 4728 4742 /* Allow only one rate */ ··· 4755 4769 return -EINVAL; 4756 4770 } 4757 4771 4758 - if ((count_ht && count_vht) || (!rate && !count_ht && !count_vht)) 4772 + count_he = 0; 4773 + for (i = 0; i < NL80211_HE_NSS_MAX; i++) { 4774 + if (hweight16(beacon_rate->control[band].he_mcs[i]) > 1) { 4775 + return -EINVAL; 4776 + } else if (beacon_rate->control[band].he_mcs[i]) { 4777 + count_he++; 4778 + if (count_he > 1) 4779 + return -EINVAL; 4780 + } 4781 + if (count_he && rate) 4782 + return -EINVAL; 4783 + } 4784 + 4785 + if ((count_ht && count_vht && count_he) || 4786 + (!rate && !count_ht && !count_vht && !count_he)) 4759 4787 return -EINVAL; 4760 4788 4761 4789 if (rate && ··· 4783 4783 if (count_vht && 4784 4784 !wiphy_ext_feature_isset(&rdev->wiphy, 4785 4785 NL80211_EXT_FEATURE_BEACON_RATE_VHT)) 4786 + return -EINVAL; 4787 + if (count_he && 4788 + !wiphy_ext_feature_isset(&rdev->wiphy, 4789 + NL80211_EXT_FEATURE_BEACON_RATE_HE)) 4786 4790 return -EINVAL; 4787 4791 4788 4792 return 0; ··· 5248 5244 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, 5249 5245 NL80211_ATTR_TX_RATES, 5250 5246 &params.beacon_rate, 5251 - dev); 5247 + dev, false); 5252 5248 if (err) 5253 5249 return err; 5254 5250 ··· 9736 9732 nla_len(info->attrs[NL80211_ATTR_SAE_PASSWORD]); 9737 9733 } 9738 9734 9735 + if (info->attrs[NL80211_ATTR_SAE_PWE]) 9736 + settings->sae_pwe = 9737 + nla_get_u8(info->attrs[NL80211_ATTR_SAE_PWE]); 9738 + else 9739 + settings->sae_pwe = NL80211_SAE_PWE_UNSPECIFIED; 9740 + 9739 9741 return 0; 9740 9742 } 9741 9743 ··· 11098 11088 11099 11089 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, 11100 11090 NL80211_ATTR_TX_RATES, &mask, 11101 - dev); 11091 + dev, true); 11102 11092 if (err) 11103 11093 return err; 11104 11094 ··· 11707 11697 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, 11708 11698 NL80211_ATTR_TX_RATES, 11709 11699 &setup.beacon_rate, 11710 - dev); 11700 + dev, false); 11711 11701 if (err) 11712 11702 return err; 11713 11703 ··· 14487 14477 if (tid_conf->txrate_type != NL80211_TX_RATE_AUTOMATIC) { 14488 14478 attr = NL80211_TID_CONFIG_ATTR_TX_RATE; 14489 14479 err = nl80211_parse_tx_bitrate_mask(info, attrs, attr, 14490 - &tid_conf->txrate_mask, dev); 14480 + &tid_conf->txrate_mask, dev, 14481 + true); 14491 14482 if (err) 14492 14483 return err; 14493 14484 ··· 15146 15135 .cmd = NL80211_CMD_SET_CHANNEL, 15147 15136 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 15148 15137 .doit = nl80211_set_channel, 15149 - .flags = GENL_UNS_ADMIN_PERM, 15150 - .internal_flags = NL80211_FLAG_NEED_NETDEV | 15151 - NL80211_FLAG_NEED_RTNL, 15152 - }, 15153 - { 15154 - .cmd = NL80211_CMD_SET_WDS_PEER, 15155 - .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 15156 - .doit = nl80211_set_wds_peer, 15157 15138 .flags = GENL_UNS_ADMIN_PERM, 15158 15139 .internal_flags = NL80211_FLAG_NEED_NETDEV | 15159 15140 NL80211_FLAG_NEED_RTNL,
-10
net/wireless/rdev-ops.h
··· 582 582 return ret; 583 583 } 584 584 585 - static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev, 586 - struct net_device *dev, const u8 *addr) 587 - { 588 - int ret; 589 - trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr); 590 - ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr); 591 - trace_rdev_return_int(&rdev->wiphy, ret); 592 - return ret; 593 - } 594 - 595 585 static inline int 596 586 rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev, 597 587 struct net_device *dev,
+1 -1
net/wireless/scan.c
··· 694 694 static bool cfg80211_find_ssid_match(struct cfg80211_colocated_ap *ap, 695 695 struct cfg80211_scan_request *request) 696 696 { 697 - u8 i; 697 + int i; 698 698 u32 s_ssid; 699 699 700 700 for (i = 0; i < request->n_ssids; i++) {
-5
net/wireless/trace.h
··· 838 838 TP_ARGS(wiphy, netdev, mac) 839 839 ); 840 840 841 - DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_set_wds_peer, 842 - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac), 843 - TP_ARGS(wiphy, netdev, mac) 844 - ); 845 - 846 841 TRACE_EVENT(rdev_dump_station, 847 842 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx, 848 843 u8 *mac),
+19 -18
net/wireless/util.c
··· 550 550 return -1; 551 551 break; 552 552 case cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): 553 - if (unlikely(iftype != NL80211_IFTYPE_WDS && 554 - iftype != NL80211_IFTYPE_MESH_POINT && 553 + if (unlikely(iftype != NL80211_IFTYPE_MESH_POINT && 555 554 iftype != NL80211_IFTYPE_AP_VLAN && 556 555 iftype != NL80211_IFTYPE_STATION)) 557 556 return -1; ··· 1050 1051 case NL80211_IFTYPE_P2P_GO: 1051 1052 case NL80211_IFTYPE_AP: 1052 1053 case NL80211_IFTYPE_AP_VLAN: 1053 - case NL80211_IFTYPE_WDS: 1054 1054 case NL80211_IFTYPE_MESH_POINT: 1055 1055 /* bridging OK */ 1056 1056 break; ··· 1061 1063 /* not happening */ 1062 1064 break; 1063 1065 case NL80211_IFTYPE_P2P_DEVICE: 1066 + case NL80211_IFTYPE_WDS: 1064 1067 case NL80211_IFTYPE_NAN: 1065 1068 WARN_ON(1); 1066 1069 break; ··· 1275 1276 1276 1277 static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) 1277 1278 { 1278 - #define SCALE 2048 1279 - u16 mcs_divisors[12] = { 1280 - 34133, /* 16.666666... */ 1281 - 17067, /* 8.333333... */ 1282 - 11378, /* 5.555555... */ 1283 - 8533, /* 4.166666... */ 1284 - 5689, /* 2.777777... */ 1285 - 4267, /* 2.083333... */ 1286 - 3923, /* 1.851851... */ 1287 - 3413, /* 1.666666... */ 1288 - 2844, /* 1.388888... */ 1289 - 2560, /* 1.250000... */ 1290 - 2276, /* 1.111111... */ 1291 - 2048, /* 1.000000... */ 1279 + #define SCALE 6144 1280 + u32 mcs_divisors[14] = { 1281 + 102399, /* 16.666666... */ 1282 + 51201, /* 8.333333... */ 1283 + 34134, /* 5.555555... */ 1284 + 25599, /* 4.166666... */ 1285 + 17067, /* 2.777777... */ 1286 + 12801, /* 2.083333... */ 1287 + 11769, /* 1.851851... */ 1288 + 10239, /* 1.666666... */ 1289 + 8532, /* 1.388888... */ 1290 + 7680, /* 1.250000... */ 1291 + 6828, /* 1.111111... */ 1292 + 6144, /* 1.000000... */ 1293 + 5690, /* 0.926106... */ 1294 + 5120, /* 0.833333... */ 1292 1295 }; 1293 1296 u32 rates_160M[3] = { 960777777, 907400000, 816666666 }; 1294 1297 u32 rates_969[3] = { 480388888, 453700000, 408333333 }; ··· 1302 1301 u64 tmp; 1303 1302 u32 result; 1304 1303 1305 - if (WARN_ON_ONCE(rate->mcs > 11)) 1304 + if (WARN_ON_ONCE(rate->mcs > 13)) 1306 1305 return 0; 1307 1306 1308 1307 if (WARN_ON_ONCE(rate->he_gi > NL80211_RATE_INFO_HE_GI_3_2))
-51
net/wireless/wext-compat.c
··· 49 49 case IW_MODE_ADHOC: 50 50 type = NL80211_IFTYPE_ADHOC; 51 51 break; 52 - case IW_MODE_REPEAT: 53 - type = NL80211_IFTYPE_WDS; 54 - break; 55 52 case IW_MODE_MONITOR: 56 53 type = NL80211_IFTYPE_MONITOR; 57 54 break; ··· 1147 1150 return 0; 1148 1151 } 1149 1152 1150 - static int cfg80211_wds_wext_siwap(struct net_device *dev, 1151 - struct iw_request_info *info, 1152 - struct sockaddr *addr, char *extra) 1153 - { 1154 - struct wireless_dev *wdev = dev->ieee80211_ptr; 1155 - struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); 1156 - int err; 1157 - 1158 - if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) 1159 - return -EINVAL; 1160 - 1161 - if (addr->sa_family != ARPHRD_ETHER) 1162 - return -EINVAL; 1163 - 1164 - if (netif_running(dev)) 1165 - return -EBUSY; 1166 - 1167 - if (!rdev->ops->set_wds_peer) 1168 - return -EOPNOTSUPP; 1169 - 1170 - err = rdev_set_wds_peer(rdev, dev, (u8 *)&addr->sa_data); 1171 - if (err) 1172 - return err; 1173 - 1174 - memcpy(&wdev->wext.bssid, (u8 *) &addr->sa_data, ETH_ALEN); 1175 - 1176 - return 0; 1177 - } 1178 - 1179 - static int cfg80211_wds_wext_giwap(struct net_device *dev, 1180 - struct iw_request_info *info, 1181 - struct sockaddr *addr, char *extra) 1182 - { 1183 - struct wireless_dev *wdev = dev->ieee80211_ptr; 1184 - 1185 - if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) 1186 - return -EINVAL; 1187 - 1188 - addr->sa_family = ARPHRD_ETHER; 1189 - memcpy(&addr->sa_data, wdev->wext.bssid, ETH_ALEN); 1190 - 1191 - return 0; 1192 - } 1193 - 1194 1153 static int cfg80211_wext_siwrate(struct net_device *dev, 1195 1154 struct iw_request_info *info, 1196 1155 struct iw_param *rate, char *extra) ··· 1324 1371 return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra); 1325 1372 case NL80211_IFTYPE_STATION: 1326 1373 return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra); 1327 - case NL80211_IFTYPE_WDS: 1328 - return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra); 1329 1374 default: 1330 1375 return -EOPNOTSUPP; 1331 1376 } ··· 1340 1389 return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra); 1341 1390 case NL80211_IFTYPE_STATION: 1342 1391 return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra); 1343 - case NL80211_IFTYPE_WDS: 1344 - return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra); 1345 1392 default: 1346 1393 return -EOPNOTSUPP; 1347 1394 }