Skip to content

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Update MTK WiFi drive Part 3/7#1865

Open
gtc199389 wants to merge 32 commits into
deepin-community:linux-6.6.yfrom
gtc199389:pr/mtk-003
Open

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Update MTK WiFi drive Part 3/7#1865
gtc199389 wants to merge 32 commits into
deepin-community:linux-6.6.yfrom
gtc199389:pr/mtk-003

Conversation

@gtc199389

Copy link
Copy Markdown

Synchronize the MTK WiFi driver from chromeos-kernel-6.6 and update the MTK WiFi driver to the latest version.

Part 3/7

Link: #1849

benzea and others added 30 commits June 16, 2026 13:54
The specification says that this information should not be explicitly
included in the per-STA profile. However, we need this information
readily available in the BSS for userspace and also internally when
associating. As such, append the appropriate element before
adding/updating the BSS.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231211085121.abde63d9cc6d.I3d346be0f84f51dccf4f4f92a3e997e6102b9456@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 5f478ad)
Signed-off-by: Matthew Wang <matthewmwang@chromium.org>

BUG=b:327617889
TEST=N/A

Change-Id: I80781eee4036e8199244315b6f61c1cd160ed945
Signed-off-by: David Ruth <druth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5335614
Reviewed-by: David Ruth <druth@chromium.org>
Tested-by: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Matthew Wang <matthewmwang@chromium.org>
(cherry picked from commit cb8373294c965c857931db50b6e024247eab3bb6)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5344090
Reviewed-by: Matthew Wang <matthewmwang@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
When one of the links (other than the assoc_link) is misconfigured
and cannot work the association will fail. However, userspace was not
able to tell that the operation only failed because of a problem with
one of the links. Fix this, by allowing the driver to set a per-link
error code and reporting the (first) offending link by setting the
bad_attr accordingly.

This only allows us to report the first error, but that is sufficient
for userspace to e.g. remove the offending link and retry.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230920211508.ebe63c0bd513.I40799998f02bf987acee1501a2522dc98bb6eb5a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit a7b2cc5)
Signed-off-by: Matthew Wang <matthewmwang@chromium.org>

Conflicts:
	net/wireless/nl80211.c - about 40 changes were made to move the
	locking mechanism. The backport would have required quite a bit
	of reverting and backporting, so I left it as is.

BUG=b:327617889
TEST=N/A

Change-Id: I940876433c23fc39a659d5aa1d9e1fc57ea85ded
Signed-off-by: David Ruth <druth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5335601
Tested-by: Matthew Wang <matthewmwang@chromium.org>
Commit-Queue: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.corp-partner.google.com>
Reviewed-by: David Ruth <druth@chromium.org>
(cherry picked from commit 0891f31155af757139206f3fd0c930489ed0fd1f)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5344089
Reviewed-by: Matthew Wang <matthewmwang@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
This reverts commit 4b299a9.

Keep the patch order the same in the upstream to make the following
backport without the conflict. Will apply it later

Signed-off-by: goutongchen <goutongchen@uniontech.com>
Most devices now do duration calculations, so we don't hit
this code at all any more. Clearly the approach of warning
at compile time here when new bands are added didn't work,
the new bands were just added with "TODO". Clean it up, it
won't matter for new bands since they'll just not have any
need to calculate durations in software.

While at it, also clean up and unify the code a bit.

