Skip to content

Commit 56d2f48

Browse files
committed
Merge tag 'wireless-2024-03-27' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
Kalle Valo says: ==================== wireless fixes for v6.9-rc2 The first fixes for v6.9. Ping-Ke Shih now maintains a separate tree for Realtek drivers, document that in the MAINTAINERS. Plenty of fixes for both to stack and iwlwifi. Our kunit tests were working only on um architecture but that's fixed now. * tag 'wireless-2024-03-27' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: (21 commits) MAINTAINERS: wifi: mwifiex: add Francesco as reviewer kunit: fix wireless test dependencies wifi: iwlwifi: mvm: include link ID when releasing frames wifi: iwlwifi: mvm: handle debugfs names more carefully wifi: iwlwifi: mvm: guard against invalid STA ID on removal wifi: iwlwifi: read txq->read_ptr under lock wifi: iwlwifi: fw: don't always use FW dump trig wifi: iwlwifi: mvm: rfi: fix potential response leaks wifi: mac80211: correctly set active links upon TTLM wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW wifi: iwlwifi: mvm: consider having one active link wifi: iwlwifi: mvm: pick the version of SESSION_PROTECTION_NOTIF wifi: mac80211: fix prep_connection error path wifi: cfg80211: fix rdev_dump_mpp() arguments order wifi: iwlwifi: mvm: disable MLO for the time being wifi: cfg80211: add a flag to disable wireless extensions wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes wifi: mac80211: fix mlme_link_id_dbg() MAINTAINERS: wifi: add git tree for Realtek WiFi drivers ... ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents afbf75e + 8ea3f4f commit 56d2f48

File tree

21 files changed

+138
-65
lines changed

21 files changed

+138
-65
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13133,6 +13133,7 @@ F: drivers/net/ethernet/marvell/mvpp2/
1313313133

1313413134
MARVELL MWIFIEX WIRELESS DRIVER
1313513135
M: Brian Norris <[email protected]>
13136+
R: Francesco Dolcini <[email protected]>
1313613137
1313713138
S: Odd Fixes
1313813139
F: drivers/net/wireless/marvell/mwifiex/
@@ -18642,18 +18643,21 @@ REALTEK WIRELESS DRIVER (rtlwifi family)
1864218643
M: Ping-Ke Shih <[email protected]>
1864318644
1864418645
S: Maintained
18646+
T: git https://github.com/pkshih/rtw.git
1864518647
F: drivers/net/wireless/realtek/rtlwifi/
1864618648

1864718649
REALTEK WIRELESS DRIVER (rtw88)
1864818650
M: Ping-Ke Shih <[email protected]>
1864918651
1865018652
S: Maintained
18653+
T: git https://github.com/pkshih/rtw.git
1865118654
F: drivers/net/wireless/realtek/rtw88/
1865218655

1865318656
REALTEK WIRELESS DRIVER (rtw89)
1865418657
M: Ping-Ke Shih <[email protected]>
1865518658
1865618659
S: Maintained
18660+
T: git https://github.com/pkshih/rtw.git
1865718661
F: drivers/net/wireless/realtek/rtw89/
1865818662

1865918663
REDPINE WIRELESS DRIVER
@@ -19197,12 +19201,14 @@ M: Hin-Tak Leung <[email protected]>
1919719201
M: Larry Finger <[email protected]>
1919819202
1919919203
S: Maintained
19204+
T: git https://github.com/pkshih/rtw.git
1920019205
F: drivers/net/wireless/realtek/rtl818x/rtl8187/
1920119206

1920219207
RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
1920319208
M: Jes Sorensen <[email protected]>
1920419209
1920519210
S: Maintained
19211+
T: git https://github.com/pkshih/rtw.git
1920619212
F: drivers/net/wireless/realtek/rtl8xxxu/
1920719213

1920819214
RTRS TRANSPORT DRIVERS

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,8 +3081,6 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
30813081
struct iwl_fw_dbg_params params = {0};
30823082
struct iwl_fwrt_dump_data *dump_data =
30833083
&fwrt->dump.wks[wk_idx].dump_data;
3084-
u32 policy;
3085-
u32 time_point;
30863084
if (!test_bit(wk_idx, &fwrt->dump.active_wks))
30873085
return;
30883086

@@ -3113,13 +3111,16 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
31133111

31143112
iwl_fw_dbg_stop_restart_recording(fwrt, &params, false);
31153113

3116-
policy = le32_to_cpu(dump_data->trig->apply_policy);
3117-
time_point = le32_to_cpu(dump_data->trig->time_point);
3114+
if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
3115+
u32 policy = le32_to_cpu(dump_data->trig->apply_policy);
3116+
u32 time_point = le32_to_cpu(dump_data->trig->time_point);
31183117

