Commit Graph

1267463 Commits

Author SHA1 Message Date
Kalle Valo
2d6c717760 rtw-next patches for v6.10
Major changes are listed as below
 
 rtl8xxxu:
 
  - remove rtl8xxxu_ prefix from filename
  - cleanup includes of header files
 
 rtlwifi:
 
  - adjust code to share with coming support of rtl8192du
 
 rtw89:
 
  - complete features of new WiFi 7 chip 8922AE including BT-coexistence
    and WoWLAN
  - use BIOS ACPI settings to set TX power and channels
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuyEnvMdOsBl1WjpdjlvZYmhshd8FAmY2Jk8ACgkQjlvZYmhs
 hd/I9Q//aatzdSDkVtVC9YUFLAb+UYXc0s8t7Kq4eYEu/ZgFRgWHcB1Ka8OBE/9p
 mkCiLPBujzqI5nLq+9HoJ0ptzI9F93QnPrsLr670NpY5Nt7IRO5ph90/HN/e2VPm
 +FlF+EZ5UuHolw+KaA3Kym3a6Ui7vnmIZympRkk9vKrq4GAXmcVI4zVNAFgRfHo1
 tWBdGONlMJGjjIQ2UJ8CiTRMkM7Ph3VgK/aCJyHwtAJvVxSJFN9b1cDzW64DES5V
 cPQgVtRg3o/l05KJ+xrggXQWSkiYrtbBMX6URTkOaX6cfVDd6D8qsLLB/CabXGjo
 12LqxAxMQuQ44kxXyFSln5SgNwMA0X301Qbzms5KCfKDd9SMZ0MKmOrAlEI35Og5
 T03DUg2btD6VSFZJcnNCmBZtSdlm7fhRlxmJTo/N++6lS8CmA0NettkwcOPpfi1l
 KdaU735KUG3lgelW9gj4RWUI06cVZ2y4UPAh3fvMq7FuwGDyJvFftrgwn/bN2jPH
 9Zmivq1Q2/7xwZ/hhzAwLNUAUv6191XZXAwMxBGT/qpNNrgwMiLnVEjMa1/pgixH
 Z5cMlg5c14wpaepB70PCvy2CImOBcGAs8kfvX8cER5L29+lmg5vpdz+DGTCKK8t3
 2tdMTA9xtDc+J1EIqgydSXvMfDwdyX9wBr+3sqOVdzfFqeSEx9I=
 =z69x
 -----END PGP SIGNATURE-----

Merge tag 'rtw-next-2024-05-04-v2' of https://github.com/pkshih/rtw

rtw-next patches for v6.10

Major changes are listed as below

rtl8xxxu:

 - remove rtl8xxxu_ prefix from filename
 - cleanup includes of header files

rtlwifi:

 - adjust code to share with coming support of rtl8192du

rtw89:

 - complete features of new WiFi 7 chip 8922AE including BT-coexistence
   and WoWLAN
 - use BIOS ACPI settings to set TX power and channels
2024-05-06 10:29:09 +03:00
Ping-Ke Shih
82b85a836a wifi: rtlwifi: 8192d: initialize rate_mask in rtl92de_update_hal_rate_mask()
le32p_replace_bits() only updates partial bits of rate_mask, and GCC warns
below. Set initial value to avoid warnings, and prevent random value of
missed bits (bit 6 of rate_mask.macid_and_short_gi).

In file included from ./include/linux/fortify-string.h:5,
                 from ./include/linux/string.h:369,
                 from ./include/linux/bitmap.h:13,
                 from ./include/linux/cpumask.h:13,
                 from ./include/linux/sched.h:16,
                 from drivers/net/wireless/realtek/rtlwifi/rtl8192d/../wifi.h:9,
                 from drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:4:
In function 'le32p_replace_bits',
    inlined from 'rtl92de_update_hal_rate_mask.isra' at drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:986:2:
./include/linux/bitfield.h:189:15: warning: 'rate_mask' is used uninitialized [-Wuninitialized]
  189 |         *p = (*p & ~to(field)) | type##_encode_bits(val, field);        \
      |               ^~
./include/linux/bitfield.h:196:9: note: in expansion of macro '____MAKE_OP'
  196 |         ____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
      |         ^~~~~~~~~~~
./include/linux/bitfield.h:201:1: note: in expansion of macro '__MAKE_OP'
  201 | __MAKE_OP(32)
      | ^~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c: In function 'rtl92de_update_hal_rate_mask.isra':