Link: https://msgid.link/20240129194108.70a97bd69265.Icdd8b0ac60a382244466510090eb0f5868151f39@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 61f0261
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Cq-Depend: chromium:5828194
Change-Id: Icdd8b0ac60a382244466510090eb0f5868151f39
Signed-off-by: Sean Wang <objelf@gmail.com>
Signed-off-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827988
Reviewed-by: David Ruth <druth@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
The only user of this function passes a lot of pointers
directly from the parsed elements, so it's simpler to
just pass the entire elements parsing struct. This also
shows that the ht_cap is actually unused.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240111181514.f0653cd5e7dd.I8bd5ee848074029a9f0495c95e4339546ad8fe15@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit d1155f2
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/mlme.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I8bd5ee848074029a9f0495c95e4339546ad8fe15
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827989
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
The ESS capability bit is reserved in frames transmitted by
the client, so we shouldn't set it. Since we've set it for
decades, keep that old behaviour unless we're connection to
a new EHT AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231211085121.65005aba900b.I3d00c8741400572a89a7508b5ae612c968874ad7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 6a9c8ed
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I3d00c8741400572a89a7508b5ae612c968874ad7
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827991
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
For verifying the required HE capabilities are supported
locally, we access the HE capability element of the AP.
Simplify that access, we've already parsed and validated
it when parsing elements.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240111181514.2ef62b43caeb.I8baa604dd3f3399e08b86c99395a2c6a1185d35d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 6593c7a
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I8baa604dd3f3399e08b86c99395a2c6a1185d35d
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827992
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
The code that sets up the assoc link will currently take the BSS
element data from the beacon only. This is correct for some of
the data, notably the timing and the "have_beacon", but all the
data about MBSSID and EHT really doesn't need to be taken from
there, and if the EHT puncturing is misconfigured on the AP but
we didn't receive a beacon yet, this causes us to connect but
immediately disconnect upon receiving the first beacon, rather
than connecting without EHT in the first place.

Change the code to take MBSSID and EHT data also from the probe
response, for a better picture of what the BSS capabilities are
and to avoid that EHT puncturing problem.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230827135854.3c7e52d49482.Iba6b672f6dc74b45bba26bc497e953e27da43ef9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 90668e3
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Iba6b672f6dc74b45bba26bc497e953e27da43ef9
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827993
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
There may be cases where puncturing isn't possible, and
a connection needs to be downgraded. Add a hardware flag
to support this.

This is likely temporary: it seems we will need to move
puncturing to the chandef/channel context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231211085121.c1e89ea55e93.I37b8ca0ee64d5d7699e351785a9010afc106da3c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 42b941c
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I37b8ca0ee64d5d7699e351785a9010afc106da3c
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827994
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Reject configuring a channel for MLO if either EHT is not supported or
the BSS does not have the correct ML element. This avoids trying to do
a multi-link association with a misconfigured AP.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230920211508.80c3b8e5a344.Iaa2d466ee6280994537e1ae7ab9256a27934806f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 1228c74
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Iaa2d466ee6280994537e1ae7ab9256a27934806f
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827995
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
The association response is more likely to be correct
than a random scan result, which really also should be
correct, but we generally prefer to take data from the
association response, so do that here as well.

Also reset the data so it doesn't hang around from an
old connection to a non-MLO connection, drivers would
hopefully not look at it, but less surprise this way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240102213313.1d10f1d1dbab.I545e955675e2269a52496a22ae7822d95b40235e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit a8b6526
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/mlme.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I545e955675e2269a52496a22ae7822d95b40235e
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827996
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
We already parse all the BSS elements into elems, there's
really no need to separately find EHT/ML again. Remove the
extra code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240111181514.c4a55da9f778.I112b1ef00904c4183ac7644800f8daa8a4449875@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit f73ef56
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I112b1ef00904c4183ac7644800f8daa8a4449875
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827997
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
The SMPS mode is currently re-initialized too late, since
ieee80211_prep_channel() can be called again after we've
already done ieee80211_setup_assoc_link(), in case there's
some override of the channel configuration. Fix this.

Link: https://msgid.link/20240129195405.d6d74508be18.I0a7303b1ce4d8e5436011951ab624372a445c069@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 86b2dac
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/mlme.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I0a7303b1ce4d8e5436011951ab624372a445c069
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827998
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Add a unit test for the parsing of a fragmented sta profile
sub-element inside a fragmented multi-link element.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230827135854.333bc75df13f.I0ddfeb6a88a4d89e7c7850e8ef45a4b19b5a061a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit ffbd0c8
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I0ddfeb6a88a4d89e7c7850e8ef45a4b19b5a061a
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5827999
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
This function will be used by the kunit tests within cfg80211. As it
is generally useful, move it from mac80211 to cfg80211.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230827135854.5af9391659f5.Ie534ed6591ba02be8572d4d7242394f29e3af04b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 5806ef2
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ie534ed6591ba02be8572d4d7242394f29e3af04b
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828000
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
In CSA, parse the (EHT) bandwidth indication element and
use it (in fact prefer it if present).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230920211508.43ef01920556.If4f24a61cd634ab1e50eba43899b9e992bf25602@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit b323949
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: If4f24a61cd634ab1e50eba43899b9e992bf25602
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828181
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Rewrite the station-side connection handling. The connection
flags (IEEE80211_DISABLE_*) are rather confusing, and they're
not always maintained well. Additionally, for wider-bandwidth
OFDMA support we need to know the precise bandwidth of the AP,
which is currently somewhat difficult.

