Commit graph

5281 commits

Author SHA1 Message Date
Bjoern A. Zeeb
c8a6676eb6 LinuxKPI: 802.11: crypto pn lengths
Define the last missing PN length and for consistency use them
in struct ieee80211_key_seq (even though a 6 is a 6 is a 6).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-03-18 09:22:00 +00:00
Bjoern A. Zeeb
19df0c5abc LinuxKPI: make __kmalloc() play by the rules
According to Documentation/core-api/dma-api.rst kmalloc() is supposd
to provide physically contiguous memory. [1]

In order to guarantee that allocations are contiguous even if using
PAGE_SIZE or larger check the size and use contigmalloc if needed.
This makes use of 9e6544dd6e (and following) allowing free(9) to
also work for contigmalloced memory.

Sponsored by:	The FreeBSD Foundation
Pointed out by:	jhb [1]
Reviewed by:	jhb, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46656
2025-03-14 16:24:52 +00:00
Bjoern A. Zeeb
a5c7b44d6a LinuxKPI: always use contig allocations in linux_alloc_kmem()
In linux_alloc_kmem() [used by *get_page*()] we always at least allocate
PAGE_SIZE and we want the allocation to be contiguous so it can be passed
to DMA.  Always use kmem_alloc_contig() and only change the low argument
depending on the GFP_DMA32 flag being given or not.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	jhb, dumbbell
Differential Revision: https://reviews.freebsd.org/D46661
2025-03-14 16:24:52 +00:00
Lutz Bichler
ef037a028a linuxkpi: Correct DIV_ROUND_DOWN_ULL
This fixes a black screen issue with the i915 DRM driver from Linux v6.8

Fixes: c4e0746e7d ("LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL.")
Pull request: https://github.com/freebsd/freebsd-src/pull/1612
2025-03-12 13:43:08 -04:00
Alex S
186dc094cf linux: Handle IP_RECVTOS cmsg type
This unbreaks apps using GameNetworkingSockets from Valve.
2025-03-10 11:12:36 -07:00
Alex S
9f55630b8d linux: Fix a typo in linux_recvmsg_common
We are supposed to check the result of bsd_to_linux_sockopt_level here
rather than its input.
2025-03-10 11:12:36 -07:00
Alex S
b9752d5d1c linprocfs: Correct sysfs /proc/<pid>/mountinfo entry
Technically mount source could be an arbitrary string (since it's
effectively ignored), but it's common to repeat fs type there.
2025-03-10 11:12:36 -07:00
Bjoern A. Zeeb
b8dfc3ecf7 LinuxKPI: 802.11: improve key update locking to work around net80211
As indicated in 11db70b605 there was another panic on key removal
which could no longer be reproduced.  As originally assumed the
problem was "hidden" by commit 9763fec11b as mentioned in
11db70b605.
Said commit had logic inverted and 27bf5c405b fixed that and with
that the possible panic came back.

The problem exists because some code paths out of net80211 are
locked while others are not. This opens a possible race in
net80211 which was tracked by extra logging in
(*iv_key_update_begin)() (log lines shortend):
	key_update_begin: tid 100112 vap X nt Y unlocked
	key_update_begin: tid 100133 vap X nt Y locked
One thread can be wpa_supplicant, the other is driven from the
driver net80211 taskq.
Further LinuxKPI needs to unlock (conditionally in case the lock
is held) as a downcall to the driver/FW may sleep.  This opens up
possibilities for said race even further so that we observe it
more reliably.

This all leads to one thread calling down into the driver/firmware
(unlocked) while the other will get to the same place (after acquiring
the wiphy lock) before the nt re-lock happens and thus state checks
did not catch this either.

For LinuxKPI work around the problem utilizing
(*iv_key_update_begin/end)() and taking the wiphy_lock() there
holding it over the entire operation.
Given we still have to conditionally unlock we need to keep track
from _begin to _end on whether we have to re-lock.  The checks for
this need to be done under the wiphy_lock().
While a bool would suffice we use a refcount to make any future
debugging easier.

