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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Johannes Berg [Fri, 16 Jun 2023 20:28:45 +0000 (22:28 +0200)]
wifi: cfg80211: fix regulatory disconnect with OCB/NAN
Since regulatory disconnect was added, OCB and NAN interface
types were added, which made it completely unusable for any
driver that allowed OCB/NAN. Add OCB/NAN (though NAN doesn't
do anything, we don't have any info) and also remove all the
logic that opts out, so it won't be broken again if/when new
interface types are added.
Fixes:
6e0bd6c35b02 ("cfg80211: 802.11p OCB mode handling")
Fixes:
cb3b7d87652a ("cfg80211: add start / stop NAN commands")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20230616222844.2794d1625a26.I8e78a3789a29e6149447b3139df724a6f1b46fc3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 16 Jun 2023 20:28:44 +0000 (22:28 +0200)]
wifi: cfg80211: fix regulatory disconnect for non-MLO
The multi-link loop here broke disconnect when multi-link
operation (MLO) isn't active for a given interface, since
in that case valid_links is 0 (indicating no links, i.e.
no MLO.)
Fix this by taking that into account properly and skipping
the link only if there are valid_links in the first place.
Cc: stable@vger.kernel.org
Fixes:
7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20230616222844.eb073d650c75.I72739923ef80919889ea9b50de9e4ba4baa836ae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Fri, 16 Jun 2023 06:54:09 +0000 (09:54 +0300)]
wifi: mac80211: Rename ieee80211_mle_sta_prof_size_ok()
Rename it to ieee80211_mle_basic_sta_prof_size_ok() as it
validates the size of the station profile included in
Basic 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/20230616094949.9bdfd263974f.I7bebd26894f33716e93cc7da576ef3215e0ba727@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Fri, 16 Jun 2023 06:54:08 +0000 (09:54 +0300)]
wifi: mac80211: Add support for parsing Reconfiguration Multi Link element
Parse Reconfiguration Multi Link IE.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.6eeb6c9a4a6e.I1cb137da9b3c712fc7c7949a6dec9e314b5d7f63@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Fri, 16 Jun 2023 06:54:07 +0000 (09:54 +0300)]
wifi: mac80211: Rename multi_link
As a preparation to support Reconfiguration Multi Link
element, rename 'multi_link' and 'multi_link_len' fields
in 'struct ieee802_11_elems' to 'ml_basic' and 'ml_basic_len'.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.b11370d3066a.I34280ae3728597056a6a2f313063962206c0d581@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:06 +0000 (09:54 +0300)]
wifi: mac80211: use cfg80211 defragmentation helper
Use the shared functionality rather than copying it into mac80211.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.7dcbf82baade.Ic68d1f547cb75d66037abdbb0f066db20ff41ba3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:05 +0000 (09:54 +0300)]
wifi: cfg80211: add element defragmentation helper
This is already needed within mac80211 and support is also needed by
cfg80211 to parse ML elements.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.29c3ebeed10d.I009c049289dd0162c2e858ed8b68d2875a672ed6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:04 +0000 (09:54 +0300)]
wifi: cfg80211: drop incorrect nontransmitted BSS update code
The removed code ran for any BSS that was not included in the MBSSID
element in order to update it. However, instead of using the correct
inheritance rules, it would simply copy the elements from the
transmitting AP. The result is that we would report incorrect elements
in this case.
After some discussions, it seems that there are likely not even APs
actually using this feature. Either way, removing the code decreases
complexity and makes the cfg80211 behaviour more correct.
Fixes:
0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.cfd6d8db1f26.Ia1044902b86cd7d366400a4bfb93691b8f05d68c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:03 +0000 (09:54 +0300)]
wifi: cfg80211: rewrite merging of inherited elements
The cfg80211_gen_new_ie function merges the IEs using inheritance rules.
Rewrite this function to fix issues around inheritance rules. In
particular, vendor elements do not require any special handling, as they
are either all inherited or overridden by the subprofile.
Also, add fragmentation handling as this may be needed in some cases.
This also changes the function to not require making a copy. The new
version could be optimized a bit by explicitly tracking which IEs have
been handled already rather than looking that up again every time.
Note that a small behavioural change is the removal of the SSID special
handling. This should be fine for the MBSSID element, as the SSID must
be included in the subelement.
Fixes:
0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.bc6152e146db.I2b5f3bc45085e1901e5b5192a674436adaf94748@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:02 +0000 (09:54 +0300)]
wifi: cfg80211: ignore invalid TBTT info field types
The TBTT information field type must be zero. This is only changed in
the 802.11be draft specification where the value 1 is used to indicate
that only the MLD parameters are included.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.7865606ffe94.I7ff28afb875d1b4c39acd497df8490a7d3628e3f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:01 +0000 (09:54 +0300)]
wifi: mac80211: use new inform_bss callback
Doing this simplifies the code somewhat, as iteration over the
nontransmitted BSSs is not required anymore. Also, mac80211 should
not be iterating over the nontrans_list as it should only be accessed
while the bss_lock is held.
It also simplifies parsing of the IEs somewhat, as cfg80211 already
extracts the IEs and passes them to the callback.
Note that the only user left requiring parsing a specific BSS is the
association code if a beacon is required by the hardware.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.39ebfe2f9e59.Ia012b08e0feed8ec431b666888b459f6366f7bd1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:54:00 +0000 (09:54 +0300)]
wifi: cfg80211: add inform_bss op to update BSS
This new function is called from within the inform_bss(_frame)_data
functions in order for the driver to update data that it is tracking.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094949.8d7781b0f965.I80041183072b75c081996a1a5a230b34aff5c668@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Fri, 16 Jun 2023 06:53:59 +0000 (09:53 +0300)]
wifi: cfg80211: keep bss_lock held when informing
It is reasonable to hold bss_lock for a little bit longer after
cfg80211_bss_update is done. Right now, this does not make any big
difference, but doing so in preparation for the next patch which adds
a call to the driver.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230616094948.61701884ff0d.I3358228209eb6766202aff04d1bae0b8fdff611f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>