]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 months agoMerge tag 'rtw-next-2024-06-04' of https://github.com/pkshih/rtw
Kalle Valo [Wed, 5 Jun 2024 18:23:16 +0000 (21:23 +0300)]
Merge tag 'rtw-next-2024-06-04' of https://github.com/pkshih/rtw

rtw-next patches for v6.11

Some fixes and refactors of rtlwifi, rtw88 and rtw89. Only one major change
listed below:

rtlwifi:
 - add new chip support of RTL8192DU

13 months agowifi: rtw89: chan: Use swap() in rtw89_swap_sub_entity()
Jiapeng Chong [Wed, 29 May 2024 02:02:44 +0000 (10:02 +0800)]
wifi: rtw89: chan: Use swap() in rtw89_swap_sub_entity()

Use existing swap() function instead of keeping duplicate source code.

./drivers/net/wireless/realtek/rtw89/chan.c:2336:32-33: WARNING opportunity for swap().

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9174
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240529020244.129027-1-jiapeng.chong@linux.alibaba.com
13 months agowifi: brcm80211: remove unused structs
Dr. David Alan Gilbert [Sun, 26 May 2024 23:45:53 +0000 (00:45 +0100)]
wifi: brcm80211: remove unused structs

'brcmf_pcie_core_info' was added in
commit 9e37f045d5e7 ("brcmfmac: Adding PCIe bus layer support.")
but never used.

'brcms_c_bit_desc' last use was removed in
commit cdf4352f5c59 ("brcmsmac: Improve tx trace and debug support").

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240526234553.286773-1-linux@treblig.org
13 months agowifi: brcm80211: use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Mon, 27 May 2024 17:34:25 +0000 (19:34 +0200)]
wifi: brcm80211: use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

At the same time remove some redundant NULL initializations.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Erick Archer <erick.archer@outlook.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/AS8PR02MB7237FF1C2E880D1231684D708BF02@AS8PR02MB7237.eurprd02.prod.outlook.com
13 months agowifi: rtlwifi: handle return value of usb init TX/RX
Ping-Ke Shih [Fri, 24 May 2024 00:32:48 +0000 (08:32 +0800)]
wifi: rtlwifi: handle return value of usb init TX/RX

Handle error code to cause failed to USB probe result from unexpected
USB EP number, otherwise when USB disconnect skb_dequeue() an uninitialized
skb list and cause warnings below.

usb 2-1: USB disconnect, device number 76
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
turning off the locking correctness validator.
CPU: 0 PID: 54060 Comm: kworker/0:1 Not tainted 6.9.0-rc7 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x116/0x1b0 lib/dump_stack.c:114
 assign_lock_key kernel/locking/lockdep.c:976 [inline]
 register_lock_class+0xc18/0xfa0 kernel/locking/lockdep.c:1289
 __lock_acquire+0x108/0x3bc0 kernel/locking/lockdep.c:5014
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1b0/0x550 kernel/locking/lockdep.c:5719
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
 skb_dequeue+0x20/0x180 net/core/skbuff.c:3846
 rtl_usb_cleanup drivers/net/wireless/realtek/rtlwifi/usb.c:706 [inline]
 rtl_usb_deinit drivers/net/wireless/realtek/rtlwifi/usb.c:721 [inline]
 rtl_usb_disconnect+0x4a4/0x850 drivers/net/wireless/realtek/rtlwifi/usb.c:1051
 usb_unbind_interface+0x1e8/0x980 drivers/usb/core/driver.c:461
 device_remove drivers/base/dd.c:568 [inline]
 device_remove+0x122/0x170 drivers/base/dd.c:560
 __device_release_driver drivers/base/dd.c:1270 [inline]
 device_release_driver_internal+0x443/0x620 drivers/base/dd.c:1293
 bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
 device_del+0x395/0x9f0 drivers/base/core.c:3909
 usb_disable_device+0x360/0x7b0 drivers/usb/core/message.c:1418
 usb_disconnect+0x2db/0x930 drivers/usb/core/hub.c:2305
 hub_port_connect drivers/usb/core/hub.c:5362 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5662 [inline]
 port_event drivers/usb/core/hub.c:5822 [inline]
 hub_event+0x1e39/0x4ce0 drivers/usb/core/hub.c:5904
 process_one_work+0x97b/0x1a90 kernel/workqueue.c:3267
 process_scheduled_works kernel/workqueue.c:3348 [inline]
 worker_thread+0x680/0xf00 kernel/workqueue.c:3429
 kthread+0x2c7/0x3b0 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Reported-by: Shichao Lai <shichaorai@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CAEk6kZuuezkH1dVRJf3EAVZK-83=OpTz62qCugkpTkswj8JF6w@mail.gmail.com/T/#u
Tested-by: Shichao Lai <shichaorai@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240524003248.5952-1-pkshih@realtek.com
13 months agowifi: rtlwifi: Enable the new rtl8192du driver
Bitterblue Smith [Thu, 23 May 2024 14:49:00 +0000 (17:49 +0300)]
wifi: rtlwifi: Enable the new rtl8192du driver

The RTL8192DU is an older Wifi 4 dual band chip. It comes in two
flavours: single MAC single PHY (like most Realtek Wifi 4 USB devices),
and dual MAC dual PHY.

The single MAC single PHY version is 2T2R and can work either in the
2.4 GHz band or the 5 GHz band.

The dual MAC dual PHY version has two USB interfaces and appears to the
system as two separate 1T1R Wifi devices, one working in the 2.4 GHz
band, the other in the 5 GHz band.

This was tested only with a single MAC single PHY device, mostly in
station mode. The speeds in the 2.4 GHz band with 20 MHz channel width
are similar to the out-of-tree driver: 85/51 megabits/second.

Stefan Lippers-Hollmann tested the speed in the 5 GHz band with 40 MHz
channel width: 173/99 megabits/second.

It was also tested briefly in AP mode. It's emitting beacons and my
phone can connect to it.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/5f2da7ee-876a-42fc-8fec-ec5386fa8c26@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/sw.c
Bitterblue Smith [Thu, 23 May 2024 14:48:32 +0000 (17:48 +0300)]
wifi: rtlwifi: Add rtl8192du/sw.c

