]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
4 months agowifi: rtw88: Add __nonstring annotations for unterminated strings
Kees Cook [Mon, 10 Mar 2025 22:22:58 +0000 (15:22 -0700)]
wifi: rtw88: Add __nonstring annotations for unterminated strings

When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
with __nonstring to and correctly identify the char array as "not a C
string" and thereby eliminate the warning.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250310222257.work.866-kees@kernel.org
4 months agowifi: rtw88: Enable the new RTL8814AE/RTL8814AU drivers
Bitterblue Smith [Fri, 7 Mar 2025 00:26:25 +0000 (02:26 +0200)]
wifi: rtw88: Enable the new RTL8814AE/RTL8814AU drivers

RTL8814A is a wifi 5 chip with 4 RF paths (chains), 3 spatial streams,
and probably no Bluetooth.

The USB-based RTL8814AU can reach 800 Mbps in the 5 GHz band in USB 3
mode. In USB 2 mode it only uses 2 spatial streams.

The PCI-based RTL8814AE is not as popular and didn't get as much
testing so it's unclear how fast it goes. It's more like a bonus on top
of the RTL8814AU support.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/5795b0a7-511e-40b5-ac36-476b63f174c7@gmail.com
4 months agowifi: rtw88: Add rtw8814au.c
Bitterblue Smith [Fri, 7 Mar 2025 00:25:37 +0000 (02:25 +0200)]
wifi: rtw88: Add rtw8814au.c

This is the entry point for the new module rtw88_8814au.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/71457787-5a9e-4ead-a62c-22ca44e00b89@gmail.com
4 months agowifi: rtw88: Add rtw8814ae.c
Bitterblue Smith [Fri, 7 Mar 2025 00:25:09 +0000 (02:25 +0200)]
wifi: rtw88: Add rtw8814ae.c

This is the entry point for the new module rtw88_8814ae.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/74ebab2f-a23e-4d87-935f-0af2b5cba672@gmail.com
4 months agowifi: rtw88: Add rtw8814a.{c,h}
Bitterblue Smith [Fri, 7 Mar 2025 00:24:40 +0000 (02:24 +0200)]
wifi: rtw88: Add rtw8814a.{c,h}

These contain all the logic for the RTL8814A chip.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/5d3b8c03-63c1-4f20-860a-89d424badad8@gmail.com
4 months agowifi: rtw88: Add rtw8814a_table.c (part 2/2)
Bitterblue Smith [Fri, 7 Mar 2025 00:24:02 +0000 (02:24 +0200)]
wifi: rtw88: Add rtw8814a_table.c (part 2/2)

This contains various tables for initialising the RTL8814A, plus TX
power limits.

Also add rtw8814a_table.h.

Split into two patches because they are big.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/4c48e35e-1b04-42ed-940e-0e931693def6@gmail.com
4 months agowifi: rtw88: Add rtw8814a_table.c (part 1/2)
Bitterblue Smith [Fri, 7 Mar 2025 00:23:22 +0000 (02:23 +0200)]
wifi: rtw88: Add rtw8814a_table.c (part 1/2)

This contains various tables for initialising the RTL8814A, plus TX
power limits.

Split into two patches because they are big.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/df0b8ceb-2c2f-4bda-906f-a05c7b4d424c@gmail.com
4 months agowifi: rtw88: Add some definitions for RTL8814AU
Bitterblue Smith [Fri, 7 Mar 2025 00:22:17 +0000 (02:22 +0200)]
wifi: rtw88: Add some definitions for RTL8814AU

Add various register definitions which will be used by the new driver.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/1dcb5abb-26f8-4db5-be36-057de56465e5@gmail.com
4 months agowifi: rtw89: coex: Update Wi-Fi/Bluetooth coexistence version to 7.0.4
Ching-Te Ku [Sat, 8 Mar 2025 02:58:32 +0000 (10:58 +0800)]
wifi: rtw89: coex: Update Wi-Fi/Bluetooth coexistence version to 7.0.4

RTL8852BE-VT support for firmware 29.122. Add parser for Bluetooth channel
map report version 7.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250308025832.10400-5-pkshih@realtek.com
4 months agowifi: rtw89: coex: Add parser for Bluetooth channel map report version 7
Ching-Te Ku [Sat, 8 Mar 2025 02:58:31 +0000 (10:58 +0800)]
wifi: rtw89: coex: Add parser for Bluetooth channel map report version 7

In order to rearrange the structure member, the format update to version 7.
And to parse the report correctly, add the related logic.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250308025832.10400-4-pkshih@realtek.com
4 months agowifi: rtw89: coex: Fix coexistence report not show as expected
Ching-Te Ku [Sat, 8 Mar 2025 02:58:30 +0000 (10:58 +0800)]
wifi: rtw89: coex: Fix coexistence report not show as expected

This report will feedback some basic information from firmware(PTA counter,
report counter, mailbox counter etc). And the report version need to match
driver & firmware both side. The original logic break the switch case logic
before driver update the report version. It made the report can not be
parsed correctly. Delete the break at the version 7 and 8.
Add logic to count C2H event report.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250308025832.10400-3-pkshih@realtek.com
4 months agowifi: rtw89: coex: RTL8852BT coexistence Wi-Fi firmware support for 0.29.122.0
Ching-Te Ku [Sat, 8 Mar 2025 02:58:29 +0000 (10:58 +0800)]
wifi: rtw89: coex: RTL8852BT coexistence Wi-Fi firmware support for 0.29.122.0

Add format version of Wi-Fi firmware commands/events for firmware
version 0.29.122.0.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250308025832.10400-2-pkshih@realtek.com
4 months agowifi: rtw89: set force HE TB mode when connecting to 11ax AP
Dian-Syuan Yang [Thu, 6 Mar 2025 02:11:44 +0000 (10:11 +0800)]
wifi: rtw89: set force HE TB mode when connecting to 11ax AP

Some of 11ax AP set the UL HE-SIG-A2 reserved subfield to all 0s, which
will cause the 11be chip to recognize trigger frame as EHT. We propose
a method to bypass the "UL HE-SIG-A2 reserved subfield" and always uses
HE TB in response to the AP's trigger frame.

Signed-off-by: Dian-Syuan Yang <dian_syuan0116@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250306021144.12854-6-pkshih@realtek.com
4 months agowifi: rtw89: 8922a: enable dynamic antenna gain
Kuan-Chung Chen [Thu, 6 Mar 2025 02:11:43 +0000 (10:11 +0800)]
wifi: rtw89: 8922a: enable dynamic antenna gain

