mirror of
https://github.com/t2linux/kernel.git
synced 2026-04-30 13:48:59 -07:00
Merge tag 'mac80211-next-for-davem-2019-06-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== Many changes all over: * HE (802.11ax) work continues * WPA3 offloads * work on extended key ID handling continues * fixes to honour AP supported rates with auth/assoc frames * nl80211 netlink policy improvements to fix some issues with strict validation on new commands with old attrs ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -226,9 +226,6 @@ TBD
|
||||
.. kernel-doc:: include/net/mac80211.h
|
||||
:functions: ieee80211_tx_rate_control
|
||||
|
||||
.. kernel-doc:: include/net/mac80211.h
|
||||
:functions: rate_control_send_low
|
||||
|
||||
TBD
|
||||
|
||||
This part of the book describes mac80211 internals.
|
||||
|
||||
@@ -646,9 +646,6 @@ il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
|
||||
il_sta = NULL;
|
||||
}
|
||||
|
||||
if (rate_control_send_low(sta, il_sta, txrc))
|
||||
return;
|
||||
|
||||
rate_mask = sta->supp_rates[sband->band];
|
||||
|
||||
/* get user max rate if set */
|
||||
|
||||
@@ -2224,10 +2224,6 @@ il4965_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
|
||||
il_sta = NULL;
|
||||
}
|
||||
|
||||
/* Send management frames and NO_ACK data using lowest rate. */
|
||||
if (rate_control_send_low(sta, il_sta, txrc))
|
||||
return;
|
||||
|
||||
if (!lq_sta)
|
||||
return;
|
||||
|
||||
|
||||
@@ -2731,10 +2731,6 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
|
||||
priv_sta = NULL;
|
||||
}
|
||||
|
||||
/* Send management frames and NO_ACK data using lowest rate. */
|
||||
if (rate_control_send_low(sta, priv_sta, txrc))
|
||||
return;
|
||||
|
||||
rate_idx = lq_sta->last_txrate_idx;
|
||||
|
||||
if (lq_sta->last_rate_n_flags & RATE_MCS_HT_MSK) {
|
||||
|
||||
@@ -2960,10 +2960,6 @@ static void rs_drv_get_rate(void *mvm_r, struct ieee80211_sta *sta,
|
||||
mvm_sta = NULL;
|
||||
}
|
||||
|
||||
/* Send management frames and NO_ACK data using lowest rate. */
|
||||
if (rate_control_send_low(sta, mvm_sta, txrc))
|
||||
return;
|
||||
|
||||
if (!mvm_sta)
|
||||
return;
|
||||
|
||||
|
||||
@@ -457,6 +457,8 @@ static struct wiphy_vendor_command mac80211_hwsim_vendor_commands[] = {
|
||||
.subcmd = QCA_NL80211_SUBCMD_TEST },
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV,
|
||||
.doit = mac80211_hwsim_vendor_cmd_test,
|
||||
.policy = hwsim_vendor_test_policy,
|
||||
.maxattr = QCA_WLAN_VENDOR_ATTR_MAX,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -173,9 +173,6 @@ static void rtl_get_rate(void *ppriv, struct ieee80211_sta *sta,
|
||||
u8 try_per_rate, i, rix;
|
||||
bool not_data = !ieee80211_is_data(fc);
|
||||
|
||||
if (rate_control_send_low(sta, priv_sta, txrc))
|
||||
return;
|
||||
|
||||
rix = _rtl_rc_get_highest_rix(rtlpriv, sta, skb, not_data);
|
||||
try_per_rate = 1;
|
||||
_rtl_rc_rate_set_series(rtlpriv, sta, &rates[0], txrc,
|
||||
|
||||
@@ -2612,6 +2612,7 @@ enum ieee80211_key_len {
|
||||
#define FILS_ERP_MAX_RRK_LEN 64
|
||||
|
||||
#define PMK_MAX_LEN 64
|
||||
#define SAE_PASSWORD_MAX_LEN 128
|
||||
|
||||
/* Public action codes (IEEE Std 802.11-2016, 9.6.8.1, Table 9-307) */
|
||||
enum ieee80211_pub_actioncode {
|
||||
@@ -2712,6 +2713,13 @@ enum ieee80211_tdls_actioncode {
|
||||
#define WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT BIT(5)
|
||||
#define WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT BIT(6)
|
||||
|
||||
/*
|
||||
* When set, indicates that the AP is able to tolerate 26-tone RU UL
|
||||
* OFDMA transmissions using HE TB PPDU from OBSS (not falsely classify the
|
||||
* 26-tone RU UL OFDMA transmissions as radar pulses).
|
||||
*/
|
||||
#define WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT BIT(7)
|
||||
|
||||
/* Defines support for enhanced multi-bssid advertisement*/
|
||||
#define WLAN_EXT_CAPA11_EMA_SUPPORT BIT(1)
|
||||
|
||||
|
||||
+77
-11
@@ -381,6 +381,26 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype
|
||||
* @sband: the sband to search for the iftype on
|
||||
* @iftype: enum nl80211_iftype
|
||||
*
|
||||
* Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found
|
||||
*/
|
||||
static inline const struct ieee80211_sta_he_cap *
|
||||
ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband,
|
||||
u8 iftype)
|
||||
{
|
||||
const struct ieee80211_sband_iftype_data *data =
|
||||
ieee80211_get_sband_iftype_data(sband, iftype);
|
||||
|
||||
if (data && data->he_cap.has_he)
|
||||
return &data->he_cap;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA
|
||||
* @sband: the sband to search for the STA on
|
||||
@@ -390,13 +410,7 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband,
|
||||
static inline const struct ieee80211_sta_he_cap *
|
||||
ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)
|
||||
{
|
||||
const struct ieee80211_sband_iftype_data *data =
|
||||
ieee80211_get_sband_iftype_data(sband, NL80211_IFTYPE_STATION);
|
||||
|
||||
if (data && data->he_cap.has_he)
|
||||
return &data->he_cap;
|
||||
|
||||
return NULL;
|
||||
return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -742,6 +756,9 @@ struct survey_info {
|
||||
* CFG80211_MAX_WEP_KEYS WEP keys
|
||||
* @wep_tx_key: key index (0..3) of the default TX static WEP key
|
||||
* @psk: PSK (for devices supporting 4-way-handshake offload)
|
||||
* @sae_pwd: password for SAE authentication (for devices supporting SAE
|
||||
* offload)
|
||||
* @sae_pwd_len: length of SAE password (for devices supporting SAE offload)
|
||||
*/
|
||||
struct cfg80211_crypto_settings {
|
||||
u32 wpa_versions;
|
||||
@@ -757,6 +774,8 @@ struct cfg80211_crypto_settings {
|
||||
struct key_params *wep_keys;
|
||||
int wep_tx_key;
|
||||
const u8 *psk;
|
||||
const u8 *sae_pwd;
|
||||
u8 sae_pwd_len;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -878,6 +897,7 @@ enum cfg80211_ap_settings_flags {
|
||||
* @he_cap: HE capabilities (or %NULL if HE isn't enabled)
|
||||
* @ht_required: stations must support HT
|
||||
* @vht_required: stations must support VHT
|
||||
* @twt_responder: Enable Target Wait Time
|
||||
* @flags: flags, as defined in enum cfg80211_ap_settings_flags
|
||||
*/
|
||||
struct cfg80211_ap_settings {
|
||||
@@ -904,6 +924,7 @@ struct cfg80211_ap_settings {
|
||||
const struct ieee80211_vht_cap *vht_cap;
|
||||
const struct ieee80211_he_cap_elem *he_cap;
|
||||
bool ht_required, vht_required;
|
||||
bool twt_responder;
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
@@ -4151,6 +4172,8 @@ struct sta_opmode_info {
|
||||
u8 rx_nss;
|
||||
};
|
||||
|
||||
#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)ERR_PTR(-ENODATA))
|
||||
|
||||
/**
|
||||
* struct wiphy_vendor_command - vendor command definition
|
||||
* @info: vendor command identifying information, as used in nl80211
|
||||
@@ -4161,6 +4184,10 @@ struct sta_opmode_info {
|
||||
* @dumpit: dump callback, for transferring bigger/multiple items. The
|
||||
* @storage points to cb->args[5], ie. is preserved over the multiple
|
||||
* dumpit calls.
|
||||
* @policy: policy pointer for attributes within %NL80211_ATTR_VENDOR_DATA.
|
||||
* Set this to %VENDOR_CMD_RAW_DATA if no policy can be given and the
|
||||
* attribute is just raw data (e.g. a firmware command).
|
||||
* @maxattr: highest attribute number in policy
|
||||
* It's recommended to not have the same sub command with both @doit and
|
||||
* @dumpit, so that userspace can assume certain ones are get and others
|
||||
* are used with dump requests.
|
||||
@@ -4173,6 +4200,8 @@ struct wiphy_vendor_command {
|
||||
int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
struct sk_buff *skb, const void *data, int data_len,
|
||||
unsigned long *storage);
|
||||
const struct nla_policy *policy;
|
||||
unsigned int maxattr;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -5721,6 +5750,26 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
|
||||
*/
|
||||
void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
|
||||
|
||||
/**
|
||||
* cfg80211_bss_iter - iterate all BSS entries
|
||||
*
|
||||
* This function iterates over the BSS entries associated with the given wiphy
|
||||
* and calls the callback for the iterated BSS. The iterator function is not
|
||||
* allowed to call functions that might modify the internal state of the BSS DB.
|
||||
*
|
||||
* @wiphy: the wiphy
|
||||
* @chandef: if given, the iterator function will be called only if the channel
|
||||
* of the currently iterated BSS is a subset of the given channel.
|
||||
* @iter: the iterator function to call
|
||||
* @iter_data: an argument to the iterator function
|
||||
*/
|
||||
void cfg80211_bss_iter(struct wiphy *wiphy,
|
||||
struct cfg80211_chan_def *chandef,
|
||||
void (*iter)(struct wiphy *wiphy,
|
||||
struct cfg80211_bss *bss,
|
||||
void *data),
|
||||
void *iter_data);
|
||||
|
||||
static inline enum nl80211_bss_scan_width
|
||||
cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
@@ -6231,8 +6280,11 @@ struct cfg80211_fils_resp_params {
|
||||
* case.
|
||||
* @bssid: The BSSID of the AP (may be %NULL)
|
||||
* @bss: Entry of bss to which STA got connected to, can be obtained through
|
||||
* cfg80211_get_bss() (may be %NULL). Only one parameter among @bssid and
|
||||
* @bss needs to be specified.
|
||||
* cfg80211_get_bss() (may be %NULL). But it is recommended to store the
|
||||
* bss from the connect_request and hold a reference to it and return
|
||||
* through this param to avoid a warning if the bss is expired during the
|
||||
* connection, esp. for those drivers implementing connect op.
|
||||
* Only one parameter among @bssid and @bss needs to be specified.
|
||||
* @req_ie: Association request IEs (may be %NULL)
|
||||
* @req_ie_len: Association request IEs length
|
||||
* @resp_ie: Association response IEs (may be %NULL)
|
||||
@@ -6280,8 +6332,12 @@ void cfg80211_connect_done(struct net_device *dev,
|
||||
*
|
||||
* @dev: network device
|
||||
* @bssid: the BSSID of the AP
|
||||
* @bss: entry of bss to which STA got connected to, can be obtained
|
||||
* through cfg80211_get_bss (may be %NULL)
|
||||
* @bss: Entry of bss to which STA got connected to, can be obtained through
|
||||
* cfg80211_get_bss() (may be %NULL). But it is recommended to store the
|
||||
* bss from the connect_request and hold a reference to it and return
|
||||
* through this param to avoid a warning if the bss is expired during the
|
||||
* connection, esp. for those drivers implementing connect op.
|
||||
* Only one parameter among @bssid and @bss needs to be specified.
|
||||
* @req_ie: association request IEs (maybe be %NULL)
|
||||
* @req_ie_len: association request IEs length
|
||||
* @resp_ie: association response IEs (may be %NULL)
|
||||
@@ -6491,6 +6547,16 @@ void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
|
||||
struct ieee80211_channel *chan,
|
||||
gfp_t gfp);
|
||||
|
||||
/**
|
||||
* cfg80211_tx_mgmt_expired - tx_mgmt duration expired
|
||||
* @wdev: wireless device
|
||||
* @cookie: the requested cookie
|
||||
* @chan: The current channel (from tx_mgmt request)
|
||||
* @gfp: allocation flags
|
||||
*/
|
||||
void cfg80211_tx_mgmt_expired(struct wireless_dev *wdev, u64 cookie,
|
||||
struct ieee80211_channel *chan, gfp_t gfp);
|
||||
|
||||
/**
|
||||
* cfg80211_sinfo_alloc_tid_stats - allocate per-tid statistics.
|
||||
*
|
||||
|
||||
+9
-23
@@ -317,6 +317,7 @@ struct ieee80211_vif_chanctx_switch {
|
||||
* @BSS_CHANGED_MCAST_RATE: Multicast Rate setting changed for this interface
|
||||
* @BSS_CHANGED_FTM_RESPONDER: fime timing reasurement request responder
|
||||
* functionality changed for this BSS (AP mode).
|
||||
* @BSS_CHANGED_TWT: TWT status changed
|
||||
*
|
||||
*/
|
||||
enum ieee80211_bss_change {
|
||||
@@ -347,6 +348,7 @@ enum ieee80211_bss_change {
|
||||
BSS_CHANGED_KEEP_ALIVE = 1<<24,
|
||||
BSS_CHANGED_MCAST_RATE = 1<<25,
|
||||
BSS_CHANGED_FTM_RESPONDER = 1<<26,
|
||||
BSS_CHANGED_TWT = 1<<27,
|
||||
|
||||
/* when adding here, make sure to change ieee80211_reconfig */
|
||||
};
|
||||
@@ -504,6 +506,8 @@ struct ieee80211_ftm_responder_params {
|
||||
* @he_support: does this BSS support HE
|
||||
* @twt_requester: does this BSS support TWT requester (relevant for managed
|
||||
* mode only, set if the AP advertises TWT responder role)
|
||||
* @twt_responder: does this BSS support TWT requester (relevant for managed
|
||||
* mode only, set if the AP advertises TWT responder role)
|
||||
* @assoc: association status
|
||||
* @ibss_joined: indicates whether this station is part of an IBSS
|
||||
* or not
|
||||
@@ -611,6 +615,7 @@ struct ieee80211_bss_conf {
|
||||
u16 frame_time_rts_th;
|
||||
bool he_support;
|
||||
bool twt_requester;
|
||||
bool twt_responder;
|
||||
/* association related data */
|
||||
bool assoc, ibss_joined;
|
||||
bool ibss_creator;
|
||||
@@ -2269,6 +2274,9 @@ struct ieee80211_txq {
|
||||
* @IEEE80211_HW_EXT_KEY_ID_NATIVE: Driver and hardware are supporting Extended
|
||||
* Key ID and can handle two unicast keys per station for Rx and Tx.
|
||||
*
|
||||
* @IEEE80211_HW_NO_AMPDU_KEYBORDER_SUPPORT: The card/driver can't handle
|
||||
* active Tx A-MPDU sessions with Extended Key IDs during rekey.
|
||||
*
|
||||
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
|
||||
*/
|
||||
enum ieee80211_hw_flags {
|
||||
@@ -2321,6 +2329,7 @@ enum ieee80211_hw_flags {
|
||||
IEEE80211_HW_SUPPORTS_MULTI_BSSID,
|
||||
IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
|
||||
IEEE80211_HW_EXT_KEY_ID_NATIVE,
|
||||
IEEE80211_HW_NO_AMPDU_KEYBORDER_SUPPORT,
|
||||
|
||||
/* keep last, obviously */
|
||||
NUM_IEEE80211_HW_FLAGS
|
||||
@@ -5951,29 +5960,6 @@ static inline int rate_supported(struct ieee80211_sta *sta,
|
||||
return (sta == NULL || sta->supp_rates[band] & BIT(index));
|
||||
}
|
||||
|
||||
/**
|
||||
* rate_control_send_low - helper for drivers for management/no-ack frames
|
||||
*
|
||||
* Rate control algorithms that agree to use the lowest rate to
|
||||
* send management frames and NO_ACK data with the respective hw
|
||||
* retries should use this in the beginning of their mac80211 get_rate
|
||||
* callback. If true is returned the rate control can simply return.
|
||||
* If false is returned we guarantee that sta and sta and priv_sta is
|
||||
* not null.
|
||||
*
|
||||
* Rate control algorithms wishing to do more intelligent selection of
|
||||
* rate for multicast/broadcast frames may choose to not use this.
|
||||
*
|
||||
* @sta: &struct ieee80211_sta pointer to the target destination. Note
|
||||
* that this may be null.
|
||||
* @priv_sta: private rate control structure. This may be null.
|
||||
* @txrc: rate control information we sholud populate for mac80211.
|
||||
*/
|
||||
bool rate_control_send_low(struct ieee80211_sta *sta,
|
||||
void *priv_sta,
|
||||
struct ieee80211_tx_rate_control *txrc);
|
||||
|
||||
|
||||
static inline s8
|
||||
rate_lowest_index(struct ieee80211_supported_band *sband,
|
||||
struct ieee80211_sta *sta)
|
||||
|
||||
@@ -1754,6 +1754,15 @@ static inline int __nla_validate_nested(const struct nlattr *start, int maxtype,
|
||||
validate, extack);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nl80211_validate_nested(const struct nlattr *start, int maxtype,
|
||||
const struct nla_policy *policy,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
return __nla_validate_nested(start, maxtype, policy,
|
||||
NL_VALIDATE_STRICT, extack);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nla_validate_nested_deprecated(const struct nlattr *start, int maxtype,
|
||||
const struct nla_policy *policy,
|
||||
|
||||
@@ -234,6 +234,15 @@
|
||||
* use in a FILS shared key connection with PMKSA caching.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: SAE authentication offload
|
||||
*
|
||||
* By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
|
||||
* support offloading SAE authentication for WPA3-Personal networks. In
|
||||
* %NL80211_CMD_CONNECT the password for SAE should be specified using
|
||||
* %NL80211_ATTR_SAE_PASSWORD.
|
||||
*/
|
||||
|
||||
/**
|
||||
* enum nl80211_commands - supported nl80211 commands
|
||||
*
|
||||
@@ -2341,6 +2350,12 @@ enum nl80211_commands {
|
||||
* should be picking up the lowest tx power, either tx power per-interface
|
||||
* or per-station.
|
||||
*
|
||||
* @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It
|
||||
* is used with %NL80211_CMD_CONNECT to provide password for offloading
|
||||
* SAE authentication for WPA3-Personal networks.
|
||||
*
|
||||
* @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
|
||||
*
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -2794,6 +2809,10 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_STA_TX_POWER_SETTING,
|
||||
NL80211_ATTR_STA_TX_POWER,
|
||||
|
||||
NL80211_ATTR_SAE_PASSWORD,
|
||||
|
||||
NL80211_ATTR_TWT_RESPONDER,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
@@ -4406,6 +4425,7 @@ enum nl80211_mfp {
|
||||
enum nl80211_wpa_versions {
|
||||
NL80211_WPA_VERSION_1 = 1 << 0,
|
||||
NL80211_WPA_VERSION_2 = 1 << 1,
|
||||
NL80211_WPA_VERSION_3 = 1 << 2,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -5422,6 +5442,9 @@ enum nl80211_feature_flags {
|
||||
* @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
|
||||
* to a station.
|
||||
*
|
||||
* @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
|
||||
* station mode (SAE password is passed as part of the connect command).
|
||||
*
|
||||
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
||||
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
||||
*/
|
||||
@@ -5466,6 +5489,7 @@ enum nl80211_ext_feature_index {
|
||||
NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
|
||||
NL80211_EXT_FEATURE_EXT_KEY_ID,
|
||||
NL80211_EXT_FEATURE_STA_TX_PWR,
|
||||
NL80211_EXT_FEATURE_SAE_OFFLOAD,
|
||||
|
||||
/* add new features before the definition below */
|
||||
NUM_NL80211_EXT_FEATURES,
|
||||
|
||||
+5
-3
@@ -4,7 +4,7 @@
|
||||
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
|
||||
* Copyright 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2015-2017 Intel Deutschland GmbH
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* This file is GPLv2 as found in COPYING.
|
||||
*/
|
||||
@@ -975,7 +975,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
|
||||
BSS_CHANGED_BEACON |
|
||||
BSS_CHANGED_SSID |
|
||||
BSS_CHANGED_P2P_PS |
|
||||
BSS_CHANGED_TXPOWER;
|
||||
BSS_CHANGED_TXPOWER |
|
||||
BSS_CHANGED_TWT;
|
||||
int err;
|
||||
int prev_beacon_int;
|
||||
|
||||
@@ -1045,6 +1046,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
|
||||
sdata->vif.bss_conf.dtim_period = params->dtim_period;
|
||||
sdata->vif.bss_conf.enable_beacon = true;
|
||||
sdata->vif.bss_conf.allow_p2p_go_ps = sdata->vif.p2p;
|
||||
sdata->vif.bss_conf.twt_responder = params->twt_responder;
|
||||
|
||||
sdata->vif.bss_conf.ssid_len = params->ssid_len;
|
||||
if (params->ssid_len)
|
||||
@@ -1466,7 +1468,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (params->supported_rates) {
|
||||
if (params->supported_rates && params->supported_rates_len) {
|
||||
ieee80211_parse_bitrates(&sdata->vif.bss_conf.chandef,
|
||||
sband, params->supported_rates,
|
||||
params->supported_rates_len,
|
||||
|
||||
@@ -274,6 +274,7 @@ static const char *hw_flag_names[] = {
|
||||
FLAG(SUPPORTS_MULTI_BSSID),
|
||||
FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID),
|
||||
FLAG(EXT_KEY_ID_NATIVE),
|
||||
FLAG(NO_AMPDU_KEYBORDER_SUPPORT),
|
||||
#undef FLAG
|
||||
};
|
||||
|
||||
|
||||
@@ -342,9 +342,6 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
|
||||
key->debugfs.dir = debugfs_create_dir(buf,
|
||||
key->local->debugfs.keys);
|
||||
|
||||
if (!key->debugfs.dir)
|
||||
return;
|
||||
|
||||
sta = key->sta;
|
||||
if (sta) {
|
||||
sprintf(buf, "../../netdev:%s/stations/%pM",
|
||||
|
||||
@@ -818,9 +818,8 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
|
||||
sprintf(buf, "netdev:%s", sdata->name);
|
||||
sdata->vif.debugfs_dir = debugfs_create_dir(buf,
|
||||
sdata->local->hw.wiphy->debugfsdir);
|
||||
if (sdata->vif.debugfs_dir)
|
||||
sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
|
||||
sdata->vif.debugfs_dir);
|
||||
sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
|
||||
sdata->vif.debugfs_dir);
|
||||
add_files(sdata);
|
||||
}
|
||||
|
||||
@@ -845,8 +844,5 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
|
||||
return;
|
||||
|
||||
sprintf(buf, "netdev:%s", sdata->name);
|
||||
if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
|
||||
sdata_err(sdata,
|
||||
"debugfs: failed to rename debugfs dir to %s\n",
|
||||
buf);
|
||||
debugfs_rename(dir->d_parent, dir, dir->d_parent, buf);
|
||||
}
|
||||
|
||||
@@ -960,8 +960,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
|
||||
* dir might still be around.
|
||||
*/
|
||||
sta->debugfs_dir = debugfs_create_dir(mac, stations_dir);
|
||||
if (!sta->debugfs_dir)
|
||||
return;
|
||||
|
||||
DEBUGFS_ADD(flags);
|
||||
DEBUGFS_ADD(aid);
|
||||
|
||||
+56
-44
@@ -274,50 +274,61 @@ int ieee80211_set_tx_key(struct ieee80211_key *key)
|
||||
|
||||
old = key_mtx_dereference(local, sta->ptk[sta->ptk_idx]);
|
||||
sta->ptk_idx = key->conf.keyidx;
|
||||
|
||||
if (ieee80211_hw_check(&local->hw, NO_AMPDU_KEYBORDER_SUPPORT))
|
||||
clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
|
||||
ieee80211_check_fast_xmit(sta);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ieee80211_hw_key_replace(struct ieee80211_key *old_key,
|
||||
struct ieee80211_key *new_key,
|
||||
bool pairwise)
|
||||
static void ieee80211_pairwise_rekey(struct ieee80211_key *old,
|
||||
struct ieee80211_key *new)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata;
|
||||
struct ieee80211_local *local;
|
||||
struct sta_info *sta;
|
||||
int ret;
|
||||
struct ieee80211_local *local = new->local;
|
||||
struct sta_info *sta = new->sta;
|
||||
int i;
|
||||
|
||||
/* Aggregation sessions are OK when running on SW crypto.
|
||||
* A broken remote STA may cause issues not observed with HW
|
||||
* crypto, though.
|
||||
*/
|
||||
if (!(old_key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
|
||||
return 0;
|
||||
assert_key_lock(local);
|
||||
|
||||
assert_key_lock(old_key->local);
|
||||
sta = old_key->sta;
|
||||
if (new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) {
|
||||
/* Extended Key ID key install, initial one or rekey */
|
||||
|
||||
/* Unicast rekey without Extended Key ID needs special handling */
|
||||
if (new_key && sta && pairwise &&
|
||||
rcu_access_pointer(sta->ptk[sta->ptk_idx]) == old_key) {
|
||||
local = old_key->local;
|
||||
sdata = old_key->sdata;
|
||||
|
||||
/* Stop TX till we are on the new key */
|
||||
old_key->flags |= KEY_FLAG_TAINTED;
|
||||
ieee80211_clear_fast_xmit(sta);
|
||||
|
||||
/* Aggregation sessions during rekey are complicated due to the
|
||||
* reorder buffer and retransmits. Side step that by blocking
|
||||
* aggregation during rekey and tear down running sessions.
|
||||
if (sta->ptk_idx != INVALID_PTK_KEYIDX &&
|
||||
ieee80211_hw_check(&local->hw,
|
||||
NO_AMPDU_KEYBORDER_SUPPORT)) {
|
||||
/* Aggregation Sessions with Extended Key ID must not
|
||||
* mix MPDUs with different keyIDs within one A-MPDU.
|
||||
* Tear down any running Tx aggregation and all new
|
||||
* Rx/Tx aggregation request during rekey if the driver
|
||||
* asks us to do so. (Blocking Tx only would be
|
||||
* sufficient but WLAN_STA_BLOCK_BA gets the job done
|
||||
* for the few ms we need it.)
|
||||
*/
|
||||
set_sta_flag(sta, WLAN_STA_BLOCK_BA);
|
||||
mutex_lock(&sta->ampdu_mlme.mtx);
|
||||
for (i = 0; i < IEEE80211_NUM_TIDS; i++)
|
||||
___ieee80211_stop_tx_ba_session(sta, i,
|
||||
AGG_STOP_LOCAL_REQUEST);
|
||||
mutex_unlock(&sta->ampdu_mlme.mtx);
|
||||
}
|
||||
} else if (old) {
|
||||
/* Rekey without Extended Key ID.
|
||||
* Aggregation sessions are OK when running on SW crypto.
|
||||
* A broken remote STA may cause issues not observed with HW
|
||||
* crypto, though.
|
||||
*/
|
||||
if (!(old->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
|
||||
return;
|
||||
|
||||
/* Stop Tx till we are on the new key */
|
||||
old->flags |= KEY_FLAG_TAINTED;
|
||||
ieee80211_clear_fast_xmit(sta);
|
||||
if (ieee80211_hw_check(&local->hw, AMPDU_AGGREGATION)) {
|
||||
set_sta_flag(sta, WLAN_STA_BLOCK_BA);
|
||||
ieee80211_sta_tear_down_BA_sessions(sta,
|
||||
AGG_STOP_LOCAL_REQUEST);
|
||||
}
|
||||
|
||||
if (!wiphy_ext_feature_isset(local->hw.wiphy,
|
||||
NL80211_EXT_FEATURE_CAN_REPLACE_PTK0)) {
|
||||
pr_warn_ratelimited("Rekeying PTK for STA %pM but driver can't safely do that.",
|
||||
@@ -325,18 +336,9 @@ static int ieee80211_hw_key_replace(struct ieee80211_key *old_key,
|
||||
/* Flushing the driver queues *may* help prevent
|
||||
* the clear text leaks and freezes.
|
||||
*/
|
||||
ieee80211_flush_queues(local, sdata, false);
|
||||
ieee80211_flush_queues(local, old->sdata, false);
|
||||
}
|
||||
}
|
||||
|
||||
ieee80211_key_disable_hw_accel(old_key);
|
||||
|
||||
if (new_key)
|
||||
ret = ieee80211_key_enable_hw_accel(new_key);
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata,
|
||||
@@ -394,7 +396,6 @@ void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata,
|
||||
mutex_unlock(&sdata->local->key_mtx);
|
||||
}
|
||||
|
||||
|
||||
static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
|
||||
struct sta_info *sta,
|
||||
bool pairwise,
|
||||
@@ -402,7 +403,7 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
|
||||
struct ieee80211_key *new)
|
||||
{
|
||||
int idx;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
bool defunikey, defmultikey, defmgmtkey;
|
||||
|
||||
/* caller must provide at least one old/new */
|
||||
@@ -414,16 +415,27 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
WARN_ON(new && old && new->conf.keyidx != old->conf.keyidx);
|
||||
|
||||
if (new && sta && pairwise) {
|
||||
/* Unicast rekey needs special handling. With Extended Key ID
|
||||
* old is still NULL for the first rekey.
|
||||
*/
|
||||
ieee80211_pairwise_rekey(old, new);
|
||||
}
|
||||
|
||||
if (old) {
|
||||
idx = old->conf.keyidx;
|
||||
ret = ieee80211_hw_key_replace(old, new, pairwise);
|
||||
|
||||
if (old->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
|
||||
ieee80211_key_disable_hw_accel(old);
|
||||
|
||||
if (new)
|
||||
ret = ieee80211_key_enable_hw_accel(new);
|
||||
}
|
||||
} else {
|
||||
/* new must be provided in case old is not */
|
||||
idx = new->conf.keyidx;
|
||||
if (!new->local->wowlan)
|
||||
ret = ieee80211_key_enable_hw_accel(new);
|
||||
else
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
|
||||
+22
-3
@@ -3148,6 +3148,19 @@ static bool ieee80211_twt_req_supported(const struct sta_info *sta,
|
||||
IEEE80211_HE_MAC_CAP0_TWT_RES;
|
||||
}
|
||||
|
||||
static int ieee80211_recalc_twt_req(struct ieee80211_sub_if_data *sdata,
|
||||
struct sta_info *sta,
|
||||
struct ieee802_11_elems *elems)
|
||||
{
|
||||
bool twt = ieee80211_twt_req_supported(sta, elems);
|
||||
|
||||
if (sdata->vif.bss_conf.twt_requester != twt) {
|
||||
sdata->vif.bss_conf.twt_requester = twt;
|
||||
return BSS_CHANGED_TWT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
|
||||
struct cfg80211_bss *cbss,
|
||||
struct ieee80211_mgmt *mgmt, size_t len)
|
||||
@@ -3330,8 +3343,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
|
||||
sta);
|
||||
|
||||
bss_conf->he_support = sta->sta.he_cap.has_he;
|
||||
bss_conf->twt_requester =
|
||||
ieee80211_twt_req_supported(sta, &elems);
|
||||
changed |= ieee80211_recalc_twt_req(sdata, sta, &elems);
|
||||
} else {
|
||||
bss_conf->he_support = false;
|
||||
bss_conf->twt_requester = false;
|
||||
@@ -3991,6 +4003,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
|
||||
mutex_lock(&local->sta_mtx);
|
||||
sta = sta_info_get(sdata, bssid);
|
||||
|
||||
changed |= ieee80211_recalc_twt_req(sdata, sta, &elems);
|
||||
|
||||
if (ieee80211_config_bw(sdata, sta,
|
||||
elems.ht_cap_elem, elems.ht_operation,
|
||||
elems.vht_operation, elems.he_operation,
|
||||
@@ -4941,7 +4955,12 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
|
||||
basic_rates = BIT(min_rate_index);
|
||||
}
|
||||
|
||||
new_sta->sta.supp_rates[cbss->channel->band] = rates;
|
||||
if (rates)
|
||||
new_sta->sta.supp_rates[cbss->channel->band] = rates;
|
||||
else
|
||||
sdata_info(sdata,
|
||||
"No rates found, keeping mandatory only\n");
|
||||
|
||||
sdata->vif.bss_conf.basic_rates = basic_rates;
|
||||
|
||||
/* cf. IEEE 802.11 9.2.12 */
|
||||
|
||||
@@ -202,6 +202,10 @@ static void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
|
||||
cfg80211_remain_on_channel_expired(&roc->sdata->wdev,
|
||||
roc->cookie, roc->chan,
|
||||
GFP_KERNEL);
|
||||
else
|
||||
cfg80211_tx_mgmt_expired(&roc->sdata->wdev,
|
||||
roc->mgmt_tx_cookie,
|
||||
roc->chan, GFP_KERNEL);
|
||||
|
||||
list_del(&roc->list);
|
||||
kfree(roc);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user