Rewrite this to have a 'mode' (S1G/legacy/HT/...) and a limit
on the bandwidth. This is not entirely clean because some of
those modes aren't completely sequenced (as this assumes in
some places), e.g. VHT doesn't exist on 2.4 GHz, but HE does.
However, it still simplifies things and gives us a good idea
what we're operating as, so we can parse elements accordingly
etc.

This leaves a FIXME for puncturing, this is addressed in a
later patch.

Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240129194108.9451722c0110.I3e61f4cfe9da89008e1854160093c76a1e69dc2a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 310c838
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/mlme.c
   net/mac80211/util.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I3e61f4cfe9da89008e1854160093c76a1e69dc2a
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828182
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
When parsing 6 GHz operation, don't set the bss_conf
values. We only commit to that later in association,
so move the code there. Also clear it later.

While at it, handle IEEE80211_6GHZ_CTRL_REG_VLP_AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240111181514.c2da4bc515e8.I219ca40e15c0fbaff0e7c3e83ca4b92ecbc1f8ae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit bc8a0fa
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I219ca40e15c0fbaff0e7c3e83ca4b92ecbc1f8ae
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828183
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
There really isn't any support for scanning at different
channel widths than 20 MHz since there's no way to set it.
Remove this support for now, if somebody wants to maintain
this whole thing later we can revisit how it should work.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 5add321
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I84afe28caf93f6942138b2498144ce542d981b7a
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828184
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
There are still surprisingly many non-chanctx drivers, but in
mac80211 that code is a bit awkward. Simplify this by having
those drivers assign 'emulated' ops, so that the mac80211 code
can be more unified between non-chanctx/chanctx drivers. This
cuts the number of places caring about it by about 15, which
are scattered across - now they're fewer and no longer in the
channel context handling.

Link: https://msgid.link/20240129194108.6d0ead50f5cf.I60d093b2fc81ca1853925a4d0ac3a2337d5baa5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 0a44dfc
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/cfg.c
   net/mac80211/chan.c
   net/mac80211/main.c
   net/mac80211/offchannel.c
   net/mac80211/util.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I60d093b2fc81ca1853925a4d0ac3a2337d5baa5b
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828185
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
For channel contexts, mac80211 currently uses the cfg80211
chandef struct (control channel, center freq(s), width) to
define towards drivers and internally how these behave. In
fact, there are _two_ such structs used, where the min_def
can reduce bandwidth according to the stations connected.

Unfortunately,  with EHT this is longer be sufficient,  at
least not for all hardware.  EHT requires that non-AP STAs
that are connected to an AP with a lower bandwidth than it
(the AP) advertises (e.g. 160 MHz STA connected to 320 MHz
AP) still be able to receive downlink OFDMA and respond to
trigger frames for uplink OFDMA  that specify the position
and bandwidth  for the non-AP STA  relative to the channel
the AP is using.  Therefore, they need to be aware of this,
and at least for some hardware (e.g. Intel) this awareness
is in the hardware. As a result, use of the "same" channel
may need to be split over  two channel contexts where they
differ by the AP being used.

As a first step,  introduce a concept of a channel request
('chanreq') for each interface,  to control the context it
requests.   This step does nothing but reorganise the code,
so that later the AP's chandef can be added to the request
in order to handle the EHT case described above.