The 8922A now supports dynamic antenna gain. However, in firmware
before v0.35.64.0, different transmit powers cannot be applied to
each RF path. To comply with regulatory limits in these older
firmware, the lower of the two requested transmit powers will
be used for both paths when they differ.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250306021144.12854-5-pkshih@realtek.com
4 months agowifi: rtw89: enable dynamic antenna gain based on country
Kuan-Chung Chen [Thu, 6 Mar 2025 02:11:42 +0000 (10:11 +0800)]
wifi: rtw89: enable dynamic antenna gain based on country

The dynamic antenna gain (DAG) considers the country, meaning DAG can
be activated only when countries and regulatory domains allow it.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250306021144.12854-4-pkshih@realtek.com
4 months agowifi: rtw89: refine mechanism of TAS
Kuan-Chung Chen [Thu, 6 Mar 2025 02:11:41 +0000 (10:11 +0800)]
wifi: rtw89: refine mechanism of TAS

TAS state switching mechanism now incorporates the TX ratio as a
decision parameter. The average power calculation has been improved
by using a higher resolution conversion from dBm to linear. During
scan or MCC operations, TAS state is forced to static SAR and
suspend the average power calculation. Additionally, TAS window
size depends on the regulatory domain and band to ensure compliance.

TAS is enabled when permitted by the regulatory domain and is
currently supported on the 8852CE.

For debugging, add a flag to disable_dm that can stop TAS mechanism.

Co-developed-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250306021144.12854-3-pkshih@realtek.com
4 months agowifi: rtw89: add support for negative values of dBm to linear conversion
Kuan-Chung Chen [Thu, 6 Mar 2025 02:11:40 +0000 (10:11 +0800)]
wifi: rtw89: add support for negative values of dBm to linear conversion

Enhanced the dBm to linear conversion function to accommodate negative
dBm values and improved the precision from 1 dBm to 0.25 dBm.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250306021144.12854-2-pkshih@realtek.com
4 months agowifi: rtw89: pci: correct ISR RDU bit for 8922AE
Ping-Ke Shih [Thu, 27 Feb 2025 13:19:07 +0000 (21:19 +0800)]
wifi: rtw89: pci: correct ISR RDU bit for 8922AE

The interrupt status (ISR) bits of RX desc unavailable (RDU) for 8922AE
are B_BE_RDU_CH1_INT_V1 and B_BE_RDU_CH0_INT_V1. With wrong bits, if it
happens, driver can't recognize the situation and prompt a message.
Fix the definition accordingly.

Fixes: aa70f76120ee ("wifi: rtw89: pci: generalize interrupt status bits of interrupt handlers")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131907.9864-1-pkshih@realtek.com
4 months agowifi: rtw89: fw: don't reject firmware in blacklist to prevent breaking users
Ping-Ke Shih [Thu, 27 Feb 2025 13:12:28 +0000 (21:12 +0800)]
wifi: rtw89: fw: don't reject firmware in blacklist to prevent breaking users

Once update driver blacklist of firmware, users' firmware might be in
the list, and then driver stops working. Since breaking users is not
expected, report a significant message instead of stopping.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131228.8457-5-pkshih@realtek.com
4 months agowifi: rtw89: fw: correct debug message format in rtw89_build_txpwr_trk_tbl_from_elm()
Ping-Ke Shih [Thu, 27 Feb 2025 13:12:27 +0000 (21:12 +0800)]
wifi: rtw89: fw: correct debug message format in rtw89_build_txpwr_trk_tbl_from_elm()

The format should be "%08x". Fix the mistakes.

Fixes: d60e73e5dd70 ("wifi: rtw89: fw: load TX power track tables from fw_element")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131228.8457-4-pkshih@realtek.com
4 months agowifi: rtw89: fw: update role_maintain H2C command for roles operating on band 1
Po-Hao Huang [Thu, 27 Feb 2025 13:12:26 +0000 (21:12 +0800)]
wifi: rtw89: fw: update role_maintain H2C command for roles operating on band 1

Add new fields band and port ID to make chips operating on the band and
port ID other than 0, so that multiple vif(s) can be working at the
same time.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131228.8457-3-pkshih@realtek.com
4 months agowifi: rtw89: fw: use struct to fill role_maintain H2C command
Po-Hao Huang [Thu, 27 Feb 2025 13:12:25 +0000 (21:12 +0800)]
wifi: rtw89: fw: use struct to fill role_maintain H2C command

The role_maintain H2C command is to align operating mode of WiFi role,
such as STA or AP modes, between driver and firmware.

Use a struct to fill fields of this H2C command.

Don't change logic at all.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131228.8457-2-pkshih@realtek.com
5 months agowifi: rtw89: Parse channel from IE to correct invalid hardware reports during scanning
Chih-Kang Chang [Thu, 20 Feb 2025 06:43:57 +0000 (14:43 +0800)]
wifi: rtw89: Parse channel from IE to correct invalid hardware reports during scanning

For some packets, we could not get channel information from PPDU status.
And this causes wrong frequencies being reported. Parse the channel
information from IE if provided by AP to fix this.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250220064357.17962-1-pkshih@realtek.com
5 months agowifi: rtw89: add support for HW TKIP crypto
Kuan-Chung Chen [Thu, 20 Feb 2025 06:23:44 +0000 (14:23 +0800)]
wifi: rtw89: add support for HW TKIP crypto

For 8852BTE, 8852CE, and 8922AE, TKIP encryption and decryption
will be handled by hardware. All other chips will retain their
existing software-based encryption and decryption.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250220062344.15836-1-pkshih@realtek.com
5 months agowifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:32:49 +0000 (01:32 +0200)]
wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU

Make it print the TX power details for all RF paths, not just A and B,
and for all the rates supported by the chip, not just 1SS and 2SS
rates.

Also skip the RF paths and rates not supported by the chip.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/ea65a978-a735-4c97-af82-d7fe26f95da1@gmail.com
5 months agowifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:32:15 +0000 (01:32 +0200)]
wifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU

Print information about the 3rd and 4th RF paths and about the 3rd
spatial stream.

Also, fix a small bug: don't show the average SNR and EVM for the OFDM
and HT/VHT rates when the rate is actually CCK 11M.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/7c8e94e2-e034-40f3-bdaf-b000018b5573@gmail.com
5 months agowifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:31:51 +0000 (01:31 +0200)]
wifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU

Select the TX power tracking tables for RF paths C and D as well.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/e1e532c9-8733-4ec8-84fe-ced4af6c08da@gmail.com
5 months agowifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:31:13 +0000 (01:31 +0200)]
wifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU

Record statistics for the 3SS rates too.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/39e3c7cf-37ed-4c0e-af00-dcd9eab351f0@gmail.com
5 months agowifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:30:48 +0000 (01:30 +0200)]
wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU

Set the MCS maps and the highest rates according to the number of
spatial streams the chip has. For RTL8814AU that is 3.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/e86aa009-b5bf-4b3a-8112-ea5e3cd49465@gmail.com
5 months agowifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:30:22 +0000 (01:30 +0200)]
wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU

Set the RX mask and the highest RX rate according to the number of
spatial streams the chip can receive. For RTL8814AU that is 3.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/4e786f50-ed1c-4387-8b28-e6ff00e35e81@gmail.com
5 months agowifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
Bitterblue Smith [Mon, 17 Feb 2025 23:29:52 +0000 (01:29 +0200)]
wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31

This function translates the rate number reported by the hardware into
something mac80211 can understand. It was ignoring the 3SS and 4SS HT
rates. Translate them too.

Also set *nss to 0 for the HT rates, just to make sure it's
initialised.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/d0a5a86b-4869-47f6-a5a7-01c0f987cc7f@gmail.com
5 months agowifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU
Bitterblue Smith [Mon, 17 Feb 2025 23:28:59 +0000 (01:28 +0200)]
wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU

rtw_mac_power_switch() checks bit 8 of REG_SYS_STATUS1 to see if the
chip is powered on. This bit appears to be always on in the RTL8814AU,
so ignore it.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/2f0fcffb-3067-4d95-a68c-f2f3a5a47921@gmail.com
5 months agowifi: rtw89: fw: safely cast mfw_hdr pointer from firmware->data
Ping-Ke Shih [Mon, 17 Feb 2025 06:43:08 +0000 (14:43 +0800)]
wifi: rtw89: fw: safely cast mfw_hdr pointer from firmware->data

Check size of struct mfw_hdr within firmware->size before type casting
to ensure to validly dereference fields from mfm_hdr pointer. Then,
check if signature field is equal to RTW89_MFW_SIG to assert current
is multi-firmware.

Addresses-Coverity-ID: 1494046 ("Untrusted loop bound")
Addresses-Coverity-ID: 1544385 ("Untrusted array index read")

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-6-pkshih@realtek.com
5 months agowifi: rtw89: fw: add debug message for unexpected secure firmware
Ping-Ke Shih [Mon, 17 Feb 2025 06:43:07 +0000 (14:43 +0800)]
wifi: rtw89: fw: add debug message for unexpected secure firmware

If failed to load a non-secure firmware with a secure chip, it only throws
a unclear message:

   rtw89_8922ae 0000:03:00.0: parse fw header fail

To address this case simpler, add a message to point out this.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-5-pkshih@realtek.com
5 months agowifi: rtw89: fw: propagate error code from rtw89_h2c_tx()
Ping-Ke Shih [Mon, 17 Feb 2025 06:43:06 +0000 (14:43 +0800)]
wifi: rtw89: fw: propagate error code from rtw89_h2c_tx()

The error code should be propagated to callers during downloading firmware
header and body. Remove unnecessary assignment of -1.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-4-pkshih@realtek.com
5 months agowifi: rtw89: fw: get sb_sel_ver via get_unaligned_le32()
Ping-Ke Shih [Mon, 17 Feb 2025 06:43:05 +0000 (14:43 +0800)]
wifi: rtw89: fw: get sb_sel_ver via get_unaligned_le32()

The sb_sel_ver is selection version for secure boot recorded in firmware
binary data, and its size is 4 and offset is 58 (not natural alignment).
Use get_unaligned_le32() to get this value safely. Find this by reviewing.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-3-pkshih@realtek.com
5 months agowifi: rtw89: fw: add blacklist to avoid obsolete secure firmware
Ping-Ke Shih [Mon, 17 Feb 2025 06:43:04 +0000 (14:43 +0800)]
wifi: rtw89: fw: add blacklist to avoid obsolete secure firmware

To ensure secure chip only runs expected secure firmware, stop using
obsolete firmware in blacklist which weakness or flaw was found.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217064308.43559-2-pkshih@realtek.com
5 months agowifi: rtw89: add H2C command of TX time for WiFi 7 chips
Ping-Ke Shih [Mon, 17 Feb 2025 06:30:53 +0000 (14:30 +0800)]
wifi: rtw89: add H2C command of TX time for WiFi 7 chips

BT-coexistence configure WiFi TX time to share time slots with Bluetooth
devices. Since the format is different from WiFi 6 chips, add the new
format accordingly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217063053.38936-3-pkshih@realtek.com
5 months agowifi: rtw89: mac: define registers of agg_limit and txcnt_limit to share common flow
Ping-Ke Shih [Mon, 17 Feb 2025 06:30:52 +0000 (14:30 +0800)]
wifi: rtw89: mac: define registers of agg_limit and txcnt_limit to share common flow

The agg_limit and txcnt_limit are used by BT-coexistence to reduce
WiFi TX time at once to share time with Bluetooth devices. Since
these registers address are different from WiFi 6 and 7 chips, define
them accordingly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217063053.38936-2-pkshih@realtek.com
5 months agowifi: rtw89: 8922a: fix incorrect STA-ID in EHT MU PPDU
Kuan-Chung Chen [Mon, 17 Feb 2025 06:12:35 +0000 (14:12 +0800)]
wifi: rtw89: 8922a: fix incorrect STA-ID in EHT MU PPDU

EHT MU PPDU contains user field of EHT-SIG field with STA-ID that
must match AID subfield in the Associate Response. Add a necessary
setting to prevent these from being inconsistent.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250217061235.32031-1-pkshih@realtek.com
5 months agowifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps
Dmitry Antipov [Thu, 13 Feb 2025 09:50:06 +0000 (12:50 +0300)]
wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps

Since the vendor driver is claimed to measure 'tssi_alimk_time' of
'struct rtw89_tssi_info' in microseconds, adjust rtw8852b{t}-specific
'_tssi_alimentk()' to not mess the former with nanoseconds and print
both per-call and accumulated times. Compile tested only.

Fixes: 7f18a70d7b4d ("wifi: rtw89: 8852b: rfk: add TSSI")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250213095006.1308810-1-dmantipov@yandex.ru
5 months agowifi: rtw88: Add support for Mercusys MA30N and D-Link DWA-T185 rev. A1
Zenm Chen [Mon, 10 Feb 2025 07:36:10 +0000 (15:36 +0800)]
wifi: rtw88: Add support for Mercusys MA30N and D-Link DWA-T185 rev. A1

