Skip to content

Commit cd882e2

Browse files
committed
Merge wireless into wireless-next
There's a conflict already and some upcoming changes also depend on changes in wireless for being conflict- free, so pull wireless in to make all that easier. Signed-off-by: Johannes Berg <[email protected]>
2 parents 1820944 + b719838 commit cd882e2

File tree

6 files changed

+79
-18
lines changed

6 files changed

+79
-18
lines changed

drivers/net/wireless/intel/iwlwifi/fw/acpi.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt)
475475
&tbl_rev);
476476
if (!IS_ERR(wifi_pkg)) {
477477
if (tbl_rev != 2) {
478-
ret = PTR_ERR(wifi_pkg);
478+
ret = -EINVAL;
479479
goto out_free;
480480
}
481481

@@ -491,7 +491,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt)
491491
&tbl_rev);
492492
if (!IS_ERR(wifi_pkg)) {
493493
if (tbl_rev != 1) {
494-
ret = PTR_ERR(wifi_pkg);
494+
ret = -EINVAL;
495495
goto out_free;
496496
}
497497

@@ -507,7 +507,7 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt)
507507
&tbl_rev);
508508
if (!IS_ERR(wifi_pkg)) {
509509
if (tbl_rev != 0) {
510-
ret = PTR_ERR(wifi_pkg);
510+
ret = -EINVAL;
511511
goto out_free;
512512
}
513513

@@ -563,7 +563,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt)
563563
&tbl_rev);
564564
if (!IS_ERR(wifi_pkg)) {
565565
if (tbl_rev != 2) {
566-
ret = PTR_ERR(wifi_pkg);
566+
ret = -EINVAL;
567567
goto out_free;
568568
}
569569

@@ -579,7 +579,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt)
579579
&tbl_rev);
580580
if (!IS_ERR(wifi_pkg)) {
581581
if (tbl_rev != 1) {
582-
ret = PTR_ERR(wifi_pkg);
582+
ret = -EINVAL;
583583
goto out_free;
584584
}
585585

@@ -595,7 +595,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt)
595595
&tbl_rev);
596596
if (!IS_ERR(wifi_pkg)) {
597597
if (tbl_rev != 0) {
598-
ret = PTR_ERR(wifi_pkg);
598+
ret = -EINVAL;
599599
goto out_free;
600600
}
601601

@@ -848,6 +848,9 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
848848
goto read_table;
849849
}
850850

851+
ret = PTR_ERR(wifi_pkg);
852+
goto out_free;
853+
851854
read_table:
852855
fwrt->ppag_ver = tbl_rev;
853856
flags = &wifi_pkg->package.elements[1];

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,6 +3698,9 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
36983698
NL80211_TDLS_SETUP);
36993699
}
37003700

3701+
if (ret)
3702+
return ret;
3703+
37013704
for_each_sta_active_link(vif, sta, link_sta, i)
37023705
link_sta->agg.max_rc_amsdu_len = 1;
37033706

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue,
512512
return false;
513513

514514
mvm_sta = iwl_mvm_sta_from_mac80211(sta);
515+
516+
if (WARN_ON_ONCE(!mvm_sta->dup_data))
517+
return false;
518+
515519
dup_data = &mvm_sta->dup_data[queue];
516520