Link: https://msgid.link/20240129194108.2e88e48bd2e9.I4256183debe975c5ed71621611206fdbb69ba330@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 6092077
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
   net/mac80211/cfg.c
   net/mac80211/chan.c
   net/mac80211/ibss.c
   net/mac80211/iface.c
   net/mac80211/main.c
   net/mac80211/mlme.c
   net/mac80211/ocb.c
   net/mac80211/util.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I4256183debe975c5ed71621611206fdbb69ba330
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828186
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
My previous patch only initialized match_auth when the
ifmgd->auth_data exists, but that was wrong, it should
always be set. Fix that.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/3151f5d0-c18f-413d-b34b-b94f095b947c@moroto.mountain
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240301193633.1a3fc370f211.I979dd222b3b5eb5e1437886e5f7c2355eeccb9f7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 01ad6b7
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: I979dd222b3b5eb5e1437886e5f7c2355eeccb9f7
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828187
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
If the assoc link doesn't exist yet at this point, we
cannot use it yet. This isn't normally the case, but
e.g. in case of FT-DS (or just broken userspace) the
link might not be set up yet and will only be created
later in this function. Check that the link exists.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/3151f5d0-c18f-413d-b34b-b94f095b947c@moroto.mountain
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240301193633.c886d300e90a.Ie1d5e23b2a033d934d343c37249f6f4dfddcc5fe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 2a705bc
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ie1d5e23b2a033d934d343c37249f6f4dfddcc5fe
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828188
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
When a link doesn't have VHT capability, before the rework
we'd have set IEEE80211_CONN_DISABLE_VHT, but now with the
linear progression of 'mode', we no longer have that. Add
an explicit check for VHT being supported, so we don't add
a zeroed VHT capabilities element where it shouldn't be.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240228094207.bfe4283bcde7.Ib70a558bc6bdbcec3d9e663079229dfcc2493682@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit bf7bc8c
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ib70a558bc6bdbcec3d9e663079229dfcc2493682
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828189
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
In the association request, we make some parameters depend on the
AP's HT/VHT information. This was broken by my code because it no
longer filled that information, making it all zero.

For HT that meant we wouldn't reduce our capabilities to 20 MHz if
needed, and for VHT we lost beamforming capabilities.

Fix this. It seems like it may even have been broken for all but
the assoc link before.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240228094207.7dc812c2060a.Ibd591f9c214b4e166cf7171db3cf63bda8e3c9fd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 7d8b025
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ibd591f9c214b4e166cf7171db3cf63bda8e3c9fd
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828190
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Make sure that the new mlme_link_id_dbg() macro honours
CONFIG_MAC80211_MLME_DEBUG as intended to avoid spamming the log with
messages like:

	wlan0: no EHT support, limiting to HE
	wlan0: determined local STA to be HE, BW limited to 160 MHz
	wlan0: determined AP xx:xx:xx:xx:xx:xx to be VHT
	wlan0: connecting with VHT mode, max bandwidth 160 MHz

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://msgid.link/20240325085948.26203-1-johan+linaro@kernel.org
Tested-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 27f8f10
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ifdbd63e012776187e35d5e112768e9a55ba3c974
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828191
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
When doing re-parsing in ieee80211_determine_chan_mode(),
the conn->mode is changed, and the whole point of doing
the parsing again was to parse as the downgraded mode.
However, that didn't actually work, because the setting
was copied before and never changed again. Fix that.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240418105220.5e0d1fcb5622.Ib0673e0bc90033fd6d387b6a5f107c040eb907cf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 645acc6
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ib0673e0bc90033fd6d387b6a5f107c040eb907cf
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828192
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
When re-parsing the elements here (with changed mode), free
the original ones first to avoid leaking memory.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240418105220.458421e3bbff.Icb5b84cba3ea420794cf009cf18ec3d76e434736@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 1ac6f60
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Icb5b84cba3ea420794cf009cf18ec3d76e434736
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828193
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
If the AP mode ends up being determined less than the client mode,
there may be different reasons for this, e.g. AP misconfiguration.
If this happens in a way that causes e.g. EHT to be rejected, the
elements need to be re-parsed since we'll connect as HE, but not
reparsing means that we'll still think it's OK to use multi-link,
so we can connect in a non-sensical configuration of advertising
only HE on a secondary link. This normally won't happen for the
assoc link because that reuses the mode from authentication, and
if that's not EHT, multi-link association is rejected.