This isn't the most elegant solution but having the wiphy lock
covering the full operation allows the 2nd thread to later run through
the same code path and find the key gone (which we already checked).
It remains questionable if (*iv_key_update_begin/end)() is the
correct solution (as there are futher callers covering which would
not need the unlock cycle) or if it should be done in the current
code.  The former will allow us to cover a full key store which
we will need in case we will implement suspend/resume beyond what
is done in native drivers/net80211 currently, if we will factor
out the crypto locking for good, and fix the inconsistent locking
of the nt (NODE) lock in net80211.

Alternate solutions were discussed on freebsd-wireless today
(2025-03-06, in the thread "Re: HEADS UP! Do not update on main
currently (panic - on boot)").

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
X-MFC with:	27bf5c405b
Differential Revision: https://reviews.freebsd.org/D49256
2025-03-06 23:02:08 +00:00
SHENGYI HONG
8ee127efb0 vm_lowmem: Fix signature mismatches in vm_lowmem callbacks
This is required for kernel CFI.

Reviewed by:	rrs, jhb, glebius
Differential Revision:	https://reviews.freebsd.org/D49111
2025-03-04 20:18:52 -05:00
Bjoern A. Zeeb
394a9a5b1c net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags
net80211 used MMIC flags for CCMP instead of only for TKIP.
LinuxKPI 802.11 compat code (and later net80211) had a comment about
this.  Given LinuxKPI seems to be the only consumer for these flags
currently outside of net80211 itself, clean them up before implementing
TKIP in LinuxKPI after all and before GCMP comes into the tree.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D49219
2025-03-04 15:56:49 +00:00
Bjoern A. Zeeb
d1a37f280b LinuxKPI: 802.11: remove ieee80211_node_get_txrate_dot11rate()
net80211 ieee80211_node_get_txrate_dot11rate() does not yet support
VHT and that means we get a lot of log lines when doing VHT for a
debugging statement even if it's not active.
Remove the calls to ieee80211_node_get_txrate_dot11rate() as with
hw/fw based rate control (modern iwlwifi) they are pointless anyway
as they are currently.

Sponsored by:	The FreeBSD Foundation
X-MFC:		only if net80211 gets MFCed
Reported by:	J.R. Oldroyd (jr opal.com)
Fixes:		7067450010 (I should have noticed during review)
2025-03-04 15:24:05 +00:00
Adrian Chadd
46de4d9fc2 net80211: change ieee80211_ratectl_rate() to not return a rix
There are only a few places where the returned rix is used:

* linuxkpi - logging
* bwi/bwn - used for finding a fallback rate to choose, which
  honestly should be returned by the ratectl API
* iwm - building the rateset to program into firmware

Everyone else uses the dot11rate value in ni->ni_txnode.

This is a precursor for VHT and later rate support; where currently
there aren't rate tables in ieee80211_phy.c for VHT and later
rates.

Although it's likely doable to add tables for VHT, 11ax and MU-OFDMA
(HE) rates are sufficiently larger/different to just not fit in the
current scheme without more refactoring.

Differential Revision:	https://reviews.freebsd.org/D48603
Reviewed by:	bz, thj
2025-02-26 11:29:36 -08:00
Adrian Chadd
7067450010 sys: convert ni->ni_txrate references use to the new net80211 API
This just mechanically converts things.

* For linuxkpi, it was just used for display.
* For uath, it was just used for display, as firmware
  doesn't report it up.

Differential Revision:	https://reviews.freebsd.org/D48602
Reviewed by:	bz, thj
2025-02-26 11:29:18 -08:00
Bjoern A. Zeeb
2c44f1ff69 LinuxKPI: 802.11: compile in VHT compat code by default
Compile in the VHT compat code by default even though no one will make
use of it yet.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Tested with:	iwlwifi AX210 (NOHT, HT20, HT40, VHT20, VHT40, VHT80)
2025-02-26 02:10:55 +00:00
Bjoern A. Zeeb
3e022a91c9 LinuxKPI: 802.11: ensure to select the correct channel width
If HT is enabled but not using CHW=40 set CHW=20 to make sure we do
not get stuck on any other value.

If VHT and the VHT Operation element Channel Width field is 0
(use 20/40) do not update the bandwidth but stick with what HT selected.
This is better than disabling VHT alltogether for 20/40 and allows us
to work on VHT20 and VHT40 APs it seems.
We will have to do more work to can align with the chanctx or deal with
Operating Mode Notification Action frames in LinuxKPI or net80211.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-26 02:10:55 +00:00
Bjoern A. Zeeb
75d23d8823 LinuxKPI: 802.11: compile in HT compat code by default
Compile in the HT compat code by default even though no one will make
use of it yet.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Tested with:	iwlwifi AX210 (NOHT, HT20 and HT40)
2025-02-26 02:10:55 +00:00
Mark Johnston
b01495caac umtx: Add a helper for unlocked umtxq_busy() calls
This seems like a natural complement to umtxq_unbusy_unlocked().  No
functional change intended.

Reviewed by:	olce, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D49124
2025-02-24 21:34:51 +00:00
Bjoern A. Zeeb
389265e3ca LinuxKPI: 802.11: factor out dynamic_rx_chains computation
For the moment we set dynamic_rx_chains to the rx_nss value which
should be correct given we count from 1 there too and we call
lkpi_get_max_rx_chains() after we synced ht/vht initially already.

Long-term some of these counting bits should be further factored
out into their own functions and used both here and for the sync
code.

This will likely want to change as well once more dyamic
synncronization takes place.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-24 02:56:18 +00:00
Bjoern A. Zeeb
ac2c7271b7 LinuxKPI: 802.11: disable A-MDPU TX for now for LinuxKPI WiFi drivers
Clear IEEE80211_FHT_AMPDU_TX from iv_flags_ht to avoid doing A-MPDU TX.

For Intel we need to support two different variations at least, both
likely needing net80211 surgery first.  The good news is that turning
it off in net80211 will make it work for modern iwlwifi/mvm chipsets/fw.

Realtek will need some mac80211 functions to be implemented at least.
Once we've done all and tested one after the other we can remove this
again.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-24 02:24:34 +00:00
Bjoern A. Zeeb
90d8e307ff LinuxKPI: 802.11: cleanup chanctx freq/width settings
Cleanup chanctx freq1/2 and width settings using the channel from the
net80211 node and the net80211 functions to return the center
frequencies (already doing the math for us or using pre-computed values).

Set the min_def (minimum channel definition) to def (channel definition)
for the moment as it seems to be unused by anything but
iwl_mvm_chanctx_def() to avoid complications.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-24 01:42:31 +00:00
Bjoern A. Zeeb
f9c7a07d7f LinuxKPI: 802.11: synchronize LinuxKPI 802.11 sta from net80211 ni
Have a wrapper function dealing with the synchronization for all the
dfferent standards (HT and VHT currently).
In case HT or VHT is not supported make sure to turn the LinuxKPI
"supported" flag off for that.  Previously if it was on once it would
never be turned off.
For HT and VHT properly compute the NSS and also set the max_amsdu_len
correctly.
Set the NSS directly in the function (which is called in proper order
for this) rather than passing the results back and do the setting in
the caller.  The only thing we need to make sure upfront is that it
remains at least 1 (see f5a58c2da2).  This all makes the caller and
code a tiny bit simpler and work better.

There is more synchronization to be done between the chanctx and the
deflink bandwidth, which needs to happen dynamically in case net80211
decides to change that under us but no native driver seems to properly
implement this (if at all).
HT20-only, HT40, and VHT80 are supposed to work for now at least.
VHT160 and VHT80P80 have further debug work to do as it does not yet
seem to be consistently set in all cases to sync from.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-24 01:32:22 +00:00
Bjoern A. Zeeb
2ab4a41956 LinuxKPI: skbuff: add synchronization primitives and missing bits
Make a pass over skbuff.h:
- implement some missing bits,
- sprinkle some const,
- add locking and read/write_once calls as needed to provide
  synchronization as expected by Linux,
- fix some typos,
- remove return from void functions,
- adjust tracing macros.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR:		283903 (rtw88 skb leak)
Tested by:	Guillaume Outters (guillaume-freebsd outters.eu)
Differential Revision: https://reviews.freebsd.org/D49101
2025-02-23 23:25:32 +00:00
Bjoern A. Zeeb
65c573e47c LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop()
net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)().
Make use of 054c5ddf58 and conditionally check if the caller
locked or not and if locked temporary drop the lock to avoid sleeping
on a non-sleepaable lock during the downcall into the driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-23 00:36:50 +00:00
Bjoern A. Zeeb
72ee3d57f3 LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates
ieee80211_sta_recalc_aggregates() shows up in TODO traces but there is
nothing we have to do there until we have active links (MLO support).
Make the TODO conditional for a time when we will get there.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-22 23:31:46 +00:00
Bjoern A. Zeeb
a6994e208c LinuxKPI: rather than manually defining a value use the net80211 define
Define cfg80211 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to
net80211 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK.

