Skip to content

Commit 9800fc4

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-enabled-by-default into t/upstream base
2 parents fe23015 + 8664cb1 commit 9800fc4

File tree

10 files changed

+122
-41
lines changed

10 files changed

+122
-41
lines changed

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5967,6 +5967,9 @@ static int wmi_process_mgmt_tx_comp(struct ath11k *ar,
59675967
dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
59685968

59695969
info = IEEE80211_SKB_CB(msdu);
5970+
memset(&info->status, 0, sizeof(info->status));
5971+
info->status.rates[0].idx = -1;
5972+
59705973
if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) &&
59715974
!tx_compl_param->status) {
59725975
info->flags |= IEEE80211_TX_STAT_ACK;

drivers/net/wireless/intel/iwlwifi/mld/link.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,13 @@ static int
716716
iwl_mld_get_chan_load_from_element(struct iwl_mld *mld,
717717
struct ieee80211_bss_conf *link_conf)
718718
{
719-
struct ieee80211_vif *vif = link_conf->vif;
720719
const struct cfg80211_bss_ies *ies;
721720
const struct element *bss_load_elem = NULL;
722721
const struct ieee80211_bss_load_elem *bss_load;
723722

724723
guard(rcu)();
725724

726-
if (ieee80211_vif_link_active(vif, link_conf->link_id))
727-
ies = rcu_dereference(link_conf->bss->beacon_ies);
728-
else
729-
ies = rcu_dereference(link_conf->bss->ies);
730-
725+
ies = rcu_dereference(link_conf->bss->beacon_ies);
731726
if (ies)
732727
bss_load_elem = cfg80211_find_elem(WLAN_EID_QBSS_LOAD,
733728
ies->data, ies->len);

drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -938,19 +938,12 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm,
938938

939939
u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, u8 rate_idx)
940940
{
941+
u16 flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx);
941942
bool is_new_rate = iwl_fw_lookup_cmd_ver(fw, BEACON_TEMPLATE_CMD, 0) > 10;
942-
u16 flags, cck_flag;
943-
944-
if (is_new_rate) {
945-
flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx);
946-
cck_flag = IWL_MAC_BEACON_CCK;
947-
} else {
948-
cck_flag = IWL_MAC_BEACON_CCK_V1;
949-
flags = iwl_fw_rate_idx_to_plcp(rate_idx);
950-
}
951943

952944
if (rate_idx <= IWL_LAST_CCK_RATE)
953-
flags |= cck_flag;
945+
flags |= is_new_rate ? IWL_MAC_BEACON_CCK
946+
: IWL_MAC_BEACON_CCK_V1;
954947

955948
return flags;
956949
}

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
463463
if (!aux_roc_te) /* Not a Aux ROC time event */
464464
return -EINVAL;
465465

466-
iwl_mvm_te_check_trigger(mvm, notif, te_data);
466+
iwl_mvm_te_check_trigger(mvm, notif, aux_roc_te);
467467

468468
IWL_DEBUG_TE(mvm,
469469
"Aux ROC time event notification - UID = 0x%x action %d (error = %d)\n",
@@ -475,14 +475,14 @@ static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
475475
/* End TE, notify mac80211 */
476476
ieee80211_remain_on_channel_expired(mvm->hw);
477477
iwl_mvm_roc_finished(mvm); /* flush aux queue */
478-
list_del(&te_data->list); /* remove from list */
479-
te_data->running = false;
480-
te_data->vif = NULL;
481-
te_data->uid = 0;
482-
te_data->id = TE_MAX;
478+
list_del(&aux_roc_te->list); /* remove from list */
479+
aux_roc_te->running = false;
480+
aux_roc_te->vif = NULL;
481+
aux_roc_te->uid = 0;
482+
aux_roc_te->id = TE_MAX;
483483
} else if (le32_to_cpu(notif->action) == TE_V2_NOTIF_HOST_EVENT_START) {
484484
set_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status);
485-
te_data->running = true;
485+
aux_roc_te->running = true;
486486
ieee80211_ready_on_channel(mvm->hw); /* Start TE */
487487
} else {
488488
IWL_DEBUG_TE(mvm,

drivers/net/wireless/intel/iwlwifi/mvm/utils.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,15 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
159159

160160
u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx)
161161
{
162-
return (rate_idx >= IWL_FIRST_OFDM_RATE ?
163-
rate_idx - IWL_FIRST_OFDM_RATE :
164-
rate_idx);
162+
if (iwl_fw_lookup_cmd_ver(fw, TX_CMD, 0) > 8)
163+
/* In the new rate legacy rates are indexed:
164+
* 0 - 3 for CCK and 0 - 7 for OFDM.
165+
*/
166+
return (rate_idx >= IWL_FIRST_OFDM_RATE ?
167+
rate_idx - IWL_FIRST_OFDM_RATE :
168+
rate_idx);
169+
170+
return iwl_fw_rate_idx_to_plcp(rate_idx);
165171
}
166172

167173
u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac)

drivers/net/wireless/marvell/mwl8k.c

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,6 +2966,51 @@ mwl8k_cmd_rf_antenna(struct ieee80211_hw *hw, int antenna, int mask)
29662966
/*
29672967
* CMD_SET_BEACON.
29682968
*/
2969+
2970+
static bool mwl8k_beacon_has_ds_params(const u8 *buf, int len)
2971+
{
2972+
const struct ieee80211_mgmt *mgmt = (const void *)buf;
2973+
int ies_len;
2974+
2975+
if (len <= offsetof(struct ieee80211_mgmt, u.beacon.variable))
2976+
return false;
2977+
2978+
ies_len = len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
2979+
2980+
return cfg80211_find_ie(WLAN_EID_DS_PARAMS, mgmt->u.beacon.variable,
2981+
ies_len) != NULL;
2982+
}
2983+
2984+
static void mwl8k_beacon_copy_inject_ds_params(struct ieee80211_hw *hw,
2985+
u8 *buf_dst, const u8 *buf_src,
2986+
int src_len)
2987+
{
2988+
const struct ieee80211_mgmt *mgmt = (const void *)buf_src;
2989+
static const u8 before_ds_params[] = {
2990+
WLAN_EID_SSID,
2991+
WLAN_EID_SUPP_RATES,
2992+
};
2993+
const u8 *ies;
2994+
int hdr_len, left, offs, pos;
2995+
2996+
ies = mgmt->u.beacon.variable;
2997+
hdr_len = offsetof(struct ieee80211_mgmt, u.beacon.variable);
2998+
2999+
offs = ieee80211_ie_split(ies, src_len - hdr_len, before_ds_params,
3000+
ARRAY_SIZE(before_ds_params), 0);
3001+
3002+
pos = hdr_len + offs;
3003+
left = src_len - pos;
3004+
3005+
memcpy(buf_dst, buf_src, pos);
3006+
3007+
/* Inject a DSSS Parameter Set after SSID + Supp Rates */
3008+
buf_dst[pos + 0] = WLAN_EID_DS_PARAMS;
3009+
buf_dst[pos + 1] = 1;
3010+
buf_dst[pos + 2] = hw->conf.chandef.chan->hw_value;
3011+
3012+
memcpy(buf_dst + pos + 3, buf_src + pos, left);
3013+
}
29693014
struct mwl8k_cmd_set_beacon {
29703015
struct mwl8k_cmd_pkt_hdr header;
29713016
__le16 beacon_len;
@@ -2975,17 +3020,33 @@ struct mwl8k_cmd_set_beacon {
29753020
static int mwl8k_cmd_set_beacon(struct ieee80211_hw *hw,
29763021
struct ieee80211_vif *vif, u8 *beacon, int len)
29773022
{
3023+
bool ds_params_present = mwl8k_beacon_has_ds_params(beacon, len);
29783024
struct mwl8k_cmd_set_beacon *cmd;
2979-
int rc;
3025+
int rc, final_len = len;
29803026

2981-
cmd = kzalloc(sizeof(*cmd) + len, GFP_KERNEL);
3027+
if (!ds_params_present) {
3028+
/*
3029+
* mwl8k firmware requires a DS Params IE with the current
3030+
* channel in AP beacons. If mac80211/hostapd does not
3031+
* include it, inject one here. IE ID + length + channel
3032+
* number = 3 bytes.
3033+
*/
3034+
final_len += 3;
3035+
}
3036+
3037+
cmd = kzalloc(sizeof(*cmd) + final_len, GFP_KERNEL);
29823038
if (cmd == NULL)
29833039
return -ENOMEM;
29843040

29853041
cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_BEACON);
2986-
cmd->header.length = cpu_to_le16(sizeof(*cmd) + len);
2987-
cmd->beacon_len = cpu_to_le16(len);
2988-
memcpy(cmd->beacon, beacon, len);
3042+
cmd->header.length = cpu_to_le16(sizeof(*cmd) + final_len);
3043+
cmd->beacon_len = cpu_to_le16(final_len);
3044+
3045+
if (ds_params_present)
3046+
memcpy(cmd->beacon, beacon, len);
3047+
else
3048+
mwl8k_beacon_copy_inject_ds_params(hw, cmd->beacon, beacon,
3049+
len);
29893050

29903051
rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
29913052
kfree(cmd);

drivers/net/wireless/virtual/mac80211_hwsim.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,8 +2003,14 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
20032003
struct ieee80211_sta *sta = control->sta;
20042004
struct ieee80211_bss_conf *bss_conf;
20052005

2006+
/* This can happen in case of monitor injection */
2007+
if (!vif) {
2008+
ieee80211_free_txskb(hw, skb);
2009+
return;
2010+
}
2011+
20062012
if (link != IEEE80211_LINK_UNSPECIFIED) {
2007-
bss_conf = rcu_dereference(txi->control.vif->link_conf[link]);
2013+
bss_conf = rcu_dereference(vif->link_conf[link]);
20082014
if (sta)
20092015
link_sta = rcu_dereference(sta->link[link]);
20102016
} else {
@@ -2065,13 +2071,13 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
20652071
return;
20662072
}
20672073

2068-
if (txi->control.vif)
2069-
hwsim_check_magic(txi->control.vif);
2074+
if (vif)
2075+
hwsim_check_magic(vif);
20702076
if (control->sta)
20712077
hwsim_check_sta_magic(control->sta);
20722078

20732079
if (ieee80211_hw_check(hw, SUPPORTS_RC_TABLE))
2074-
ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
2080+
ieee80211_get_tx_rates(vif, control->sta, skb,
20752081
txi->control.rates,
20762082
ARRAY_SIZE(txi->control.rates));
20772083

net/ipv4/route.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,11 @@ static void fnhe_remove_oldest(struct fnhe_hash_bucket *hash)
607607
oldest_p = fnhe_p;
608608
}
609609
}
610+
611+
/* Clear oldest->fnhe_daddr to prevent this fnhe from being
612+
* rebound with new dsts in rt_bind_exception().
613+
*/
614+
oldest->fnhe_daddr = 0;
610615
fnhe_flush_routes(oldest);
611616
*oldest_p = oldest->fnhe_next;
612617
kfree_rcu(oldest, rcu);

net/mac80211/iface.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ static int ieee80211_can_powered_addr_change(struct ieee80211_sub_if_data *sdata
223223
if (netif_carrier_ok(sdata->dev))
224224
return -EBUSY;
225225

226+
/* if any stations are set known (so they know this vif too), reject */
227+
if (sta_info_get_by_idx(sdata, 0))
228+
return -EBUSY;
229+
226230
/* First check no ROC work is happening on this iface */
227231
list_for_each_entry(roc, &local->roc_list, list) {
228232
if (roc->sdata != sdata)
@@ -242,12 +246,16 @@ static int ieee80211_can_powered_addr_change(struct ieee80211_sub_if_data *sdata
242246
ret = -EBUSY;
243247
}
244248

249+
/*
250+
* More interface types could be added here but changing the
251+
* address while powered makes the most sense in client modes.
252+
*/
245253
switch (sdata->vif.type) {
246254
case NL80211_IFTYPE_STATION:
247255
case NL80211_IFTYPE_P2P_CLIENT:
248-
/* More interface types could be added here but changing the
249-
* address while powered makes the most sense in client modes.
250-
*/
256+
/* refuse while connecting */
257+
if (sdata->u.mgd.auth_data || sdata->u.mgd.assoc_data)
258+
return -EBUSY;
251259
break;
252260
default:
253261
ret = -EOPNOTSUPP;

net/mac80211/rx.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5446,10 +5446,14 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
54465446
if (WARN_ON(!local->started))
54475447
goto drop;
54485448

5449-
if (likely(!(status->flag & RX_FLAG_FAILED_PLCP_CRC))) {
5449+
if (likely(!(status->flag & RX_FLAG_FAILED_PLCP_CRC) &&
5450+
!(status->flag & RX_FLAG_NO_PSDU &&
5451+
status->zero_length_psdu_type ==
5452+
IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED))) {
54505453
/*
5451-
* Validate the rate, unless a PLCP error means that
5452-
* we probably can't have a valid rate here anyway.
5454+
* Validate the rate, unless there was a PLCP error which may
5455+
* have an invalid rate or the PSDU was not capture and may be
5456+
* missing rate information.
54535457
*/
54545458

54555459
switch (status->encoding) {

0 commit comments

Comments
 (0)