Add two more USB IDs found in
https://github.com/RinCat/RTL88x2BU-Linux-Driver
to support Mercusys MA30N and D-Link DWA-T185 rev. A1.

Signed-off-by: Zenm Chen <zenmchen@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250210073610.4174-1-zenmchen@gmail.com
5 months agoMerge tag 'rtw-next-2025-02-10-v2' of https://github.com/pkshih/rtw
Johannes Berg [Tue, 11 Feb 2025 14:55:48 +0000 (15:55 +0100)]
Merge tag 'rtw-next-2025-02-10-v2' of https://github.com/pkshih/rtw

Ping-Ke says:

====================
rtw-next patches for v6.15

Major changes are listed below:

rtw88:

 * preparation to support RTL8814AU

rtw89:

 * switch using wiphy_lock and wiphy_work

 * add BB context to manipulate two PHY as preparation of MLO

 * improve BT-coexistence mechanism to play A2DP smoothly

 * firmware file can contain regd table
====================

Link: https://lore.kernel.org/linux-wireless/b65fae15-79bf-40fa-8acc-63d87ae35e19@RTEXMBS04.realtek.com.tw/
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: implement dump region split
Johannes Berg [Wed, 5 Feb 2025 12:55:48 +0000 (14:55 +0200)]
wifi: iwlwifi: implement dump region split

Due to hardware design constraints, a reset handshake may be
necessary even when the firmware has already crashed, with
the dump descriptions indicating which parts should be done
before/after the handshake, if needed. Implement that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.9296e3113d42.Ifb32703fd06a644d08a86b7af1b990738e3c8134@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: add twt operation cmd
Shaul Triebitz [Wed, 5 Feb 2025 12:55:47 +0000 (14:55 +0200)]
wifi: iwlwifi: add twt operation cmd

Add the firmware API.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.50a9f7bebe4c.I15ac1361fdab547dbf680a6fa6e88fdc5b177082@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: use correct IMR dump variable
Johannes Berg [Wed, 5 Feb 2025 12:55:46 +0000 (14:55 +0200)]
wifi: iwlwifi: use correct IMR dump variable

We shouldn't dump the reg_data here which dumps the last
entry again, it should use the imr_reg_data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.3313b18667d1.Iaa9ab66b1d397912a573525e060d39ea01b29d19@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: support ROC version 6
Shaul Triebitz [Wed, 5 Feb 2025 12:55:45 +0000 (14:55 +0200)]
wifi: iwlwifi: support ROC version 6

Version 6 added ROC with multi repetitions.
We don't use it, but need to update the command
length.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.956c33729d48.I609835c08f0003c084a13a1e1e505cb7bc8ecbc6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: clarify the meaning of IWL_INIT_PHY
Emmanuel Grumbach [Wed, 5 Feb 2025 12:55:44 +0000 (14:55 +0200)]
wifi: iwlwifi: clarify the meaning of IWL_INIT_PHY

This is a bit that tells the firmware to wait for the
PHY_CONFIGURATION_CMD before completing its init sequence.
Clarify this in the comment.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.097510347ae2.Ica00b4b30163a21bf993fa968dd406ee4023fc9e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: properly set the names for SC devices
Emmanuel Grumbach [Wed, 5 Feb 2025 12:55:43 +0000 (14:55 +0200)]
wifi: iwlwifi: properly set the names for SC devices

Sc devices can come with several CRFs. Use the CRF to determine the name
of the device.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.5bf5d931204e.I5eb435db1b8df46687c43ebae6488c0c4430d530@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: make no_160 more generic
Emmanuel Grumbach [Wed, 5 Feb 2025 12:55:42 +0000 (14:55 +0200)]
wifi: iwlwifi: make no_160 more generic

We'll have devices that are EHT capable but don't support 320 MHz and
those devices look like the 320 MHz capable devices, but have distinct
subsystem ID.
We already had the same type of differentiation for HE devices that
support 160 MHz or not.
Enhance that mechanism and now the _IWL_DEV_INFO macro gets an
indication whether the bandwidth should be limited for that specific
device.
The subsystem ID gives a binary answer about the bandwidth limitation
and iwl_pci_find_dev_info() compares this to the list of _IWL_DEV_INFO
entries.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.1ba406c538a5.I6e24123f60a764aedfeaaac8768c26e136c320cf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: be less aggressive with re-probe
Emmanuel Grumbach [Wed, 5 Feb 2025 12:55:41 +0000 (14:55 +0200)]
wifi: iwlwifi: be less aggressive with re-probe

Re-probing if we had 2 firmware crash within 3 minutes is really too
aggressive. Drastically reduce the threshold to 7 seconds.
After 7 seconds, a new firmware crash will be considered "new" and not
cause a PCI re-probe.
This allows to pass tests that cause a firmware crash every 10 seconds
and expect to see no impact on the traffic.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.38f912b047f4.I03f0c10ae9e7ecea639431f3e089b757cc8a4347@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: fw: make iwl_send_dbg_dump_complete_cmd() static
Johannes Berg [Wed, 5 Feb 2025 12:55:40 +0000 (14:55 +0200)]
wifi: iwlwifi: fw: make iwl_send_dbg_dump_complete_cmd() static

It's only used in the same file, so can be static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.319b66c00676.I3c06d6c2ee5850a5a89feff7d770e557fd625a6d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: Indicate support link reconfiguration
Ilan Peer [Wed, 5 Feb 2025 12:55:39 +0000 (14:55 +0200)]
wifi: iwlwifi: mvm: Indicate support link reconfiguration

As MLO link configuration is supported by mac80211, indicate
support for MLO link reconfiguration in station mode.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
----------------
depends on "wifi: ieee80211: Add some missing MLO related definitions"
Link: https://patch.msgid.link/20250205145347.92d19705d2b9.Id07fa3ebad6bc23ecf6e91868f67150ce70f47b0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: Indicate support for EPCS
Ilan Peer [Wed, 5 Feb 2025 12:55:38 +0000 (14:55 +0200)]
wifi: iwlwifi: Indicate support for EPCS

Indicate support for EPCS and unsolicited EPCS in the EHT MAC
capabilities.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.6b1c7cc8a958.Idd72ea53f70eb452d43d99e6c45ff21f891100bd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: cfg: separate 22000/BZ family HT params
Johannes Berg [Wed, 5 Feb 2025 12:55:37 +0000 (14:55 +0200)]
wifi: iwlwifi: cfg: separate 22000/BZ family HT params