We should likely at some point make a sweep and replace all the
values with the defines from the comments for the matching net80211
version.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-22 23:25:35 +00:00
Bjoern A. Zeeb
73cd1c5d44 LinuxKPI: 802.11: add further checks for deflink.supp_rates[]
When setting the per-band supp_rates bitfield check for mandatory
rates only.  We cannot easily say at that point for 2Ghz whether
11g is supported so assume these days it is not pure-b.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-22 23:16:25 +00:00
Bjoern A. Zeeb
1f73e0ed53 LinuxKPI: 802.11: use net80211 macro instead of manual check
Use IEEE80211_CONF_VHT() instead of manually checking if hardware
supports VHT.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-22 22:22:14 +00:00
Bjoern A. Zeeb
11450726d3 LinuxKPI: 802.11: improve cfg80211_chandef_create()
Implement cfg80211_chandef_create() to work with HT.  Update enum
with HT channel types.  When calling the function from LinuxKPI 802.11
code, pass in NL80211_CHAN_HT20 if HT is supported rather than NO_HT.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-22 22:18:51 +00:00
Jean-Sébastien Pédron
05dfaadde4
linuxkpi: Add shrinker_alloc() and shrinker_free()
They are used by the DRM drivers in Linux 6.7.

Bump `FreeBSD_version` because external drivers that use `struct
shrinker` will have to be recompiled.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48747
2025-02-19 21:39:46 +01:00
Jean-Sébastien Pédron
1396a7316f
linuxkpi: Print "TODO" if a driver call pci_wake_from_d3()
This helps developers working with linuxkpi find out a function is
already defined but is just a stub.

