Commit graph

1398 commits

Author SHA1 Message Date
Bjoern A. Zeeb
9fb914634e LinuxKPI: 802.11: bring in some HT code
Fix defines and structures to use proper types.

Bring in basic ni->sta synchronization, some channel width handling,
and overload the net80211 functions so that we can talk to
driver/firmware to setup parameters.  We will likely not need one
or two of those but it is good for tracing currently.

Cover HT and bits of VHT code in LinuxKPI behind apropriate #ifdef
which are currently not enabled (like LKPI_80211_HW_CRYPTO) until
confirmed to work.
Last, IEEE80211_AMPDU_RX_START made some firmware unhappy.

This will allow others to work on it and test as well.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-12-01 22:26:28 +00:00
Bjoern A. Zeeb
de607e3c23 net80211: move net_epoch into net80211
Move the net_epoch into net80211 around the if_input calls and out of
the driver (in this first case LinuxKPI).  This reduces coverage but
also allows us to alloc in calls like (*ampdu_rx_start) which do not
actually pass data up the stack.

The follow-up commits will revert b65f813c1a,
21c4082de9,
17c328b6ae,
af2441fbc7,
and 6c3e93cb5a for ath.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Tested by:	few (rtwn, ath, iwlwifi, ...)
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D42427
2023-12-01 00:46:10 +00:00
Gleb Smirnoff
0fac350c54 sockets: don't malloc/free sockaddr memory on getpeername/getsockname
Just like it was done for accept(2) in cfb1e92912, use same approach
for two simplier syscalls that return socket addresses.  Although,
these two syscalls aren't performance critical, this change generalizes
some code between 3 syscalls trimming code size.

Following example of accept(2), provide VNET-aware and INVARIANT-checking
wrappers sopeeraddr() and sosockaddr() around protosw methods.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D42694
2023-11-30 08:31:10 -08:00
Jean-Sébastien Pédron
b292c995cf
linuxkpi: Include <linux/rbtree.h> from <linux/hrtimer.h> and <linux/mm_types.h>
[Why]
Some files in DRM rely on this indirect include to use `struct rb_*`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D42835
2023-11-29 19:54:48 +01:00
Warner Losh
fdafd315ad sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:00 -07:00
Jean-Sébastien Pédron
14dcd40983
linuxkpi: GFP_KERNEL equals M_NOWAIT now
... instead of `M_WAITOK`.

[Why]
The reason is that in some places in the DRM drivers (in particular, the
framebuffer management code), kmalloc() is called from a non-sleepable
context, such as after a call to mtx_lock(8) with an MTX_DEF mutex.

If `GFP_KERNEL` is defined as `M_WAITOK`, we hit an assertion from
witness(4).

[How]
The definition of `GFP_KERNEL` is changed to `M_NOWAIT`. This means that
callers should verify the return value of kmalloc(). Fortunately, this
is always the case in Linux.

Reviewed by:	bz, emaste, manu
Approved by:	manu
Differential Revision:  https://reviews.freebsd.org/D42054
2023-11-24 18:31:32 +01:00
Konstantin Belousov
96cb1d7000 linuxkpi linux_work: use 'true' instead of 'non-zero'
Submitted by:	markj
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42468
2023-11-07 12:58:21 +02:00
Konstantin Belousov
05fe82455f linuxkpi: races between linux_queue_delayed_work_on() and linux_cancel_delayed_work_sync()
1. Suppose that linux_queue_delayed_work_on() is called with
   non-zero delay and found the work.state WORK_ST_IDLE. It
   resets the state to WORK_ST_TIMER and locks timer.mtx. Now, if
   linux_cancel_delayed_work_sync() was also called meantime, read
   state as WORK_ST_TIMER and already taken the mutex, it is executing
   callout_stop() on non-armed callout. Then linux_queue_delayed_work_on()
   continues and schedules callout.  But the return value from cancel() is
   false, making it possible to the requeue from callback to slip in.

2. If linux_cancel_delayed_work_sync() returned true, we need to cancel
   again.  The requeue from callback could have revived the work.

The end result is that we schedule callout that might be freed, since
cancel_delayed_work_sync() claims that everything was stopped.  This
contradicts the way the KPI is used in Linux, where consumers expect
that cancel_delayed_work_sync() is reliable on its own.

Reviewed by:	markj
Discussed with:	bz
Sponsored by:	NVidia networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42468
2023-11-07 12:58:04 +02:00
Bjoern A. Zeeb
562adbe1d3 net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht
Like for the VAP rename ic_flags_vht to ic_vht_flags for consistency to
keep "VHT" fields together and merge ic_vhtcaps and ic_vht_mcsinfo
into struct ieee80211_vht_cap ic_vht_cap.