We're adding a new IWLMLD opmode for just BZ and later
devices. If that's enabled but IWLMVM isn't, the build
fails because 22000 family configs aren't built but BZ
and later refer to it. Rather than trying to make some
new file to build it in all cases, just copy the small
struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.1d6186c23bee.I3c61a6c9e0db3ba6eea4dac63e1547945ad01703@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: enable 320 MHz on slow PCIe links
Johannes Berg [Wed, 5 Feb 2025 12:55:36 +0000 (14:55 +0200)]
wifi: iwlwifi: enable 320 MHz on slow PCIe links

Despite not being able to sustain the full 320 MHz throughput
even at MCS 9, enable 320 MHz on slow PCIe links. This may in
some cases result in frames being dropped (on the air) by the
firmware if they cannot be delivered to the host, but it can
still be better to use 320 MHz.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.1e5356a3b124.I1224023721aaeff8ebcaa47dff88613c7fd0533a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: don't warn during reprobe
Miri Korenblit [Wed, 5 Feb 2025 12:55:35 +0000 (14:55 +0200)]
wifi: iwlwifi: don't warn during reprobe

During reprobe, the sw state is being destroyd, and so is the
connection. When the peer STA is being removed, the opmode sends a
command to flush the TXQs of the STA and uses iwl_trans_wait_txq_empty.

This one warns if the FW is not alive, but it really shouldn't if
there is a FW error - and return silently instead, just like we do when
sending a hcmd.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250205145347.76425b10e5a0.I3bf0de2eb090a8b94c4e36d93dd91df61fadb808@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: Unify TAS block list handling in regulatory.c
Anjaneyulu [Wed, 5 Feb 2025 12:55:34 +0000 (14:55 +0200)]
wifi: iwlwifi: Unify TAS block list handling in regulatory.c

Created a common function iwl_add_mcc_to_tas_block_list() to handle the
operations previously performed by iwl_mld_add_to_tas_block_list() and
iwl_mvm_add_to_tas_block_list(). moved this new function to regulatory.c
to better reflect its purpose and improve code organization.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.157d26fb7f02.I87e20e967835bc895be390daf1c6637e20b52aae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: mvm: rename and move iwl_mvm_eval_dsm_rfi() to iwl_rfi_is_enabled_in_b...
Anjaneyulu [Wed, 5 Feb 2025 12:55:33 +0000 (14:55 +0200)]
wifi: iwlwifi: mvm: rename and move iwl_mvm_eval_dsm_rfi() to iwl_rfi_is_enabled_in_bios()

Renamed iwl_mvm_eval_dsm_rfi() to iwl_rfi_is_enabled_in_bios() to better
reflect the function's operation. Additionally, moved the function to the
regulatory.c file for better organization. optimize local variable
usage in it.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.b7ac9d05234e.Ieb623d7e8dca6bb6a5733682b31e4ff1e39373f0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: b43: Replace outdated firmware URL
Salvatore Bonaccorso [Wed, 5 Feb 2025 11:06:14 +0000 (12:06 +0100)]
wifi: b43: Replace outdated firmware URL

https://wireless.wiki.kernel.org site now redirects to
https://wireless.docs.kernel.org/en/latest/ making the reference
information for the b43 firmware inaccessible. Update the URL to the
current location.

Link: https://bugs.debian.org/1095062
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Acked-by: Michael Büsch <m@bues.ch>
Link: https://patch.msgid.link/20250205110614.216958-1-carnil@debian.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: rework the Tx of the deauth in ieee80211_set_disassoc()
Emmanuel Grumbach [Wed, 5 Feb 2025 09:39:27 +0000 (11:39 +0200)]
wifi: mac80211: rework the Tx of the deauth in ieee80211_set_disassoc()

When we disassociate we may need to send a deauth frame.
Regardless of this decision, we need to flush the queues to drop all the
packets on the Tx queues.

The flow looks like this:

1) Flush packets waiting on the queues (drop=true)
2) Prepare Tx to send the deauth
3) Build the deauth header
4) send the deauth
5) Flush the deauth packet (drop=false)
6) Complete_tx

Step 3 and 4 are done in ieee80211_send_deauth_disassoc() and that
function  must be called even if we decide not to send the deauth
frame because we need step 3 for cfg80211.

This means that if we want to send the deauth frame, we need all the
steps, but if we don't want to send the deauth frame we still want step
1 and 3.

Change the code to do that.

Also, prevent sending the deauth frame if we are in the middle of a CSA
with mode=1 in which case we won't be able to send the frame anyway.
This caused issues in iwlwifi at step 5 since the firmware wouldn't
send the frame and we'd be stuck flushing with drop=false.
Implement this in ieee80211_set_disassoc() which has many callers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.480bfea605e0.I91131eed942e49b9885d73f4180a3c9c26691c62@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: ensure sdata->work is canceled before initialized.
Miri Korenblit [Wed, 5 Feb 2025 09:39:26 +0000 (11:39 +0200)]
wifi: mac80211: ensure sdata->work is canceled before initialized.

This wiphy work is canceled when the iface is stopped,
and shouldn't be queued for a non-running iface.
If it happens to be queued for a non-running iface (due to a bug)
it can cause a corruption of wiphy_work_list when ieee80211_setup_sdata
is called. Make sure to cancel it in this case and warn on.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250205110958.99204c767c10.I84ce27a239059f6009cee197b252549a11426046@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: enable removing assoc link
Johannes Berg [Wed, 5 Feb 2025 09:39:25 +0000 (11:39 +0200)]
wifi: mac80211: enable removing assoc link

With the previous patch to no longer access deflink for aggregation
it seems we no longer access the deflink for MLO stations (MLDs) so
we can allow removing the assoc link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.05bc2175cea2.I8f62609a682fdf3f703872d0fce63ab6a4780a7e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: aggregation: remove deflink accesses for MLO
Johannes Berg [Wed, 5 Feb 2025 09:39:24 +0000 (11:39 +0200)]
wifi: mac80211: aggregation: remove deflink accesses for MLO

If a station has connected with MLO (as indicated by valid_links
being non-zero, even if that may have just a single bit set), it
necessarily supports EHT/aggregation, so we don't need to check
the deflink for those cases.

Add conditions so we can support removing the link it/we used to
associate on.

Note that we still use the statistics in the deflink, but that's
a whole different story we will need to address separately.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.daf2a9e367f2.Id2c2dfbbe7451cc900ed88c5a81b33c55b4ab1cf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: always send max agg subframe num in strict mode
Johannes Berg [Wed, 5 Feb 2025 09:39:23 +0000 (11:39 +0200)]
wifi: mac80211: always send max agg subframe num in strict mode