drivers/net/wireless/realtek/rtlwifi/rtl8192d/hw_common.c:863:37: note: 'rate_mask' declared here
  863 |         struct rtl92d_rate_mask_h2c rate_mask;
      |                                     ^~~~~~~~~

Compile tested only.

Fixes: 014bba73b5 ("wifi: rtlwifi: Adjust rtl8192d-common for USB")
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240504111916.31445-1-pkshih@realtek.com
2024-05-04 20:05:14 +08:00
Gustavo A. R. Silva
b3e11ee3b9 wifi: rtlwifi: Remove unused structs and avoid multiple -Wfamnae warnings
Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
ready to enable it globally.

So, remove unused structs and fix the following
-Wflex-array-member-not-at-end warnings:

drivers/net/wireless/realtek/rtlwifi/btcoexist/../wifi.h:1063: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/realtek/rtlwifi/rtl8188ee/../wifi.h:1063: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/realtek/rtlwifi/rtl8192c/../wifi.h:1063: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/realtek/rtlwifi/rtl8192ce/../wifi.h:1063: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/realtek/rtlwifi/rtl8192cu/../wifi.h:1063: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/realtek/rtlwifi/rtl8192de/../wifi.h:1063: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/realtek/rtlwifi/rtl8192ee/../wifi.h:1063: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/realtek/rtlwifi/rtl8192se/../wifi.h:1063: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/realtek/rtlwifi/rtl8723ae/../wifi.h:1063: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/realtek/rtlwifi/rtl8723be/../wifi.h:1063: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/realtek/rtlwifi/rtl8723com/../wifi.h:1063: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/realtek/rtlwifi/rtl8821ae/../wifi.h:1063: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/realtek/rtlwifi/wifi.h:1063: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>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/ZjLFIa31BGPVCGh1@neat
2024-05-04 08:17:00 +08:00
Ping-Ke Shih
f506e3ee54 wifi: rtw89: correct aSIFSTime for 6GHz band
aSIFSTime is 10us for 2GHz band and 16us for 5GHz and 6GHz bands.
Originally, it doesn't consider 6GHz band and use wrong value, so correct
it accordingly.