While the structure layout changes no other functional changes intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian, cc
Differential Revision: https://reviews.freebsd.org/D42421
2023-11-03 21:08:04 +00:00
Bjoern A. Zeeb
8895b47638 LinuxKPI: 802.11: zero-pad debug flags
Write the debug flags as full 32bit hex numbers to have a better
view on them.

No functional changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	cc, emaste
Differential Revision: https://reviews.freebsd.org/D42426
2023-11-03 21:08:03 +00:00
Bjoern A. Zeeb
78ca45df31 LinuxKPI: 802.11: deal with scan_ie_len
We only need to reserve the extra space for DSSS if
NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES is set, so add the conditional.
Also add checks in case scan_ie_len will grow beyond the maximum.
Given this is currently unlikely, leave the cleanup for later as
some other restructuring should be done first.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D42425
2023-11-03 21:08:03 +00:00
Bjoern A. Zeeb
5856761fd5 LinuxKPI: 802.11: fix ieee80211_add_channel_cbw() argument
Fix the last argument passed to ieee80211_add_channel_cbw() in
lkpi_ic_getradiocaps() for both 2Ghz and 5Ghz bands.
We passed in the unmodified version rather than the adjusted version
based on the per-band channel information possibly leaving
ieee80211_channel_flags enabled which should not be.

So far this should not have made a difference given we did not enable
HT or VHT.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D42424
2023-11-03 21:08:03 +00:00
Bjoern A. Zeeb
45c27ad524 LinuxKPI: 802.11: error on state transition failure
The state transition failures we were seeing in the early days are
solved.  If we now experience one stop processing before passing
over to net80211 (sta_newstate()) and before updating iv_state on
the vap.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D42423
2023-11-03 21:08:03 +00:00
Olivier Certner
2c7dd66d09 linuxkpi: dma_get_cache_alignment(): Fix off-by-one result
Substituting 'uma_align_cache' by the appropriately named accessor
uma_get_cache_align_mask() made apparent that dma_get_cache_alignment()
was off by one, since it was defined to be the mask derived from the
alignment value.

Reviewed by:            markj, bz
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42264
2023-11-02 09:30:03 -04:00
Olivier Certner
dc8f7692fd uma: Hide 'uma_align_cache'; Create/rename accessors
Create the uma_get_cache_align_mask() accessor and put it in a separate
private header so as to minimize namespace pollution in header/source
files that need only this function and not the whole 'uma.h' header.

Make sure the accessors have '_mask' as a suffix, so that callers are
aware that the real alignment is the power of two that is the mask plus
one.  Rename the stem to something more explicit.  Rename
uma_set_cache_align_mask()'s single parameter to 'mask'.

Hide 'uma_align_cache' to ensure that it cannot be set in any other way
then by a call to uma_set_cache_align_mask(), which will perform sanity
checks in a further commit.  While here, rename it to
'uma_cache_align_mask'.

This is also in preparation for some further changes, such as improving
the sanity checks, eliminating internal resolving of UMA_ALIGN_CACHE and
changing the type of the 'uma_cache_align_mask' variable.

Reviewed by:            markj, kib
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42258
2023-11-02 09:30:03 -04:00
Mark Johnston
f88bd1174a linuxkpi: Fix an assertion in linux_free_kmem()
In the LinuxKPI, PAGE_MASK is the logical negation of FreeBSD's
PAGE_MASK, so the original assertion was simply incorrect.

Reported by:	trasz
Tested by:	trasz
Fixes:		6223d0b67a ("linuxkpi: Handle direct-mapped addresses in linux_free_kmem()")
2023-10-18 09:43:02 -04:00
Mark Johnston
6223d0b67a linuxkpi: Handle direct-mapped addresses in linux_free_kmem()
See the analysis in PR 271333.  It is possible for driver code to
allocate a page, store its address as returned by page_address(), then
call free_page() on that address.  On most systems that'll result in the
LinuxKPI calling kmem_free() with a direct-mapped address, which is not
legal.

Fix the problem by making linux_free_kmem() check the address to see
whether it's direct-mapped or not, and handling it appropriately.

