Commit graph

291956 commits

Author SHA1 Message Date
Michael Tuexen
ccd9c1ef4e icmp: use per rate limit randomized jitter
Using the same random jitter for multiple rate limits allows an
attacker to use one rate limiter to figure out the current jitter
and then use this knowledge to de-randomize the other rate limiters.
This can be mitigated by using a separate randomized jitter for each
rate limiter.
This issue was reported as issue number 10 in Keyu Man et al.:
SCAD: Towards a Universal and Automated Network Side-Channel
Vulnerability Detection

Reviewed by:		rrs, Peter Lei, glebius
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48804

(cherry picked from commit 923c223f27e792e51ca13c476428adbbf6887551)
2025-02-12 11:04:10 +01:00
Jose Luis Duran
f7393d2892
mtree: Add missing ossl-modules entry
Reviewed by:	imp
Approved by:	emaste (mentor)
Fixes:	b077aed33b ("Merge OpenSSL 3.0.9")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48837

(cherry picked from commit 16197cf147e98c2ffc0250f8b71f0fa485c03ecc)
2025-02-12 01:37:27 +00:00
Jose Luis Duran
abada75ea8
mtree: Add missing libxo/encoder path
Reviewed by:	imp
Approved by:	emaste (mentor)
Fixes:	d1a0d267b7 ("Upgrade libxo to 0.4.5.")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48836

(cherry picked from commit d10deaea12adb73a698d907a148f081c402d5dd6)
2025-02-12 01:37:09 +00:00
Jose Luis Duran
911d0089d0
mk: Move vm stack test debug symbols
Avoid the creation of a /usr/tests/sys/vm/stack/.debug directory by
placing sys/vm/stack test debug symbols under /usr/lib/debug.

Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48796

(cherry picked from commit 88d448ec815c1fda27be94846f88ccd96251febd)
(cherry picked from commit 955f974a1a37cf3ae8b241327b1fef74c8932855)
2025-02-12 01:36:34 +00:00
Jose Luis Duran
f9e98800af
libopencsd: Remove extra slashes
Remove extra slashes that end up in the metalog.  These double slashes
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

    ./base/aaa type=dir
    ./base//aaa/bbb type=dir

If sorted, would turn out:

    ./base//aaa/bbb type=dir
    ./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:	imp, emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48779

(cherry picked from commit bccaf0262dcab84be49c42cc6b7a81c279c44b62)
2025-02-12 01:33:35 +00:00
Jose Luis Duran
ac74f9a654
csu tests: Remove extra slash
Remove an extra slash that ends up in the metalog.  This double slash
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.

For example, consider the following metalog excerpt:

    ./base/aaa type=dir
    ./base//aaa/bbb type=dir

If sorted, would turn out:

    ./base//aaa/bbb type=dir
    ./base/aaa type=dir

Apparently missing the ./base/aaa directory in the specification.

Luckily here are no subdirectories.

Reviewed by:	imp, emaste
Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48778

(cherry picked from commit 841856570e7b623c4f1283939936ffa005d2fcf4)
2025-02-12 01:33:15 +00:00
Jose Luis Duran
e58d9b71f3
nanobsd: Always define the partition index
Print the desired partition index together with the starting LBA and the
size. Otherwise, when only one code partition is desired, the
configuration partition (/cfg) may not end up in the third slice, thus
breaking the scripts that expect it there.