Reported by:	bz
Reviewed by:	bz, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48862
2025-02-19 21:39:46 +01:00
Jean-Sébastien Pédron
dec2806f96
linuxkpi: Define PCI_IRQ_LEGACY for Linux < 6.10
Commit 03e39d3d42 decreased the Linux
version that exposes this constant to be Linux 6.7. It happens that the
constant is older.

However, it is removed in Linux 6.10. Let's change the version condition
to say that it is defined for any version before 6.10.

Reported by:	bz
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48861
2025-02-19 21:39:46 +01:00
Jean-Sébastien Pédron
585cdb74f4
linuxkpi: Defaults to get_file_rcu() version from Linux 6.7
To use the old version, one has to explicitly set `LINUXKPI_VERSION` to
the expected version of Linux KPI.

Reported by:	bz
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48860
2025-02-19 21:39:46 +01:00
Bjoern A. Zeeb
1432e0f20c LinuxKPI: 802.11: remove a blank between ltxq-> stopped
No functional changes.

Sponsored by:	The FreeBSD Foundation
Fixes:		bcf1d8ee35
MFC after:	1 days
X-MFC with:	bcf1d8ee35
2025-02-19 12:22:41 +00:00
Bjoern A. Zeeb
a8f735a661 LinuxKPI: 802.11: switch vif station list to a linux list
We ran into problems with locking the VIF for the lsta tailq on and
off.  Switch from a native tailq to the LinuxKPI list.
This allows us to implement the "rcu" part in
linuxkpi_ieee80211_iterate_keys() which we could not before.
Further using either rcu or the wiphy lock we no longer run into
problems with the lock not being sleepable.
The last case was rtw89 debugfs which was doing a sleepable alloc
in the iterator callback of linuxkpi_ieee80211_iterate_stations_atomic().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-19 12:16:15 +00:00
Bjoern A. Zeeb
12a511c844 LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly
Rather than just printing the cipher suite as uint32_t hex
(or split into OUI and number) also print a short name.