Cc: stable@vger.kernel.org
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240430020515.8399-1-pkshih@realtek.com
2024-05-04 08:14:49 +08:00
Chin-Yen Lee
58ed86e166 wifi: rtw89: wow: add ARP offload feature
Add H2C command and offload template packet to allow firmware send ARP
response in WoWLAN mode. Then, firmware in WoWLAN mode can interactive
with peer that issue ARP request to query MAC address.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-13-pkshih@realtek.com
2024-05-04 08:05:43 +08:00
Chih-Kang Chang
e765370fdc wifi: rtw89: wow: support WEP cipher on WoWLAN
When using the WEP cipher, we need to add the address cam type as all
unicast mode to let firmware to work. Although WEP only set GTK in
mac80211, but we need to set both PTK and GTK information to firmware.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-12-pkshih@realtek.com
2024-05-04 08:05:34 +08:00
Chih-Kang Chang
940cd99625 wifi: rtw89: wow: support 802.11w PMF IGTK rekey
Once we connect to AP with 802.11w enabled, IGTK rekey happen during GTK
happen. We get IGTK IPN from mac80211 and set to firmware, and get latest
IGTK IPN from AOAC report then update to mac80211 after resume. When rekey
happen, also update new IGTK key info to mac80211. Furthermore, We
construct SA query reply packet to firmware. If firmware received SA query
request from AP can transmit reply back when suspend.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-11-pkshih@realtek.com
2024-05-04 08:05:15 +08:00
Chih-Kang Chang
ff53fce5c7 wifi: rtw89: wow: update latest PTK GTK info to mac80211 after resume
When resume we parse AOAC report from firmware using H2C and C2H
registers before enable interrupt, then update PTK RX PN and GTK RX PN.
After enable interrupt, we parse AOAC report using H2C and C2H commands,
then update PTK TX PN and update new GTK key info if GTK rekey during
suspend. Furthermore, We update pattern match index if wakeup by pattern.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-10-pkshih@realtek.com
2024-05-04 08:04:03 +08:00
Chih-Kang Chang
0291633afe wifi: rtw89: wow: add GTK rekey feature related H2C commands
Add PTK TRX IV, GTK RX IV, key encryption algorithm to H2C command to
enable GTK rekey feature.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-9-pkshih@realtek.com
2024-05-04 08:03:50 +08:00
Chih-Kang Chang
ed9a3c0d4d wifi: rtw89: wow: construct EAPoL packet for GTK rekey offload
We construct EAPoL packet with various encryption method, and download
to firmware. Also we add Key Encryption Key (KEK) and Key Confirmation Key
(KCK) to H2C command. Once firmware received EAPoL group rekey packet(1/2)
can TX EAPoL group rekey packet(2/2) when suspend.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-8-pkshih@realtek.com
2024-05-04 08:02:34 +08:00
Chih-Kang Chang
786737b6b7 wifi: rtw89: use struct to fill H2C of WoWLAN global configuration
This H2C command is used to set WoWLAN global config, and we correct
the H2C format by enlarging the H2C size to fill GTK and PTK info.
This fix is compatible with old firmware.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-7-pkshih@realtek.com
2024-05-04 08:01:55 +08:00
Chih-Kang Chang
9076bf365e wifi: rtw89: use struct to access firmware command h2c_dctl_sec_cam_v1
This H2C command set key information into security CAM including key
index, entry index and valid map. No logic is changed.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-6-pkshih@realtek.com
2024-05-04 08:01:13 +08:00
Chih-Kang Chang
803a96f477 wifi: rtw89: wow: prepare PTK GTK info from mac80211
Get the PTK and PTK TRX PN value and transfer to IV value, these
values will used by firmware to generate packets with correct IV value.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-5-pkshih@realtek.com
2024-05-04 07:59:55 +08:00
Chih-Kang Chang
92790c4e50 wifi: rtw89: wow: parsing Auth Key Management from associate request
Need Auth Key Management(AKM) to let firmware to generate appropriate
EAPoL packet for GTK rekey. The AKM is present in the association request
RSN IE to indicate which cipher that station selected.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-4-pkshih@realtek.com
2024-05-04 07:58:28 +08:00
Chih-Kang Chang
baaf806e46 wifi: rtw89: wow: refine WoWLAN flows of HCI interrupts and low power mode
After enabling packet offload, the TX will be stuck after resume from
WoWLAN mode. And the 8852c gets error messages like

rtw89_8852ce 0000:04:00.0: No busy txwd pages available
rtw89_8852ce 0000:04:00.0: queue 0 txwd 100 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 101 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 102 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 103 is not idle

If suspend/resume many times that firmware will download failed and
disconnection.

To fix these issues, We removed the rtw89_hci_disable_intr() and
rtw89_hci_enable_intr() during rtw89_wow_swap_fw() to prevent add packet
offload can't receive c2h back due to interrupt disable. Only 8852C and
8922A needs to disable interrupt before downloading fw.

Furthermore, we avoid using low power HCI mode on WoWLAN mode, to prevent
interrupt enabled, then get interrupt and calculate RXBD mismatched due to
software RXBD index already reset but hardware RXBD index not yet.

Fixes: 5c12bb66b7 ("wifi: rtw89: refine packet offload flow")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-3-pkshih@realtek.com
2024-05-04 07:58:18 +08:00
Chin-Yen Lee
a79264e8c7 wifi: rtw89: wow: send RFK pre-nofity H2C command in WoWLAN mode
802.11be WiFi chips need a RFK (RF calibration) notify H2C command after
downloading WoWLAN firmware to make sure RF TX/RX work fine when leaving
power save mode, so add it to correct RF TX/RX in WoWLAN mode.

Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-2-pkshih@realtek.com
2024-05-04 07:54:19 +08:00
Kalle Valo
f1c26960b6 ath.git patches for v6.10
ath12k
 
 * debugfs support
 
 * dfs_simulate_radar debugfs file
 
 * disable Wireless Extensions
 
 * suspend and hibernation support
 
 * ACPI support
 
 * refactoring in preparation of multi-link support
 
 ath11k
 
 * support hibernation (required changes in qrtr and MHI subsystems)
 
 * ieee80211-freq-limit Device Tree property support
 
 ath10k
 
 * firmware-name Device Tree property support
 -----BEGIN PGP SIGNATURE-----
 
 iQFLBAABCgA1FiEEiBjanGPFTz4PRfLobhckVSbrbZsFAmYztxUXHHF1aWNfa3Zh
 bG9AcXVpY2luYy5jb20ACgkQbhckVSbrbZs0NQf/dYF+Pjy3eh9vabwZ05rUZwLF
 P/k7Q8o631Gl0LTkmGw6SseUFswAOH1uwaKpWQvjhzHE8Fy4ziMeQ+aruqtbfZ3i
 Q1BYsnCbQHZ+1HX0EJmB9KDz8+/G1JxOlwiux7EsujOuFixjomm08VEJ4QXGVSnj
 NnCg0zx/0njDqT/3KjJuoL4stAk0HDvIayiVGsQOwcQQJelLGudqTNmRPnKQkR5w
 yRUX+NaFlVHgbbhsnEyW3XeqKVFwgy64BtNRIVpJ0lF51aazT80DagNmw5CawznC
 uak1nFktAtX/AID3lWRjek3smIdlnUz39JojKW7iO60/wfZXXFbR8Xl2XEpp9g==
 =fF10
 -----END PGP SIGNATURE-----