This was the previous approach, changed in 587c054bea ("nanobsd: Use
gpart and create code image before full disk image").

Fix it by printing the index as the last column to reduce the chances of
breaking current overrides, and using it as the gpart index.

PR:		262098
Reviewed by:	imp
Approved by:	emaste (mentor)
Fixes:	587c054bea ("nanobsd: Use gpart and create code image before full disk image")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47835

(cherry picked from commit dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d)
2025-02-12 01:32:12 +00:00
Ed Maste
916ee8225f contrib: Remove now-unused cortex-strings
Replaced by arm-optimized-routines in commit 2e8ff4d1d5 ("Switch to
Arm Optimized Routines for mem* & str*").

Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48500

(cherry picked from commit 4a7d6666c5ddd135b2023b4b3b4962770ff2e73b)
2025-02-11 16:30:59 -05:00
Ed Maste
90702fb5de install: Fix METALOG ouptut for numeric -o and -g args
install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.

If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.

Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode.  We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.

PR:		284119
Reviewed by:	jlduran
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48504

(cherry picked from commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f)
2025-02-11 16:27:17 -05:00
Kristof Provost
8921c82b76 carp: don't unintentionally revert to multicast mode
PR:		284140
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit af33f86e6aef6b15c8aa3da615167272aa7a3ee3)
2025-02-11 17:52:42 +01:00
Juraj Lutter
860d98fc6d periodic: set _localbase for periodic scripts from within periodic.conf
Set _localbase variable from within /etc/defaults/periodic.conf
for use by periodic scripts.

This fixes e5d7100c09, no other functional changes intended.

Reported by:		gahr, otis
Reviewed by:		markj, gahr
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D47486

(cherry picked from commit c8b89c11a1181e900acb638cfde7a55e92553175)
2025-02-11 14:47:28 +01:00
Konstantin Belousov
cba91bf59c unlink, rmdir: call notify_upper from VOP pre method instead of syscall
PR:	254210

(cherry picked from commit 1a0cb938f7b461edc40316cb44a80438df674174)
2025-02-11 03:11:49 +02:00
Kevin Bowling
50202e05a3 net: if_media for 100BASE-BX
d82c3e81:
net: if_media for 100BASE-BX

Renumber 1000BASE-BX and add 100BASE-BX sequentially

I added this 1000BASE-BX in 78c63ed260fa20b3500aedfe41dc0dcae9593f51 but
did not connect it to any code yet, appologize for the churn.

7835a4ad:
net: if_media fix syntax/build

Fixes:		d82c3e815a5f ("net: if_media for 100BASE-BX")

(cherry picked from commit d82c3e815a5fc0069562b69145ad695f9aa183f9)
(cherry picked from commit 7835a4ad6948290c92ea55c7be34ae72f4e2b0bd)
2025-02-10 17:48:35 -07:00
Bjoern A. Zeeb
51b3a9dacf lindebugfs: use __func__ not __FUNCTION__
Change to the C99 version and not the old gcc name.
No functional changes.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D48736

(cherry picked from commit 94e6c8d7d19de68b29233e59c85b16c645c1a872)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
8552e8de6d contrib/wpa: pass IFM_IEEE80211_VHT5G if vht_enabled on the channel
Set media mode correctly to IFM_IEEE80211_VHT5G if vht_enabled is set
on the channel.  Otherwise we'll end up setting 11NA.
Not a problem on first sight given net80211 does the upgrade to VHT
for us.  But we would not set iv_des_mode ("desired mode") on the vap.
Setting this will put a contraint on/help scanning for our desired
(VHT) channels to my understanding of the code.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	cy, adrian
Differential Revision:	https://reviews.freebsd.org/D35978

(cherry picked from commit a0e45db6f6eb6660e78921bbd5307fa7fc13d0a9)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
4f9bec61d8 ifconfig: make -vht work
Also hide the other vht options on -vht and only show vht40/80/160/80p80
when vht is enabled.

While here fix some whitespace and comments.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48326

(cherry picked from commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
054c043b0a ifconfig: 802.11: fix indentation of a line
No functional changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit cf71349a23f02b55bd3bb4973decac87f7a7d2b8)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
1b5e1d919f ifconfig: remove debug printfs from set80211vhtconf()
Anyone testing VHT options would wonder about these extra two printfs
by now.  Remove them from the tree before I have to do so locally again
in another branch.

Sponsored by:	The FreeBSD Foundation
Fixes:		e9bb7f9aa1
Reviewed by:	adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48319

(cherry picked from commit 91a4107d6d3028acd96df96de33b8a7665d3eb03)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
9bb63440a2 lib80211: regdomain: add the two other 160MHz bands
ETSI had one 160Mhz band in regdomain but the other two were missing.
Add them.  I am always confused that the bands use the center frequency
of the 20Mhz edge channels rather than the actual edges so it seems we
are only configuring 140Mhz instead of 160Mhz.

We will have to go through the entire regdomain file one
day and make sure to verify all the power levels.

Sponsored by:	The FreeSBD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48356

(cherry picked from commit a3a308f0f29b14d522c56dd88231e27fdf206104)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
0735e8ddc3 rtw88/rtw89: avoid duplicate top-level directory with debugfs
If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.

Sponsored by:	The FreeBSD Foundation
X-Note:		ath1[01]k and mt76 likely will need a similar change

(cherry picked from commit b4886c4ece3e692c294aa853da7aec849f8d00a2)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
9689622f98 rtw88/rtw89: add module_param to enable/disable HT/VHT and EHT
In order to better test HT and VHT support with LinuxKPI add (tunable)
options disabled by default to on-demand enable HT/VHT
and for rtw89 also EHT.

It is expected that we will remove this FreeBSD-specific code again in
the future.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7a5b55e3b448744b099c274763992cba2e3ebce5)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
be330cd9f9 rtw89: turn on debugfs support
Following 07f6575585bf also turn on debugfs support for rtw89.