Fix this inconsistency by parsing the elements again if the mode
was different from the first parsing attempt. Print the message a
bit later to avoid printing "determined AP ... to be HE" twice in
cases where ieee80211_determine_ap_chan() returned a lesser mode,
rather than the regulatory downgrades below changing it.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240418105220.d1f25d92cfe7.Ia21eff6cdcae2f5aca13cf8e742a986af5e70f89@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 2fb5dfe
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)

Conflicts:
   net/mac80211/mlme.c

BUG=b:366169724
TEST=Merge patch from upstream

Change-Id: Ia21eff6cdcae2f5aca13cf8e742a986af5e70f89
Signed-off-by: Sean Wang <objelf@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5828194
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Chanctx emulation didn't info IEEE80211_CONF_CHANGE_CHANNEL to drivers
during ieee80211_restart_hw (ieee80211_emulate_add_chanctx). It caused
non-chanctx drivers to not stand on the correct channel after recovery.
RX then behaved abnormally. Finally, disconnection/reconnection occurred.

So, set IEEE80211_CONF_CHANGE_CHANNEL when in_reconfig.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Link: https://patch.msgid.link/20240709073531.30565-1-kevin_yang@realtek.com
Cc: stable@vger.kernel.org
Fixes: 0a44dfc ("wifi: mac80211: simplify non-chanctx drivers")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 19b815e)

BUG=b:366169724
TEST=Merge patch from upstream

Signed-off-by: Linux Patches Robot <linux-patches-robot@chromeos-missing-patches.google.com.iam.gserviceaccount.com>
Change-Id: Id17c04f6fe4b3b92c95c0a1d4070266df174c6f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5902847
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
Linux Patches Robot and others added 2 commits June 16, 2026 13:54
Check for missing VHT Capabilities and VHT Operation elements in
association response frame only for 5 GHz links.

Fixes: 310c838 ("wifi: mac80211: clean up connection process")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240827103920.dd711282d543.Iaba245cebc52209b0499d5bab7d8a8ef1df9dd65@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 67bb124)

BUG=b:366169724
TEST=Merge patch from upstream

Signed-off-by: Linux Patches Robot <linux-patches-robot@chromeos-missing-patches.google.com.iam.gserviceaccount.com>
Change-Id: I9ef728fa69666d4722c6962199bae2045434bbfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5898309
Tested-by: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Jintao Lin <jintaolin@chromium.org>
Reviewed-by: Jintao Lin <jintaolin@chromium.org>
Signed-off-by: goutongchen <goutongchen@uniontech.com>
[ Upstream commit ea92854 ]

The element data length check did not account for the extra
octet used for the extension ID. Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250907115109.8da0012e2286.I8c0c69a0011f7153c13b365b14dfef48cfe7c3e3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 9406ec01a077082649f28392936144f962a90c08)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @gtc199389, your pull request is larger than the review limit of 150000 diff characters

@deepin-ci-robot

Copy link
Copy Markdown

Hi @gtc199389. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign opsiff for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is part of a multi-patch sync of the MediaTek WiFi driver stack from chromeos-kernel-6.6 into the 6.6.y tree, and it also carries broader mac80211/cfg80211 API and internal refactors needed by the updated driver code (e.g., scan-width removal, channel request plumbing, and chanctx emulation helpers), plus a small KUnit test addition.

Changes:

  • Remove scan_width plumbing from cfg80211 scan/BSS reporting paths and stop exporting it to userspace.
  • Refactor mac80211 channel configuration to use struct ieee80211_chan_req and new connection settings (mode/bw_limit), including chanctx emulation helpers for older drivers.
  • Add mac80211 KUnit test scaffolding and an element-parsing test for MLE defragmentation.

Reviewed changes