iwlwifi(4), for example, now prints on startup with HW_CRYPTO on:
unsupported WLAN Cipher Suite 0x000fac | 8 (GCMP)
unsupported WLAN Cipher Suite 0x000fac | 9 (GCMP_256)
unsupported WLAN Cipher Suite 0x000fac | 6 (AES_CMAC)
unsupported WLAN Cipher Suite 0x000fac | 11 (BIP_GMAC_128)
unsupported WLAN Cipher Suite 0x000fac | 12 (BIP_GMAC_256)

Likewise _lkpi_iv_key_set() would now print:
iwlwifi0: _lkpi_iv_key_set: CIPHER SUITE 0xfac02 (TKIP) not supported

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-19 12:11:02 +00:00
Bjoern A. Zeeb
11db70b605 LinuxKPI: 802.11: hardware crypto offload improvements
Implement mac80211 functions ieee80211_iter_keys[_rcu](), and
ieee80211_get_key_rx_seq() (*).
Implement an internal function lkpi_sta_del_keys() to delete keys
when we are leaving RUN (AUTHORIZED) state.
Improve and make work (*) the net80211 vap function pointers
(*iv_key_set)(), (*iv_key_delete)() implementations.
Correct the logic in lkpi_80211_txq_tx_one() and factor most crypto
related bits out into lkpi_hw_crypto_prepare() (*).

(*) We are currently supporting CCMP only.  I would hope we will
not have to do full WEP/TKIP support anymore given both are deprecated.

The entire logic remains behind the LKPI_80211_HW_CRYPTO pre-processor
condition and with this commit in addition behind a tunable.
The code is compiled in by default now but the tunable remains off until
wider testing has shown no problems.
I have seen one net80211 triggered panic on shutdown related to deleting
keys which I cannot reproduce anymore and could have been fixed by
9763fec11b83; otherwise we will have to investigate as it shows again.
The dedicated hw crypto tracing option can help in that case with debug
kernels.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Fixes:		b35f6cd066
2025-02-18 02:54:33 +00:00
Bjoern A. Zeeb
408394185f LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl
Implement the mac80211 (*sta_statistics) to obtain station statistics.
Fix up struct station_info for that.
Add supporting funtions to decode station_info and rate_info_bw fields
to make the output more usable to human beings.

Add a per-VIF (VAP) sysctl to export that information.  This is mostly
used for now to see what the driver/fw thinks about its TX rate.
We should later gather this information in different ways and pass it
to net80211 to export it to user space so we can finally have nice
station information (also for the non-AP side).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-17 01:37:30 +00:00
Bjoern A. Zeeb
bcf1d8ee35 LinuxKPI: 802.11/skb: add extra information for skb alloc failures
rtw88 seems to have an skb leak still.

Add a WARN_ONCE to __skb_queue_purge() just to make sure there is no
glitch due to missing locking.

Also add a rolling error reporting for skb allocation failures in
LinuxKPI to gather some more information if possible about queue
states.

This is a corrected version of what was initially part of D48474.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-16 23:04:24 +00:00
Bjoern A. Zeeb
d2407a21bd LinuxKPI: 802.11: ieee80211_vif_usable_links()
ieee80211_vif_usable_links() shows up in TODO() tracking.
Turns out the return (1) is likely wrong and should be 0 given we do
not support MLD yet.  For now return the valid_links bitmap and leave
an IMPROVE as likely not all of the valid ones will be useable.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-16 22:45:33 +00:00
Bjoern A. Zeeb
a7c19b8a99 LinuxKPI; 802.11: start implementing cfg80211_calculate_bitrate()
For now we only return the legacy rate and have two TODOs for HT and
VHT which still need to be implemented as needed.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-16 22:33:03 +00:00
Bjoern A. Zeeb
470aaf42c3 LinuxKPI: 802.11: make struct ieee80211_tx_info a bit more packed
Given I was looking at the struct make it more packed at the beginning
at least.  In fact it did not shrink but the tx_time_est got expanded.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-16 22:24:53 +00:00
Bjoern A. Zeeb
49010ba706 LinuxKPI: 802.11: fill in a lot more RX status fields
Convert a lot more LinuxKPI rx_status fields to net80211 rx_stats
bits for as much as we can see fit.  Factor the entire logic out
into its own function as it got quite long.