PR:		271333, 274515
Reviewed by:	hselasky, bz
Tested by:	trasz
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40028
2023-10-17 11:19:06 -04:00
Bjoern A. Zeeb
018d93ece1 LinuxKPI: 802.11: add unconditional error reporting
Multiple reports have shown missed state transitions in net80211 without
major cause obvious (or with a txq warning in iwlwifi).
In order to better track down potential problems add unconditional
ic_printf calls to any case in the lkpi state machine compat code which
would let us return with an error in the hope that it helps us to catch
the actual problems.
Also remove the debug conditions from ieee80211_{beacon,connection}_loss
which can also cause state transitions to have the ic_printf all the time
there too.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-10-09 19:21:51 +00:00
Bjoern A. Zeeb
0d2cb6a6ec LinuxKPI: 802.11: hide txq debugging behind checks
Two txq debug messages were left unconditionally.  Hide them behind
ifdef/if() condition checks for selective debugging only.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-10-05 14:32:41 +00:00
Bjoern A. Zeeb
f06c928544 LinuxKPI: remove dummy headers with implementations
Both agp_backend.h and utsname.h have an implementation in common/
these days so the dummy headers are no longer needed.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-10-04 10:17:21 +00:00
Bjoern A. Zeeb
6c38c6b1b9 LinuxKPI: 802.11: fix re-creation of VAP
After dbf7691999 (as indicated in that commit message) EEXISTS
errors may be seen.  From current investigation that is due to the
single-VAP support in LinuxKPI 802.11 and the related calls to
mo_start() and mo_stop() and them being disabled in ic_parent()
currently.  Calling mo_stop() in lkpi_ic_vap_delete() seems to
fix the problem and new VAPs (wlan interfaces) can be created again
after being destroyed.

Fixes:		dbf7691999 ("improve lkpi_ic_vap_delete()")
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-10-03 21:18:29 +00:00
Jean-Sébastien Pédron
1e99b2ee90
linuxkpi: Fix uses of pmap_change_attr()
[Why]
This function takes an offset and a length as argument, not a physical
address and a number of pages.

This misuse caused the `set_memory_*()` and
`arch_io_reserve_memtype_wc()` functions to return EINVAL.

Another problem was the fact that they returned errors as a positive
integer, whereas Linux uses negative integers.

[How]
Physical addresses and number of pages are converted to offset+length in
the `set_memory_*()` functions.