This contains the new module's entry point.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/1fdc83ac-4a6f-4645-8837-6e38683b6c84@gmail.com
13 months agowifi: rtlwifi: Constify rtl_hal_cfg.{ops,usb_interface_cfg} and rtl_priv.cfg
Bitterblue Smith [Thu, 23 May 2024 14:48:02 +0000 (17:48 +0300)]
wifi: rtlwifi: Constify rtl_hal_cfg.{ops,usb_interface_cfg} and rtl_priv.cfg

This allows the drivers to declare the structs rtl_hal_cfg, rtl_hal_ops,
and rtl_hal_usbint_cfg as const.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/1b29994f-3d07-4297-875d-57c3a87a1ec6@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/dm.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:47:40 +0000 (17:47 +0300)]
wifi: rtlwifi: Add rtl8192du/dm.{c,h}

These contain functions related to the dynamic mechanism, which runs
every two seconds to adjust to changes in the environment.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/a010ed6d-efb0-456d-bd4a-dfc6da23e7aa@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/fw.{c,h} and rtl8192du/led.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:47:19 +0000 (17:47 +0300)]
wifi: rtlwifi: Add rtl8192du/fw.{c,h} and rtl8192du/led.{c,h}

fw.c contains a function for loading the firmware.
led.c contains a function for controlling the LED.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/a52b8907-267c-4811-90ca-5eb852a2aa09@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/rf.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:46:51 +0000 (17:46 +0300)]
wifi: rtlwifi: Add rtl8192du/rf.{c,h}

These contain one RF configuration function and some functions related
to dual MAC operation.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/36258d72-11fd-4f70-84c6-782972f706ed@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/trx.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:46:26 +0000 (17:46 +0300)]
wifi: rtlwifi: Add rtl8192du/trx.{c,h}

These contain routines related to sending frames to the chip.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/bd2c24a0-a1fe-493a-8079-d83fda81a0d5@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/phy.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:46:02 +0000 (17:46 +0300)]
wifi: rtlwifi: Add rtl8192du/phy.{c,h}

These contain mostly the calibration and channel switching routines
for RTL8192DU.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/299a5ab7-46bf-410b-bbeb-e252eeeeb34c@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/hw.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:45:31 +0000 (17:45 +0300)]
wifi: rtlwifi: Add rtl8192du/hw.{c,h}

These contain mostly hardware init/deinit routines for RTL8192DU.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/282afe18-f37d-45f7-9275-68c39d1fde09@gmail.com
13 months agowifi: rtlwifi: Add new members to struct rtl_priv for RTL8192DU
Bitterblue Smith [Thu, 23 May 2024 14:44:39 +0000 (17:44 +0300)]
wifi: rtlwifi: Add new members to struct rtl_priv for RTL8192DU

These are needed for the dual MAC version of RTL8192DU.

The two mutexes are used to avoid concurrent access to the hardware
from the two USB interfaces.

The two arrays are filled by one interface during LC calibration and
accessed by the other interface during channel switching.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/d1bf581b-de41-4d09-bf56-768c2fc29dd3@gmail.com
13 months agowifi: rtlwifi: Add rtl8192du/table.{c,h}
Bitterblue Smith [Thu, 23 May 2024 14:44:09 +0000 (17:44 +0300)]
wifi: rtlwifi: Add rtl8192du/table.{c,h}

These contain the MAC, BB, RF, and AGC initialisation tables for
RTL8192DU.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/5ea548b9-5ec6-4358-aa5d-94071f2341cb@gmail.com
13 months agowifi: rtlwifi: rtl8192d: Use "rtl92d" prefix
Bitterblue Smith [Thu, 23 May 2024 14:43:37 +0000 (17:43 +0300)]
wifi: rtlwifi: rtl8192d: Use "rtl92d" prefix

Some functions moved from rtl8192de still use the "rtl92de" prefix.
Rename them.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/abe3624d-f986-4a24-966c-67defa962e3f@gmail.com
13 months agowifi: nl80211: clean up coalescing rule handling
Johannes Berg [Thu, 23 May 2024 10:02:13 +0000 (12:02 +0200)]
wifi: nl80211: clean up coalescing rule handling

There's no need to allocate a tiny struct and then
an array again, just allocate the two together and
use __counted_by(). Also unify the freeing.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240523120213.48a40cfb96f9.Ia02bf8f8fefbf533c64c5fa26175848d4a3a7899@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: handle HW restart during ROC
Johannes Berg [Thu, 23 May 2024 10:03:52 +0000 (12:03 +0200)]
wifi: mac80211: handle HW restart during ROC

If we have a HW restart in the middle of a ROC period,
then there are two cases:
 - if it's a software ROC, we really don't need to do
   anything, since the ROC work will still be queued
   and will run later, albeit with the interruption
   due to the restart;
 - if it's a hardware ROC, then it may have begun or
   not, if it did begin already we can only remove it
   and tell userspace about that.

In both cases, this fixes the warning that would appear
in ieee80211_start_next_roc() in this case.

In the case of some drivers such as iwlwifi, the part of
restarting is never going to happen since the driver will
cancel the ROC, but flushing the work to ensure nothing
is pending here will also result in no longer being able
to trigger the warning in this case.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240523120352.f1924b5411ea.Ifc02a45a5ce23868dc7e428bad8d0e6996dd10f4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: check ieee80211_bss_info_change_notify() against MLD
Johannes Berg [Thu, 23 May 2024 10:11:40 +0000 (12:11 +0200)]
wifi: mac80211: check ieee80211_bss_info_change_notify() against MLD

It's not valid to call ieee80211_bss_info_change_notify() with
an sdata that's an MLD, remove the FIXME comment (it's not true)
and add a warning.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240523121140.97a589b13d24.I61988788d81fb3cf97a490dfd3167f67a141d1fd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: move Bz and Gl iwl_dev_info entries
Miri Korenblit [Mon, 27 May 2024 16:06:15 +0000 (19:06 +0300)]
wifi: iwlwifi: move Bz and Gl iwl_dev_info entries