Now only net80211 needs to start using more of these values and
report them.

Also fix some related fields and struct definitions in LinuxKPI.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-16 22:09:00 +00:00
Bjoern A. Zeeb
ec6185c526 net80211/crypto: LinuxKPI/802.11: introduce IEEE80211_RX_F_PN_VALIDATED
There are cases when we see "rx seq# violation (CCMP)".

Historically these were AHDEMO/IBBS cases (IEEE80211_KEY_NOREPLAY,
see 5d766a09da).

With iwlwifi(4) doing RSS for newer chipsets and us not having any idea
about multiple rx-queues (passed all the way through) leads to the same
problem.  An easy way to trigger this is doing an IPv6 all-nodes echo
request.  With a sufficient amount of nodes answering the answers will
be hashed to different queues and re-ordering will likely take place
as queues get released individually.
However crypto validation is already done in fw/driver for these cases
and we need to carry the state forward.  Add IEEE80211_RX_F_PN_VALIDATED
to indicate that the checks were done passing the information from driver
through LinuxKPI to net80211.
LinuxKPI enforces that a frame was indeed decrypted; otherwise the flag
would be invalid.

This also avoids returning an error and no key from
ieee80211_crypto_decap() and thus avoids dropping the frame.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D49029
2025-02-16 20:20:50 +00:00
Bjoern A. Zeeb
5778cbdae7 LinuxKPI: 802.11: implement various VHT helper functions
Implement ieee80211_rate_set_vht(), ieee80211_rate_get_vht_{mcs,nss}(),
and ieee80211_get_vht_max_nss().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-02-15 23:53:19 +00:00
Bjoern A. Zeeb
c272abc5c6 LinuxKPI: 802.11: adjust the hw_scan channel list
Until net80211 will grow proper scan offload with the various options
needed and will allow switching the scan engine try to improve the
situation if we are doing a hw_scan and the device supports
SINGLE_SCAN_ON_ALL_BANDS.  In that case create the channel list from
our device information of supported channels rather than from the
net80211 scan list.  Filter out currently unsupported bands.

While the general "scan EBUSY" problem remains at least in my local
testing I am seeing a lot more 2 and 5 GHz band results rather than
being stuck on a single band (as was also often the case with iwm for
me in the past).

Tested by:	rene (previous version)
MFC after:	3 days
2025-02-15 23:22:39 +00:00
Bjoern A. Zeeb
75fb66d824 net80211 / LinuxKPI 802.11: add 802.11-2016 VHT Extended NSS BW defines
Add the mask and shift for the VHT Extended NSS BW Support field.
Document them in net80211 and further related bitmasks in LinuxKPI.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48975
2025-02-15 15:48:36 +00:00
Emmanuel Vadot
03704b89e7 linuxkpi: cc_platform: Add CC_ATTR_GUEST_MEM_ENCRYPT
Add this attribute which is a no-op for us but in linux represent that
the guest memory encryption is active.
drm ttm started to check this flag in > 6.1.92

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2025-02-11 09:27:48 +01:00
Gleb Smirnoff
99e5a70046 sysent: regen for deletion of gssd_syscall and new ABI for rpctls_syscall 2025-02-01 01:00:28 -08:00
Bjoern A. Zeeb
95ea57c856 LinnuxKPI: drm2: retire timespec_to_jiffies()
Linux has removed timespec_to_jiffies() half a decade ago [1].
I cannot find any use of it anymore in recent drm-kmod branches
or in the tree so retire it.

While here also retire it from drm2.

Reported by:	emaste (D48318) [1].
Sponsored by:	The freeBSD Foundation
MFC after:	2 weeks
Reviewed by:	emaste, dumbbell (tested all drm-kmod versions, thanks!)
Differential Revision: https://reviews.freebsd.org/D48379
2025-02-01 00:47:30 +00:00
Bjoern A. Zeeb
94e6c8d7d1 lindebugfs: use __func__ not __FUNCTION__
Change to the C99 version and not the old gcc name.
No functional changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D48736
2025-01-31 23:53:31 +00:00