Merge tag 'ath-next-20240502' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath

ath.git patches for v6.10

ath12k

* debugfs support

* dfs_simulate_radar debugfs file

* disable Wireless Extensions

* suspend and hibernation support

* ACPI support

* refactoring in preparation of multi-link support

ath11k

* support hibernation (required changes in qrtr and MHI subsystems)

* ieee80211-freq-limit Device Tree property support

ath10k

* firmware-name Device Tree property support
2024-05-03 13:30:19 +03:00
Kalle Valo
d08aeb97ce mt76 patches for 6.10
- fixes
 - mt7603 stability improvements
 - mt7921 LED control
 - mt7925 EHT radiotap support
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org
 
 iF0EABECAB0WIQR10Rp9kadxD0kAQu/XfRQdAqdu9QUCZjNw8gAKCRDXfRQdAqdu
 9fGGAKCB12huzzRR/UIM21G6YFXQsHE+fQCgy5pPqDVlhWC/F7ZCS5jSPQtZfk8=
 =/JDa
 -----END PGP SIGNATURE-----

Merge tag 'mt76-for-kvalo-2024-05-02' of https://github.com/nbd168/wireless

mt76 patches for 6.10

- fixes
- mt7603 stability improvements
- mt7921 LED control
- mt7925 EHT radiotap support
2024-05-03 13:27:45 +03:00
Aditya Kumar Singh
daf85b78a1 wifi: mac80211_hwsim: add support for BSS color
Advertise support for BSS color and then once the countdown reaches 0,
call color change finish.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240422053412.2024075-8-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-03 10:18:29 +02:00
Aditya Kumar Singh
414e736c3d wifi: mac80211: handle color change per link
In order to support color change with MLO, handle the link ID now
passed from cfg80211, adjust the code to do everything per link
and call the notifications to cfg80211 correctly.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240422053412.2024075-4-quic_adisi@quicinc.com
Link: https://msgid.link/20240422053412.2024075-5-quic_adisi@quicinc.com
Link: https://msgid.link/20240422053412.2024075-6-quic_adisi@quicinc.com
Link: https://msgid.link/20240422053412.2024075-7-quic_adisi@quicinc.com
[squash, move API call updates to this patch]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-03 10:18:19 +02:00
Aditya Kumar Singh
91d2b6ee13 wifi: cfg80211: handle color change per link
Currently, during color change, no link id information is passed down.
In order to support color change during Multi Link Operation, it is
required to pass link id as well.
Additionally, update notification APIs to allow drivers/mac80211 to
pass the link ID.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://msgid.link/20240422053412.2024075-2-quic_adisi@quicinc.com
Link: https://msgid.link/20240422053412.2024075-3-quic_adisi@quicinc.com
[squash, actually only pass 0 from mac80211]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-03 10:18:03 +02:00
Xin Deng
9f6d4b8d14 wifi: cfg80211: Clear mlo_links info when STA disconnects
wdev->valid_links is not cleared when upper layer disconnect from a
wdev->AP MLD. It has been observed that this would prevent offchannel
operations like remain-on-channel which would be needed for user space
operations with Public Action frame.
Clear the wdev->valid_links when STA disconnects.

Signed-off-by: Xin Deng <quic_deng@quicinc.com>
Link: https://msgid.link/20240426092501.8592-1-quic_deng@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-03 10:03:19 +02:00
Breno Leitao
b73c138a87 wifi: iwlwifi: pcie: allocate dummy net_device dynamically
struct net_device shouldn't be embedded into any structure, instead,
the owner should use the priv space to embed their state into net_device.

Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].