Instead of only sending the correct number for EHT and up,
always send the correct number as it should be in strict
mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.5910263db6da.Icd1f93fabc9705e4e760d834095c29b60b934d9e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: don't unconditionally call drv_mgd_complete_tx()
Johannes Berg [Wed, 5 Feb 2025 09:39:22 +0000 (11:39 +0200)]
wifi: mac80211: don't unconditionally call drv_mgd_complete_tx()

We might not have called drv_mgd_prepare_tx(), so only call
drv_mgd_complete_tx() under the same conditions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.e091fc39a351.Ie6a3cdca070612a0aa4b3c6914ab9ed602d1f456@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: remove misplaced drv_mgd_complete_tx() call
Johannes Berg [Wed, 5 Feb 2025 09:39:21 +0000 (11:39 +0200)]
wifi: mac80211: remove misplaced drv_mgd_complete_tx() call

In the original commit 15fae3410f1d ("mac80211: notify driver on
mgd TX completion") I evidently made a mistake and placed the
call in the "associated" if, rather than the "assoc_data". Later
I noticed the missing call and placed it in commit c042600c17d8
("wifi: mac80211: adding missing drv_mgd_complete_tx() call"),
but didn't remove the wrong one. Remove it now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.6ed954179bbf.Id8ef8835b7e6da3bf913c76f77d201017dc8a3c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: set ieee80211_prep_tx_info::link_id upon Auth Rx
Emmanuel Grumbach [Wed, 5 Feb 2025 09:39:20 +0000 (11:39 +0200)]
wifi: mac80211: set ieee80211_prep_tx_info::link_id upon Auth Rx

This will be used by the low level driver.
Note that link_id  will be 0 in case of a non-MLO authentication.
Also fix a call-site of mgd_prepare_tx() where the link_id was not
populated.

Update the documentation to reflect the current state
ieee80211_prep_tx_info::link_id is also available in mgd_complete_tx().

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.6a590f189ce5.I1fc5c0da26b143f5b07191eb592f01f7083d55ae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: tests: add tests for ieee80211_determine_chan_mode
Benjamin Berg [Wed, 5 Feb 2025 09:39:19 +0000 (11:39 +0200)]
wifi: mac80211: tests: add tests for ieee80211_determine_chan_mode

Add a few tests for ieee80211_determine_chan_mode that check that
mac80211 will not try to connect to an AP if an advertised basic rate is
not supported.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.530c81eb7fdc.Ia77f5efdf9efb70d2766a3d6bf425553bcb308e8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: add HT and VHT basic set verification
Benjamin Berg [Wed, 5 Feb 2025 09:39:18 +0000 (11:39 +0200)]
wifi: mac80211: add HT and VHT basic set verification

So far we did not verify the HT and VHT basic MCS set. However, in
P802.11REVme/D7.0 (6.5.4.2.4) says that the MLME-JOIN.request shall
return an error if the VHT and HT basic set requirements are not met.

Given broken APs, apply VHT basic MCS/NSS set checks only in
strict mode.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.e2d8d4095f6b.I66bcf6c2de3b9d3325e4ffd9f573f4cd26ce5685@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211_hwsim: enable strict mode
Johannes Berg [Wed, 5 Feb 2025 09:39:17 +0000 (11:39 +0200)]
wifi: mac80211_hwsim: enable strict mode

Since we use hwsim for testing e.g. the hostapd implementation,
enable strict mode to catch errors that would otherwise not be
caught.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.85bee694f09c.I61ec37d20fe97699d47fce252dc4ae2e4475fc51@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: add strict mode disabling workarounds
Johannes Berg [Wed, 5 Feb 2025 09:39:16 +0000 (11:39 +0200)]
wifi: mac80211: add strict mode disabling workarounds

Add a strict mode where we disable certain workarounds and have
additional checks such as, for now, that VHT capabilities from
association response match those from beacon/probe response. We
can extend the checks in the future.

Make it an opt-in setting by the driver so it can be set there
in some driver-specific way, for example. Also allow setting
this one hw flag through the hwflags debugfs, by writing a new
strict=0 or strict=1 value.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.5cecb0469479.I4a69617dc60ba0d6308416ffbc3102cfd08ba068@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: Add processing of TTLM teardown frame
Ilan Peer [Wed, 5 Feb 2025 09:39:15 +0000 (11:39 +0200)]
wifi: mac80211: Add processing of TTLM teardown frame

Add processing of negotiated TTLM tear down frame.
Handle this frame similar to the way a locally initiated
tear down is handled.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.860691076786.I32df71182c25c5f84e4534f40efe1316926b8249@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: ieee80211: Add missing EHT MAC capabilities
Ilan Peer [Wed, 5 Feb 2025 09:39:14 +0000 (11:39 +0200)]
wifi: ieee80211: Add missing EHT MAC capabilities

Add missing EHT MAC capabilities definitions.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.6c1643c345a1.I7405b9c35cb39ae97a52c3fbcc36b0bd81e495dc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: Add support for EPCS configuration
Ilan Peer [Wed, 5 Feb 2025 09:39:13 +0000 (11:39 +0200)]
wifi: mac80211: Add support for EPCS configuration

Add support for configuring EPCS state:

- When EPCS is enabled, send an EPCS enable request action frame
  to the AP. When the AP replies with EPCS enable response, enable
  EPCS by applying the QoS parameters provided by the AP. Do so for
  all the valid MLD links. Once EPCS is enabled, support processing
  of unsolicited EPCS enable response frames.
- When EPCS is disabled, send an EPCS teardown request to the AP
  and apply the QoS parameters as obtained from the last received
  beacons. Do so for all the valid links.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.7a90afd7e140.I3f602d65f5c1fd849d6c70b12307dda33aa91ccb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: Refactor ieee80211_sta_wmm_params()
Ilan Peer [Wed, 5 Feb 2025 09:39:12 +0000 (11:39 +0200)]
wifi: mac80211: Refactor ieee80211_sta_wmm_params()

The function first updates the link configuration and then
calls the driver to set the link parameters. Since the call
to the driver might sleep, split the function such that
the link configuration could be done without calling the
driver. This would be useful in cases that WMM parameters
need to be configured, but the current locking doesn't allow
to call the driver.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.b1cedcf93763.I65783c102d44127035838f97fab64ec4df5c40f3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: cfg80211: Fix trace print for removed links
Ilan Peer [Wed, 5 Feb 2025 09:39:11 +0000 (11:39 +0200)]
wifi: cfg80211: Fix trace print for removed links

Print the mask of removed links in hexadecimal.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.1dd2831cab5f.Ib9f5e82286f0352cd057b4bf76737223e9de8274@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: qtnfmac: Avoid multiple -Wflex-array-member-not-at-end warnings
Gustavo A. R. Silva [Wed, 5 Feb 2025 00:43:33 +0000 (11:13 +1030)]
wifi: qtnfmac: Avoid multiple -Wflex-array-member-not-at-end warnings

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

So, in order to avoid ending up with a flexible-array member in the
middle of other structs, we use the `__struct_group()` helper to
create a new tagged `struct qlink_tlv_hdr_fixed`. This structure
groups together all the members of the flexible `struct qlink_tlv_hdr`
except the flexible array.

As a result, the array is effectively separated from the rest of the
members without modifying the memory layout of the flexible structure.
We then change the type of the middle struct member currently causing
trouble from `struct qlink_tlv_hdr` to `struct qlink_tlv_hdr_fixed`.

We also want to ensure that when new members need to be added to the
flexible structure, they are always included within the newly created
tagged struct. For this, we use `static_assert()`. This ensures that
the memory layout for both the flexible structure and the new tagged
struct is the same after any changes.

This approach avoids having to implement `struct qlink_tlv_hdr_fixed`
as a completely separate structure, thus preventing having to maintain
two independent but basically identical structures, closing the door
to potential bugs in the future.

So, with this changes, fix 66 of the following warnings:
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1681:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1660:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1646:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1621:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1609:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/quantenna/qtnfmac/qlink.h:1570:30: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/Z6K0Nd_IprrhS6pn@kspp
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mac80211: Drop cooked monitor support
Alexander Wetzel [Tue, 4 Feb 2025 11:13:52 +0000 (12:13 +0100)]
wifi: mac80211: Drop cooked monitor support

Hostapd switched from cooked monitor interfaces to nl80211 Dec 2011.
Drop support for the outdated cooked monitor interfaces and fix
creating the virtual monitor interfaces in the following cases:

 1) We have one non-monitor and one monitor interface with
    %MONITOR_FLAG_ACTIVE enabled and then delete the non-monitor
    interface.

 2) We only have monitor interfaces enabled on resume while at least one
    has %MONITOR_FLAG_ACTIVE set.

Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Link: https://patch.msgid.link/20250204111352.7004-2-Alexander@wetzel-home.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: nl80211/cfg80211: Stop supporting cooked monitor
Alexander Wetzel [Tue, 4 Feb 2025 11:13:51 +0000 (12:13 +0100)]
wifi: nl80211/cfg80211: Stop supporting cooked monitor