Copilot reviewed 95 out of 96 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
net/wireless/util.c Adjust ieee80211_mandatory_rates() signature and add exported IE fragmentation helper.
net/wireless/trace.h Remove trace field/logging for deprecated scan_width.
net/wireless/scan.c Remove scan_width from BSS combine/channel selection paths and extend ML element IE generation.
net/wireless/nl80211.c Stop sending NL80211_BSS_CHAN_WIDTH and improve extack error reporting for MLO association.
net/wireless/mesh.c Update mesh join to new ieee80211_mandatory_rates() API.
net/mac80211/vht.c Switch link channel accessors to chanreq.oper.
net/mac80211/util.c Introduce connection settings model, parse-mode filtering, and export parser for KUnit; update HE cap builder API.
net/mac80211/tx.c Minor refactor of mandatory rate selection and remove _oper_chandef fallback in monitor xmit.
net/mac80211/trace.h Update tracepoints to use chanreq.oper.
net/mac80211/tests/module.c Add KUnit module boilerplate for mac80211 tests.
net/mac80211/tests/Makefile Add KUnit test build rules.
net/mac80211/tests/elems.c Add KUnit test validating MLE fragmentation/defragmentation.
net/mac80211/tdls.c Update TDLS code to use chanreq.oper and new conn settings semantics.
net/mac80211/spectmgmt.c Refactor CSA parsing to use ieee80211_conn_settings and bandwidth indication IE.
net/mac80211/scan.c Remove scan-width usage; switch channel config calls to ieee80211_hw_conf_chan() and emulate-chanctx gating.
net/mac80211/rate.c Update rate control bandwidth/band references to chanreq.oper.
net/mac80211/offchannel.c Replace use_chanctx checks with emulate_chanctx checks and use ieee80211_hw_conf_chan().
net/mac80211/ocb.c Update mandatory rates call and switch to ieee80211_chan_req for channel use.
net/mac80211/mesh.c Update mesh channel/bandwidth accesses to chanreq.oper and CSA parsing to new conn settings.
net/mac80211/mesh_plink.c Use chanreq.oper.width for HT protection decisions.
net/mac80211/Makefile Always include tests/ subdir (objects still gated by Kconfig).
net/mac80211/main.c Add chanctx emulation plumbing and new hw channel config helpers; replace use_chanctx with emulate_chanctx.
net/mac80211/link.c Pass chanreq into ieee80211_link_use_channel().
net/mac80211/Kconfig Add MAC80211_KUNIT_TEST Kconfig option.
net/mac80211/iface.c Use chanreq.oper for CAC handling; initialize HW config on first interface open; use monitor_chanreq.
net/mac80211/ieee80211_i.h Replace conn flags with ieee80211_conn_settings; add ieee80211_chan_req; rework chanctx/CSA/reservation structs; add parser mode.
net/mac80211/ibss.c Replace scan-width usage and switch channel use to ieee80211_chan_req; update CSA parsing to new conn settings.
net/mac80211/ht.c Switch bandwidth reads to chanreq.oper.width.
net/mac80211/debugfs.c Add debugfs flag name for DISALLOW_PUNCTURING.
net/mac80211/debug.h Add _link_id_dbg() helper and mlme_link_id_dbg() macro.
net/mac80211/chan.c Convert chanctx compatibility/reservation logic to ieee80211_chan_req and remove _oper_chandef single-ctx path.
net/mac80211/cfg.c Migrate monitor/AP/mesh/radar/channel-switch operations to ieee80211_chan_req and updated channel config model.
include/uapi/linux/nl80211.h Mark NL80211_BSS_CHAN_WIDTH as no longer used in docs.
include/net/mac80211.h Add struct ieee80211_chan_req, new hw flag, and export chanctx emulation helpers for older drivers.
include/net/cfg80211.h Remove scan-width from scan/BSS structs and helpers; update mandatory rates prototype; add per-link assoc error field.
include/linux/ieee80211.h Add bandwidth indication IE definitions and size checker; add EID enum value.
drivers/staging/vt6656/main_usb.c Update bss_conf channel access and enable chanctx emulation ops.
drivers/staging/vt6655/device_main.c Update bss_conf channel access and enable chanctx emulation ops.
drivers/net/wireless/zydas/zd1211rw/zd_mac.c Enable chanctx emulation ops.
drivers/net/wireless/virtual/mac80211_hwsim.c Enable chanctx emulation ops.
drivers/net/wireless/ti/wlcore/main.c Switch chandef access to chanreq.oper.
drivers/net/wireless/ti/wl1251/main.c Enable chanctx emulation ops.
drivers/net/wireless/st/cw1200/main.c Enable chanctx emulation ops.
drivers/net/wireless/silabs/wfx/sta.c Switch chandef access to chanreq.oper.
drivers/net/wireless/rsi/rsi_91x_mac80211.c Switch chandef access to chanreq.oper and enable chanctx emulation ops.
drivers/net/wireless/realtek/rtw89/mac.c Switch chandef access to chanreq.oper.
drivers/net/wireless/realtek/rtw89/core.c Switch chandef access to chanreq.oper.
drivers/net/wireless/realtek/rtlwifi/core.c Enable chanctx emulation ops.
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c Enable chanctx emulation ops.
drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c Enable chanctx emulation ops.
drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt73usb.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt61pci.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2800usb.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2800soc.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2800pci.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2500usb.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2500pci.c Enable chanctx emulation ops.
drivers/net/wireless/ralink/rt2x00/rt2400pci.c Enable chanctx emulation ops.
drivers/net/wireless/purelifi/plfxlc/mac.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt7601u/main.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt7996/main.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt792x_core.c Switch no-CNM case to use chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c Switch chandef access to chanreq.oper.
drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c Enable chanctx emulation ops.
drivers/net/wireless/mediatek/mt76/mt7603/main.c Enable chanctx emulation ops.
drivers/net/wireless/marvell/mwl8k.c Enable chanctx emulation ops.
drivers/net/wireless/marvell/libertas_tf/main.c Enable chanctx emulation ops.
drivers/net/wireless/intersil/p54/main.c Enable chanctx emulation ops.
drivers/net/wireless/intel/iwlwifi/mvm/tx.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/sta.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/ops.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c Switch chandef access to chanreq.oper.
drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c Enable chanctx emulation ops.
drivers/net/wireless/intel/iwlegacy/4965-mac.c Enable chanctx emulation ops.
drivers/net/wireless/intel/iwlegacy/3945-mac.c Enable chanctx emulation ops.
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c Enable chanctx emulation ops.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c Remove scan_width initialization in BSS inform path.
drivers/net/wireless/broadcom/b43legacy/main.c Enable chanctx emulation ops.
drivers/net/wireless/broadcom/b43/main.c Enable chanctx emulation ops.
drivers/net/wireless/atmel/at76c50x-usb.c Enable chanctx emulation ops.
drivers/net/wireless/ath/wil6210/wmi.c Remove scan_width initialization in BSS inform paths.
drivers/net/wireless/ath/wcn36xx/main.c Enable chanctx emulation ops.
drivers/net/wireless/ath/carl9170/main.c Enable chanctx emulation ops.
drivers/net/wireless/ath/ath9k/main.c Enable chanctx emulation ops.
drivers/net/wireless/ath/ath9k/htc_drv_main.c Enable chanctx emulation ops.
drivers/net/wireless/ath/ath5k/mac80211-ops.c Enable chanctx emulation ops.
drivers/net/wireless/ath/ar5523/ar5523.c Enable chanctx emulation ops.
drivers/net/wireless/admtek/adm8211.c Enable chanctx emulation ops.
Comments suppressed due to low confidence (1)

net/mac80211/cfg.c:1378

  • ieee80211_link_use_channel() requires local->mtx to be held (lockdep assert in ieee80211_link_use_channel()), but this function currently calls it without locking and then unconditionally calls mutex_unlock(&local->mtx). This will trigger lockdep and can also lead to an unlocked mutex / data races when starting an AP.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/mac80211/cfg.c
Comment on lines +930 to +934
ieee80211_link_release_channel(&sdata->deflink);
ret = ieee80211_link_use_channel(&sdata->deflink, &chanreq,
IEEE80211_CHANCTX_EXCLUSIVE);
if (ret)
return ret;
Comment thread net/mac80211/Kconfig
Comment on lines +60 to +66
config MAC80211_KUNIT_TEST
tristate "KUnit tests for mac80211" if !KUNIT_ALL_TESTS
depends on KUNIT
depends on MAC80211
default KUNIT_ALL_TESTS
depends on !KERNEL_6_2
help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants