Sean Wang [Thu, 13 Jun 2024 03:02:29 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_get_phy_mode for per-link STA
Extend mt7925_get_phy_mode with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-36-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:28 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_get_phy_mode_ext for per-link STA
Extend mt7925_get_phy_mode_ext with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-35-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:27 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_phy_tlv for per-link STA
Extend mt7925_mcu_sta_phy_tlv with per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-34-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:26 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_ht_tlv for per-link STA
Extend mt7925_mcu_sta_ht_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-33-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:25 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_vht_tlv for per-link STA
Extend mt7925_mcu_sta_vht_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-32-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:24 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_amsdu_tlv for per-link STA
Extend mt7925_mcu_sta_amsdu_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-31-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:23 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_he_tlv for per-link STA
Extend mt7925_mcu_sta_he_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-30-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:22 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_he_6g_tlv for per-link STA
Extend mt7925_mcu_sta_he_6g_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-29-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:21 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_eht_tlv for per-link STA
Extend mt7925_mcu_sta_eht_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-28-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:20 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_rate_ctrl_tlv with per-link STA
Extend mt7925_mcu_sta_rate_ctrl_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-27-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:19 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_state_v2_tlv for per-link STA
Extend mt7925_mcu_sta_state_v2_tlv with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-26-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:18 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_sta_update for per-link STA
Extend mt7925_mcu_sta_update with the per-link STA configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:16 +0000 (20:02 -0700)]
wifi: mt76: mt7925: add mt7925_mcu_bss_rlm_tlv to constitue the RLM TLV
add mt7925_mcu_bss_rlm_tlv to maintain consistency with the other TLVs that
constitute the command for creating the per-link BSS.
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20240613030241.5771-23-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sean Wang [Thu, 13 Jun 2024 03:02:15 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_uni_bss_ps for per-link BSS
Extend mt7925_mcu_uni_bss_ps with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:14 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_uni_bss_bcnft for per-link BSS
Extend mt7925_mcu_uni_bss_bcnft with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:13 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_[abort, set]_roc for per-link BSS
The channel context has to be bound with the per-link BSS, thus,
we extend mt7925_mcu_[abort, set]_roc to work with the per-link BSS
configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:12 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_set_bss_pm for per-link BSS
Extend mt7925_mcu_set_bss_pm with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:11 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_basic_tlv for per-link BSS
Extend mt7925_mcu_bss_basic_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:10 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_sec_tlv for per-link BSS
Extend mt7925_mcu_bss_sec_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:08 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_bmc_tlv for per-link BSS
Extend mt7925_mcu_bss_bmc_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:07 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_mld_tlv for per-link BSS
Extend mt7925_mcu_bss_mld_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:06 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_qos_tlv for per-link BSS
Extend mt7925_mcu_bss_qos_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:05 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_he_tlv for per-link BSS
Extend mt7925_mcu_bss_he_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:04 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_color_tlv for per-link BSS
Extend mt7925_mcu_bss_color_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:03 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_bss_ifs_tlv for per-link BSS
Extend mt7925_mcu_bss_ifs_tlv with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:02 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_set_timing for per-link BSS
Extend mt7925_mcu_set_timing with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:02:01 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_add_bss_info for per-link BSS
Extend mt7925_mcu_add_bss_info with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Deren Wu [Thu, 13 Jun 2024 03:02:00 +0000 (20:02 -0700)]
wifi: mt76: mt7925: extend mt7925_mcu_set_tx with for per-link BSS
Extend mt7925_mcu_set_tx with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
Sean Wang [Thu, 13 Jun 2024 03:01:59 +0000 (20:01 -0700)]
wifi: mt76: mt792x: extend mt76_connac_mcu_uni_add_dev for per-link BSS
Extend mt76_connac_mcu_uni_add_dev with per-link BSS configuration.
The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.
We also extend link_idx field in mt76_connac_bss_basic_tlv for the firmware
to able to identify the link index in the MLO mode that is not harmful
for the current non-MLO mode.
Deren Wu [Thu, 13 Jun 2024 03:01:58 +0000 (20:01 -0700)]
wifi: mt76: mt7925: support for split bss_info_changed method
The .bss_info_changed method is being split into .vif_cfg_changed and
.link_info_changed to support MLD devices, but it will still support
non-MLD devices.
Deren Wu [Thu, 13 Jun 2024 03:01:57 +0000 (20:01 -0700)]
wifi: mt76: mt792x: add struct mt792x_chanctx
We are introducing a new structure, mt792x_chanctx, to quickly identify
the linked BSS it is working on. This eliminates the need to search in
mt7921_ctx_iter() or mt7925_ctx_iter() when the channel context changes.
Deren Wu [Thu, 13 Jun 2024 03:01:56 +0000 (20:01 -0700)]
wifi: mt76: mt792x: add struct mt792x_link_sta
We are introducing a new structure, mt792x_link_sta, to manage per-link
configurations in preparation for future station (STA) support of
Multi-Link Operation (MLO).
This patch only includes structural changes and does not involve any
logic changes.
We have moved relevant parameters, such as the wcid from the mt76_wcid
structure, from the mt7921x_sta structure to the mt792x_link_sta structure.
For current drivers that do not support MLO, there is only one link STA,
and link information is accessed via the deflink member.
However, we have not yet created the per-link BSS configuration indexed
by link ID for Multi-Link Device (MLD) support in mt7921x_sta.
This step needs to be completed before adding MLD support for STA mode.
Deren Wu [Thu, 13 Jun 2024 03:01:55 +0000 (20:01 -0700)]
wifi: mt76: mt792x: add struct mt792x_bss_conf
We are introducing a new structure, mt792x_bss_conf, to manage per-link
configurations in preparation for future STA support of Multi-Link
Operation (MLO).
The patch does not include any logic changes, only structural changes.
We have moved relevant parameters from the mt7921x_vif structure such
as to mt76 of mt76_vif structure, rssi and Tx queue parameters to
mt7921x_bss_conf structure. We can access those members to configure the
BSS for this interface, whether it is our own BSS or the one we are
associated with.
However, we have not yet created the per-link BSS configuration indexed by
link ID for Multi-Link Device (MLD) support. This step needs to be
extended before adding MLD support for AP mode.
wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id()
mwifiex_get_priv_by_id() returns the priv pointer corresponding to
the bss_num and bss_type, but without checking if the priv is actually
currently in use.
Unused priv pointers do not have a wiphy attached to them which can
lead to NULL pointer dereferences further down the callstack. Fix
this by returning only used priv pointers which have priv->bss_mode
set to something else than NL80211_IFTYPE_UNSPECIFIED.
Said NULL pointer dereference happened when an Accesspoint was started
with wpa_supplicant -i mlan0 with this config:
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240703072409.556618-1-s.hauer@pengutronix.de
Felix Fietkau [Tue, 9 Jul 2024 08:38:30 +0000 (10:38 +0200)]
wifi: cfg80211: add support for advertising multiple radios belonging to a wiphy
The prerequisite for MLO support in cfg80211/mac80211 is that all the links
participating in MLO must be from the same wiphy/ieee80211_hw. To meet this
expectation, some drivers may need to group multiple discrete hardware each
acting as a link in MLO under single wiphy.
With this change, supported frequencies and interface combinations of each
individual radio are reported to user space. This allows user space to figure
out the limitations of what combination of channels can be used concurrently.
Even for non-MLO devices, this improves support for devices capable of
running on multiple channels at the same time.
Zong-Zhe Yang [Tue, 9 Jul 2024 07:35:31 +0000 (15:35 +0800)]
wifi: mac80211: chanctx emulation set CHANGE_CHANNEL when in_reconfig
Chanctx emulation didn't info IEEE80211_CONF_CHANGE_CHANNEL to drivers
during ieee80211_restart_hw (ieee80211_emulate_add_chanctx). It caused
non-chanctx drivers to not stand on the correct channel after recovery.
RX then behaved abnormally. Finally, disconnection/reconnection occurred.
So, set IEEE80211_CONF_CHANGE_CHANNEL when in_reconfig.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Link: https://patch.msgid.link/20240709073531.30565-1-kevin_yang@realtek.com Cc: stable@vger.kernel.org Fixes: 0a44dfc07074 ("wifi: mac80211: simplify non-chanctx drivers") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 9 Jul 2024 06:34:09 +0000 (08:34 +0200)]
wifi: virt_wifi: don't use strlen() in const context
Looks like not all compilers allow strlen(constant) as
a constant, so don't do that. Instead, revert back to
defining the length as the first submission had it.
Fixes: b5d14b0c6716 ("wifi: virt_wifi: avoid reporting connection success with wrong SSID") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202407090934.NnR1TUbW-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202407090944.mpwLHGt9-lkp@intel.com/ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 5 Jul 2024 11:39:21 +0000 (13:39 +0200)]
wifi: mac80211_hwsim: fix warning
WARN_ON("string") will unconditionally trigger a warning, but
not really do what it may look like. Use WARN(1, ...) instead
and add the mode number as well.
wifi: virt_wifi: avoid reporting connection success with wrong SSID
When user issues a connection with a different SSID than the one
virt_wifi has advertised, the __cfg80211_connect_result() will
trigger the warning: WARN_ON(bss_not_found).
The issue is because the connection code in virt_wifi does not
check the SSID from user space (it only checks the BSSID), and
virt_wifi will call cfg80211_connect_result() with WLAN_STATUS_SUCCESS
even if the SSID is different from the one virt_wifi has advertised.
Eventually cfg80211 won't be able to find the cfg80211_bss and generate
the warning.
Fixed it by checking the SSID (from user space) in the connection code.
Felix Fietkau [Thu, 4 Jul 2024 13:09:47 +0000 (15:09 +0200)]
wifi: mac80211: clear vif drv_priv after remove_interface when stopping
Avoid reusing stale driver data when an interface is brought down and up
again. In order to avoid having to duplicate the memset in every single
driver, do it here.
Felix Fietkau [Tue, 2 Jul 2024 11:35:56 +0000 (13:35 +0200)]
wifi: nl80211: split helper function from nl80211_put_iface_combinations
Create a helper function that puts the data from struct
ieee80211_iface_combination to a nl80211 message.
This will be used for adding per-radio interface combination data.
Aleksandr Mishin [Wed, 3 Jul 2024 21:05:10 +0000 (00:05 +0300)]
wifi: rtw89: Fix array index mistake in rtw89_sta_info_get_iter()
In rtw89_sta_info_get_iter() 'status->he_gi' is compared to array size.
But then 'rate->he_gi' is used as array index instead of 'status->he_gi'.
This can lead to go beyond array boundaries in case of 'rate->he_gi' is
not equal to 'status->he_gi' and is bigger than array size. Looks like
"copy-paste" mistake.
Fix this mistake by replacing 'rate->he_gi' with 'status->he_gi'.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Zong-Zhe Yang [Tue, 2 Jul 2024 12:44:52 +0000 (20:44 +0800)]
wifi: rtw89: unify the selection logic of RFK table when MCC
Driver will notify FW the target index of RFK table to use at some
moments. When MCC (multi-channel concurrent), the correctness of the
notification is especially important.
We now unify the selection logic of RFK table as below among chips.
1. check each table if it matches target channel
2. check all tables if any is idle by iterating active channels
3. replace the first table if all are busy unexpectedly
Marcin Åšlusarz [Tue, 28 May 2024 11:02:46 +0000 (13:02 +0200)]
wifi: rtw88: usb: schedule rx work after everything is set up
Right now it's possible to hit NULL pointer dereference in
rtw_rx_fill_rx_status on hw object and/or its fields because
initialization routine can start getting USB replies before
rtw_dev is fully setup.
So while we do the async stuff rtw_usb_probe continues and calls
rtw_register_hw, which does all kinds of initialization (e.g.
via ieee80211_register_hw) that rtw_rx_fill_rx_status relies on.
Fix this by moving the first usb_submit_urb after everything
is set up.
For me, this bug manifested as:
[ 8.893177] rtw_8821cu 1-1:1.2: band wrong, packet dropped
[ 8.910904] rtw_8821cu 1-1:1.2: hw->conf.chandef.chan NULL in rtw_rx_fill_rx_status
because I'm using Larry's backport of rtw88 driver with the NULL
checks in rtw_rx_fill_rx_status.
MLO was temporarily disabled by
commit 5f404005055 ("wifi: iwlwifi: mvm: disable MLO for the time being"),
until it will stabilize.
Now, that all the bugs were fixed and the minimum FW version was bumped
to a stable one, we can re-enable MLO back.
Benjamin Berg [Wed, 3 Jul 2024 09:58:57 +0000 (12:58 +0300)]
wifi: iwlwifi: release TXQ lock during reclaim
Much of the work during reclaim can be done without holding the TXQ
lock and releasing the lock means that command submission can happen at
the same time.
Add a new reclaim_lock to prevent parallel cleanup. Release the lock
while working with an internal copy of the txq->read_ptr and only take
the lock again when updating the read pointer after the cleanup is done.
Benjamin Berg [Wed, 3 Jul 2024 09:58:56 +0000 (12:58 +0300)]
wifi: iwlwifi: keep BHs disabled when TXing from reclaim
During reclaim, we may release the txq->lock spinlock in order to call
iwl_trans_tx to queue new frames. The iwl_trans_tx function expects to
be called with BHs disabled and iwl_pcie_reclaim is most of the times
called with BHs disabled already. However, reclaim can also happen after
flushing a STA and in that case BHs will not be disabled.
Solve this corner case by only releasing the spinlock but keeping BHs
disabled.
Benjamin Berg [Wed, 3 Jul 2024 09:58:53 +0000 (12:58 +0300)]
wifi: iwlwifi: map entire SKB when sending AMSDUs
This adds logic to map the entire SKB for AMSDUs. The required scatter
gather list is allocated together with the space for TSO headers.
Unmapping happens again when free'ing the TSO header page.
For now the mapping is unused, this will be changed in a later commit.
Benjamin Berg [Wed, 3 Jul 2024 09:58:52 +0000 (12:58 +0300)]
wifi: iwlwifi: return a new allocation for hdr page space
Instead of returning the pointer to the structure describing the header
page, return the pointer to the newly allocated area. This disentangles
the user from the allocation within the page as it does not need to
advance the position itself.
Johannes Berg [Wed, 3 Jul 2024 09:58:51 +0000 (12:58 +0300)]
wifi: iwlwifi: mvm: simplify EMLSR blocking
If EMLSR is already blocked for the same reason that
it's blocked for again, there's no need to actually
do any work, so exit early from the function. Also,
print the state after modifying it, so it's clearer.
Johannes Berg [Wed, 3 Jul 2024 09:58:50 +0000 (12:58 +0300)]
wifi: iwlwifi: mvm: align reorder buffer entries to cacheline
The entries[] array needs to be cacheline aligned to avoid false
sharing between different queues, each queue has a set of entries
in it that it writes to.
While it is aligned in practice today given that each array entry
before it is aligned, it's still clearer to explicitly require it
to be aligned, so add the annotation for that.
Johannes Berg [Wed, 3 Jul 2024 09:58:49 +0000 (12:58 +0300)]
wifi: iwlwifi: mvm: clean up reorder buffer data
We really don't need to maintain the buffer size per
queue buffer, it's the same for the whole BA session.
Also, we no longer use the mvm pointer inside each
queue's data structure. Clean that up.
wifi: iwlwifi: mvm: don't send an ROC command with max_delay = 0
The firmware can't handle that (it will crash with ASSERT 300A).
This happened because we looked at vif->bss_conf which is not
the right bss_conf to look at in case of an MLD connection.
Fix iwl_mvm_roc_duration_and_delay to iterate on the active links to
get the right value for the dtim_interval.
Johannes Berg [Tue, 2 Jul 2024 11:00:00 +0000 (13:00 +0200)]
wifi: iwlwifi: mvm: fix interface combinations
The NAN code referenced in this commit isn't actually
present in the driver (any more), and the commit didn't
add the extra NAN entry. Thus, the -1 is incorrect.
Kalle Valo [Wed, 3 Jul 2024 13:57:16 +0000 (16:57 +0300)]
Merge tag 'ath-next-20240702' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
ath.git patches for v6.11
We have moved to a new group-managed repo, and this is the first pull
request from that repo, and from me. Fingers crossed...
We have some new features in ath12k along with some cleanups in ath11k
and ath12k. Also notable are some device-tree changes to allow certain
ath11k and ath12k devices to work with a new power sequencing
subsystem.
Major changes:
ath12k
* DebugFS support for datapath statistics
* WCN7850: support for WoW (Wake on WLAN)
* WCN7850: device-tree bindings
Ping-Ke Shih [Thu, 27 Jun 2024 02:58:47 +0000 (10:58 +0800)]
wifi: rtw89: 8852bt: rfk: add RX DCK
RX DCK stands for receiver DC calibration. With this calibration, we have
proper DC offset to reflect correct received signal strength indicator.
Do this calibration when bringing up interface and going to connect.
Ping-Ke Shih [Thu, 27 Jun 2024 02:58:46 +0000 (10:58 +0800)]
wifi: rtw89: 8852bt: rfk: add IQK
IQ signal calibration is a very important calibration to yield good RF
performance. We do this calibration once we are going to an AP. During
scanning phase, without this calibration RF performance is still
acceptable because it transmits and receives with low data rate at
this phase.
Zong-Zhe Yang [Wed, 26 Jun 2024 02:32:37 +0000 (10:32 +0800)]
wifi: rtw89: constrain TX power according to Transmit Power Envelope
Calculate a TX power constraint based on content of ieee80211 Transmit
Power Envelope (TPE). Since HW control registers aren't designed as many
as all kinds of TPE fields, we strictly intersect all TPE inputs in driver.
Then, according to result, constrain TX power via TX power limit/limit_RU.
Besides, extend dbgfs txpwr_table to show info about 6 GHz regulatory.
Dinesh Karthikeyan [Tue, 25 Jun 2024 04:22:17 +0000 (09:52 +0530)]
wifi: ath12k: Support TQM stats
Add support to request pdev TQM stats from firmware through HTT stats
type 6. This stat type gives information such as TQM error, MPDU
related information and TQM pdev stats.
Signed-off-by: Dinesh Karthikeyan <quic_dinek@quicinc.com> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20240625042217.1303332-4-quic_rdevanat@quicinc.com
Dinesh Karthikeyan [Tue, 25 Jun 2024 04:22:16 +0000 (09:52 +0530)]
wifi: ath12k: Support pdev error stats
Add support to request pdev error stats from firmware through HTT stats
type 5. This stats type gives information such as list of pdev errors,
reasons for reset, logging information about recovery, drain and war
stats. etc.
Signed-off-by: Dinesh Karthikeyan <quic_dinek@quicinc.com> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20240625042217.1303332-3-quic_rdevanat@quicinc.com
Dinesh Karthikeyan [Tue, 25 Jun 2024 04:22:15 +0000 (09:52 +0530)]
wifi: ath12k: Support Transmit Scheduler stats
Add support to request transmission scheduler stats from firmware through
HTT stats type 4. This stat gives information such as pdev stats
scheduled per transmission queue, transmission queue command posted and
reaped, scheduler order, scheduler ineligibility and supercycle triggers.
Signed-off-by: Dinesh Karthikeyan <quic_dinek@quicinc.com> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20240625042217.1303332-2-quic_rdevanat@quicinc.com
Ramya Gnanasekar [Thu, 27 Jun 2024 16:37:02 +0000 (19:37 +0300)]
wifi: ath12k: Dump additional Tx PDEV HTT stats
Support to dump additional Tx PDEV stats through HTT stats debugfs.
Following stats dump are supported:
1. PDEV control path stat to dump Tx management frame count
2. Tx PDEV SIFS histogram stats
3. Tx MU MIMO PPDU stats for 802.11ac, 802.11ax and 802.11be
Dinesh Karthikeyan [Thu, 27 Jun 2024 16:36:56 +0000 (19:36 +0300)]
wifi: ath12k: Add support to parse requested stats_type
Add extended htt stats parser and print the corresponding TLVs associated
with the requested htt_stats_type.
Add support for TX PDEV related htt stats.
Dinesh Karthikeyan [Thu, 27 Jun 2024 16:36:50 +0000 (19:36 +0300)]
wifi: ath12k: Add htt_stats_dump file ops support
Add dump_htt_stats file operation to dump the stats value requested
for the requested stats_type.
Stats sent from firmware will be cumulative. Hence add debugfs to reset
the requested stats type.
Dinesh Karthikeyan [Wed, 26 Jun 2024 08:58:51 +0000 (14:28 +0530)]
wifi: ath12k: Add support to enable debugfs_htt_stats
Create debugfs_htt_stats file when ath12k debugfs support is enabled.
Add basic ath12k_debugfs_htt_stats_register and handle htt_stats_type
file operations.
Johannes Berg [Thu, 27 Jun 2024 11:25:27 +0000 (13:25 +0200)]
wifi: mac80211: remove DEAUTH_NEED_MGD_TX_PREP
This flag is annoying because it puts a lot of logic into mac80211
that could just as well be in the driver (only iwlmvm uses it) and
the implementation is also broken for MLO.
Remove the flag in favour of calling drv_mgd_prepare_tx() without
any conditions even for the deauth-while-assoc case. The drivers
that implement it can take the appropriate actions, which for the
only user of DEAUTH_NEED_MGD_TX_PREP (iwlmvm) is a bit more tricky
than the implementation in mac80211 is anyway, and all others have
no need and can just exit if info->was_assoc is set.
Ilan Peer [Thu, 27 Jun 2024 08:46:00 +0000 (10:46 +0200)]
wifi: mac80211: Use the link BSS configuration for beacon processing
The beacon processing should be fully done in the context of the link.
This also resolves a bug with CQM handling with MLO as in such a case
the RSSI thresholds configuration is maintained in the link context and
not in the interface context.