Unconditionally start to refuse creating cooked monitor interfaces to
phase them out.

There is no feature flag for drivers to opt-in for cooked monitor and
all known users are using/preferring the modern API since the hostapd
release 1.0 in May 2012.

Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Link: https://patch.msgid.link/20250204111352.7004-1-Alexander@wetzel-home.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: mwifiex: Remove unused mwifiex_uap_del_sta_data
Dr. David Alan Gilbert [Tue, 4 Feb 2025 01:25:12 +0000 (01:25 +0000)]
wifi: mwifiex: Remove unused mwifiex_uap_del_sta_data

The last use of mwifiex_uap_del_sta_data() was removed in 2014 by
commit dda9ddeb2638 ("mwifiex: do not delete station entries in del_sta
handler")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20250204012512.390209-1-linux@treblig.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: ipw2x00: Fix spelling mistake "stablization" -> "stabilization"
Colin Ian King [Sun, 2 Feb 2025 22:06:59 +0000 (22:06 +0000)]
wifi: ipw2x00: Fix spelling mistake "stablization" -> "stabilization"

There is a spelling mistake in a IPW_DEBUG_INFO message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250202220659.199341-1-colin.i.king@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove the mvm prefix from iwl_mvm_aux_sta_cmd
Emmanuel Grumbach [Sun, 19 Jan 2025 19:03:15 +0000 (21:03 +0200)]
wifi: iwlwifi: remove the mvm prefix from iwl_mvm_aux_sta_cmd

This is a firmware command and is not specific to the iwlmvm op_mode

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250119210104.276658439163.I70641851f9e5210ec3a7033db38a45d24814083b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove the version number from iwl_dts_measurement_notif_v2
Emmanuel Grumbach [Sun, 19 Jan 2025 19:03:14 +0000 (21:03 +0200)]
wifi: iwlwifi: remove the version number from iwl_dts_measurement_notif_v2

No need to carry the version number in the structure name if this is the
latest version available.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250119210104.9d218a5c4f6b.I9de3e424be48d66994cde3684ce7e9e99456067d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: remove the mvm prefix from iwl_mvm_ctdp_cmd
Emmanuel Grumbach [Sun, 19 Jan 2025 19:03:13 +0000 (21:03 +0200)]
wifi: iwlwifi: remove the mvm prefix from iwl_mvm_ctdp_cmd

This command is not specific to iwlmvm.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250119210104.04f3afcf9c77.Ic2b6f265d0b4aea25ccc7114d6f48afa621871be@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agonet: rfkill: gpio: allow booting in blocked state
Catalin Popescu [Thu, 16 Jan 2025 08:47:02 +0000 (09:47 +0100)]
net: rfkill: gpio: allow booting in blocked state

By default, rfkill state is unblocked and this behavior is not
configurable. Add support for booting in blocked state based on the
presence of a devicetree property.

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
Link: https://patch.msgid.link/20250116084702.3473176-2-catalin.popescu@leica-geosystems.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agodt-bindings: net: rfkill-gpio: enable booting in blocked state
Catalin Popescu [Thu, 16 Jan 2025 08:47:01 +0000 (09:47 +0100)]
dt-bindings: net: rfkill-gpio: enable booting in blocked state

By default, rfkill state is set to unblocked. Sometimes, we want to boot
in blocked state and let the application unblock the rfkill.

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250116084702.3473176-1-catalin.popescu@leica-geosystems.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 months agowifi: iwlwifi: Remove old device data
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:32:02 +0000 (01:32 +0000)]
wifi: iwlwifi: Remove old device data

The last use of iwl_ax204_name[], iwl_ax221_name[] and iwl_cfg_so_a0_ms_a0
was removed by
commit f473a7fd6d60 ("wifi: iwlwifi: remove devices that never came out")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-7-linux@treblig.org
5 months agowifi: iwlwifi: Remove unused iwl_bz_name
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:32:01 +0000 (01:32 +0000)]
wifi: iwlwifi: Remove unused iwl_bz_name