Sponnsored by:	The FreeBSD Foundation

(cherry picked from commit 446eab491e523e3d7586e11cb16448e524297da4)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
787787fa89 iwlwifi: module correct -DCONFIG_*
Remove the =1 from -DCONFIG_* in the conditional cases.
They are not needed.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 411c857b4ccedd6491dff9a35e952bc49d053053)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
bd42a25673 LinuxKPI: 802.11: turn on debugfs for iwlwifi and rtw88
Make iwlwifi compile with debugfs after the last updates and turn it on
for both iwlwifi and rtw88 in order to be able to get at least some
useful information on driver/firwmare state.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 07f6575585bf69ae48dffe87c4578057ae4782d8)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
fde943a07e LinuxKPI: 802.11: remove rate_lowest_index()
rate_lowest_index() is no longer used anywhere in our code.
Garbage collect it.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1b840f09b6b379c0aae5a558ba5a4ed6bb571a85)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
6d24089732 LinuxKPI; 802.11 initalize ic_vht_cap.supp_mcs
Given the channel struct has an extra bool we cannot assign the
information 1:1 to net80211.  While the caps where assigned the
suppoerted mcs sets were not.  Fix that.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ecb2e5f9c30a8c0ae491d07b2300e37eb599c298)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
1a7956f64b LinuxKPI: 802.11: implement ieee80211_get_{he,eht}_iftype_cap{,_vif}
Implement the combination of all four functions, the *_vif versions
from mac80211.h as a wrapper to the non-*_vif ones in cfg80211.h.
Put the function pairs next to each other and in the right files
and harmonize argument naming, etc.

Both of them have shown up too often in the todo-tracing to bother
enough to implement them now for a time in the future when we will
support HE/EHT.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c75a558d0729da87ee3c016b57cc8f5ac4fc65d0)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
706c18c8b6 LinuxKPI: 802.11: improve the IMPROVE_HT() macro
Let the macro take a format string and arguments and
add __func__, __LINE__ to the output.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4cdb785bbd7e26cc3f2ed0bb4e5cf7ea83c400b)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
08e6f5e449 LinuxKPI: 802.11: add a print mask for ieee80211_rx_status_flags bits
Add a print mask for use with %b to aid debugging.  It is a lot easier
to read names than numbers.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f1aeb5d850cf26418fb70a16d1304b92c45b5f1d)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
69aeb770a9 LinuxKPI: 802.11: implement wiphy_{,un}lock()
This will help us to get minimally better lock coverage in iwlwifi
though not yet against the LinuxKPI implementation which will likely
switch to this in the future.  At least the TODO() logging noise is
out of the way.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 95a7aa8009877ca95d81967f9af568ef832bb565)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
950dc789cc LinuxKPI: 802.11: make HT compile again
Bring in changes missed during the last driver updates to make HT
compile when enabled.

