diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-01-29 21:34:47 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-02-08 15:07:38 +0300 |
commit | 8f251a0a1566e3e1da0f1d9322c8ffae808a7509 (patch) | |
tree | 10fef1e9013c21821b8135183245c1672bda3948 /net/mac80211/util.c | |
parent | b9d908dc3a294d25c7d6c2f54ca3987cbd98f040 (diff) | |
download | linux-8f251a0a1566e3e1da0f1d9322c8ffae808a7509.tar.xz |
wifi: cfg80211: simplify cfg80211_chandef_compatible()
Simplify cfg80211_chandef_compatible() a bit by switching
c1 and c2 around so that c1 is always the narrower one
(once they're not identical or narrow/S1G). Then we can
just check the various primary channels and exit with the
wider one (c2), or NULL.
Also refactor the primary 40/80/160 function to not have
all the calculations hard-coded, and use a wrapper around
it to check primary 40/80/160 compatibility.
While at it, add some kunit tests for this functionality.
Also expose the new cfg80211_chandef_primary_freq() to
drivers, mac80211 will use it.
Link: https://msgid.link/20240129194108.be3e6eccaba3.I8399c2ff1435d7378e5837794cb5aa6dd2ee1416@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
0 files changed, 0 insertions, 0 deletions