517521
/*

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2012-2014, 2018-2023 Intel Corporation
3+
* Copyright (C) 2012-2014, 2018-2024 Intel Corporation
44
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
55
* Copyright (C) 2017 Intel Deutschland GmbH
66
*/
@@ -971,6 +971,7 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
971971
if (!le32_to_cpu(notif->status) || !le32_to_cpu(notif->start)) {
972972
/* End TE, notify mac80211 */
973973
mvmvif->time_event_data.id = SESSION_PROTECT_CONF_MAX_ID;
974+
mvmvif->time_event_data.link_id = -1;
974975
iwl_mvm_p2p_roc_finished(mvm);
975976
ieee80211_remain_on_channel_expired(mvm->hw);
976977
} else if (le32_to_cpu(notif->start)) {

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

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,24 @@ static bool iwl_mvm_use_host_rate(struct iwl_mvm *mvm,
545545
return mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ;
546546
}
547547

548+
static void iwl_mvm_copy_hdr(void *cmd, const void *hdr, int hdrlen,
549+
const u8 *addr3_override)
550+
{
551+
struct ieee80211_hdr *out_hdr = cmd;
552+
553+
memcpy(cmd, hdr, hdrlen);
554+
if (addr3_override)
555+
memcpy(out_hdr->addr3, addr3_override, ETH_ALEN);
556+
}
557+
548558
/*
549559
* Allocates and sets the Tx cmd the driver data pointers in the skb
550560
*/
551561
static struct iwl_device_tx_cmd *
552562
iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
553563
struct ieee80211_tx_info *info, int hdrlen,
554-
struct ieee80211_sta *sta, u8 sta_id)
564+
struct ieee80211_sta *sta, u8 sta_id,
565+
const u8 *addr3_override)
555566
{
556567
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
557568
struct iwl_device_tx_cmd *dev_cmd;
@@ -609,7 +620,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
609620
cmd->len = cpu_to_le16((u16)skb->len);
610621

611622
/* Copy MAC header from skb into command buffer */
612-
memcpy(cmd->hdr, hdr, hdrlen);
623+
iwl_mvm_copy_hdr(cmd->hdr, hdr, hdrlen, addr3_override);
613624

614625
cmd->flags = cpu_to_le16(flags);
615626
cmd->rate_n_flags = cpu_to_le32(rate_n_flags);
@@ -624,7 +635,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
624635
cmd->len = cpu_to_le16((u16)skb->len);
625636

626637
/* Copy MAC header from skb into command buffer */
627-
memcpy(cmd->hdr, hdr, hdrlen);
638+
iwl_mvm_copy_hdr(cmd->hdr, hdr, hdrlen, addr3_override);
628639

629640
cmd->flags = cpu_to_le32(flags);
630641
cmd->rate_n_flags = cpu_to_le32(rate_n_flags);
@@ -642,7 +653,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
642653
iwl_mvm_set_tx_cmd_rate(mvm, tx_cmd, info, sta, hdr->frame_control);
643654

644655
/* Copy MAC header from skb into command buffer */
645-
memcpy(tx_cmd->hdr, hdr, hdrlen);
656+
iwl_mvm_copy_hdr(tx_cmd->hdr, hdr, hdrlen, addr3_override);
646657

647658
out:
648659
return dev_cmd;
@@ -845,7 +856,8 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
845856

846857
IWL_DEBUG_TX(mvm, "station Id %d, queue=%d\n", sta_id, queue);
847858

848-
dev_cmd = iwl_mvm_set_tx_params(mvm, skb, &info, hdrlen, NULL, sta_id);
859+
dev_cmd = iwl_mvm_set_tx_params(mvm, skb, &info, hdrlen, NULL, sta_id,
860+
NULL);
849861
if (!dev_cmd)
850862
return -1;
851863

@@ -1171,7 +1183,8 @@ static int iwl_mvm_tx_pkt_queued(struct iwl_mvm *mvm,
11711183
*/
11721184
static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
11731185
struct ieee80211_tx_info *info,
1174-
struct ieee80211_sta *sta)
1186+
struct ieee80211_sta *sta,
1187+
const u8 *addr3_override)
11751188
{
11761189
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
11771190
struct iwl_mvm_sta *mvmsta;
@@ -1203,7 +1216,8 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
12031216
iwl_mvm_probe_resp_set_noa(mvm, skb);
12041217

12051218
dev_cmd = iwl_mvm_set_tx_params(mvm, skb, info, hdrlen,
1206-
sta, mvmsta->deflink.sta_id);
1219+
sta, mvmsta->deflink.sta_id,
1220+
addr3_override);
12071221
if (!dev_cmd)
12081222
goto drop;
12091223

@@ -1325,9 +1339,11 @@ int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb,
13251339
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
13261340
struct ieee80211_tx_info info;
13271341
struct sk_buff_head mpdus_skbs;
1342+
struct ieee80211_vif *vif;
13281343
unsigned int payload_len;
13291344
int ret;
13301345
struct sk_buff *orig_skb = skb;
1346+
const u8 *addr3;
13311347

13321348
if (WARN_ON_ONCE(!mvmsta))
13331349
return -1;
@@ -1338,26 +1354,59 @@ int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb,
13381354
memcpy(&info, skb->cb, sizeof(info));
13391355

13401356
if (!skb_is_gso(skb))
1341-
return iwl_mvm_tx_mpdu(mvm, skb, &info, sta);
1357+
return iwl_mvm_tx_mpdu(mvm, skb, &info, sta, NULL);
13421358

13431359
payload_len = skb_tail_pointer(skb) - skb_transport_header(skb) -
13441360
tcp_hdrlen(skb) + skb->data_len;
13451361

13461362
if (payload_len <= skb_shinfo(skb)->gso_size)
1347-
return iwl_mvm_tx_mpdu(mvm, skb, &info, sta);
1363+
return iwl_mvm_tx_mpdu(mvm, skb, &info, sta, NULL);
13481364

13491365
__skb_queue_head_init(&mpdus_skbs);
13501366

1367+
vif = info.control.vif;
1368+
if (!vif)
1369+
return -1;
1370+
13511371
ret = iwl_mvm_tx_tso(mvm, skb, &info, sta, &mpdus_skbs);
13521372
if (ret)
13531373
return ret;
13541374

13551375
WARN_ON(skb_queue_empty(&mpdus_skbs));
13561376

1377+
/*
1378+
* As described in IEEE sta 802.11-2020, table 9-30 (Address
1379+
* field contents), A-MSDU address 3 should contain the BSSID
1380+
* address.
1381+
* Pass address 3 down to iwl_mvm_tx_mpdu() and further to set it
1382+
* in the command header. We need to preserve the original
1383+
* address 3 in the skb header to correctly create all the
1384+
* A-MSDU subframe headers from it.
1385+
*/
1386+
switch (vif->type) {
1387+
case NL80211_IFTYPE_STATION:
1388+
addr3 = vif->cfg.ap_addr;
1389+
break;
1390+
case NL80211_IFTYPE_AP:
1391+
addr3 = vif->addr;
1392+
break;
1393+
default:
1394+
addr3 = NULL;
1395+
break;
1396+
}
1397+
13571398
while (!skb_queue_empty(&mpdus_skbs)) {
1399+
struct ieee80211_hdr *hdr;
1400+
bool amsdu;
1401+
13581402
skb = __skb_dequeue(&mpdus_skbs);
1403+
hdr = (void *)skb->data;
1404+
amsdu = ieee80211_is_data_qos(hdr->frame_control) &&
1405+
(*ieee80211_get_qos_ctl(hdr) &
1406+
IEEE80211_QOS_CTL_A_MSDU_PRESENT);
13591407

1360-
ret = iwl_mvm_tx_mpdu(mvm, skb, &info, sta);
1408+
ret = iwl_mvm_tx_mpdu(mvm, skb, &info, sta,
1409+
amsdu ? addr3 : NULL);
13611410
if (ret) {
13621411
/* Free skbs created as part of TSO logic that have not yet been dequeued */
13631412
__skb_queue_purge(&mpdus_skbs);

net/mac80211/tx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3930,6 +3930,7 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
39303930
goto begin;
39313931

39323932
skb = __skb_dequeue(&tx.skbs);
3933+
info = IEEE80211_SKB_CB(skb);
39333934

39343935
if (!skb_queue_empty(&tx.skbs)) {
39353936
spin_lock_bh(&fq->lock);
@@ -3975,7 +3976,7 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
39753976
}
39763977

39773978
encap_out:
3978-
IEEE80211_SKB_CB(skb)->control.vif = vif;
3979+
info->control.vif = vif;
39793980

39803981
if (tx.sta &&
39813982
wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) {

0 commit comments

Comments
 (0)