Sponsored by:	The FreeBSD Foundation
Fixes:		7b43f4d064195

(cherry picked from commit 943a19c666d67424cdde6cbcd096f28359b2d314)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
4eaf978df5 net80211: add IEEE80211_IS_LOCKED()
When trying to sort out a teardown locking problem (downcall in the
driver can sleep) I found that the fan-out tree was getting too big
to fix net80211 locking per-se for this while working on entirely
different problems.
Add IEEE80211_IS_LOCKED() so the driver can check and un-/re-lock as
necessary (as we do in other cases already) to avoid panics on
debug kernels left and right.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48475

(cherry picked from commit 054c5ddf587a7a0c430cf64dbf100b718eafdcc5)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
4d027e53be net80211: (v)ht: use macros at hand
Rather than duplicating the manual logic here and leaving a comment,
use the self-explanatory macros we already have.

No functional changes intended.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48359

(cherry picked from commit 5fdc4824a5e2646a07c0638eca9f5c81b0b85fd5)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
b7be66e4e8 net80211: add missing 80Mhz and 160Mhz channel ranges
We have two arrays, one for 80Mhz and one for 160Mhz.  Both were lacking
frequency ranges for more possibly available configurations (the other
bits of what is valid are for regdomain to set right).

Sponsored by:	The FreeBSD Foundation
Fixes:		67f4aa3878, 04e7bb08a5
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48357

(cherry picked from commit 1832eb102e10c7f2891c032ecf7b265b75d3cd50)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
594d6c7141 net80211: correct typo s/Insure/Ensure/
No functional changes.

Sposnored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D48358

(cherry picked from commit e6d40f90110ad8026f1af3fa68f836463936ea78)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
1a083d59b6 net80211: HT: check for feature support in ht_recv_action_ht_txchwidth()
ht_recv_action_ht_txchwidth() can blindly change the channel width to
40 Mhz whether or not that is supported.  If 20/40 is not supported
there is nothing to do as the channel width cannot change in that case.

While here mark unused arguments with __unused.

Sponosred by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47857

(cherry picked from commit 30e8252353d95cc77f787ef784942a551d3e0567)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
1a472e9357 net80211: HT: add missing bit descriptions for IEEE80211_AGGR_BITS
The print mask for IEEE80211_AGGR_BITS is missing three fields.
Add them for completness.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47858

(cherry picked from commit 8437d7d6a4d6827ccb78c06341c6e3d847da44dd)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
c5978cd3e4 net80211 / LinuxKPI 802.11: use enum ieee80211_sta_rx_bw for ni_chw
net80211 node ni_chw currently encodes the channel width as Mhz number.
LinuxKPI 802.11 uses enum ieee80211_sta_rx_bw for the same.

Rather than keeping the "20" and "40" throughout the code (eventually
expanded to 80/160/320) switch them over to use the enum throughout.

Once we get to 320Mhz channel widths we would otherwise also need to
extend the uint8_t in struct ieee80211_node; making
enum ieee80211_sta_rx_bw __packed allows us for lots more channel
widths without breaking the KBI.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47891

(cherry picked from commit ca389486a9599768e0ba69dca13c208020623083)
(cherry picked from commit 2c8b0d6205f6f98855773e3a82640b50abb2f2f6)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
36ace2a923 net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage
if STBC will be allowed for VHT RX/TX.
For RX this will only allow us to turn it off but no fine grained
control of the number of supported spatial streams.

Introduce IEEE80211_FVHT_CHANWIDTH_MASK as a helper to make the
spelling out of the IEEE80211_FVHT_MASK more readable.

Update ifconfig to allow setting of these flags.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47838

(cherry picked from commit 243f6925bf818a64f3c996c6a89fec6c8a6ff058)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
b6d4dc0b30 net80211: name IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_{NONE -> NO160}
IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE is confusing as the field does
indicate that the STA does not support 160 (or 80+80) Mhz.
[802.11ac: Table 8-183v-Subfields of the VHT Capabilities Info field]
All the other bits are related to the support of 160Mhz so make it
clear that it does not mean that we do not support any VHT CHAN WIDTH
but merely do not support the optional 160/80+80.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47837

