Skip to content

Commit 0d7043f

Browse files
committed
Merge tag 'mac80211-next-for-net-next-2020-03-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== Another set of changes: * HE ranging (fine timing measurement) API support * hwsim gets virtio support, for use with wmediumd, to be able to simulate with multiple machines * eapol-over-nl80211 improvements to exclude preauth * IBSS reset support, to recover connections from userspace * and various others. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents ffe10e6 + 8fa180b commit 0d7043f

19 files changed

Lines changed: 596 additions & 44 deletions

File tree

‎drivers/net/wireless/mac80211_hwsim.c‎

Lines changed: 309 additions & 18 deletions
Large diffs are not rendered by default.

‎drivers/net/wireless/mac80211_hwsim.h‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
44
* Copyright (c) 2008, Jouni Malinen <j@w1.fi>
55
* Copyright (c) 2011, Javier Lopez <jlopex@gmail.com>
6+
* Copyright (C) 2020 Intel Corporation
67
*/
78

89
#ifndef __MAC80211_HWSIM_H
@@ -245,4 +246,24 @@ struct hwsim_tx_rate_flag {
245246
s8 idx;
246247
u16 flags;
247248
} __packed;
249+
250+
/**
251+
* DOC: Frame transmission support over virtio
252+
*
253+
* Frame transmission is also supported over virtio to allow communication
254+
* with external entities.
255+
*/
256+
257+
/**
258+
* enum hwsim_vqs - queues for virtio frame transmission
259+
*
260+
* @HWSIM_VQ_TX: send frames to external entity
261+
* @HWSIM_VQ_RX: receive frames and transmission info reports
262+
* @HWSIM_NUM_VQS: enum limit
263+
*/
264+
enum {
265+
HWSIM_VQ_TX,
266+
HWSIM_VQ_RX,
267+
HWSIM_NUM_VQS,
268+
};
248269
#endif /* __MAC80211_HWSIM_H */

‎drivers/net/wireless/virt_wifi.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,18 @@ static int virt_wifi_net_device_stop(struct net_device *dev)
436436
return 0;
437437
}
438438

439+
static int virt_wifi_net_device_get_iflink(const struct net_device *dev)
440+
{
441+
struct virt_wifi_netdev_priv *priv = netdev_priv(dev);
442+
443+
return priv->lowerdev->ifindex;
444+
}
445+
439446
static const struct net_device_ops virt_wifi_ops = {
440447
.ndo_start_xmit = virt_wifi_start_xmit,
441-
.ndo_open = virt_wifi_net_device_open,
442-
.ndo_stop = virt_wifi_net_device_stop,
448+
.ndo_open = virt_wifi_net_device_open,
449+
.ndo_stop = virt_wifi_net_device_stop,
450+
.ndo_get_iflink = virt_wifi_net_device_get_iflink,
443451
};
444452

445453
/* Invoked as part of rtnl lock release. */

‎include/net/cfg80211.h‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
88
* Copyright 2013-2014 Intel Mobile Communications GmbH
99
* Copyright 2015-2017 Intel Deutschland GmbH
10-
* Copyright (C) 2018-2019 Intel Corporation
10+
* Copyright (C) 2018-2020 Intel Corporation
1111
*/
1212

