platform/kernel/linux-starfive.git
12 months agowifi: ieee80211: fix erroneous NSTR bitmap size checks
Johannes Berg [Thu, 22 Jun 2023 17:44:22 +0000 (19:44 +0200)]
wifi: ieee80211: fix erroneous NSTR bitmap size checks

The complete profile bit together with the NSTR link pair
present bit indicate whether or not the NSTR bitmap is,
the NSTR bitmap size just indicates how big it is.

Fixes: 7b6f08771bf6 ("wifi: ieee80211: Support validating ML station profile length")
Fixes: 5c1f97537bfb ("wifi: mac80211: store BSS param change count from assoc response")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: rtlwifi: cleanup USB interface
Dmitry Antipov [Wed, 14 Jun 2023 06:18:32 +0000 (09:18 +0300)]
wifi: rtlwifi: cleanup USB interface

Drop unused '_usb_writen_sync()' and relevant pointer
from 'struct rtl_io', handle possible write error in
'_usb_write_async()', adjust related code.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230614061832.40882-2-dmantipov@yandex.ru
12 months agowifi: rtlwifi: simplify LED management
Dmitry Antipov [Wed, 14 Jun 2023 06:18:31 +0000 (09:18 +0300)]
wifi: rtlwifi: simplify LED management

Introduce 'rtl_init_sw_leds()' to replace per-chip LED
initialization code (and so drop 'struct rtl_led' as no
longer used), drop 'init_sw_leds' and 'deinit_sw_leds'
fields from 'struct rtl_hal_ops', adjust related code.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230614061832.40882-1-dmantipov@yandex.ru
12 months agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 21 Jun 2023 18:18:08 +0000 (21:18 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for v6.5. Major changes:

ath11k

* factory test mode support

12 months agowifi: ath10k: improve structure padding
Arnd Bergmann [Fri, 16 Jun 2023 09:04:21 +0000 (11:04 +0200)]
wifi: ath10k: improve structure padding

Including an aligned structure inside of a packed one is ambiguous
and can lead to misaligned data, as pointed out by this clang warning:

drivers/net/wireless/ath/ath10k/htt.h:715:34: error: field prefix within 'struct htt_rx_indication' is less aligned than 'struct htt_rx_indication_prefix' and is usually due to 'struct htt_rx_indication' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
        struct htt_rx_indication_prefix prefix;
                                        ^
drivers/net/wireless/ath/ath10k/htt.h:736:34: error: field prefix within 'struct htt_rx_indication_hl' is less aligned than 'struct htt_rx_indication_prefix' and is usually due to 'struct htt_rx_indication_hl' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
        struct htt_rx_indication_prefix prefix;
                                        ^
drivers/net/wireless/ath/ath10k/htt.h:1564:2: error: field  within 'struct htt_tx_fetch_ind' is less aligned than 'union htt_tx_fetch_ind::(anonymous at drivers/net/wireless/ath/ath10k/htt.h:1564:2)' and is usually due to 'struct htt_tx_fetch_ind' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
        union {
        ^
drivers/net/wireless/ath/ath10k/htt.h:1702:2: error: field  within 'struct htt_resp' is less aligned than 'union htt_resp::(anonymous at drivers/net/wireless/ath/ath10k/htt.h:1702:2)' and is usually due to 'struct htt_resp' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]

These structures appear to actually need the packing since they
are embedded at misaligned offsets. Add even more such annotations
here to enforce bytewise access throughout the driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230616090439.2484857-1-arnd@kernel.org
12 months agowifi: ath9k: convert msecs to jiffies where needed
Dmitry Antipov [Tue, 13 Jun 2023 13:46:55 +0000 (16:46 +0300)]
wifi: ath9k: convert msecs to jiffies where needed

Since 'ieee80211_queue_delayed_work()' expects timeout in
jiffies and not milliseconds, 'msecs_to_jiffies()' should
be used in 'ath_restart_work()' and '__ath9k_flush()'.

Fixes: d63ffc45c5d3 ("ath9k: rename tx_complete_work to hw_check_work")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230613134655.248728-1-dmantipov@yandex.ru
12 months agowifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow
Yedidya Benshimol [Wed, 21 Jun 2023 11:49:52 +0000 (14:49 +0300)]
wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow

As part of the new security API in the FW, all security keys are to
be removed before station removal. Until now IGTK rekey
wasn't supported in the D3 resume flow, and thus the driver might
not know the right key to remove.
If an IGTK was rekeyed during D3 the old IGTK is removed and the
new key is updated. If not, the old key's IPN is updated.
As opposed to GTK, which both the FW and the driver hold it's two
most recent keys, only one IGTK is held.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621144844.b53c301c07e6.I375277a10a1f756b93d4a343f6664351a80189c5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: update two most recent GTKs on D3 resume flow
Yedidya Benshimol [Wed, 21 Jun 2023 11:49:51 +0000 (14:49 +0300)]
wifi: iwlwifi: mvm: update two most recent GTKs on D3 resume flow

When resuming from D3 the two most recent GTKs are passed from
the FW with wowlan_info_notif. Both keys should be updated as
they both might be needed upon FW restart and they both should
be removed upon station removal.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621144844.3ea3a9f52ec2.I7cedfa2bb0eafb83e7c77363673560acf05bff74@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: Refactor security key update after D3
Yedidya Benshimol [Wed, 21 Jun 2023 11:49:50 +0000 (14:49 +0300)]
wifi: iwlwifi: mvm: Refactor security key update after D3

In the D3 resume flow, use two different iterating functions
to go over the old keys and update the new ones

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621144844.a2442844c224.I598ed742c7aaa5414702f03f694f2dc0874bc077@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: mark keys as uploaded when added by the driver
Yedidya Benshimol [Wed, 21 Jun 2023 11:44:36 +0000 (14:44 +0300)]
wifi: mac80211: mark keys as uploaded when added by the driver

When the driver has some form of GTK rekeying offload, e.g. during
WoWLAN, mac80211 can assume that keys that the driver adds for
that are already present in the hardware acceleration. Mark them
accordingly.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621144414.bc78c7ff2a3d.I5e313d69e2b6a7a4766ef82d0faa122dd4c1c46d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: remove support of A0 version of FM RF
Mukesh Sisodiya [Wed, 21 Jun 2023 10:12:22 +0000 (13:12 +0300)]
wifi: iwlwifi: remove support of A0 version of FM RF

Remove the support for A0 step of latest wifi-7
FM RF as it is no longer supported.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130444.269d55ffbc8e.I4740f32c3d95d4474a82cc153891c92b9bc465db@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: cfg: clean up Bz module firmware lines
Johannes Berg [Wed, 21 Jun 2023 10:12:21 +0000 (13:12 +0300)]
wifi: iwlwifi: cfg: clean up Bz module firmware lines

Remove module firmware lines for images that don't exist
as well as some unused macros, and add gl-a-fm-a that
(still) exists.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130444.b399b0072d72.Ie7ca1b3dcdebc929ce96a739e0d557fac2c8aeeb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: pcie: add device id 51F1 for killer 1675
Yi Kuo [Wed, 21 Jun 2023 10:12:20 +0000 (13:12 +0300)]
wifi: iwlwifi: pcie: add device id 51F1 for killer 1675

Intel Killer AX1675i/s with device id 51f1 would show
"No config found for PCI dev 51f1/1672" in dmesg and refuse to work.
Add the new device id 51F1 for 1675i/s to fix the issue.

Signed-off-by: Yi Kuo <yi@yikuo.dev>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130444.ee224675380b.I921c905e21e8d041ad808def8f454f27b5ebcd8b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: bump FW API to 83 for AX/BZ/SC devices
Gregory Greenman [Wed, 21 Jun 2023 10:12:19 +0000 (13:12 +0300)]
wifi: iwlwifi: bump FW API to 83 for AX/BZ/SC devices

Start supporting API version 83 for new devices.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130444.267a136ea57f.Iaef9f04b9655c5c1b8bdee3b89cc3361ab621bcf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: cfg: remove trailing dash from FW_PRE constants
Johannes Berg [Wed, 21 Jun 2023 10:12:18 +0000 (13:12 +0300)]
wifi: iwlwifi: cfg: remove trailing dash from FW_PRE constants

We have the trailing dash here, but that complicates all
the code. Simplify this by removing the dashes, adding
them to the *_MODULE_FIRMWARE macros, and adjusting the
code using this accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.72240ca13b83.I1f4ed547f0964719ed98a3ef928080462d594491@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: also unify Ma device configurations
Johannes Berg [Wed, 21 Jun 2023 10:12:17 +0000 (13:12 +0300)]
wifi: iwlwifi: also unify Ma device configurations

Again, they're all the same except for the radio and
steps, so use the new logic to unify them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.676887cc8180.I29994dec43bfb29aad5e4ab0126c06a9ea4670cb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: also unify Sc device configurations
Johannes Berg [Wed, 21 Jun 2023 10:12:16 +0000 (13:12 +0300)]
wifi: iwlwifi: also unify Sc device configurations

Again, they're all the same except for the radio and
steps, so use the new logic to unify them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.3bc1191f883f.If1e6f73a164b0794ac65372b72673ce8ddf9e571@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: unify Bz/Gl device configurations
Johannes Berg [Wed, 21 Jun 2023 10:12:15 +0000 (13:12 +0300)]
wifi: iwlwifi: unify Bz/Gl device configurations

All the configurations for the various Bz/Gl devices
are basically identical, except for Gl A-step and the
firmware filename prefixes.

Add some infrastructure to auto-generate the firmware
filename prefix based on the detected MAC step and
RF name/step, and remove all the unneeded configs.

This reduces the size of the iwlwifi module by ~9k:
 517582   27111     560  545253   851e5 drivers/net/wireless/intel/iwlwifi/iwlwifi.ko
 526885   27083     560  554528   87620 drivers/net/wireless/intel/iwlwifi/iwlwifi.ko

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.1dc121ba338f.I07d651516eb82cbaded4724ef30558a50f2fa866@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: pcie: also drop jacket from info macro
Johannes Berg [Wed, 21 Jun 2023 10:12:14 +0000 (13:12 +0300)]
wifi: iwlwifi: pcie: also drop jacket from info macro

We don't need this here anymore, ANY is just fine.
Still keep the rest of the infrastructure so we can
more easily add back support for testing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.168c714cbb83.I0721ce86a042c4d8004914129bab46d7ccc8cb00@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: remove support for *nJ devices
Johannes Berg [Wed, 21 Jun 2023 10:12:13 +0000 (13:12 +0300)]
wifi: iwlwifi: remove support for *nJ devices

These are test chips that will never reach anyone
outside of Intel, so remove support for them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.d9f4e0356ae4.If9eccc22eb500dfff8973a70a649d94af7a60841@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: don't load old firmware for 22000
Johannes Berg [Wed, 21 Jun 2023 10:12:12 +0000 (13:12 +0300)]
wifi: iwlwifi: don't load old firmware for 22000

The earliest firmware released for these products is with
API version 50, so there's no point in trying to load any
versions before that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.768186c0475d.I7de717072221712176a3085d71c8018ae0348db8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: don't load old firmware for ax210
Johannes Berg [Wed, 21 Jun 2023 10:12:11 +0000 (13:12 +0300)]
wifi: iwlwifi: don't load old firmware for ax210

The earliest firmware released for these products is with
API version 59 (for 'ty' only), so no point trying to go
back in time even further than that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.ebe02b5dbddb.I51484ebb6c89256b0e6e7f9bb24f597c4ebead67@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: don't load old firmware for Bz
Johannes Berg [Wed, 21 Jun 2023 10:12:10 +0000 (13:12 +0300)]
wifi: iwlwifi: don't load old firmware for Bz

This is a future product, don't try to load ancient
firmware images for it, they don't exist anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.a6961592f258.Ib7afecd46b1963164481c2acf35d2582691ef0bc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: don't load old firmware for Sc
Johannes Berg [Wed, 21 Jun 2023 10:12:09 +0000 (13:12 +0300)]
wifi: iwlwifi: don't load old firmware for Sc

This is a future product, don't try to load ancient
firmware images for it, they don't exist anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.a15e7bf936cb.I68c3c71fda62c837e4da885a42471bf772ac1202@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: give Sc devices their own family
Johannes Berg [Wed, 21 Jun 2023 10:12:08 +0000 (13:12 +0300)]
wifi: iwlwifi: give Sc devices their own family

They're not the same as Bz or any prior ones, and there's
already one place in the driver that would erroneously
assign a workaround to A-step Sc devices if they're just
treated as a version of Bz. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.e98272ddb808.If18577b2393f631d1bfaa931287cae106fa32438@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: split 22000.c into multiple files
Johannes Berg [Wed, 21 Jun 2023 10:12:07 +0000 (13:12 +0300)]
wifi: iwlwifi: split 22000.c into multiple files

Split the configuration list in 22000.c into four new files,
per new device family, so we don't have this huge unusable
file. Yes, this duplicates a few small things, but that's
still much better than what we have now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.7543603b2ee7.Ia8dd54216d341ef1ddc0531f2c9aa30d30536a5d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: Add support for new CNVi (SC)
Mukesh Sisodiya [Wed, 21 Jun 2023 10:12:06 +0000 (13:12 +0300)]
wifi: iwlwifi: Add support for new CNVi (SC)

Add support for the new Integrated Connectivity (CNVi)
and Companion RF (CRF) versions and their combinations
to handle new devices.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.716fd707e847.I34f6ffd61e3210c926868a3e961b16d1742bba29@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: Add support for new Bz version
Mukesh Sisodiya [Wed, 21 Jun 2023 10:12:05 +0000 (13:12 +0300)]
wifi: iwlwifi: Add support for new Bz version

Add support for the new version of the Bz CNVI device.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230621130443.82d436d5f346.I0154c202c5d895cb002a2b7c827b9536e81a84b5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: Add support for scan version 17
Ilan Peer [Tue, 20 Jun 2023 10:04:05 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: Add support for scan version 17

Add support for scan request command version 17, which supports
specifying the maximal EIRP PSD value that can be used for
probe request transmission on a given channel.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.0a41c847d450.I0c9b45cc3eb39d44c75d3bdca84f0a91fdad1fa1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: adjust skip-over-dtim in D3
Johannes Berg [Tue, 20 Jun 2023 10:04:04 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: adjust skip-over-dtim in D3

The current formula can skip both too much and not enough time,
given the +1 (where the comment about firmware is wrong). Adjust
the formula accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.32406b6828ae.I88c315b85f7c56ac6109f84580b95a3dd104ff6c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: check only affected links
Johannes Berg [Tue, 20 Jun 2023 10:04:03 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: check only affected links

When hostapd starts up, it may start up with only one link
while the other is still scanning for overlapping BSSes. A
station might start to connect at this point, but we run
into this warning instead. Since there's no need to check
for _all_ links, restrict the check to just the affected
links that the STA will be using.

Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")
Reported-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.c3d5a006ec21.Ib4715381f598f4c18d67cd9598ebd5cdbe7d2b09@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: avoid baid size integer overflow
Johannes Berg [Tue, 20 Jun 2023 10:04:02 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: avoid baid size integer overflow

Roee reported various hard-to-debug crashes with pings in
EHT aggregation scenarios. Enabling KASAN showed that we
access the BAID allocation out of bounds, and looking at
the code a bit shows that since the reorder buffer entry
(struct iwl_mvm_reorder_buf_entry) is 128 bytes if debug
such as lockdep is enabled, then staring from an agg size
512 we overflow the size calculation, and allocate a much
smaller structure than we should, causing slab corruption
once we initialize this.

Fix this by simply using u32 instead of u16.

Reported-by: Roee Goldfiner <roee.h.goldfiner@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.f428c856030d.I2c2bb808e945adb71bc15f5b2bac2d8957ea90eb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
Johannes Berg [Tue, 20 Jun 2023 10:04:01 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection

We've already done the 'decryption' here, so tell
mac80211 it need not do it again.

Fixes: b1fdc2505abc ("iwlwifi: mvm: advertise BIGTK client support if available")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.a50cf68fbf2e.Ieceacbe3789d81ea02ae085ad8d1f8813a33c31b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: support new flush_sta method
Johannes Berg [Tue, 20 Jun 2023 10:04:00 +0000 (13:04 +0300)]
wifi: iwlwifi: mvm: support new flush_sta method

For iwlwifi this is simple to implement, and on newer hardware
it's an improvement since we have per-station queues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.a1f8ec20b727.I48594b708b41aa55dc2b8c3d346b4412ad3a5ba3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: Add support for new PCI Id
Mukesh Sisodiya [Tue, 20 Jun 2023 10:03:59 +0000 (13:03 +0300)]
wifi: iwlwifi: Add support for new PCI Id

Add support for the PCI Id 51F1 without IMR support.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.9800e652e789.Ic06a085832ac3f988c8ef07d856c8e281563295d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: send LARI configuration earlier
Benjamin Berg [Tue, 20 Jun 2023 10:03:58 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: send LARI configuration earlier

Sending the LARI configuration may trigger calibration, which can have
undesired side effects. Move the command to be send earlier (before the
phy contexts are registered) to avoid unintended side effects.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.80742497eb3f.I3e599a796290082e6d331ea495a5591d55de4726@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: remove disable_dummy_notification
Johannes Berg [Tue, 20 Jun 2023 10:03:57 +0000 (13:03 +0300)]
wifi: iwlwifi: remove disable_dummy_notification

This struct member is read-only, so can never change away
from the default value of zero. Remove the code that's in
an if on the value, since it's effectively dead code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.e7c96d0aa805.I5b158ce15e48393d2896c0bff9f644d983f0e92d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: limit EHT capabilities based on PCIe link speed
Johannes Berg [Tue, 20 Jun 2023 10:03:56 +0000 (13:03 +0300)]
wifi: iwlwifi: limit EHT capabilities based on PCIe link speed

If a discrete NIC is connected to a PCIe link hat isn't at least
Gen3 (8.0 GT/s), then we cannot sustain 320 MHz traffic, so remove
that from EHT capabilities in that case.

While at it, also move setting 320 MHz beamformee to the right
place in the code so it's not set while not supporting 320 MHz.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.b77a1574a0a7.Id4120c161fb7df6dedc70d5f3e3829e9117b8cb1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: add EHT A-MPDU size exponent support
Johannes Berg [Tue, 20 Jun 2023 10:03:55 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: add EHT A-MPDU size exponent support

Add support for reading the EHT MAC capabilities A-MPDU
size exponent field, as indicated by the draft spec.

Also clarify the existing code a bit and add comments
so it's clearer to understand what's going on here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.c5e00045d90f.I7520787fca8f8430a564adedf975d069ad8c5417@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: use min_t() for agg_size
Johannes Berg [Tue, 20 Jun 2023 10:03:54 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: use min_t() for agg_size

We can use min_t() for the agg_size and avoid
spelling out the (firmware) limit twice.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.211768036c1f.I78b7eea32eaae20cc9f32869aa3f42814634ce9a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: use EHT maximum MPDU length on 2.4 GHz
Johannes Berg [Tue, 20 Jun 2023 10:03:53 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: use EHT maximum MPDU length on 2.4 GHz

On 2.4 GHz there's no VHT, so EHT defines its own bits for
the maximum MPDU length. Use them when telling firmware
about the maximum.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.fd5322bb48a4.Ic471045f83229ceaacce25edcf992d3ce2c75de5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag
Johannes Berg [Tue, 20 Jun 2023 10:03:52 +0000 (13:03 +0300)]
wifi: iwlwifi: nvm: handle EHT/320 MHz regulatory flag

Handle the regulatory EHT/320 MHz flags from firmware just
like any other flags before it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.2c5e886c08f3.Ibc5c27d973d0590e2dea1f50435f9cf3ba8c2c09@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware
Emmanuel Grumbach [Tue, 20 Jun 2023 10:03:51 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: make iwl_mvm_set_fw_mu_edca_params mld aware

We need to work on the right link there.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.8762a90e8857.Ic5b8e96140a449fd1ed7008907d67fc36fe98506@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: fw: send marker cmd before suspend cmd
Miri Korenblit [Tue, 20 Jun 2023 10:03:50 +0000 (13:03 +0300)]
wifi: iwlwifi: fw: send marker cmd before suspend cmd

This is needed to sync the times in the FW and driver logs

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.9c84322c41b5.Id13816b3ece103f88514a7523b22bb2b9dcc8ab7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: mvm: check the right csa_active
Emmanuel Grumbach [Tue, 20 Jun 2023 10:03:49 +0000 (13:03 +0300)]
wifi: iwlwifi: mvm: check the right csa_active

When the firmware says that the channel switch is happening, we check
that we know about that switch by checking the csa_active bit.

Until now, we checked the bss_conf from the vif instead of taking the
bss_conf of the link.
Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.63f835a4f578.I0bb2a231e4da506b7c751dc23a428558f9ecfa75@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: pcie: add size assertions
Johannes Berg [Tue, 20 Jun 2023 10:03:48 +0000 (13:03 +0300)]
wifi: iwlwifi: pcie: add size assertions

Ensure that the TX command scratch fits into the buffer
provided by the first TB. It does, of course, but add
some build-time validations in case we touch this code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.8f54f2990b92.If19a038dfd633d4601e3d44dd0ff678bc0a851e9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: pcie: refactor RB status size calculation
Johannes Berg [Tue, 20 Jun 2023 10:03:47 +0000 (13:03 +0300)]
wifi: iwlwifi: pcie: refactor RB status size calculation

We have three places doing this check, and even in
slightly different ways (with/without an intermediate).
Refactor that to a new small inline function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230620125813.f3e87ddd5bce.Ifefba753043b68c394590a35bc6914a0f6497fd3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: nl80211/reg: add no-EHT regulatory flag
Johannes Berg [Mon, 19 Jun 2023 13:26:53 +0000 (16:26 +0300)]
wifi: nl80211/reg: add no-EHT regulatory flag

This just propagates to the channel flags, like no-HE and
similar other flags before it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.74ce2983aed8.Ifa343ba89c11760491daad5aee5a81209d5735a7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: Retrieve PSD information from RNR AP information
Ilan Peer [Mon, 19 Jun 2023 13:26:52 +0000 (16:26 +0300)]
wifi: cfg80211: Retrieve PSD information from RNR AP information

Retrieve the Power Spectral Density (PSD) value from RNR AP
information entry and store it so it could be used by the drivers.

PSD value is explained in Section 9.4.2.170 of Draft
P802.11Revme_D2.0.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.067ded2b8fc3.I9f407ab5800cbb07045a0537a513012960ced740@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: fix CRC calculation for extended elems
Johannes Berg [Mon, 19 Jun 2023 13:26:51 +0000 (16:26 +0300)]
wifi: mac80211: fix CRC calculation for extended elems

For extended elements, we currently only calculate the CRC
for some of them, but really we should do it also for the
rest that we care about, such as EHT operation and multi-
link.

Also, while at it, it seems we should do it even if they
aren't well-formed, so we notice if that changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.93235d5c8651.I6615cb3c1244bc9618066baa2bdad7982e9abd1f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: avoid lockdep checking when removing deflink
Benjamin Berg [Mon, 19 Jun 2023 13:26:50 +0000 (16:26 +0300)]
wifi: mac80211: avoid lockdep checking when removing deflink

struct sta_info may be removed without holding sta_mtx if it has not
yet been inserted. To support this, only assert that the lock is held
for links other than the deflink.

This fixes lockdep issues that may be triggered in error cases.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.cdd81377dea0.If5a6734b4b85608a2275a09b4f99b5564d82997f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: always hold sdata lock in chanctx assign/unassign
Johannes Berg [Mon, 19 Jun 2023 13:26:49 +0000 (16:26 +0300)]
wifi: mac80211: always hold sdata lock in chanctx assign/unassign

Due to all the multi-link handling, we now expose the fact that
the sdata/vif is locked to drivers, e.g. when the driver uses
ieee80211_set_monitor_channel(). This was true when a chanctx
is added to or removed from a link, _except_ in monitor mode
with the virtual sdata/vif. Change that, so that drivers can
make that assumption.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.a5cf7534beda.I5b51664231abee27e02f222083df7ccf88722929@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: store BSS param change count from assoc response
Johannes Berg [Mon, 19 Jun 2023 13:26:48 +0000 (16:26 +0300)]
wifi: mac80211: store BSS param change count from assoc response

When receiving a multi-link association response, make sure to
track the BSS parameter change count for each link, including
the assoc link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.1799c164e7e9.I8e2c1f5eec6eec3fab525ae2dead9f6f099a2427@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: drop some unprotected action frames
Johannes Berg [Mon, 19 Jun 2023 13:26:47 +0000 (16:26 +0300)]
wifi: mac80211: drop some unprotected action frames

We should not receive/handle unicast protected dual
or public action frames that aren't protected, so
drop them - in the latter case of course only if MFP
is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.eb4461108129.I3c2223cf29d8a3586dfc74b2dda3f6fa2a4eea7c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: move action length check up
Johannes Berg [Mon, 19 Jun 2023 13:26:46 +0000 (16:26 +0300)]
wifi: mac80211: move action length check up

We'd like to add more checks to the function here for
action frames, so move up the length check from the
action processing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619161906.e799254e923f.I0a1de5f6bbdc1b2ef5efaa0ac80c7c3f39415538@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: drop unprotected robust mgmt before 4-way-HS
Alon Giladi [Mon, 19 Jun 2023 15:37:38 +0000 (18:37 +0300)]
wifi: mac80211: drop unprotected robust mgmt before 4-way-HS

When MFP is used, drop unprotected robust management frames also
before the 4-way handshake has been completed, i.e. no key has
been installed yet.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230619183718.cfbefddccd0c.Ife369dbb61c87e311ce15739d5b2b4763bfdfbae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: p54: Add missing MODULE_FIRMWARE macro
Juerg Haefliger [Fri, 16 Jun 2023 12:19:17 +0000 (14:19 +0200)]
wifi: p54: Add missing MODULE_FIRMWARE macro

Add the missing MODULE_FIRMWARE macro for "3826.eeprom".

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616121917.1034761-1-juerg.haefliger@canonical.com
12 months agoMAINTAINERS: ath11k: add wiki and bugreport page
Kalle Valo [Wed, 14 Jun 2023 14:47:04 +0000 (17:47 +0300)]
MAINTAINERS: ath11k: add wiki and bugreport page

ath11k has a wiki and a separate page about reporting bugs, add those so
hopefully people find them easier.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230614144704.505553-3-kvalo@kernel.org
12 months agoMAINTAINERS: ath9k: add git tree
Kalle Valo [Wed, 14 Jun 2023 14:47:03 +0000 (17:47 +0300)]
MAINTAINERS: ath9k: add git tree

ath9k patches go to my ath.git tree, document that.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230614144704.505553-2-kvalo@kernel.org
12 months agoMAINTAINERS: mt76: add git tree
Kalle Valo [Wed, 14 Jun 2023 14:47:02 +0000 (17:47 +0300)]
MAINTAINERS: mt76: add git tree

Felix has a git tree for mt76 patches, document that.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230614144704.505553-1-kvalo@kernel.org
12 months agowifi: rtw89: use struct to parse firmware header
Ping-Ke Shih [Fri, 16 Jun 2023 06:06:01 +0000 (14:06 +0800)]
wifi: rtw89: use struct to parse firmware header

A firmware contains basic header, sections and optional dynamic header.
Define them by a struct, so it will be easier to understand the layout,
and also simply access these elements.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616060601.28460-1-pkshih@realtek.com
12 months agowifi: rtw89: TX power stuffs replace confusing naming of _max with _num
Zong-Zhe Yang [Fri, 16 Jun 2023 06:05:23 +0000 (14:05 +0800)]
wifi: rtw89: TX power stuffs replace confusing naming of _max with _num

Some old declarations about TX power stuffs were named with confusing
`_max`. But, they mean "the number of". So we change them to be named
with `_num`.

(No logic is changed.)

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616060523.28396-1-pkshih@realtek.com
12 months agowifi: rtw89: 8851b: configure to force 1 TX power value
Ping-Ke Shih [Thu, 15 Jun 2023 13:04:42 +0000 (21:04 +0800)]
wifi: rtw89: 8851b: configure to force 1 TX power value

RTL8851B is a chip with only single RF path, and it must use 1 TX power
value for transmission, so force 1 TX power value to prevent hardware
logic gets wrong TX power values randomly in certain samples.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615130442.18116-6-pkshih@realtek.com
12 months agowifi: rtw89: 8851b: rfk: update IQK to version 0x8
Ping-Ke Shih [Thu, 15 Jun 2023 13:04:41 +0000 (21:04 +0800)]
wifi: rtw89: 8851b: rfk: update IQK to version 0x8

The main change is to adjust RX calibration groups from {0,1,2,3} to {0,2}
in 5 GHz, so reduce elements from 4 to 2, and use index to iterate them.
Meanwhile, always do RX narrowband calibration (ID_NBRXK) for each group.
NCTL is used to assist IQK, so also update NCTL to 0x6 along with internal
tag HALRF_029_00_103.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615130442.18116-5-pkshih@realtek.com
12 months agowifi: rtw89: 8851b: rfk: add LCK track
Ping-Ke Shih [Thu, 15 Jun 2023 13:04:40 +0000 (21:04 +0800)]
wifi: rtw89: 8851b: rfk: add LCK track

LCK is short for LC Tank calibration. To keep RF performance, do this
calibration if difference of thermal value is over a threshold.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615130442.18116-4-pkshih@realtek.com
12 months agowifi: rtw89: 8851b: update TX power tables to R28
Zong-Zhe Yang [Thu, 15 Jun 2023 13:04:39 +0000 (21:04 +0800)]
wifi: rtw89: 8851b: update TX power tables to R28

Update 8851B TX power tables to RF version R28.

TX power tables' changes:
* TX power limit and TX power shape:
update 5 GHz configurations for FCC and IC

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615130442.18116-3-pkshih@realtek.com
12 months agowifi: rtw89: 8851b: update RF radio A parameters to R28
Ping-Ke Shih [Thu, 15 Jun 2023 13:04:38 +0000 (21:04 +0800)]
wifi: rtw89: 8851b: update RF radio A parameters to R28

Update 8851b radio A parameters to R28 along with internal HALRF_029_00_103

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615130442.18116-2-pkshih@realtek.com
12 months agowifi: rtw88: fix not entering PS mode after AP stops
Po-Hao Huang [Fri, 16 Jun 2023 12:55:40 +0000 (20:55 +0800)]
wifi: rtw88: fix not entering PS mode after AP stops

Without this patch, firmware only track beacons for port 0 and since
we will always start AP on port 0, this results in misbehavior of
power saving mode on other ports after AP stops.

The "default port" H2C command is used to notify which port should
firmware track. Update the correct settings to firmware so power
saving mode can work properly.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-7-pkshih@realtek.com
12 months agowifi: rtw88: refine register based H2C command
Po-Hao Huang [Fri, 16 Jun 2023 12:55:39 +0000 (20:55 +0800)]
wifi: rtw88: refine register based H2C command

Since register based H2C commands don't need endian conversion.
Introduce a new API that don't do conversion and send it directly.
New caller are expected to encode with cpu order and gradually
replace the old ones.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-6-pkshih@realtek.com
12 months agowifi: rtw88: Stop high queue during scan
Po-Hao Huang [Fri, 16 Jun 2023 12:55:38 +0000 (20:55 +0800)]
wifi: rtw88: Stop high queue during scan

When traversing channel list, TX in high queue should be disabled
along with beacon function, so packets won't be sent to incorrect
channels.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-5-pkshih@realtek.com
12 months agowifi: rtw88: Skip high queue in hci_flush
Po-Hao Huang [Fri, 16 Jun 2023 12:55:37 +0000 (20:55 +0800)]
wifi: rtw88: Skip high queue in hci_flush

The flush period may not always intersect with DTIM and when that
happens, an error log "timed out to flush pci TX ring[6]" is shown.
Bypass this since hardware will do proper transmission on the next
DTIM period for broadcast/multicast packets in high queue.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-4-pkshih@realtek.com
12 months agowifi: rtw88: Fix AP mode incorrect DTIM behavior
Po-Hao Huang [Fri, 16 Jun 2023 12:55:36 +0000 (20:55 +0800)]
wifi: rtw88: Fix AP mode incorrect DTIM behavior

Broadcast and multicast packets in high queue should be transmitted
all at once during DTIM. But without proper settings, hardware fails
to recognize that there are multiple packets and fetches only one.
Fix this by signaling hardware with more data bit set when there are
packets in the high queue.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-3-pkshih@realtek.com
12 months agowifi: rtw88: use struct instead of macros to set TX desc
Po-Hao Huang [Fri, 16 Jun 2023 12:55:35 +0000 (20:55 +0800)]
wifi: rtw88: use struct instead of macros to set TX desc

Remove macros that set TX descriptors. Use struct and
le32_encode_bits() with mask definitions.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616125540.36877-2-pkshih@realtek.com
12 months agowifi: rtw88: process VO packets without workqueue to avoid PTK rekey failed
Chih-Kang Chang [Fri, 16 Jun 2023 03:17:13 +0000 (11:17 +0800)]
wifi: rtw88: process VO packets without workqueue to avoid PTK rekey failed

In the wpa_supplicant rekey flow, it sends an EAPOL packet 4/4 through
nl80211_tx_control_port() and triggers wake_tx_queue() in the driver.
Then, it sends nl80211_new_key() to configure a new key in mac80211.
However, in wake_tx_queue(), a workqueue is used to process the tx packet,
which might cause the driver to process the EAPOL packet later than
nl80211_new_key(). As a result, the EAPOL 4/4 packet is dropped by mac80211
due to the rekey configuration being finished. The EAPOL packets belongs to
VO packets that need high priority. Therefore, we process VO packets
directly without workqueue to ensure that packets can process immediately.

VO is normally used by voice application that is low traffic load and low
latency, that doesn't affect user experience.
We test iperf with VO packets(iperf3 -P4 -u -b 10000M -S 0xdf)
                          before       after
TX throughput             162M         162M
ping RTT                  3.8ms        3.7ms

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230616031713.16769-1-pkshih@realtek.com
12 months agowifi: rtw88: Fix action frame transmission fail before association
Po-Hao Huang [Thu, 15 Jun 2023 11:43:48 +0000 (19:43 +0800)]
wifi: rtw88: Fix action frame transmission fail before association

For combo chips, antennas were controlled by bluetooth only during
power on. If WiFi wish to do transmission, notification to the coexistence
module are required. Previously we only do this before authentication.
To allow transmission before auth, such as management TX, now we start
the initiation of coexistence earlier so antennas are shared between
WiFi and bluetooth after set_channel(), and frames could then be sent.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230615114348.7193-1-pkshih@realtek.com
12 months agowifi: mac80211: fix documentation config reference
Johannes Berg [Wed, 21 Jun 2023 07:16:26 +0000 (09:16 +0200)]
wifi: mac80211: fix documentation config reference

We shouldn't refer to CPTCFG_, that's for backports, in
mainline that's just CONFIG_. Fix it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: add eht_capa debugfs field
Ben Greear [Wed, 17 May 2023 18:44:28 +0000 (11:44 -0700)]
wifi: mac80211: add eht_capa debugfs field

Output looks like this:

[root@ct523c-0b29 ~]# cat /debug/ieee80211/wiphy6/netdev\:wlan6/stations/50\:28\:4a\:bd\:f4\:a7/eht_capa
EHT supported
MAC-CAP: 0x82 0x00
PHY-CAP: 0x0c 0x00 0x00 0x00 0x00 0x48 0x00 0x00 0x00
OM-CONTROL
MAX-MPDU-LEN: 11454
242-TONE-RU-GT20MHZ
NDP-4-EHT-LFT-32-GI
BEAMFORMEE-80-NSS: 0
BEAMFORMEE-160-NSS: 0
BEAMFORMEE-320-NSS: 0
SOUNDING-DIM-80-NSS: 0
SOUNDING-DIM-160-NSS: 0
SOUNDING-DIM-320-NSS: 0
MAX_NC: 0
PPE_THRESHOLD_PRESENT
NOMINAL_PKT_PAD: 0us
MAX-NUM-SUPP-EHT-LTF: 1
SUPP-EXTRA-EHT-LTF
MCS15-SUPP-MASK: 0

EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=2, Tx=2
EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=2, Tx=2
EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=2, Tx=2
EHT bw <= 160 MHz, max NSS for MCS 8-9: Rx=0, Tx=0
EHT bw <= 160 MHz, max NSS for MCS 10-11: Rx=0, Tx=0
EHT bw <= 160 MHz, max NSS for MCS 12-13: Rx=0, Tx=0
EHT bw <= 320 MHz, max NSS for MCS 8-9: Rx=0, Tx=0
EHT bw <= 320 MHz, max NSS for MCS 10-11: Rx=0, Tx=0
EHT bw <= 320 MHz, max NSS for MCS 12-13: Rx=0, Tx=0
EHT PPE Thresholds: 0xc1 0x0e 0xe0 0x00 0x00

Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://lore.kernel.org/r/20230517184428.999384-1-greearb@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: iwlwifi: dvm: fix -Wunused-const-variable gcc warning
Dmitry Antipov [Mon, 19 Jun 2023 10:38:56 +0000 (13:38 +0300)]
wifi: iwlwifi: dvm: fix -Wunused-const-variable gcc warning

Fix the following gcc 13.1 warning observed with W=1:

drivers/net/wireless/intel/iwlwifi/dvm/rs.c:207:39: warning:
‘iwl_rate_mcs’ defined but not used [-Wunused-const-variable=]

This table is actually used in 'rs_sta_dbgfs_scale_table_read()'
only if CONFIG_MAC80211_DEBUGFS is enabled, so the whole thing
may be moved close to its actual use.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://lore.kernel.org/r/20230619103900.300628-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: check EHT basic MCS/NSS set
Johannes Berg [Sun, 18 Jun 2023 18:50:02 +0000 (21:50 +0300)]
wifi: mac80211: check EHT basic MCS/NSS set

Check that all the NSS in the EHT basic MCS/NSS set
are actually supported, otherwise disable EHT for the
connection.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.737827c906c9.I0c11a3cd46ab4dcb774c11a5bbc30aecfb6fce11@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: search all RNR elements for colocated APs
Benjamin Berg [Sun, 18 Jun 2023 18:50:01 +0000 (21:50 +0300)]
wifi: cfg80211: search all RNR elements for colocated APs

An AP reporting colocated APs may send more than one reduced neighbor
report element. As such, iterate all elements instead of only parsing
the first one when looking for colocated APs.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.ffe2c014f478.I372a4f96c88f7ea28ac39e94e0abfc465b5330d4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: stop parsing after allocation failure
Benjamin Berg [Sun, 18 Jun 2023 18:50:00 +0000 (21:50 +0300)]
wifi: cfg80211: stop parsing after allocation failure

The error handling code would break out of the loop incorrectly,
causing the rest of the message to be misinterpreted. Fix this by
also jumping out of the surrounding while loop, which will trigger
the error detection code.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.0ffac98475cf.I6f5c08a09f5c9fced01497b95a9841ffd1b039f8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: update multi-link element STA reconfig
Johannes Berg [Sun, 18 Jun 2023 18:49:59 +0000 (21:49 +0300)]
wifi: update multi-link element STA reconfig

Update the MLE STA reconfig sub-type to 802.11be D3.0
format, which includes the operation update field.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.2e1383b31f07.I8055a111c8fcf22e833e60f5587a4d8d21caca5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: agg-tx: prevent start/stop race
Johannes Berg [Sun, 18 Jun 2023 18:49:58 +0000 (21:49 +0300)]
wifi: mac80211: agg-tx: prevent start/stop race

There were crashes reported in this code, and the timer_shutdown()
warning in one of the previous patches indicates that the timeout
timer for the AP response (addba_resp_timer) is still armed while
we're stopping the aggregation session.

After a very long deliberation of the code, so far the only way I
could find that might cause this would be the following sequence:
 - session start requested
 - session start indicated to driver, but driver returns
   IEEE80211_AMPDU_TX_START_DELAY_ADDBA
 - session stop requested, sets HT_AGG_STATE_WANT_STOP
 - session stop worker runs ___ieee80211_stop_tx_ba_session(),
   sets HT_AGG_STATE_STOPPING

From here on, the order doesn't matter exactly, but:

 1. driver calls ieee80211_start_tx_ba_cb_irqsafe(),
    setting HT_AGG_STATE_START_CB
 2. driver calls ieee80211_stop_tx_ba_cb_irqsafe(),
    setting HT_AGG_STATE_STOP_CB
 3. the worker will run ieee80211_start_tx_ba_cb() for
    HT_AGG_STATE_START_CB
 4. the worker will run ieee80211_stop_tx_ba_cb() for
    HT_AGG_STATE_STOP_CB

(the order could also be 1./3./2./4.)

This will cause ieee80211_start_tx_ba_cb() to send out the AddBA
request frame to the AP and arm the timer, but we're already in
the middle of stopping and so the ieee80211_stop_tx_ba_cb() will
no longer assume it needs to stop anything.

Prevent this by checking for WANT_STOP/STOPPING in the start CB,
and warn if we're sending a frame on a stopping session.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.e5b52777462a.I0b2ed6658e81804279f5d7c9c1918cb1f6626bf2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: agg-tx: add a few locking assertions
Johannes Berg [Sun, 18 Jun 2023 18:49:57 +0000 (21:49 +0300)]
wifi: mac80211: agg-tx: add a few locking assertions

This is all true today, but difficult to understand since
the callers are in other files etc. Add two new lockdep
assertions to make things easier to read.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.7f03dec6a90b.I762c11e95da005b80fa0184cb1173b99ec362acf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: reorder presence checks in MLE per-STA profile
Johannes Berg [Sun, 18 Jun 2023 18:49:56 +0000 (21:49 +0300)]
wifi: ieee80211: reorder presence checks in MLE per-STA profile

In ieee80211_mle_sta_prof_size_ok(), the presence
checks aren't ordered by field order, so that's a
bit confusing. Reorder them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.fdbf17320a37.I517cf27fdc3f6e5d6a2615182da47ba4bdf14039@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: Support link removal using Reconfiguration ML element
Ilan Peer [Sun, 18 Jun 2023 18:49:55 +0000 (21:49 +0300)]
wifi: mac80211: Support link removal using Reconfiguration ML element

Add support for handling link removal indicated by the
Reconfiguration Multi-Link element.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.d8a046dc0c1a.I4dcf794da2a2d9f4e5f63a4b32158075d27c0660@changeid
[use cfg80211_links_removed() API instead]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: add set_active_links variant not locking sdata
Benjamin Berg [Thu, 11 May 2023 11:13:21 +0000 (13:13 +0200)]
wifi: mac80211: add set_active_links variant not locking sdata

There are cases where keeping sdata locked for an operation. Add a
variant that does not take sdata lock to permit these usecases.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: add ___ieee80211_disconnect variant not locking sdata
Benjamin Berg [Tue, 6 Jun 2023 15:43:26 +0000 (17:43 +0200)]
wifi: mac80211: add ___ieee80211_disconnect variant not locking sdata

There are cases where keeping sdata locked for an operation. Add a
variant that does not take sdata lock to permit these usecases.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal
Veerendranath Jakkam [Fri, 17 Mar 2023 14:21:53 +0000 (19:51 +0530)]
wifi: cfg80211/nl80211: Add support to indicate STA MLD setup links removal

STA MLD setup links may get removed if AP MLD remove the corresponding
affiliated APs with Multi-Link reconfiguration as described in
P802.11be_D3.0, section 35.3.6.2.2 Removing affiliated APs. Currently,
there is no support to notify such operation to cfg80211 and userspace.

Add support for the drivers to indicate STA MLD setup links removal to
cfg80211 and notify the same to userspace. Upon receiving such
indication from the driver, clear the MLO links information of the
removed links in the WDEV.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/20230317142153.237900-1-quic_vjakkam@quicinc.com
[rename function and attribute, fix kernel-doc]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: do not scan disabled links on 6GHz
Benjamin Berg [Sun, 18 Jun 2023 18:49:54 +0000 (21:49 +0300)]
wifi: cfg80211: do not scan disabled links on 6GHz

If a link is disabled on 6GHz, we should not send a probe request on the
channel to resolve it. Simply skip such RNR entries so that the link is
ignored.

Userspace can still see the link in the RNR and may generate an ML probe
request in order to associate to the (currently) disabled link.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.4f7384006471.Iff8f1081e76a298bd25f9468abb3a586372cddaa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: handle BSS data contained in ML probe responses
Benjamin Berg [Sun, 18 Jun 2023 18:49:53 +0000 (21:49 +0300)]
wifi: cfg80211: handle BSS data contained in ML probe responses

The basic multi-link element within an multi-link probe response will
contain full information about BSSes that are part of an MLD AP. This
BSS information may be used to associate with a link of an MLD AP
without having received a beacon from the BSS itself.

This patch adds parsing of the data and adding/updating the BSS using
the received elements. Doing this means that userspace can discover the
BSSes using an ML probe request and request association on these links.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.29593bd0ae1f.Ic9a67b8f022360aa202b870a932897a389171b14@changeid
[swap loop conditions smatch complained about]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: use structs for TBTT information access
Benjamin Berg [Sun, 18 Jun 2023 18:49:52 +0000 (21:49 +0300)]
wifi: cfg80211: use structs for TBTT information access

Make the data access a bit nicer overall by using structs. There is a
small change here to also accept a TBTT information length of eight
bytes as we do not require the 20 MHz PSD information.

This also fixes a bug reading the short SSID on big endian machines.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.4c3f8901c1bc.Ic3e94fd6e1bccff7948a252ad3bb87e322690a17@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: add structs for TBTT information access
Benjamin Berg [Sun, 18 Jun 2023 18:49:51 +0000 (21:49 +0300)]
wifi: ieee80211: add structs for TBTT information access

The TBTT information can have various lengths with different elements
thare are present. Add definitions for the two types that we are
interested in (i.e. the ones that contain the BSSID).

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.2a6f8766a3ec.Ic962e28492212cc8ee1eb602b8f07a4ea172fc4a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: use a struct for inform_single_bss data
Benjamin Berg [Sun, 18 Jun 2023 18:49:50 +0000 (21:49 +0300)]
wifi: cfg80211: use a struct for inform_single_bss data

The argument is getting quite large, so use a struct internally to pass
around the information.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.831ab8a87b6f.I3bcc83d90f41d6f8a47b39528575dad0a9ec3564@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: add definitions for RNR MLD params
Benjamin Berg [Sun, 18 Jun 2023 18:49:49 +0000 (21:49 +0300)]
wifi: ieee80211: add definitions for RNR MLD params

Add the definitions necessary to parse the MLD parameters
included in an RNR element.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.9999842237c0.I80f00a90cb4e43071432b4158f206c73ba799618@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: cfg80211: Always ignore ML element
Benjamin Berg [Sun, 18 Jun 2023 18:49:48 +0000 (21:49 +0300)]
wifi: cfg80211: Always ignore ML element

The element should never be inherited, so always exclude it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.c0e17989b4ed.I7cecb5ab7cd6919e61839b50ce5156904b41d7d8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: use default for medium synchronization delay
Benjamin Berg [Sun, 18 Jun 2023 18:49:47 +0000 (21:49 +0300)]
wifi: ieee80211: use default for medium synchronization delay

Default values are defined for the information included in the Medium
Synchronization Delay Information subfield. The spec says to
initialize the values to these defaults and only change them when
included.

Return the default value instead of zero so that the defaults are
used when the field is not included in the association response.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.a7725bef3795.I2d3528cf4af021c5b37f97fbe64ae9116ce9bef1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: add helper to validate ML element type and size
Benjamin Berg [Sun, 18 Jun 2023 18:49:46 +0000 (21:49 +0300)]
wifi: ieee80211: add helper to validate ML element type and size

The helper functions to retrieve the EML capabilities and medium
synchronization delay both assume that the type is correct. Instead of
assuming the length is correct and still checking the type, add a new
helper to check both and don't do any verification.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.1b50e7a3b3cf.I9385514d8eb6d6d3c82479a6fa732ef65313e554@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: ieee80211: Fix the common size calculation for reconfiguration ML
Ilan Peer [Sun, 18 Jun 2023 18:49:45 +0000 (21:49 +0300)]
wifi: ieee80211: Fix the common size calculation for reconfiguration ML

The common information length is found in the first octet of the common
information.

Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.3c7ed4817338.I42ef706cb827b4dade6e4ffbb6e7f341eaccd398@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agowifi: mac80211: Include Multi-Link in CRC calculation
Ilan Peer [Sun, 18 Jun 2023 18:49:44 +0000 (21:49 +0300)]
wifi: mac80211: Include Multi-Link in CRC calculation

Include the Multi-Link elements found in beacon frames
in the CRC calculation, as these elements are intended
to reflect changes in the AP MLD state.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214435.ae8246b93d85.Ia64b45198de90ff7f70abcc997841157f148ea40@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>