The iwl_dev_info entries for these devices were incorrectly positioned
within the array, out of chronological order. Move them arround.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://msgid.link/20240527190228.a75e9a1eb86c.I003980f8ca60a96019657e396e848a07df6b92a4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: move amsdu_size parsing to iwlwifi
Miri Korenblit [Mon, 27 May 2024 16:06:14 +0000 (19:06 +0300)]
wifi: iwlwifi: move amsdu_size parsing to iwlwifi

The code that is parsing the amsdu_size module parameter and mapping it
to the corresponding Rx buffer size is common to all opmodes.
Move it into a function in iwlwifi, as preparation to a new op mode we
are working on.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240527190228.a3430d32923d.Iab3c22ef0df685f72f22dafc47021f0dc7bd6fa5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: remove redundant prints
Miri Korenblit [Mon, 27 May 2024 16:06:13 +0000 (19:06 +0300)]
wifi: iwlwifi: remove redundant prints

Upon start, the different opmodes are currently printing:
1. HW rev, which is already print by iwlwifi
2. The HW name (e.g. "Intel(R) Wi-Fi 7 BE201 320MHz")

cleanup things such as the hw rev won't be printed again, the HW name will
be printed by iwlwifi instead of each opmode.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://msgid.link/20240527190228.5c589c7abed0.I3590c4ee0ee99d1b207852c32d25d326afb327dd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: fix a wrong comment
Miri Korenblit [Mon, 27 May 2024 16:06:12 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: fix a wrong comment

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240527190228.2105ffcf747d.Ic838959b812b6cb4cbb856e8c0bcaad2f46ac71b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: declare band variable in the scope
Miri Korenblit [Mon, 27 May 2024 16:06:11 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: declare band variable in the scope

band is not used outside of the for loop, declare it inside it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240527190228.b634d184980a.I9d9e71125f9a77ba4f9a33a7a2ff1e8e78e17767@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: show full firmware ID in debugfs
Johannes Berg [Mon, 27 May 2024 16:06:10 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: show full firmware ID in debugfs

The firmware prefix is unused today, but it might still be
useful to have some information. Since the prefix will get
the intel/ directory in some cases, replace the prefix by
the full FW id which has all the information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.527a1c72996d.If7588b854149d51605031fc9a70a650534351ef4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add debug data for MPDU counting
Miri Korenblit [Mon, 27 May 2024 16:06:09 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: add debug data for MPDU counting

It is hard to debug issues of EMLSR entry/exit due to low throughput.
Add debug data.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240527190228.77ef3c2654dc.I1796a3995da2a49dd5102d33766af1ad416dd60b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: use only beacon BSS load for active links
Johannes Berg [Mon, 27 May 2024 16:06:08 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: use only beacon BSS load for active links

For active links, don't take information that may have been
received in probe responses, as those are not protected. For
inactive links, there may not be a choice.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.6947dc462fa9.I2076961211d6785c8a15b4308e0e87a413148222@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add support for version 10 of the responder config command
Avraham Stern [Mon, 27 May 2024 16:06:07 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: add support for version 10 of the responder config command

This version adds the band to the responder config command.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.af09129ebd74.I9356e2504a4c19961d4856494416ae49b36bfe62@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add support for version 14 of the range request command
Avraham Stern [Mon, 27 May 2024 16:06:06 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: add support for version 14 of the range request command

This version adds a testing option to send an incorrect SAC in the
first NDPA.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.8f36ccb1cc74.I9b76461634f308e75dc3cd016d0b0bce812c6e9d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: modify iwl_mvm_ftm_set_secured_ranging() parameters
Avraham Stern [Mon, 27 May 2024 16:06:05 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: modify iwl_mvm_ftm_set_secured_ranging() parameters

Modify iwl_mvm_ftm_set_secured_ranging() parameters to support
multiple versions of the target struct.
This is done as preparation for moving to the new range request
version.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.56d6aee320b3.I5a52fa93cd791d0229b392a20f076b7cebb110cd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: initiator: move setting the sta_id into a function
Avraham Stern [Mon, 27 May 2024 16:06:04 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: initiator: move setting the sta_id into a function

Move setting the target's sta_id (and related flags) into a function
to support different versions of the target struct.
This is done as preparation for moving to the new range request
version.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.18e3a6a6f1cb.I85e3ee607b3947448532bc16730f8898a11c92b8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: Remove debug related code
Miri Korenblit [Mon, 27 May 2024 16:06:03 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: Remove debug related code

This code is intended for internal testing. Remove it.

Fixes: 30ce039094b5 ("wifi: iwlwifi: mvm: Don't allow EMLSR when the RSSI is low")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.c3b89828efb2.I7ded6348d2fb0cb7e103c4eee033451924c3461d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: initiator: move setting target flags into a function
Avraham Stern [Mon, 27 May 2024 16:06:02 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: initiator: move setting target flags into a function

Move setting the target flags into a dedicated function to support
different versions of the target struct.
This is done as preparation for moving to the new range request
version.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.9d22b61ce589.I7dbe596b4f677638d9a48c3f39b0826a9e35bea4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: handle TPE advertised by AP
Johannes Berg [Mon, 27 May 2024 16:06:01 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: handle TPE advertised by AP

6 GHz BSS SP client shall respect TX power limits advertised
by the AP in TPE elements, send the data to the firmware using
the AP_TX_POWER_CONSTRAINTS_CMD command, so do that.

Co-developed-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.32f1e2e1447c.I58ac91c38585362aa42bb4a8a59c7d88e67bc40b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: move a constant to constants.h
Miri Korenblit [Mon, 27 May 2024 16:06:00 +0000 (19:06 +0300)]
wifi: iwlwifi: mvm: move a constant to constants.h

Move IWL_MVM_MIN_BEACON_INTERVAL_TU to constants.h

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.395f5b24ff82.Id78a5a404c3ae15cbbc950b1f1d7e500a8b92a43@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: remove IWL_MVM_USE_NSSN_SYNC
Miri Korenblit [Mon, 27 May 2024 16:05:59 +0000 (19:05 +0300)]
wifi: iwlwifi: mvm: remove IWL_MVM_USE_NSSN_SYNC

This is not used and not needed anymore.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.c5edfb967e35.I34a3d54a1dc90d9b2937b0bcbbc508fe3cd41773@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: Enable p2p low latency
Avri Altman [Mon, 27 May 2024 16:05:58 +0000 (19:05 +0300)]
wifi: iwlwifi: mvm: Enable p2p low latency

Enable p2p low latency by default.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.21b431bdfc26.I018e330d1e6a76e967b25e9542c2260f0f6ed2a8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: report 64-bit radiotap timestamp
Johannes Berg [Mon, 27 May 2024 16:05:57 +0000 (19:05 +0300)]
wifi: iwlwifi: mvm: report 64-bit radiotap timestamp

Use the new RX_FLAG_MACTIME_IS_RTAP_TS64 in mac80211 to report
a 64-bit timestamp in the mactime for radiotap only, in case we
report the synchronized PTP clock timestamp (otherwise we really
only have 32 bits anyway).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.4fc44356e7df.Ic8642d35f1090a415e09299a1bd409f51dfb6351@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add an option to use ptp clock for rx timestamp
Avraham Stern [Mon, 27 May 2024 16:05:56 +0000 (19:05 +0300)]
wifi: iwlwifi: mvm: add an option to use ptp clock for rx timestamp

Add a debugfs option to use the ptp clock time for rx device
timestamps. This can be useful to e.g. synchronize multiple NICs or
reporting the timestamp in the system clock instead of gp2.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.b197b4f3f9ed.I578ee916d5f517a2e3a89e890a8ea24065946427@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: rtw89: Fix P2P behavior for WiFi 7 chips
Po-Hao Huang [Wed, 22 May 2024 02:45:31 +0000 (10:45 +0800)]
wifi: rtw89: Fix P2P behavior for WiFi 7 chips

Previously we used CCK rate when scanning for P2P on WiFi 7 chips.
Fix this by explicitly setting the rate to OFDM 6Mbps.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240522024531.11401-1-pkshih@realtek.com
13 months agowifi: rtw89: add LDPC and STBC to rx_status and radiotap known fields for monitor...
Ping-Ke Shih [Wed, 22 May 2024 02:38:30 +0000 (10:38 +0800)]
wifi: rtw89: add LDPC and STBC to rx_status and radiotap known fields for monitor mode

Add LDPC and STBC to rx_status by hardware PPDU status, and set them as
known fields of radiotap, so we can check these capabilities in monitor
mode.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240522023830.9798-2-pkshih@realtek.com
13 months agowifi: rtw89: fill STBC and LDPC capabilities to TX descriptor
Ping-Ke Shih [Wed, 22 May 2024 02:38:29 +0000 (10:38 +0800)]
wifi: rtw89: fill STBC and LDPC capabilities to TX descriptor

Fill STBC and LDPC fields to get better performance when transmitting under
noisy environment. Old chips like 8852AE use firmware command to enable
these two capabilities, but newer chips must use TX descriptor.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240522023830.9798-1-pkshih@realtek.com
13 months agowifi: rtw89: 8852c: correct logic and restore PCI PHY EQ after device resume
Ping-Ke Shih [Tue, 21 May 2024 04:01:39 +0000 (12:01 +0800)]
wifi: rtw89: 8852c: correct logic and restore PCI PHY EQ after device resume

PCI PHY EQ value is missing after card off/on, so update the value after
device resume. The original commit only updates once at probe stage, which
could lead problem after suspend/resume.

The logic should be read a value from one register and write to another
register with a mask to avoid affecting unrelated bits.

Fixes: a78d33a1286c ("wifi: rtw89: 8852c: disable PCI PHY EQ to improve compatibility")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240521040139.20311-1-pkshih@realtek.com
13 months agowifi: mac80211: send DelBA with correct BSSID
Johannes Berg [Fri, 10 May 2024 09:26:02 +0000 (11:26 +0200)]
wifi: mac80211: send DelBA with correct BSSID

In MLO, the deflink BSSID is clearly invalid. Since we fill
the addresses as MLD addresses and translate later, use the
AP address here instead.

This fixes an issue that happens with HW restart, where the
DelBA frame is transmitted, but not processed correctly due
to the wrong BSSID (or even just discarded entirely).  As a
result, the BA sessions are kept alive; however, as other
state is reset during HW restart, this then fails (reorder,
etc.) and data doesn't go through until new BA sessions are
established.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510112601.f4e1effdea29.I98e81f22166b68d4b6211191bcaaf8531b324a77@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: reset negotiated TTLM on disconnect
Johannes Berg [Mon, 6 May 2024 19:18:59 +0000 (21:18 +0200)]
wifi: mac80211: reset negotiated TTLM on disconnect

The negotiated TTLM data must be reset on disconnect, otherwise
it may end up getting reused on another connection. Fix that.

Fixes: 8f500fbc6c65 ("wifi: mac80211: process and save negotiated TID to Link mapping request")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211858.04142e8fe01c.Ia144457e086ebd8ddcfa31bdf5ff210b4b351c22@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: don't stop TTLM works again
Johannes Berg [Mon, 6 May 2024 19:10:35 +0000 (21:10 +0200)]
wifi: mac80211: don't stop TTLM works again

There's no need to stop works that have already been
stopped during disconnect, so don't.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211034.f8434be19f56.I021afadc538508da3bc8f95c89f424ca62b94bef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: cancel TTLM teardown work earlier
Johannes Berg [Mon, 6 May 2024 19:10:34 +0000 (21:10 +0200)]
wifi: mac80211: cancel TTLM teardown work earlier

It shouldn't be possible to run this after disconnecting, so
cancel the work earlier.

Fixes: a17a58ad2ff2 ("wifi: mac80211: add support for tearing down negotiated TTLM")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211034.096a10ccebec.I5584a21c27eb9b3e87b9e26380b627114b32ccba@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: cancel multi-link reconf work on disconnect
Johannes Berg [Mon, 6 May 2024 19:10:33 +0000 (21:10 +0200)]
wifi: mac80211: cancel multi-link reconf work on disconnect

This work shouldn't run after we're disconnecting. Cancel it earlier
(and then don't cancel it in stop later.)

Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element")
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211034.ac754794279f.Ib9fbb1dab50c6b67f6de9be09a6c452ce89bbd50@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: fix TTLM teardown work
Johannes Berg [Mon, 6 May 2024 19:18:52 +0000 (21:18 +0200)]
wifi: mac80211: fix TTLM teardown work

The worker calculates the wrong sdata pointer, so if it ever
runs, it'll crash. Fix that.

Fixes: a17a58ad2ff2 ("wifi: mac80211: add support for tearing down negotiated TTLM")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211853.e6471800c76d.I8b7c2d6984c89a11cd33d1a610e9645fa965f6e1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: cfg80211: use __counted_by where appropriate
Dmitry Antipov [Fri, 17 May 2024 15:33:31 +0000 (18:33 +0300)]
wifi: cfg80211: use __counted_by where appropriate

Annotate 'sub_specs' of 'struct cfg80211_sar_specs', 'channels'
of 'struct cfg80211_sched_scan_request', 'channels' of 'struct
cfg80211_wowlan_nd_match', and 'matches' of 'struct
cfg80211_wowlan_nd_info' with '__counted_by' attribute. Briefly
tested with clang 18.1.1 and CONFIG_UBSAN_BOUNDS running iwlwifi.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://msgid.link/20240517153332.18271-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: Add EHT UL MU-MIMO flag in ieee80211_bss_conf
Pradeep Kumar Chitrapu [Wed, 15 May 2024 18:13:18 +0000 (11:13 -0700)]
wifi: mac80211: Add EHT UL MU-MIMO flag in ieee80211_bss_conf

Add flag for Full Bandwidth UL MU-MIMO for EHT. This is utilized
to pass EHT MU-MIMO configurations from user space to driver
in AP mode.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Link: https://msgid.link/20240515181327.12855-2-quic_pradeepc@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: refactor chanreq.ap setting
Johannes Berg [Mon, 6 May 2024 19:54:52 +0000 (21:54 +0200)]
wifi: mac80211: refactor chanreq.ap setting

There are now three places setting up chanreq.ap which always
depends on the mode (EHT being used or not) and override flag.
Refactor that code into a common function with a comment, to
make that clearer.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506215543.5cd6a209e58a.I3be318959d9e2df5dccd2d0938c3d2fcc6688030@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: handle TPE element during CSA
Johannes Berg [Mon, 6 May 2024 19:54:51 +0000 (21:54 +0200)]
wifi: mac80211: handle TPE element during CSA

Handle the transmit power envelope (TPE) element during
channel switch, applying it when the channel switch is
done.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506215543.486c33157d18.Idf971ad801b6961c177bdf42cc323fd1a4ca8165@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: handle wider bandwidth OFDMA during CSA
Johannes Berg [Mon, 6 May 2024 19:54:50 +0000 (21:54 +0200)]
wifi: mac80211: handle wider bandwidth OFDMA during CSA

During channel switch, track the AP configuration in the
chanreq, so that wider bandwidth OFDMA is taken into
account correctly, since multiple channel contexts may
be needed due to sharing not being possible due to
wider bandwidth OFDMA.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506215543.b2c5a72dac1b.I69f65cb2e75d4a49a174b1aede68bf8ff0a3cab3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: collect some CSA data into sub-structs
Johannes Berg [Mon, 6 May 2024 19:54:49 +0000 (21:54 +0200)]
wifi: mac80211: collect some CSA data into sub-structs

Collect the CSA data in ieee80211_link_data_managed and
ieee80211_link_data into a csa sub-struct to clean up a
bit and make adding new things more obvious.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506215543.29f954b1f576.I9a683a9647c33d4dd3011aade6677982428c1082@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: mlme: handle cross-link CSA
Johannes Berg [Mon, 15 Apr 2024 08:27:11 +0000 (11:27 +0300)]
wifi: mac80211: mlme: handle cross-link CSA

If we see a channel switch announcement on one link for
another, handle that case and start the CSA. The driver
can react to this in whatever way it needs. The stack
will have the ability to track it via the RNR/MLE in the
reporting link's beacon if it sees it for inactive links
and adjust everything accordingly.

Note that currently the timings for the CSA aren't set,
the values are only used by the Intel drivers, and they
don't need this for newer devices that support MLO, so
I've left it out for now.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240415112355.4d34b6a31be7.Ie8453979f5805873a8411c99346bcc3810cd6476@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: cfg80211: restrict operation during radar detection
Johannes Berg [Mon, 6 May 2024 19:11:59 +0000 (21:11 +0200)]
wifi: cfg80211: restrict operation during radar detection

Just like it's not currently possible to start radar
detection while already operating, it shouldn't be
possible to start operating while radar detection is
running. Fix that.

Also, improve the check whether operating (carrier
might not be up if e.g. attempting to join IBSS).

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211158.ae8dca3d0d6c.I7c70a66a5fbdbc63a78fee8a34f31d1995491bc3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: move radar detect work to sdata
Johannes Berg [Mon, 6 May 2024 19:13:12 +0000 (21:13 +0200)]
wifi: mac80211: move radar detect work to sdata

At some point we thought perhaps this could be per link, but
really that didn't happen, and it's confusing. Radar detection
still uses the deflink to allocate the channel, but the work
need not be there. Move it back.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211311.43bd82c6da04.Ib39bec3aa198d137385f081e7e1910dcbde3aa1b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD v11
Anjaneyulu [Sun, 12 May 2024 12:25:05 +0000 (15:25 +0300)]
wifi: iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD v11

Add support for enable/disable 11be for china and South Korea by
reading DSM function 12 from UEFI or ACPI and sending it to the FW.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.037613d03c87.I4e5ee63c0dbdd4bd6c48daee7b0c88462b702423@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: move code from iwl-eeprom-parse to dvm
Emmanuel Grumbach [Sun, 12 May 2024 12:25:03 +0000 (15:25 +0300)]
wifi: iwlwifi: move code from iwl-eeprom-parse to dvm

Move code that is DVM only to dvm.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.9a1b6ef116e0.I217a513f544d5288a7760d265f51419e81abfd9d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: kill iwl-eeprom-read
Emmanuel Grumbach [Sun, 12 May 2024 12:25:02 +0000 (15:25 +0300)]
wifi: iwlwifi: kill iwl-eeprom-read

This is used by dvm only, move to dvm.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.72f4bf256c8d.I7433bda9b0fc9eece5210db2cb90c2f03973f5ec@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: don't skip link selection
Miri Korenblit [Sun, 12 May 2024 12:24:59 +0000 (15:24 +0300)]
wifi: iwlwifi: mvm: don't skip link selection

If we exit EMLSR due to a IWL_MVM_ESR_EXIT*, a MLO scan followed by a
link selection is scheduled with a delay of 30 seconds.
If during that 30 seconds EMLSR was blocked and unblocked
(IWL_MVM_ESR_BLOCKED*), we would still want to get the needed data from
the MLO scan and select link accordingly, and not return immediately to
EMLSR.

Fixes: 2f33561ea8f9 ("wifi: iwlwifi: mvm: trigger link selection after exiting EMLSR")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240512152312.caab27a8dd8f.I63f67e213d5e05416f71513a8d914917d59aa44f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add mvm-specific guard
Johannes Berg [Sun, 12 May 2024 12:24:58 +0000 (15:24 +0300)]
wifi: iwlwifi: mvm: add mvm-specific guard

Add and use an mvm-specific guard for the mvm mutex.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.7391425b3af2.I1b109f56753dd3f35602dd2c5cf6e1e35aee313d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: simplify TX tracing
Johannes Berg [Sun, 12 May 2024 12:24:57 +0000 (15:24 +0300)]
wifi: iwlwifi: simplify TX tracing

There's no need to calculate again whether data should
be included or be handled externally, just check if any
space for it was already reserved.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.a3d3b4796460.I85bd3029baee24ebf0be04db7d6bf01834090869@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: tracing: fix condition to allocate buf1
Johannes Berg [Sun, 12 May 2024 12:24:56 +0000 (15:24 +0300)]
wifi: iwlwifi: tracing: fix condition to allocate buf1

There's no need to allocate buf1 if we're not going to
write anything to it, and the condition for writing is
(correctly) "hdr_len > 0 && !iwl_trace_data()". Also
allocate the event space only under the same condition.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512152312.a11e6490d053.Ie090beea70d2f271bb22c9b0e287dbd342fb2a96@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: leave a print in the logs when we call fw_nmi()
Emmanuel Grumbach [Sun, 12 May 2024 04:58:57 +0000 (07:58 +0300)]
wifi: iwlwifi: mvm: leave a print in the logs when we call fw_nmi()

When we crash the firmware, we need to know why we decided to do so.
Almost all the callsites of iwl_force_nmi() print something in the logs
that explain why the driver decided to crash the firmware.
Debugfs doesn't print anything and it is then hard to understand why the
firmware has crashed.
Add a simple print in the debugfs hook to ease the debug.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512075822.e2558de222dc.Idd81777c47264e6f557b086625895c1dc2f667f3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false
Miri Korenblit [Sun, 12 May 2024 04:31:10 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false

When AUTO_EML is set to false, this change ignores the exit criteria,
for testing purposes. Currently, if AUTO_EML is disabled, the
driver will not select a link or enter EMLSR, but will still exit if one
of the criteria is not fulfilled.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240512072733.10a0b5da6ec2.I46fd578a3ef6cdbf14fdc4dfa97b4be008fe68e3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: use vif P2P type helper
Benjamin Berg [Sun, 12 May 2024 04:31:08 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: use vif P2P type helper

Use ieee80211_vif_type_p2p instead of checking for IFTYPE_AP in
combination with vif->p2p.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.15a00a812c1b.I5ffee795d960c9beda46a934f5b4c70acde112f9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: don't track used links separately
Johannes Berg [Sun, 12 May 2024 04:31:07 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: don't track used links separately

We track which link is using which FW link ID, so there
really isn't a need to separately track which link IDs
are in use. Remove that code and check the table when
looking for a new link ID to use.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.1a67d8af815f.Ie642c12dce3ab55c688abd9a25918569e83e558a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: always print the firmware version in hex
Emmanuel Grumbach [Sun, 12 May 2024 04:31:05 +0000 (07:31 +0300)]
wifi: iwlwifi: always print the firmware version in hex

All our firmware versions should now be printed in hex.

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://msgid.link/20240512072733.cae4c562b2c3.I5043383bd0e81f872c55046afd2c6560f482c8e0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failure
Johannes Berg [Sun, 12 May 2024 04:31:03 +0000 (07:31 +0300)]
wifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failure

In practice, iwl_trans_get_rxq_dma_data() will not fail,
it only can do that if called with the wrong arguments.
But it does have an error value and doesn't initialize
the argument when it fails, so don't use the value then.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.faf3a1b87589.I77c950173cb914676fbd28483e5ef420bb9f1bc9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: fw: api: Add new timepoint for scan failure
Mukesh Sisodiya [Sun, 12 May 2024 04:31:01 +0000 (07:31 +0300)]
wifi: iwlwifi: fw: api: Add new timepoint for scan failure

Add new time point to get the details of scan failure
While on it added other missing enum to match with FW.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Reviewed-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.6781e76990c4.Iadfb3f6dd63a98fc35019772266b5ebddc5b5270@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mei: unify iwl_mei_set_power_limit() prototype
Johannes Berg [Sun, 12 May 2024 04:31:00 +0000 (07:31 +0300)]
wifi: iwlwifi: mei: unify iwl_mei_set_power_limit() prototype

The two versions of iwl_mei_set_power_limit() are a bit different,
and while really the const isn't all that necessary on the inline,
it's still better to have it be the same.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.854427753c92.I557716085cb1f6a35d1f97640388fa421f42a56a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: mark bad no-data RX as having bad PLCP
Johannes Berg [Sun, 12 May 2024 04:30:59 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: mark bad no-data RX as having bad PLCP

Just like with any other frame, mac80211 will do sanity checks
on no-data RX (representing e.g. sounding PPDUs), and if e.g.
the NSS is wrong, it will warn. This isn't a good idea if we
already know the frame wasn't received well, e.g. has bad PLCP.
Unless the firmware reports "no error", set the bad PLCP flag
to skip checks in mac80211.

Also, since we're now extracting two different values from the
info field, use le32_get_bits() for both.

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://msgid.link/20240512072733.e6adcb9a6ece.Ic14c2e8ed5e80d48af78b2f04e9f08beeb62d68e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: bump FW API to 91 for BZ/SC devices
Miri Korenblit [Sun, 12 May 2024 04:30:58 +0000 (07:30 +0300)]
wifi: iwlwifi: bump FW API to 91 for BZ/SC devices

Start supporting API version 91 for new devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.27c00099e8b7.I99b4f24bba073414dd04a6e04a359c7fbba52990@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: add a of print of a few commands
Miri Korenblit [Sun, 12 May 2024 04:30:57 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: add a of print of a few commands

This is needed for debugging.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.65fc46e2ffbc.I19d4ef2cc06bfee7d9644a376d39399f0f6eaa15@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: Use the SMPS cfg of the correct link
Miri Korenblit [Sun, 12 May 2024 04:30:56 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: Use the SMPS cfg of the correct link

The exiting code is checking the SMPS mode of deflink.
Use the SMPS mode of the link_sta function parameter.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.f3e2834e78f5.Ie24b431a6ad0dbf977afbbd4d2116bfe2426a0d5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: don't always set antenna in beacon template cmd
Miri Korenblit [Sun, 12 May 2024 04:30:55 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: don't always set antenna in beacon template cmd

This needs to be set only if the FW is not capable of selecting an
antenna on its own.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240512072733.73d790911268.I158dc1dbc9c2e199c69d8213e5496d2de72da28b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: remove redundant reading from NVM file
Chaya Rachel Ivgi [Fri, 10 May 2024 14:06:41 +0000 (17:06 +0300)]
wifi: iwlwifi: remove redundant reading from NVM file

The driver reads xtal_calib from NVM file, but actually never uses it.
This is only used in dvm driver.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.c4d1a4571049.I7d7b73dccb793e220f023e0d049b082b043ca95e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: remove fw_running op
Shahar S Matityahu [Fri, 10 May 2024 14:06:40 +0000 (17:06 +0300)]
wifi: iwlwifi: remove fw_running op

fw_running assumes that memory can be retrieved only after alive.
This assumption is no longer true as we support dump before alive.
To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED
bit in trans status is set before dumping instead of the prior check.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: Don't set NO_HT40+/- flags on 6 GHz band
Andrei Otcheretianski [Fri, 10 May 2024 14:06:38 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: Don't set NO_HT40+/- flags on 6 GHz band

These flags are not needed on 6 GHz channels, and anyway they were set
incorrectly.
This in turn resulted in alternating channel flags, preventing reg domain
rules to be merged together, so cfg80211 couldn't even send them to the
user space, as the regulatory domain was too large.
Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.b0d51b2229f8.I092e21cde43320ffc2eff17f5748ff9c87c87fcf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: call ieee80211_sta_recalc_aggregates on A-MSDU size update
Miri Korenblit [Fri, 10 May 2024 14:06:37 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: call ieee80211_sta_recalc_aggregates on A-MSDU size update

The driver needs to call this function when the A-MSDU size changes.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.632ee6612a79.Ice3a536a4cbfe60d0edfa231fcb79ee7ab9495dd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: set A-MSDU size on the correct link
Miri Korenblit [Fri, 10 May 2024 14:06:36 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: set A-MSDU size on the correct link

The existing code sets the max A-MSDU size to the deflink, set it
on the given link instead.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.4de5c1a031ca.I063bc1508e5068b32e321b0f268bc51dba0c0747@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: define link_sta in the relevant scope
Miri Korenblit [Fri, 10 May 2024 14:06:34 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: define link_sta in the relevant scope

The link_sta pointer is now only used inside this if, so define it inside
its scope.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.e0a1dd285d9a.Id5ff16fb98af0c5f533aed6b5ec3cc856401e488@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: debugfs: add entry for setting maximum TXOP time
Avraham Stern [Fri, 10 May 2024 14:06:32 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: debugfs: add entry for setting maximum TXOP time

Add an entry for setting the maximum TXOP time in microseconds.
The configured value can be read from the same entry.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.b8d17a9c1731.I57c33574a61edd68bd0ec1aa7009f31111fd7efe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: allow UAPSD when in SCM
Avraham Stern [Fri, 10 May 2024 14:06:31 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: allow UAPSD when in SCM

Allow UAPSD when P2P and BSS interfaces share the same channel.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.1ec19d432497.Id6de5337c878fa70e85bfcf6f4e0e34ce60756fb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: mvm: simplify the uAPSD coexistence limitation code
Emmanuel Grumbach [Fri, 10 May 2024 14:06:30 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: simplify the uAPSD coexistence limitation code

uAPSD can't be enabled on BSS or P2P Client if there is
another active interface (e.g. associated client). Allow
the code that apply those limitations to run on BSS as well.
Also forbid uAPSD if we have an IBSS or NAN interface in
the system.
Since we are now forbidding uAPSD in any concurrency
scenario, we don't need to check the number of PHY
contexts.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240510170500.4ac26534adf7.Ib892020177e86603b2be3a105f8717b9a15951d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: iwlwifi: dvm: clean up rs_get_rate() logic
Johannes Berg [Fri, 10 May 2024 14:06:28 +0000 (17:06 +0300)]
wifi: iwlwifi: dvm: clean up rs_get_rate() logic

The logic here is rather convoluted - we cannot get here with
lq_sta being NULL as mac80211 will (no longer) call us like
that, and since I removed the rate_control_send_low() call in
this function there's no longer any point in setting priv_sta
to NULL either.

So the only thing that remains to check is if we have actually
initialized our lq_sta->drv pointer, and exit if we didn't in
which case we'll use the data mac80211 already set up for the
low rate usage.

Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Link: https://msgid.link/20240510170500.a4cdb41825eb.Id202bcc967c32829f70ab1412f8893b6eb7f78e2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: track changes in AP's TPE
Johannes Berg [Mon, 6 May 2024 19:37:57 +0000 (21:37 +0200)]
wifi: mac80211: track changes in AP's TPE

If the TPE (transmit power envelope) is changed, detect and
report that to the driver.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506214536.103dda923f45.I990877e409ab8eade9ed7c172272e0cae57256cf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: pass parsed TPE data to drivers
Johannes Berg [Mon, 6 May 2024 19:37:56 +0000 (21:37 +0200)]
wifi: mac80211: pass parsed TPE data to drivers

Instead of passing the full TPE elements, in all their glory
and mixed up data formats for HE backward compatibility, parse
them fully into the right values, and pass that to the drivers.

Also introduce proper validation already in mac80211, so that
drivers don't need to do it, and parse the EHT portions.

The code now passes the values in the right order according to
the channel used by an interface, which could also be a subset
of the data advertised by the AP, if we couldn't connect with
the full bandwidth (for whatever reason.)

Also add kunit tests for the more complicated bits of it.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240506214536.2aa839969b60.I265b28209e0b29772b2f125f7f83de44a4da877b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: ath11k: fix TPE power levels
Johannes Berg [Mon, 6 May 2024 19:37:55 +0000 (21:37 +0200)]
wifi: ath11k: fix TPE power levels

The chanctx can be shared, but it seems like the TPE values for
this vif should only reflect the channel that the vif uses, which
is captured in bss_conf->chanreq.oper rather than the chanctx.
Use that when calculating defaults, a similar issue is where the
data from the AP is processed, but I'm moving that to mac80211.

Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240506214536.d99fcf5856b9.I359bb401ea74bf82dc981a86a7ca3fa44d169d2e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: ieee80211/ath11k: remove IEEE80211_MAX_NUM_PWR_LEVEL
Johannes Berg [Mon, 6 May 2024 19:37:54 +0000 (21:37 +0200)]
wifi: ieee80211/ath11k: remove IEEE80211_MAX_NUM_PWR_LEVEL

The define IEEE80211_MAX_NUM_PWR_LEVEL doesn't make much
sense. Yes, that table has a maximum value of 8, and the
table will actually remain that way, but EHT introduced
a way to encode more levels for 320 MHz channels.

Remove IEEE80211_MAX_NUM_PWR_LEVEL and, for ath11k being
the only user, add ATH11K_NUM_PWR_LEVELS, where it makes
sense since it cannot support 320 MHz channels.

Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240506214536.9818e5471055.Icece7e47e963d6b68e0d97ba13c102b37fbaa689@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: update 6 GHz AP power type before association
Mukesh Sisodiya [Mon, 6 May 2024 19:37:53 +0000 (21:37 +0200)]
wifi: mac80211: update 6 GHz AP power type before association

6 GHz AP power type details are required to set proper tx power
used to send frames.

Update AP power type received in beacon while preparing
for connection instead of after association so the frames
before association can use the correct tx power.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Link: https://msgid.link/20240506214536.310434f55f76.I6aca291ee06265e3f63e0f9024ba19a850b53a33@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: remove extra link STA functions
Johannes Berg [Mon, 6 May 2024 19:19:34 +0000 (21:19 +0200)]
wifi: mac80211: remove extra link STA functions

There's no need to have a lockdep assert and then call
another function, just move everything into one place.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211934.9759564a25f4.I88d43aa459d15c1d6230152e76b7757c2cdd6085@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: mac80211: remove outdated comments
Johannes Berg [Mon, 6 May 2024 19:14:22 +0000 (21:14 +0200)]
wifi: mac80211: remove outdated comments

These comments are no longer correct, it's a wiphy work now
so it will go away immediately when canceled.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506211422.68bc10efbd8a.If80f43f4c8b9db1f5266f70d93a805f8c7463fe2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: cfg80211: add tracing for wiphy work
Johannes Berg [Mon, 6 May 2024 19:00:03 +0000 (21:00 +0200)]
wifi: cfg80211: add tracing for wiphy work

Add trace events to trace when wiphy works are queued (or
delayed ones scheduled), and other APIs are called. Also
add an event when the worker starts, before acquiring the
mutex, to be able to see potential delays due to locking.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://msgid.link/20240506210002.bf1840a1d22d.I4abba048c1c4017345640219cf1384a0b2288dd3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: cfg80211: sort trace events again
Johannes Berg [Mon, 6 May 2024 19:00:02 +0000 (21:00 +0200)]
wifi: cfg80211: sort trace events again

They were meant to be split into ops and APIs, but some
ops were added in the wrong place. Fix that.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240506210002.0b3a86a5d8d7.I5591c03223bdb95597e181de63a2eded424de34c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: nl80211: disallow setting special AP channel widths
Johannes Berg [Wed, 15 May 2024 12:16:00 +0000 (14:16 +0200)]
wifi: nl80211: disallow setting special AP channel widths

Setting the AP channel width is meant for use with the normal
20/40/... MHz channel width progression, and switching around
in S1G or narrow channels isn't supported. Disallow that.

Reported-by: syzbot+bc0f5b92cc7091f45fb6@syzkaller.appspotmail.com
Link: https://msgid.link/20240515141600.d4a9590bfe32.I19a32d60097e81b527eafe6b0924f6c5fbb2dc45@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 months agowifi: ieee80211: document two FTM related functions
Johannes Berg [Wed, 15 May 2024 07:38:40 +0000 (09:38 +0200)]
wifi: ieee80211: document two FTM related functions

Add some documentation to ieee80211_is_timing_measurement()
and ieee80211_is_ftm().

Link: https://msgid.link/20240515093852.229aa69e972c.Ifae6762a698e79cd5a49a055fe4c32330e826200@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>