`arch_io_reserve_memtype_wc()` now calls `pmap_change_attr()` directly
instead of using `set_memory_wc()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D42053
2023-10-03 22:13:52 +02:00
Bjoern A. Zeeb
dbf7691999 LinuxKPI: 802.11: improve lkpi_ic_vap_delete()
Changing the order of cleanup in lkpi_ic_vap_delete() will avoid
firmware crashes or a direct panic as observed as ieee80211_vap_detach()
will do most cleanup for us and get us into the correct state.

The solution is not fully developed yet and one may not be able
to create a new vap (lkpi_ic_vap_create may fail with error 17)
afterwards.  It is supposed to be a step towards more stability
for now.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR: 		269842
2023-09-30 15:27:05 +00:00
Bjoern A. Zeeb
16e688b2a4 LinuxKPI: 802.11: fix problem removing sta
Move the call to lkpi_disassoc() before the state change to
IEEE80211_STA_NOTEXIST which will remove the sta (from firmware).
Based on a comment it seems that originally we had to do it the
other way round.
iwlwifi(4) has a check and will silently not remove the sta from
the firmware when vif->cfg.assoc is still set (see iwl_mvm_sta_del()).
This leads to the LinuxKPI 802.11 code thinking the sta is gone as
downward state changes by the mac80211 op (*sta_state)() may not fail.
Once we try to assoc with a newly added station later, iwlwifi firmware
will run into an assert having two ap_sta set on the same vif.
We can observe that problem in iwlwifi(4) having __le32 sta_id = 1
instead of sta_id = 0 in iwl_mvm_sta_cfg_cmd{} on the HCMD.

This should fix one of the most seen problems with iwlwifi(4), e.g.,
when running service netif restart wlan0 or
service wpa_supplicant restart wlan0.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-30 08:19:19 +00:00
Bjoern A. Zeeb
673d62fc35 LinuxKPI: 802.11: fill regulatory_hint() with some life
Start implementing regulatory_hint() using a .c file based allocation
helper function so we could change structures in the future with
better chances to keep compatibility.
This sets wiphy->regd needed by various LinuxKPI based WiFi drivers.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-25 17:57:40 +00:00
Bjoern A. Zeeb
c5e2579850 LiunxKPI: 802.11: move ieee80211_chanctx_conf into lkpi private struct
Factor out ieee80211_chanctx_conf into struct lkpi_chanctx in order to
keep local state as well.  In first instance that is added_to_drv
only.  For now we stay single-chanctx only but this paves the path
to make it a list.
Use the new information to implement ieee80211_iter_chan_contexts_atomic().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-25 17:44:10 +00:00
Bjoern A. Zeeb
fb3c249ed9 LinuxKPI: 802.11: avoid symbol clash on UP to AC mapping
tid_to_mac80211_ac is an exported symbol in and likely based on iwlwifi,
which leads to a symbol clash in NetBSD.  Rename our local LinuxKPI copy
to a better name and add a comment where to find a copy of the mapping
table.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reported by:	Phil Nelson (phil netbsd org)
2023-09-25 17:41:30 +00:00
Bjoern A. Zeeb
6ffb7bd469 LinuxKPI: 802.11: setup a default link[0] and adjust related needs
Setup more link_conf/deflink fields for vif/sta as are needed to allow
us to work with the KPI bits in a non-MLO configuration.
In lkpi_sta_scan_to_auth() set the bss_conf values before calling into
the driver for chanctx setup/updates as certain values (e.g., beacon_int)
need to be set before; we still call the MO function for the updates
after to keep the expected workflow.
Deal with the (to be dealt with otherwise later) net80211 ni swaps and
update the addresses on the deflink as well as otherwise firmware will
hit asserts or things will not work (e.g. indicating the peer is us).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 17:09:01 +00:00
Bjoern A. Zeeb
a6042e17c8 LinuxKPI: 802.11: inialize tx queue params
When adding a VAP (vif) initialize its tx queue parameters calling
mo_conf_tx().
I could not spot net80211 providing some of the values needed before
having a node so currrently we use hard-coded values with a comment
with a reference on how to properly calculate the values in the future
(e.g., in case of 11b or other cases).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 17:08:55 +00:00
Bjoern A. Zeeb
8d58a05786 LinuxKPI: 802.11: change ic_parent() to not call mo_stop()/mo_start()
Driven by net80211 we may call mac80211 ops stop() and start() mostly
when toggling a first VAP.  While this is FreeBSD behaviour the firmware
based LinuxKPI drivers seem to possibly clear state in the case of stop()
triggering further errors down the line.
We call mo_start() when starting the VAP and mo_stop() when destroying
it now only.  In the future (e.g., in multi-VAP setups) we may need to
re-address some of this so keep the code under #ifdef.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 17:08:48 +00:00
Bjoern A. Zeeb
616e13301b LinuxKPI: 802.11: adjust code to new structure layout
With past commits new structures were added.  Now switch over some
bss_conf fields into vif->cfg where they got moved to and remove the
old fields.  This allows drivers to find the expected values in the
now expected places and work better.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 17:08:38 +00:00
Bjoern A. Zeeb
727f88f261 LinuxKPI: 802.11: mac80211 ops: distinguish between {bss,link}_info_changed
With MLO and multi-link setups if avail we want to call link_info_changed
whereas for legacy drivers we still need to call bss_info_changed.
While we currently do not (yet) support multi-link configurations
we still need to drive the correct commands to satisfy firmware
requirements.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-21 17:08:23 +00:00
Bjoern A. Zeeb
6854154638 LinuxKPI: 802.11: pass non-0/NULL arguments to MO functions
In [1] we updated the KPI for various mac80211 ops functions to deal
with MLD code.  Newer iwlwifi driver and firmware supports these
functions so we need to pass non-dummy (0, NULL) arguments to them.
Start extending the internel MO functions by these arguments and
pass down values from LinuxKPI 802.11 code.
It is assumed that further work will be needed to have all the
right fields available to at least work in the lgeacy way of a
single link.

Sponsored by:	The FreeBSD Foundation
Improves:	549198b1ab (update mac80211 KPI) [1]
MFC after:	3 days
2023-09-21 17:08:16 +00:00
Bjoern A. Zeeb
3e1f5cc9a8 LinuxKPI: 802.11: prepare for iwlwifi driver updates
Unconditionally enable the changes for newer drivers, as needed by
iwlwifi (and others).

Sposnored by:	The FreeBSD Foundation
MFC after:	3 days
X-Note:		breaks build until iwlwifi update (next hash)
2023-09-21 17:07:41 +00:00
Bjoern A. Zeeb
f454a4a10d LinuxKPI: 802.11: fix counting the number of supbands
While the main purpose was to assign an(y) early chandef with the
loop, later additions made use of it to also count supbands as well
as to initialise max_rates.
Due to the main goal we can exit the loop early and not properly
count and initialise supbands and max_rates.
Move the terminating condition into the loop and make it a continue
rather than ending the loop.

Fixes:		d9945d7821 ("improve hw_scan")
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb
e1e90be050 LinuxKPI: 802.11: make sure bssid for scans (probe_req) is set
In b0f7376822 we added bssid[] to struct cfg80211_scan_request
likely while working on mt76 and did not need it (yet) back then.
iwlwifi started to use the field in Linux f1fec51cda70f (April 2023).
Without it set firmware crashes when trying to send probe requests
((empty) SSID also given to hw_scan).
For now always set the field to the wildcard BSSID.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-14 21:20:54 +00:00
Bjoern A. Zeeb
f0e59b6903 LinuxKPI: skbuff: remove assumption about mac_header
It seems the mac_header can be set to offset 0 for frames received.
Remove the warning splattering messages to the console for each packet.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-11 14:31:35 +00:00
Emmanuel Vadot
229c65a83f kern: Globally define abs64
So we can use it in non-linuxkpi sources.

Reviewed by:	emaste, mmel
Differential Revision:	https://reviews.freebsd.org/D41767
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-09-08 09:44:06 +02:00
Austin Shafer
09b0401e91 linuxkpi: fix iteration in __sg_alloc_table_from_pages
Commit 3f686532c9 tried to fix an issue with not properly starting
at the first page in the sg list to prevent a panic. This worked but
with the side effect of incrementing "s" during the final iteration
causing it to be NULL since the list had ended.
In cases non-DEBUG kernels this causes a panic with drm-5.15, since
"s" is NULL when we later pass it to sg_mark_end().
This change decouples the iteration sg from the return value so that
it is never incremented past the final page in the chain.

MFC after:	3 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D41574
2023-09-06 14:37:12 +00:00
Bjoern A. Zeeb
815b7436a7 iwlwifi/LinuxKPI: 802.11: update ieee80211_request_smps()
Update ieee80211_request_smps() to the new number of arguments in
LinuxKPI (which was already prepared) and update the one call in the
older iwlwifi driver version.
This will allow iwlwifi as-is now and rtw88 to compile in case someone
else wants to work on the latter in parallel to predominant efforts on
the former.

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-09-05 21:14:25 +00:00
Bjoern A. Zeeb
cbb3ec2523 mt76: update driver from upstream
This is a set of updates of the mt76 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
  This adds support for mt7996 as well.
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

The current version of LinuxKPI lacks support for "page pool" which
needs enhancing and updating a decade or so old shortcut mapping
struct page directly to struct vm_page.

MFC after:	20 days
2023-08-21 01:34:03 +00:00
Bjoern A. Zeeb
adff403fe7 LinuxKPI: 802.11: update compat code for updated drivers
Adjust and add structs, fields, functions to make more modern versions
of LinuxKPI based wireless drivers (based on wireless-testing (
wt-2023-06-09, wt-2023-07-24, and later)) compile.

Some of these changes can only be applied once all drivers get
updated to not break the old versions currently in the tree.
Mark those changes with __FOR_LATER_DRV_UPDATE for now and flip the
switch at a later point.

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-08-21 00:39:57 +00:00
Bjoern A. Zeeb
e039b38d46 LinuxKPI: skbuff: add skb_cow_head()
Add dummy implementation of skb_cow_head().

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-08-19 04:55:56 +00:00
Bjoern A. Zeeb
149c457de1 LinuxKPI: skbuff: fix tracing
Fix arguments to a trace line and remove another trace line until we
actually will have the skb to trace along with a future implementation.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-08-19 04:53:00 +00:00
Doug Moore
b6a61d6836 linuxkpi math: fix kassert in math64.h
Include <sys/systm.h> in math64.h, so that KASSERT and bool are
defined, to allow compilation to succeed after
b80ea45237 and dabbbebcb0f5...
2023-08-18 00:31:03 -05:00
Kyle Evans
dabbbebcb0 linuxkpi: fix buildkernel after b80ea45237
Unbalanced parentheses broke the build; re-balance.

Fixes:	b80ea45237 ("LinuxKPI: implement mul_u64_u64_div_u64()")
2023-08-18 00:12:37 -05:00
Bjoern A. Zeeb
b80ea45237 LinuxKPI: implement mul_u64_u64_div_u64()
Implement mul_u64_u64_div_u64() for an updated iwlwifi driver (though
we do not yet use it there; it is used for in-kernel ptp on wifi).

Sponsored by:	The FreeBSD Foundation
Submitted by:	cperciva
MFC after:	10 days
Reviewed by:	cperciva, dwmalone
Differential Revision: https://reviews.freebsd.org/D40120
2023-08-18 01:20:39 +00:00
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
71625ec9ad sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:24 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00