1313
#include <linux/netdevice.h>
@@ -924,6 +924,7 @@ struct cfg80211_crypto_settings {
924924
__be16 control_port_ethertype;
925925
bool control_port_no_encrypt;
926926
bool control_port_over_nl80211;
927+
bool control_port_no_preauth;
927928
struct key_params *wep_keys;
928929
int wep_tx_key;
929930
const u8 *psk;
@@ -1054,6 +1055,7 @@ enum cfg80211_ap_settings_flags {
10541055
* @flags: flags, as defined in enum cfg80211_ap_settings_flags
10551056
* @he_obss_pd: OBSS Packet Detection settings
10561057
* @he_bss_color: BSS Color settings
1058+
* @he_oper: HE operation IE (or %NULL if HE isn't enabled)
10571059
*/
10581060
struct cfg80211_ap_settings {
10591061
struct cfg80211_chan_def chandef;
@@ -1078,6 +1080,7 @@ struct cfg80211_ap_settings {
10781080
const struct ieee80211_ht_cap *ht_cap;
10791081
const struct ieee80211_vht_cap *vht_cap;
10801082
const struct ieee80211_he_cap_elem *he_cap;
1083+
const struct ieee80211_he_operation *he_oper;
10811084
bool ht_required, vht_required;
10821085
bool twt_responder;
10831086
u32 flags;
@@ -2696,6 +2699,17 @@ enum wiphy_params_flags {
26962699
* @cache_id: 2-octet cache identifier advertized by a FILS AP identifying the
26972700
* scope of PMKSA. This is valid only if @ssid_len is non-zero (may be
26982701
* %NULL).
2702+
* @pmk_lifetime: Maximum lifetime for PMKSA in seconds
2703+
* (dot11RSNAConfigPMKLifetime) or 0 if not specified.
2704+
* The configured PMKSA must not be used for PMKSA caching after
2705+
* expiration and any keys derived from this PMK become invalid on
2706+
* expiration, i.e., the current association must be dropped if the PMK
2707+
* used for it expires.
2708+
* @pmk_reauth_threshold: Threshold time for reauthentication (percentage of
2709+
* PMK lifetime, dot11RSNAConfigPMKReauthThreshold) or 0 if not specified.
2710+
* Drivers are expected to trigger a full authentication instead of using
2711+
* this PMKSA for caching when reassociating to a new BSS after this
2712+
* threshold to generate a new PMK before the current one expires.
26992713
*/
27002714
struct cfg80211_pmksa {
27012715
const u8 *bssid;
@@ -2705,6 +2719,8 @@ struct cfg80211_pmksa {
27052719
const u8 *ssid;
27062720
size_t ssid_len;
27072721
const u8 *cache_id;
2722+
u32 pmk_lifetime;
2723+
u8 pmk_reauth_threshold;
27082724
};
27092725

27102726
/**
@@ -3269,6 +3285,12 @@ struct cfg80211_pmsr_result {
32693285
* @ftmr_retries: number of retries for FTM request
32703286
* @request_lci: request LCI information
32713287
* @request_civicloc: request civic location information
3288+
* @trigger_based: use trigger based ranging for the measurement
3289+
* If neither @trigger_based nor @non_trigger_based is set,
3290+
* EDCA based ranging will be used.
3291+
* @non_trigger_based: use non trigger based ranging for the measurement
3292+
* If neither @trigger_based nor @non_trigger_based is set,
3293+
* EDCA based ranging will be used.
32723294
*
32733295
* See also nl80211 for the respective attribute documentation.
32743296
*/
@@ -3278,7 +3300,9 @@ struct cfg80211_pmsr_ftm_request_peer {
32783300
u8 requested:1,
32793301
asap:1,
32803302
request_lci:1,
3281-
request_civicloc:1;
3303+
request_civicloc:1,
3304+
trigger_based:1,
3305+
non_trigger_based:1;
32823306
u8 num_bursts_exp;
32833307
u8 burst_duration;
32843308
u8 ftms_per_burst;
@@ -3404,7 +3428,7 @@ struct cfg80211_update_owe_info {
34043428
* @set_default_key: set the default key on an interface
34053429
*
34063430
* @set_default_mgmt_key: set the default management frame key on an interface
3407-
3431+
*
34083432
* @set_default_beacon_key: set the default Beacon frame key on an interface
34093433
*
34103434
* @set_rekey_data: give the data necessary for GTK rekeying to the driver
@@ -4434,6 +4458,8 @@ struct wiphy_iftype_ext_capab {
44344458
* forbid using the value 15 to let the responder pick)
44354459
* @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if
44364460
* not limited)
4461+
* @ftm.trigger_based: trigger based ranging measurement is supported
4462+
* @ftm.non_trigger_based: non trigger based ranging measurement is supported
44374463
*/
44384464
struct cfg80211_pmsr_capabilities {
44394465
unsigned int max_peers;
@@ -4449,7 +4475,9 @@ struct cfg80211_pmsr_capabilities {
44494475
asap:1,
44504476
non_asap:1,
44514477
request_lci:1,
4452-
request_civicloc:1;
4478+
request_civicloc:1,
4479+
trigger_based:1,
4480+
non_trigger_based:1;
44534481
} ftm;
44544482
};
44554483

‎include/net/mac80211.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,7 @@ struct ieee80211_sta_txpwr {
19871987
* @support_p2p_ps: indicates whether the STA supports P2P PS mechanism or not.
19881988
* @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control.
19891989
* @max_tid_amsdu_len: Maximum A-MSDU size in bytes for this TID
1990+
* @txpwr: the station tx power configuration
19901991
* @txq: per-TID data TX queues (if driver uses the TXQ abstraction); note that
19911992
* the last entry (%IEEE80211_NUM_TIDS) is used for non-data frames
19921993
*/
@@ -3451,6 +3452,10 @@ enum ieee80211_reconfig_type {
34513452
* in AP mode, this callback will not be called when the flag
34523453
* %IEEE80211_HW_AP_LINK_PS is set. Must be atomic.
34533454
*
3455+
* @sta_set_txpwr: Configure the station tx power. This callback set the tx
3456+
* power for the station.
3457+
* This callback can sleep.
3458+
*
34543459
* @sta_state: Notifies low level driver about state transition of a
34553460
* station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
34563461
* This callback is mutually exclusive with @sta_add/@sta_remove.

‎include/uapi/linux/nl80211.h‎

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
1212
* Copyright 2008 Colin McCabe <colin@cozybit.com>
1313
* Copyright 2015-2017 Intel Deutschland GmbH
14-
* Copyright (C) 2018-2019 Intel Corporation
14+
* Copyright (C) 2018-2020 Intel Corporation
1515
*
1616
* Permission to use, copy, modify, and/or distribute this software for any
1717
* purpose with or without fee is hereby granted, provided that the above
@@ -1632,7 +1632,8 @@ enum nl80211_commands {
16321632
* flag is included, then control port frames are sent over NL80211 instead
16331633
* using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
16341634
* to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
1635-
* flag.
1635+
* flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
1636+
* frames are not forwared over the control port.
16361637
*
16371638
* @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
16381639
* We recommend using nested, driver-specific attributes within this.
@@ -2442,6 +2443,33 @@ enum nl80211_commands {
24422443
* on output (in wiphy attributes) it contains only the feature sub-
24432444
* attributes.
24442445
*
2446+
* @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control
2447+
* port in order to forward/receive them as ordinary data frames.
2448+
*
2449+
* @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32,
2450+
* dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value).
2451+
* An optional parameter configured through %NL80211_CMD_SET_PMKSA.
2452+
* Drivers that trigger roaming need to know the lifetime of the
2453+
* configured PMKSA for triggering the full vs. PMKSA caching based
2454+
* authentication. This timeout helps authentication methods like SAE,
2455+
* where PMK gets updated only by going through a full (new SAE)
2456+
* authentication instead of getting updated during an association for EAP
2457+
* authentication. No new full authentication within the PMK expiry shall
2458+
* result in a disassociation at the end of the lifetime.
2459+
*
2460+
* @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in
2461+
* terms of percentage of %NL80211_ATTR_PMK_LIFETIME
2462+
* (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional
2463+
* parameter configured through %NL80211_CMD_SET_PMKSA. Requests the
2464+
* driver to trigger a full authentication roam (without PMKSA caching)
2465+
* after the reauthentication threshold time, but before the PMK lifetime
2466+
* has expired.
2467+
*
2468+
* Authentication methods like SAE need to be able to generate a new PMKSA
2469+
* entry without having to force a disconnection after the PMK timeout. If
2470+
* no roaming occurs between the reauth threshold and PMK expiration,
2471+
* disassociation is still forced.
2472+
*
24452473
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
24462474
* @NL80211_ATTR_MAX: highest attribute number currently defined
24472475
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2912,6 +2940,11 @@ enum nl80211_attrs {
29122940

29132941
NL80211_ATTR_TID_CONFIG,
29142942

2943+
NL80211_ATTR_CONTROL_PORT_NO_PREAUTH,
2944+
2945+
NL80211_ATTR_PMK_LIFETIME,
2946+
NL80211_ATTR_PMK_REAUTH_THRESHOLD,
2947+
29152948
/* add attributes here, update the policy in nl80211.c */
29162949

29172950
__NL80211_ATTR_AFTER_LAST,
@@ -5642,6 +5675,15 @@ enum nl80211_feature_flags {
56425675
* @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection
56435676
* and can receive key configuration for BIGTK using key indexes 6 and 7.
56445677
*
5678+
* @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the
5679+
* forwarding of preauth frames over the control port. They are then
5680+
* handled as ordinary data frames.
5681+
*
5682+
* @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames
5683+
*
5684+
* @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations
5685+
* in IBSS mode, essentially by dropping their state.
5686+
*
56455687
* @NUM_NL80211_EXT_FEATURES: number of extended features.
56465688
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
56475689
*/
@@ -5690,6 +5732,9 @@ enum nl80211_ext_feature_index {
56905732
NL80211_EXT_FEATURE_VLAN_OFFLOAD,
56915733
NL80211_EXT_FEATURE_AQL,
56925734
NL80211_EXT_FEATURE_BEACON_PROTECTION,
5735+
NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH,
5736+
NL80211_EXT_FEATURE_PROTECTED_TWT,
5737+
NL80211_EXT_FEATURE_DEL_IBSS_STA,
56935738

56945739
/* add new features before the definition below */
56955740
NUM_NL80211_EXT_FEATURES,
@@ -6312,12 +6357,14 @@ enum nl80211_ftm_responder_stats {
63126357
* @NL80211_PREAMBLE_HT: HT preamble
63136358
* @NL80211_PREAMBLE_VHT: VHT preamble
63146359
* @NL80211_PREAMBLE_DMG: DMG preamble
6360+
* @NL80211_PREAMBLE_HE: HE preamble
63156361
*/
63166362
enum nl80211_preamble {
63176363
NL80211_PREAMBLE_LEGACY,
63186364
NL80211_PREAMBLE_HT,
63196365
NL80211_PREAMBLE_VHT,
63206366
NL80211_PREAMBLE_DMG,
6367+
NL80211_PREAMBLE_HE,
63216368
};
63226369

63236370
/**
@@ -6510,6 +6557,10 @@ enum nl80211_peer_measurement_attrs {
65106557
* is valid)
65116558
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating
65126559
* the maximum FTMs per burst (if not present anything is valid)
6560+
* @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
6561+
* trigger based ranging measurement is supported
6562+
* @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
6563+
* if non trigger based ranging measurement is supported
65136564
*
65146565
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
65156566
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
@@ -6525,6 +6576,8 @@ enum nl80211_peer_measurement_ftm_capa {
65256576
NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS,
65266577
NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT,
65276578
NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
6579+
NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED,
6580+
NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED,
65286581

65296582
/* keep last */
65306583
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
@@ -6554,6 +6607,20 @@ enum nl80211_peer_measurement_ftm_capa {
65546607
* @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)
65556608
* @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data
65566609
* (flag)
6610+
* @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging
6611+
* measurement (flag).
6612+
* This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are
6613+
* mutually exclusive.
6614+
* if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
6615+
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
6616+
* ranging will be used.
6617+
* @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based
6618+
* ranging measurement (flag)
6619+
* This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
6620+
* mutually exclusive.
6621+
* if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
6622+
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
6623+
* ranging will be used.
65576624
*
65586625
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
65596626
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
@@ -6570,6 +6637,8 @@ enum nl80211_peer_measurement_ftm_req {
65706637
NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES,
65716638
NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI,
65726639
NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
6640+
NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
6641+
NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
65736642

65746643
/* keep last */
65756644
NUM_NL80211_PMSR_FTM_REQ_ATTR,

‎include/uapi/linux/virtio_ids.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@
4646
#define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */
4747
#define VIRTIO_ID_FS 26 /* virtio filesystem */
4848
#define VIRTIO_ID_PMEM 27 /* virtio pmem */
49+
#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */
4950

5051
#endif /* _LINUX_VIRTIO_IDS_H */

‎net/mac80211/cfg.c‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
66
* Copyright 2013-2015 Intel Mobile Communications GmbH
77
* Copyright (C) 2015-2017 Intel Deutschland GmbH
8-
* Copyright (C) 2018-2019 Intel Corporation
9-
* Copyright (C) 2018 Intel Corporation
8+
* Copyright (C) 2018-2020 Intel Corporation
109
*/
1110

1211
#include <linux/ieee80211.h>
@@ -1012,8 +1011,15 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
10121011
prev_beacon_int = sdata->vif.bss_conf.beacon_int;
10131012
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
10141013

1015-
if (params->he_cap)
1014+
if (params->he_cap && params->he_oper) {
10161015
sdata->vif.bss_conf.he_support = true;
1016+
sdata->vif.bss_conf.htc_trig_based_pkt_ext =
1017+
le32_get_bits(params->he_oper->he_oper_params,
1018+
IEEE80211_HE_OPERATION_DFLT_PE_DURATION_MASK);
1019+
sdata->vif.bss_conf.frame_time_rts_th =
1020+
le32_get_bits(params->he_oper->he_oper_params,
1021+
IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
1022+
}
10171023

10181024
mutex_lock(&local->mtx);
10191025
err = ieee80211_vif_use_channel(sdata, &params->chandef,
@@ -1034,6 +1040,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
10341040
sdata->control_port_no_encrypt = params->crypto.control_port_no_encrypt;
10351041
sdata->control_port_over_nl80211 =
10361042
params->crypto.control_port_over_nl80211;
1043+
sdata->control_port_no_preauth =
1044+
params->crypto.control_port_no_preauth;
10371045
sdata->encrypt_headroom = ieee80211_cs_headroom(sdata->local,
10381046
&params->crypto,
10391047
sdata->vif.type);
@@ -1045,6 +1053,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
10451053
params->crypto.control_port_no_encrypt;
10461054
vlan->control_port_over_nl80211 =
10471055
params->crypto.control_port_over_nl80211;
1056+
vlan->control_port_no_preauth =
1057+
params->crypto.control_port_no_preauth;
10481058
vlan->encrypt_headroom =
10491059
ieee80211_cs_headroom(sdata->local,
10501060
&params->crypto,

0 commit comments

Comments
 (0)