| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
| |
Adjust the IMPROVE macro to also take a format string and use that
in reg_query_regdb_wmm() instead of TODO() to avoid spamming the console
with something that needs larger reworks. Return -ENODATA instead of
-ENXIO as that seems a better fit though the only consumer uses it
without checking the return value these days.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
| |
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
A wifi driver update needs these to compile. Just add them. We'll
given them porper values when we'll do a full pass needing them.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
A wifi driver update required wiphy_locked_debugfs_read().
Add a skeleton implementation just reminding us of the TODO() for
now.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
With a wireless driver updates we are passed const arguments for
addr and ssid. Adjust the local implementation to take the const
in order to avoid compiler warnings (at no extra harm).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
Define all of IEEE80211_VHT_MAX_AMPDU_* and add a reference to the
standard section.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
Add the include to make some driver code compile without having
to add FreeBSD-specific includes to drivers.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The DRM drivers generic code started to use `HWEIGHT64()` in the
definition of an array field in a structure. Therefore, the array size
needs to be known at compile time. This was not the case with the
`HWEIGHT*()` macros based on `bitcount*()`. The use of
`__builtin_popcountg()` solves that problem.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50995
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The <linux/refcount.h> header uses the `spinlock_t` type and some
consumers in the DRM drivers don't include <linux/spinlock.h> directly
or indirectly. This led to compilation errors because the type was
undefined.
On Linux, <linux/refcount.h> includes <linux/spinlock_type.h> as a
comparision.
Reviewed by: emaste, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50994
|
| |
|
|
|
|
|
|
|
|
|
| |
... from <asm/topology.h>.
The amdgpu DRM driver started to use `topology_num_cores_per_package()`
in Linux 6.9.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50993
|
| |
|
|
|
|
|
|
|
|
|
| |
It is the same as `DEFINE_SHOW_ATTRIBUTE()` with a `write` function
added.
The i915 DRM driver started to use it in Linux 6.9.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50992
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver started to use `HW_ERR` in Linux 6.9.
Reviewed by: emaste, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50990
|
| |
|
|
|
|
|
|
|
| |
The i915 DRM driver started to display this field in log messages in
Linux 6.9.
Reviewed by: emaste, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50989
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver from Linux 6.9 started to use this function.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50988
|
| |
|
|
|
|
|
|
|
|
| |
They are used by the amdgpu DRM driver for quite some time, but new code
using them added to Linux 6.9 made me discover that these functions were
missing and existing code was commentted out.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50987
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cherry-pick commit 0b76c0a from ACPICA (actypes: Distinguish between
D3hot/cold, and default `ACPI_STATE_D3` to D3cold).
The same distinction is made between `PCI_POWERSTATE_D3_HOT` and
`PCI_POWERSTATE_D3_COLD`, as they're defined by ACPI (and are asserted
to be the same).
D3cold is essentially the same as D3hot except the power resources are
turned off. Add support for D3cold to `acpi_pwr_switch_consumer`.
`acpi_d_state_to_str` replaces the `printf("D%d", d_state)` pattern,
allowing for "D3hot" and "D3cold" strings to be printed instead of just
"D3".
Reviewed by: markj, ziaee, mckusick (mentor)
Approved by: markj, mckusick (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48384
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`kvmalloc()` was a simple wrapper around the FreeBSD native `malloc()`.
Unlike the more involved implementation of `kmalloc()`, it didn't end
and being the FPU context around the actual call to `malloc()`.
This caused the following panic in the amdgup DRM driver:
panic: malloc: called with spinlock or critical section held
... triggered by the call:
struct dc_3dlut *lut = kvzalloc(sizeof(*lut), GFP_KERNEL);
(for the record, GFP_KERNEL is defined as M_WAITOK)
Replicating the same behaviour as `kmalloc()`, in other words, ending
the FPU context before the call to the underlying `malloc()`, and
beginning it again afterwards solves the problem.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51557
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Linux drivers may pass a typed PCI_ANY_ID (-1U) in which then leads
to a warning that the value gets truncated. Switch argument types
to unsigned int (or uint32_t as we use in struct pci_device_id) to
avoid the problem.
Sponsored by: The FreeBSD Foundation
Discussed in: D50008
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51652
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The last argument (maxlen) to linuxkpi_pci_iomap_range and
linuxkpi_pci_iomap is an unsigned long not an int. LinuxKPI is
not using that argument in the end but fix it where needed.
While here adjust the name to 'maxlen' and remove the "mmio_" to
bar and off.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51651
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some blocks of #defines spacing, trailing \ and indentation of a
second line differed. Some of them are currently fine on a single
line but future additions may not fit in that scheme.
Harmonize them into a #define X\t\t\t...\\n<4 spaces>Y scheme.
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51650
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
acpi_check_dsm() and acpi_evaluate_dsm_typed() take a guid_t argument
and not a char *. For in-tree Linux based drivers this leads to a
compile error due to a warning. Fix the function argument type and
cast internally.
While this made the long statements in the wrapper functions for *_dsm_*
even less readable split them up using a local variable.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D51649
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 19df0c5abcb9d4e9 ("LinuxKPI: make __kmalloc() play by the
rules"), kmalloc() systematically allocates contiguous physical memory,
as it should. However, kvzalloc() was left defined in terms of
kmalloc(), which makes it allocate contiguous physical memory too. This
is a too stringent restriction, as kvzalloc() is supposed to be a simple
page-zeroing wrapper around kvmalloc().
According to Linux's documentation ("memory-allocation.rst"), kvmalloc()
first tries to allocate contiguous memory, falling back to
non-contiguous one if that fails. Thus, callers are already supposed to
deal with the possibility of non-contiguous memory being returned.
Reviewed by: bz
Fixes: 19df0c5abcb9 ("LinuxKPI: make __kmalloc() play by the rules")
MFC after: 10 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51247
|
| |
|
|
|
|
|
|
|
|
| |
Add a acpi_evaluate_dsm() wrapper around the native implementation
as needd by wireless drivers.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50864
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide union acpi_(object|buffer) as linuxkpi_ versions and in Linux
native lower case spelling so that driver code compiles unmodified.
Use the linuxkpi_ prefix to avoid name clashes with the native ACPI
implementation which uses CamelCase.
Use the linuxkpi_ names internally and redefine the linuxkpi_ unions
to their native names so they are avail as expected in drivers.
As a transition to not break drm-kmod which has in-place (no #ifdef)
changes from Linux spelling ot FreeBSD spelling, introduce
LINUXKPI_WANT_LINUX_ACPI so we have the Linux spelling as an opt-in.
That way the transition can happen gracefully and once "top-of-trees"
are all sorted we can remove the #ifdefs here again.
Bump __FreeBSD_version to be able to detect this change.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: wulf (previous version), dumbbell
Differential Revision: https://reviews.freebsd.org/D50863
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are too many ways to call (*shutdown)() and others in Linux
it seems; rather than using the one from dev_pm_ops or directly
on the bus system device, some wireless drivers are setting it on
struct device_driver so add it.
Bump __FreeBSD_version as this changes the size of various other
structs which have struct device_driver embedded.
Sponsored by: The FreeBSD Foundation
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50679
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to be able to use MODULE_DEVICE_TABLE() with multiple bus
attachments, factor out the bus-specfic MODULE_PNP_INFO() and place
it next to the structure defining the table.
As it turns out bnxt(4) has been using the MODULE_DEVICE_TABLE() with
PCI attachments for the "auxillary" bus so far. That makes little sense.
Define the MODULE_PNP_INFO() to nothing for that. We may consider
pulling these LinucKPI bits in semi-native drivers into LinuxKPI
one day as that route is not really sustainabke.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: imp, dumbbell
Differential Revision: https://reviews.freebsd.org/D51049
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
While we currently only use MODULE_DEVICE_TABLE() for pci (or so I
thought [*]), this may soon change. Remove a hard coded "pci" for
the bus and use the bus name passed in as _bus.
[*] see follow-up change
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: imp, dumbbell
Differential Revision: https://reviews.freebsd.org/D51048
|
| |
|
|
|
|
|
| |
Fixes: 4cc8a9da491d ("LinuxKPI: add HWEIGHT32()")
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51010
|
| |
|
|
|
|
|
|
|
|
|
|
| |
With Linux 6.9, `pm_runtime_get_if_active()` lost its second `bool`
argument.
This change is put behind a check of `LINUXKPI_VERSION` to keep
compatibility.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50991
|
| |
|
|
|
|
| |
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50986
|
| |
|
|
|
|
|
|
|
|
|
| |
vm_page_lock() and its underlying array of locks, pa_lock[], have been
replaced throughout the virtual memory system by either atomics or
busy-style, per-page synchronization. The Linux KPI support contained
the only remaining use cases. Eliminate or update them as appropriate
to each case.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D50767
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Migrate most LinuxKPI 802.11 definitions for HE IEs to net80211.
During that process also properly define them as most of them only
had dummy values. Some of the definitions are sparse; that is, only
the bits used by drivers so far were listed and annotated with the
standards section.
There seems to be little point to mangle the names and have two copies
of all these bit field definitions. We can add "_S" (shift/mask)
variants to those we need in net80211 (if we do).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50677
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take the HE IE structures as they are used by drivers and put them
into net80211 rather than LinuxKPI. There is little need to
re-invent the wheel on those. They settled for long enough.
Do not export them by default to user space as some also overlap with
wpa and we still do not have a clear distinction for what is available
only in kernel and what to user space. In our case ifconfig(8)
is a consumer of these structs which it can setting WANT_NET80211 like
we have done for some VHT bits before.
Add struct net80211_he_cap which holds the IE fields but also a bool
and is meant to be put into ic/vap/ni. The bool will give us the same
naming for all layers rather than having individual flags in each part
which was highly confusing. In theory this struct should be in
ieee80211_var.h but that would pull things apart.
Extend struct ieee80211_mu_edca_param_set by a union as it will help
ifconfig(8) parsing the bk/be/vi/vo parts.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D50676
|
| |
|
|
|
|
|
|
| |
Update strutures needed for 11ax (HE) to be correct. Add references
to the standard.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
| |
Add ieee80211_purge_tx_queue() dummy function needed by rtw88 SDIO.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
There's one case which needs skb_copy_header(); add a dummy function
for now until we get to the code which uses it to test an implementation.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Rather than using inline functions use macros so we know where we are
taking the lock in the code rather than only recording the inline
function location.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start to sort through the netdevice features to match them with
FreeBSD. Annotate them a bit more verbose though the names are
pretty telling already.
While here adjust style(9) as well.
Lastly add the bit definitions for use with printf(9) %b as names
read easier than bitmasks. We will use that in LinuxKPI 802.11.
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Given the internal field now stores a __wsum csum (after we added
the type) also make sure csum_unfold() returns a __wsum.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Fixes: 59481c7db234
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dma_map_resource() and dma_unmap_resource() functions are used to map
and unmap of memory-mapped IO resources so they can be accessed by
the device.
Required by drm-kmod v5.5 to be built.
While for drm-kmod 6.6-lts only amdgpu uses these in one place and
the code apparently has not been exercised a lot it has been around
like this for years. With changing the underlying implementations
bring it into the tree; should we find errors with it they can also
be fixed here.
Bump __FreeBSD version to be able to detect this change.
Obtained from: D30933 (by wulf)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D49625
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename linux_dma_unmap() to lkpi_dma_unmap(), and linux_dma_map_phys()
to lkpi_dma_map_phys() so that we get the full set of function
arguments (direction and attributes were missing).
Leave the old functions as wrappers as they are called from drm-kmod
linuxkpi/bsd still, and leaving them also allows us to MFC this
change.
Add missing bus_dmamap_sync() calls. Rather than inlining them
in each inline function push them down to the actual implementation.
From there do not inline them either but call the appropriate
function dealing with the sync so that we do not have the same
code splattered in many places.
Adhere to the DMA_ATTR_SKIP_CPU_SYNC attribute and skip synching
when requested.
A previous, less complete version of this change already allowed
me to load firmware on arm64 for iwlwifi (again).
There are four more places which are not currently done as the
functions which came with an OFED sync a long time ago seem to be
unused these days. Leaving a pr_debug("TODO") call there.
Also dma_[un]map_resource() when brought in from drm-kmod/linuxkpi/bsd
(D30933) should be adjusted to pass the full arguments as the amdgpu
callers are requesting to skip synching.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45294
|
| |
|
|
|
|
|
|
|
|
|
| |
Restructure struct_group() into a wrapper around __struct_group().
Various callers have arguments annotated as /* no foo */ so try to
add all we can find.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50157
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In lkpi_sta_sync_ht_from_ni() we are casting the information element (IE)
data to this struct as net80211 does not save the mcs/rx_mask.
Not marking the structs packed results in the mcs information not being
copied correctly and rx_nss calculations possibly being off. Even worse,
at a later stage iwlwifi mvm/rs.c would extract the mcs values from the
same field to pass to the firmware which will than crash in an assert
as we would want to do HT with an empty MCS set.
Sponsored by: The FreeBSD Foundation
MFC after: sunrise
Discovered: while testing other features on arm64.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
They are used by the i915 DRM driver in Linux 6.6 (although this change
was only backported with Linux 6.7 DRM drivers).
`struct folio` simply wraps `struct page` for now.
`struct folio_batch` is the same as `struct pagevec` but it works with
`struct folio` instead of `struct page` directly.
Reviewed by: bz, kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48743
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is basically one code path to free pages on Linux. In particular,
`free_pages()` is used for other pages than those returned by
`alloc_pages()`.
Also on Linux, `release_pages()` takes either `struct page` or `struct
folio`. `struct folio` support will be added in a followup commit.
Regardless, because pages come from several sources,
`linux_free_pages()` need to accept managed and unmanaged pages.
Reviewed by: bz, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49813
|
| |
|
|
|
|
| |
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49812
|
| |
|
|
|
|
|
|
|
| |
This is to prepare a future change to the implementation and make it
easier to review.
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49811
|
| |
|
|
|
|
|
|
|
| |
We want to avoid putting code managing memory in inline functions in the
future.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49810
|
| |
|
|
|
|
|
|
|
|
|
| |
They are used by the i915 DRM driver starting with Linux 6.7.
`(struct wait_queue)->flags` is no longer always zero. I wonder if some
code relied on this...
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48755
|