Un-embed the net_device from struct iwl_trans_pcie by converting it
into a pointer. Then use the leverage alloc_netdev() to allocate the
net_device object at iwl_trans_pcie_alloc.

The private data of net_device becomes a pointer for the struct
iwl_trans_pcie, so, it is easy to get back to the iwl_trans_pcie parent
given the net_device object.

[1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://msgid.link/20240501165417.3406039-1-leitao@debian.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-03 10:01:52 +02:00
Felix Fietkau
59f4c57306 wifi: mt76: enable spectrum management
It is supported by all drivers

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:47:05 +02:00
Deren Wu
97d7ab9f51 wifi: mt76: mt7925: add EHT radiotap support in monitor mode
Add IEEE80211_RADIOTAP_EHT and IEEE80211_RADIOTAP_EHT_USIG radiotap
to fill in EHT information, such as MCS, NSS, GI and bandwidth.

Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:47:04 +02:00
Hao Zhang
06777c8fdd wifi: mt76: mt7921e: add LED control support
Introduce wifi LED switch control, add flow to Control a wifi
gpio pin based on the status of WIFI radio, if the pin is connected
to an LED, the LED will indicate the status of the WiFi radio.

Signed-off-by: Hao Zhang <hao.zhang@mediatek.com>
Co-developed-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:47:04 +02:00
Michael-CY Lee
2706c5c7c9 wifi: mt76: mt7996: let upper layer handle MGMT frame protection
The firmware support for management frame protection has limitations:
- do not support cipher BIP-GMAC-128 and BIP-GMAC-256
- support cipher BIP-CMAC-128 and BIP-CMAC-256, except action frame with
  action type 'not robust'.

Therefore, to simplify the logic, do not set the IGTK to firmware and
let the encryption of management frames be handled by upper layer.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:47:04 +02:00
Rong Yan
42e85997fc wifi: mt76: mt7921: cqm rssi low/high event notify
The implementation amounts to setting the driver flag
IEEE80211_VIF_SUPPORTS_CQM_RSSI, and then providing
mechanisms for continuously updating enough information
to be able to provide notifications to userspace when
RSSI drops below a certain threshold

Signed-off-by: Rong Yan <rong.yan@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:47:04 +02:00
Felix Fietkau
39db5a541d wifi: mt76: make const arrays in functions static
Reduces size by avoiding duplicates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:52 +02:00
Felix Fietkau
64bfcdbe02 wifi: mt76: connac: use muar idx 0xe for non-mt799x as well
This is expected by the firmware of older chipsets as well, though it may
not have been as strongly required as on mt799x

Fixes: 098428c400 ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:52 +02:00
StanleyYP Wang
ec55d8e7df wifi: mt76: mt7996: add sanity checks for background radar trigger
Check if background radar is enabled or not before manually triggering it,
and also add more checks in radar detected event.

Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Howard Hsu
b03e90d19b wifi: mt76: connac: enable critical packet mode support for mt7992
For mt7992 chipsets, critical packet mode should be properly configured
to let the HW SDO module correctly fill the AC queue in TX descriptors of
some higher priority packets such as ARP and ICMP.
Without this patch, HW queues may hang when running MU traffic.

Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Howard Hsu
474b9412f3 wifi: mt76: mt7996: fix potential memory leakage when reading chip temperature
Without this commit, reading chip temperature will cause memory leakage.

Fixes: 6879b2e941 ("wifi: mt76: mt7996: add thermal sensor device support")
Reported-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Henry Yen
a7908d5b61 wifi: mt76: mt7996: fix non-main BSS no beacon issue for MBSS scenario
Do not add UNI_BSS_INFO_11V_MBSSID tag when bssid_indicator is not set
to avoid abnormal beaconing behavior in non-11v MBSS scenario.

Signed-off-by: Henry Yen <henry.yen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Howard Hsu
a30e00946e wifi: mt76: connac: enable HW CSO module for mt7996
For mt7996 chipsets, the HW CSO module can help to identify TCP traffic,
which assists the firmware in adjusting algorithms to improve overall
performance.

Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Peter Chiu
2019959944 wifi: mt76: mt7996: set RCPI value in rate control command
Set RCPI values in mt7996_mcu_sta_rate_ctrl_tlv(), which can make the
FW rate control algorithm be initialized with a better MCS selection
table.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Shayne Chen
51b795d68c wifi: mt76: connac: use peer address for station BMC entry
Set peer address and aid for the BMC wtbl of station interface. For some
functions such as parsing MU_EDCA parameters from beacon, firmware will
need the peer address to do correct parsing.
Without this patch, MU uplink traffic would get suffered.

Reported-by: Howard Hsu <howard-yh.hsu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Shayne Chen
d5479097a2 wifi: mt76: mt7996: disable rx header translation for BMC entry
When a BMC wtbl of station interface is correctly set with peer address,
HW will do rx header translation for broadcast data packets, which makes
mac80211 unable to find the corresponding ieee80211_sta and drop the
packets. To fix this, disable HW rx header translation for BMC entry.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Andy Shevchenko
2d5e1f88f4 wifi: mt76: mt7915: Remove unused of_gpio.h
of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Ben Greear
2f7cf3b61d wifi: mt76: mt7915: add missing chanctx ops
Looks like this was missed in the initial patch that made
the conversion to the emulated chanctx drivers.

Fixes: 0a44dfc070 ("wifi: mac80211: simplify non-chanctx drivers")
Tested-by: James Courtier-Dutton <james.dutton@gmail.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Lorenzo Bianconi
6d1af9b64c wifi: mt76: sdio: move mcu queue size check inside critical section
Even if it is not a real issue at the moment since concurrent access to
mcu message queue is protected by mcu mutex, make the code more robust
and move mcu queue free space check inside queue spinlock critical section.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Lorenzo Bianconi
1ac710a6e8 wifi: mt76: mt7996: fix uninitialized variable in mt7996_irq_tasklet()
Set intr1 to 0 in mt7996_irq_tasklet() in order to avoid possible
uninitialized variable usage if wed is not active for hif2.

Fixes: 83eafc9251 ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Ming Yen Hsieh
fa46bd62c9 wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
Before sending suspend & wow command to FW, its length should be
4-bytes alignd.

Fixes: c948b5da6b ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Leon Yen
ecf0b2b8a3 wifi: mt76: mt7921s: fix potential hung tasks during chip recovery
During chip recovery (e.g. chip reset), there is a possible situation that
kernel worker reset_work is holding the lock and waiting for kernel thread
stat_worker to be parked, while stat_worker is waiting for the release of
the same lock.
It causes a deadlock resulting in the dumping of hung tasks messages and
possible rebooting of the device.

This patch prevents the execution of stat_worker during the chip recovery.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <MingYen.Hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Deren Wu
4a40fcbfe3 wifi: mt76: mt7921: introduce mt7920 PCIe support
mt7920e is a mt7921 series chipset with 802.11ax 2x2:2SS support.
The major difference is in firmware side only, at this moment.
This patch would add some mandatory changes for new chip id and
firmware download control.

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:51 +02:00
Chad Monroe
66ffcb9aba wifi: mt76: mt7996: fix size of txpower MCU command
Fixes issues with scanning and low power output at some rates.

Fixes: f75e4779d2 ("wifi: mt76: mt7996: add txpower setting support")
Signed-off-by: Chad Monroe <chad@monroe.io>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:50 +02:00
Muhammad Usama Anjum
cb47c7be0e wifi: mt76: connac: check for null before dereferencing
The wcid can be NULL. It should be checked for validity before
dereferencing it to avoid crash.

Fixes: 098428c400 ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:50 +02:00
Felix Fietkau
21de5f7226 wifi: mt76: mt7603: add wpdma tx eof flag for PSE client reset
This flag is needed for the PSE client reset. Fixes watchdog reset issues.

Fixes: c677dda165 ("wifi: mt76: mt7603: improve watchdog reset reliablity")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:50 +02:00
Felix Fietkau
b473c0e47f wifi: mt76: mt7603: fix tx queue of loopback packets
Use the correct WMM AC queue instead of the MGMT one to fix potential issues
with aggregation sequence number tracking. Drop non-bufferable packets.

Fixes: fca9615f1a ("mt76: mt7603: fix up hardware queue index for PS filtered packets")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:50 +02:00
Felix Fietkau
95ff66d15e wifi: mt76: mt7915: add fallback in case of missing precal data
When pre-calibration data is missing, do not fail the driver probe.
Instead, just print a warning and fall back to regular calibration.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-05-02 12:44:50 +02:00