(cherry picked from commit 116102101a566ec8924b397c1523d362008fb35c)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
e7f6461837 net80211: add missing reference for struct ieee80211_vht_mcs_info
Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47836

(cherry picked from commit 4294f1cac15300046369d7e464ce96363839757c)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
25017e9971 LinuxKPI: firmware: change order filenames trying to load firmware
Given we have the support in main and stable/14 to load plain firmware
files from /boot/firmware/ make use of that.  Switch the order to
try the original unmangled filename and path first before trying any
replacements.
This reduces time and console noise (especially under bootverbose).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D47682

(cherry picked from commit 30d2f84ef2cba12c67c62a9fe4e1d8e22cf27bf9)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
e6698f0614 rtw89: update Realtek's rtw89 driver.
This adds support for the Realtek 8922AE PCI
wireless network (Wi-Fi 7) adapter.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
3de0d1929d rtw88: update Realtek's rtw88 driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 11c53278a8a3e86e14377f09bbaa7bad193d3713)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
1ff77e61c6 iwlwifi: avoid (hard) hang on loading module
For certain users or chipsets (reports were for CNVi devices but
we are not sure if this is limited or specific to them) loading
if_iwlwifi hangs.

The reason for this is that a SYSINIT (module_load_order()) has not
yet run in this case and the Linux driver tries to load the
chipsets-specific module.  On FreeBSD all supported sub-modules are
part of if_iwlwifi so we do not have to load them separately but
calling into kern_kldload via LinuxKPI request_module while loading
the module gives us a hard hang.

iwlwifi calls request_module_nowait() so we can simply skip over this
and continue and the SYSINIT will do the job later if no other
dependencies fail.

Sponsored by:	The FreeBSD Foundation
PR:		282789
Tested by:	Ruslan Makhmatkhanov, Pete Wright
Differential Revision: https://reviews.freebsd.org/D47994

(cherry picked from commit 87e140a5c6f89eea7ea6320d1ae34566492abfc0)
(cherry picked from commit 5d09d1070737c43738e433b547af1a90c0f10bf1)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
f4e352ef16 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4128aad8503277614f2d214011ef60a19447b83)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
c57e8af7d5 LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89
Bring in the LinuxKPI 802.11 compat bits which are altering
the mac80211 KPI.

* In struct ieee80211_bss_conf chandef -> chanreq.
* Various struct ieee80211_ops gained a link_id arguemnt,
  stop gained a suspend flag.
* Various functions gained a link_id argument.
* ieee80211_tx_status() was renamed to ieee80211_tx_status_skb()

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7b43f4d064195bcf66816cb9fe350a1392fe24ce)
2025-02-10 14:52:06 +00:00
Doug Moore
2ee9d7dcdb libkern: don't use MPASS
Using MPASS in libkern breaks buildworld.  Replace MPASS with KASSERT
in three places.

(cherry picked from commit 08f6f78f81e21b21dd002a9389436b0333cb3488)
2025-02-10 08:16:25 -06:00
Doug Moore
16b7da6f7a dev/mana: replace power2 function
Replace is_power_of_2(length) with power2(length).  When length != 0, as in
this case, they produce the same result.  This will allow an implementation
of is_power_of_two to be dropped.

Reviewed by:	alc, markj
Differential Revision:	https://reviews.freebsd.org/D45536

(cherry picked from commit a94ed493b50752cee09245fc312c63b00331f217)
2025-02-10 04:50:32 -06:00
Doug Moore
7bcc7a0b88 libkern: avoid local var in order_base_2()
order_base_2(n) is implemented with a variable, which keeps it from
being used at file scope. Implement it instead as ilog2(2*n-1), which
produces a different result when 2*n overflows, which appears unlikely
in practice.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D46826

(cherry picked from commit b7cbf741d55468ba34305a14ac3acc1c286af034)
2025-02-10 04:30:05 -06:00