iwl_bz_name[] has been unused since the resent
commit 6795a37161fb ("wifi: iwlwifi: Print a specific device name.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-6-linux@treblig.org
5 months agowifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_add_pasn_sta
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:32:00 +0000 (01:32 +0000)]
wifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_add_pasn_sta

iwl_mvm_ftm_add_pasn_sta() was added in 2020 by
commit 0739a7d70e00 ("iwlwifi: mvm: initiator: add option for adding a
PASN responder")
but hasn't been used.

Remove it.

That was the only caller of iwl_mvm_ftm_remove_pasn_sta().

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-5-linux@treblig.org
5 months agowifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_*_add_pasn_sta functions
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:31:59 +0000 (01:31 +0000)]
wifi: iwlwifi: mvm: Remove unused iwl_mvm_ftm_*_add_pasn_sta functions

iwl_mvm_ftm_respoder_add_pasn_sta() and
iwl_mvm_ftm_resp_remove_pasn_sta() were added in 2020 by
commit be82ecd3a5c8 ("iwlwifi: mvm: add an option to add PASN station")
but have remained unused.

Remove them.

After that removal iwl_mvm_add_pasn_sta() is now unused.
Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-4-linux@treblig.org
5 months agowifi: iwlwifi: mvm: Remove unused iwl_mvm_rx_missed_vap_notif
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:31:58 +0000 (01:31 +0000)]
wifi: iwlwifi: mvm: Remove unused iwl_mvm_rx_missed_vap_notif

iwl_mvm_rx_missed_vap_notif() was added in 2019 by
commit 449a29d0fead ("iwlwifi: mvm: add notification for missed VAP")

but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-3-linux@treblig.org
5 months agowifi: iwlwifi: dvm: Remove unused iwl_rx_ant_restriction
Dr. David Alan Gilbert [Mon, 23 Dec 2024 01:31:57 +0000 (01:31 +0000)]
wifi: iwlwifi: dvm: Remove unused iwl_rx_ant_restriction

iwl_rx_ant_restriction() was added in 2009 by
commit 46f9381aa3fb ("iwlwifi: Thermal Throttling Management - part 2")
but never used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241223013202.340180-2-linux@treblig.org
5 months agowifi: rtw89: debugfs depends on CFG80211's one
Ping-Ke Shih [Mon, 10 Feb 2025 12:31:05 +0000 (20:31 +0800)]
wifi: rtw89: debugfs depends on CFG80211's one

The wiphy_locked_debugfs_read() and wiphy_locked_debugfs_write() used
by rtw89 are defined if CFG80211_DEBUGFS enabled. Add the dependency
accordingly.

Fixes: 8fdf78f3cd5f ("wifi: rtw89: debugfs: use wiphy_locked_debugfs_{read,write}() if needed")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502101810.3CUpUL7p-lkp@intel.com/
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250210123105.10466-1-pkshih@realtek.com
5 months agowifi: rtlwifi: rtl8192de: Fix typos of debug message of phy setting
Andrew Kreimer [Thu, 6 Feb 2025 08:24:12 +0000 (10:24 +0200)]
wifi: rtlwifi: rtl8192de: Fix typos of debug message of phy setting

There are some typos in comments/messages:
 - althougth -> although
 - asume -> assume

Fix them via codespell.

Signed-off-by: Andrew Kreimer <algonell@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250206082457.9148-1-algonell@gmail.com
5 months agowifi: rtw88: Fix rtw_update_sta_info() for RTL8814AU
Bitterblue Smith [Tue, 4 Feb 2025 18:42:08 +0000 (20:42 +0200)]
wifi: rtw88: Fix rtw_update_sta_info() for RTL8814AU

This function tells the firmware what rates it can use.

Put the 3SS and 4SS HT rates supported by the other station into the
rate mask.

Remove the 3SS and 4SS rates from the rate mask if the hardware only has
2 spatial streams.

And finally, select the right rate ID (a parameter for the firmware)
when the hardware has 3 spatial streams.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/48d1d90f-2aeb-4ec5-9a24-0980e10eae1e@gmail.com
5 months agowifi: rtw88: Extend TX power stuff for 3-4 spatial streams
Bitterblue Smith [Tue, 4 Feb 2025 18:41:43 +0000 (20:41 +0200)]
wifi: rtw88: Extend TX power stuff for 3-4 spatial streams

Although the RTL8814AU only has 3 spatial streams, maybe some other chip
has 4.

Correct the TX power index and TX power limit calculations for 3SS and
4SS HT/VHT rates.

With this the RTL8814AU can set the TX power correctly.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/d0c0e126-0794-4c4e-9203-ea39a707b673@gmail.com
5 months agowifi: rtw88: Rename RTW_RATE_SECTION_MAX to RTW_RATE_SECTION_NUM
Bitterblue Smith [Tue, 4 Feb 2025 18:40:58 +0000 (20:40 +0200)]
wifi: rtw88: Rename RTW_RATE_SECTION_MAX to RTW_RATE_SECTION_NUM

It fits the meaning of the enum better.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/5a1c5a46-8ebb-43b0-9ab1-b78e2a22b3d2@gmail.com
5 months agowifi: rtw88: Constify some more structs and arrays
Bitterblue Smith [Tue, 4 Feb 2025 18:40:22 +0000 (20:40 +0200)]
wifi: rtw88: Constify some more structs and arrays

These structs and arrays are never modified, so make them const:

rtw_band_2ghz
rtw_band_5ghz
rtw_pci_tx_queue_idx_addr
rtw_pci_ops
rtw_cck_rates
rtw_ofdm_rates
rtw_ht_1s_rates
rtw_ht_2s_rates
rtw_vht_1s_rates
rtw_vht_2s_rates
rtw_rate_section
rtw_rate_size
rtw_sdio_ops
rtw_usb_ops

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/502f124e-ccf3-4c09-80a4-1e5c5304822b@gmail.com
5 months agowifi: rtw88: Extend rtw_fw_send_ra_info() for RTL8814AU
Bitterblue Smith [Tue, 4 Feb 2025 18:39:29 +0000 (20:39 +0200)]
wifi: rtw88: Extend rtw_fw_send_ra_info() for RTL8814AU

The existing code is suitable for chips with up to 2 spatial streams.
Inform the firmware about the rates it's allowed to use when
transmitting 3 spatial streams.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/08e2f328-1aab-4e50-93ac-c1e5dd9541ac@gmail.com