3119-
if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
3120-
IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
3121-
iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
3118+
if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
3119+
IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
3120+
iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
3121+
}
31223122
}
3123+
31233124
if (fwrt->trans->dbg.last_tp_resetfw == IWL_FW_INI_RESET_FW_MODE_STOP_FW_ONLY)
31243125
iwl_force_nmi(fwrt->trans);
31253126

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,15 +1260,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
12601260
if (IS_ERR_OR_NULL(vif))
12611261
return 1;
12621262

1263-
if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc) {
1263+
if (hweight16(vif->active_links) > 1) {
12641264
/*
1265-
* Select the 'best' link. May need to revisit, it seems
1266-
* better to not optimize for throughput but rather range,
1267-
* reliability and power here - and select 2.4 GHz ...
1265+
* Select the 'best' link.
1266+
* May need to revisit, it seems better to not optimize
1267+
* for throughput but rather range, reliability and
1268+
* power here - and select 2.4 GHz ...
12681269
*/
1269-
primary_link =
1270-
iwl_mvm_mld_get_primary_link(mvm, vif,
1271-
vif->active_links);
1270+
primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
1271+
vif->active_links);
12721272

12731273
if (WARN_ONCE(primary_link < 0, "no primary link in 0x%x\n",
12741274
vif->active_links))
@@ -1277,6 +1277,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
12771277
ret = ieee80211_set_active_links(vif, BIT(primary_link));
12781278
if (ret)
12791279
return ret;
1280+
} else if (vif->active_links) {
1281+
primary_link = __ffs(vif->active_links);
12801282
} else {
12811283
primary_link = 0;
12821284
}

drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,9 @@ void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
748748
{
749749
struct dentry *dbgfs_dir = vif->debugfs_dir;
750750
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
751-
char buf[100];
751+
char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) +
752+
(7 + IFNAMSIZ + 1) + 6 + 1];
753+
char name[7 + IFNAMSIZ + 1];
752754

753755
/* this will happen in monitor mode */
754756
if (!dbgfs_dir)
@@ -761,10 +763,11 @@ void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
761763
* find
762764
* netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/
763765
*/
764-
snprintf(buf, 100, "../../../%pd3/iwlmvm", dbgfs_dir);
766+
snprintf(name, sizeof(name), "%pd", dbgfs_dir);
767+
snprintf(buf, sizeof(buf), "../../../%pd3/iwlmvm", dbgfs_dir);
765768

766-
mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name,
767-
mvm->debugfs_dir, buf);
769+
mvmvif->dbgfs_slink =
770+
debugfs_create_symlink(name, mvm->debugfs_dir, buf);
768771
}
769772

770773
void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)

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

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm,
4646
return ret;
4747
}
4848

49+
int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
50+
struct ieee80211_bss_conf *link_conf)
51+
{
52+
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
53+
struct iwl_mvm_vif_link_info *link_info =
54+
mvmvif->link[link_conf->link_id];
55+
56+
if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) {
57+
link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm,
58+
mvmvif);
59+
if (link_info->fw_link_id >=
60+
ARRAY_SIZE(mvm->link_id_to_link_conf))
61+
return -EINVAL;
62+
63+
rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id],
64+
link_conf);
65+
}
66+
67+
return 0;
68+
}
69+
4970
int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5071
struct ieee80211_bss_conf *link_conf)
5172
{
@@ -55,19 +76,14 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5576
struct iwl_link_config_cmd cmd = {};
5677
unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD);
5778
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1);
79+
int ret;
5880

5981
if (WARN_ON_ONCE(!link_info))
6082
return -EINVAL;
6183

62-
if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) {
63-
link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm,
64-
mvmvif);
65-
if (link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf))
66-
return -EINVAL;
67-
68-
rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id],
69-
link_conf);
70-
}
84+
ret = iwl_mvm_set_link_mapping(mvm, vif, link_conf);
85+
if (ret)
86+
return ret;
7187

7288
/* Update SF - Disable if needed. if this fails, SF might still be on
7389
* while many macs are bound, which is forbidden - so fail the binding.
@@ -248,6 +264,24 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
248264
return ret;
249265
}
250266

267+
int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
268+
struct ieee80211_bss_conf *link_conf)
269+
{
270+
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
271+
struct iwl_mvm_vif_link_info *link_info =
272+
mvmvif->link[link_conf->link_id];
273+
274+
/* mac80211 thought we have the link, but it was never configured */
275+
if (WARN_ON(!link_info ||
276+
link_info->fw_link_id >=
277+
ARRAY_SIZE(mvm->link_id_to_link_conf)))
278+
return -EINVAL;
279+
280+
RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
281+
NULL);
282+
return 0;
283+
}
284+
251285
int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
252286
struct ieee80211_bss_conf *link_conf)
253287
{
@@ -257,13 +291,10 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
257291
struct iwl_link_config_cmd cmd = {};
258292
int ret;
259293

260-
/* mac80211 thought we have the link, but it was never configured */
261-
if (WARN_ON(!link_info ||
262-
link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf)))
294+
ret = iwl_mvm_unset_link_mapping(mvm, vif, link_conf);
295+
if (ret)
263296
return 0;
264297

265-
RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
266-
NULL);
267298
cmd.link_id = cpu_to_le32(link_info->fw_link_id);
268299
iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
269300
link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
360360
if (mvm->mld_api_is_used && mvm->nvm_data->sku_cap_11be_enable &&
361361
!iwlwifi_mod_params.disable_11ax &&
362362
!iwlwifi_mod_params.disable_11be)
363-
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
363+
hw->wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT;
364364

365365
/* With MLD FW API, it tracks timing by itself,
366366
* no need for any timing from the host
@@ -1577,8 +1577,14 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
15771577
mvmvif->mvm = mvm;
15781578

15791579
/* the first link always points to the default one */
1580+
mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
1581+
mvmvif->deflink.active = 0;
15801582
mvmvif->link[0] = &mvmvif->deflink;
15811583

1584+
ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf);
1585+
if (ret)
1586+
goto out;
1587+
15821588
/*
15831589
* Not much to do here. The stack will not allow interface
15841590
* types or combinations that we didn't advertise, so we
@@ -1783,6 +1789,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw,
17831789
mvm->p2p_device_vif = NULL;
17841790
}
17851791

1792+
iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf);
17861793
iwl_mvm_mac_ctxt_remove(mvm, vif);
17871794

17881795
RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);

drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,10 +855,15 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
855855

856856
int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, u8 sta_id)
857857
{
858-
int ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
858+
int ret;
859859

860860
lockdep_assert_held(&mvm->mutex);
861861

862+
if (WARN_ON(sta_id == IWL_MVM_INVALID_STA))
863+
return 0;
864+
865+
ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
866+
862867
RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL);
863868
RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL);
864869
return ret;

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,11 +1916,15 @@ int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
19161916
u32 iwl_mvm_get_lmac_id(struct iwl_mvm *mvm, enum nl80211_band band);
19171917

19181918
/* Links */
1919+
int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1920+
struct ieee80211_bss_conf *link_conf);
19191921
int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19201922
struct ieee80211_bss_conf *link_conf);
19211923
int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19221924
struct ieee80211_bss_conf *link_conf,
19231925
u32 changes, bool active);
1926+
int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1927+
struct ieee80211_bss_conf *link_conf);
19241928
int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19251929
struct ieee80211_bss_conf *link_conf);
19261930
int iwl_mvm_disable_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,18 @@ struct iwl_rfi_freq_table_resp_cmd *iwl_rfi_get_freq_table(struct iwl_mvm *mvm)
132132
if (ret)
133133
return ERR_PTR(ret);
134134

135-
if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) != resp_size))
135+
if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) !=
136+
resp_size)) {
137+
iwl_free_resp(&cmd);
136138
return ERR_PTR(-EIO);
139+
}
137140

138141
resp = kmemdup(cmd.resp_pkt->data, resp_size, GFP_KERNEL);
142+
iwl_free_resp(&cmd);
143+
139144
if (!resp)
140145
return ERR_PTR(-ENOMEM);
141146

142-
iwl_free_resp(&cmd);
143147
return resp;
144148
}
145149

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,13 @@ static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
236236
static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
237237
struct napi_struct *napi,
238238
struct sk_buff *skb, int queue,
239-
struct ieee80211_sta *sta,
240-
struct ieee80211_link_sta *link_sta)
239+
struct ieee80211_sta *sta)
241240
{
242241
if (unlikely(iwl_mvm_check_pn(mvm, skb, queue, sta))) {
243242
kfree_skb(skb);
244243
return;
245244
}
246245

247-
if (sta && sta->valid_links && link_sta) {
248-
struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
249-
250-
rx_status->link_valid = 1;
251-
rx_status->link_id = link_sta->link_id;
252-
}
253-
254246
ieee80211_rx_napi(mvm->hw, sta, skb, napi);
255247
}
256248

@@ -588,7 +580,7 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
588580
while ((skb = __skb_dequeue(skb_list))) {
589581
iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb,
590582
reorder_buf->queue,
591-
sta, NULL /* FIXME */);
583+
sta);
592584
reorder_buf->num_stored--;
593585
}
594586
}
@@ -2213,6 +2205,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
22132205
if (IS_ERR(sta))
22142206
sta = NULL;
22152207
link_sta = rcu_dereference(mvm->fw_id_to_link_sta[id]);
2208+
2209+
if (sta && sta->valid_links && link_sta) {
2210+
rx_status->link_valid = 1;
2211+
rx_status->link_id = link_sta->link_id;
2212+
}
22162213
}
22172214
} else if (!is_multicast_ether_addr(hdr->addr2)) {
22182215
/*
@@ -2356,8 +2353,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
23562353
!(desc->amsdu_info & IWL_RX_MPDU_AMSDU_LAST_SUBFRAME))
23572354
rx_status->flag |= RX_FLAG_AMSDU_MORE;
23582355

2359-
iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta,
2360-
link_sta);
2356+
iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta);
23612357
}
23622358
out:
23632359
rcu_read_unlock();

0 commit comments

Comments
 (0)