| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It comes with `PCI_ERROR_RESPONSE` and `PCI_SET_ERROR_RESPONSE()` but we
don't use them so far. Therefore `PCI_POSSIBLE_ERROR()` will always
reture false.
As written in the comment, this macro is a bit weird given the Linux
`pci_read_*() functions can return an error code separately from the
read value.
The `PCI_POSSIBLE_ERROR()` macro started to be used by the amdgpu DRM
driver in Linux 6.10.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54487
|
| |
|
|
|
|
|
|
|
|
| |
This function prints a single line of hex dump to the given line buffer.
The implementation relies on `lkpi_hex_dump()` to format the string.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51559
|
| |
|
|
|
|
|
|
|
| |
This will be useful in the upcoming implementation of
`hex_dump_to_buffer()` which doesn't add one.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51844
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the exact same logic as in Linux:
* Accept 'e', 't', 'y', '1', "on" for true.
* Accept 'd', 'f', 'n', '0', "of" for false.
* Disregard any characters beyond that.
* Check that the string is not null, but don't check the result pointer.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: bz, emaste
Differential Revision: https://reviews.freebsd.org/D54451
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In kstrto*(), don't assign to *res until we know the conversion is
successful, and address issues that may result in warnings if code
that uses <linux/kstrtox.h> is compiled at high warning levels.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: bz, emaste
Differential Revision: https://reviews.freebsd.org/D54440
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM before 19 and gcc before 14 do not support __builtin_popcountg().
Use __const_bitcount<n> from sys/bitcount.h as a replacement in these
cases. This should still allow drm-kmod to build where the size needs
to be known at compile-time.
Remove the conditional for gcc around the iwlwifi modules build,
which was collateral damage in all this.
Sponsored by: The FreeBSD Foundation
Fixes: 7cbc4d875971, 5e0a4859f28a
MFC after: 3 days
Reviewed by: brooks, emaste (without the sys/modules/Makefile change)
Differential Revision: https://reviews.freebsd.org/D54297
|
| |
|
|
|
|
|
|
| |
Required by i915kms to support recent discrete graphics cards.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54225
|
| |
|
|
|
|
|
|
| |
This is a preparation step for a future addition to this file. This is
also closer to what Linux does.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
| |
Add the conditional compile time option defaulting to off as we do
not support leds in LinuxKPI to ath10k for the new file.
Add empty struct gpio_led to LinuxKPI.
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
If CONFIG_NET_MEDIATEK_SOC_WED is not set then be silent; if
CONFIG_NET_MEDIATEK_SOC_WED is set we will enable logic or rather te
pr_debug("TODO") calls for now.
Spsonsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Some of these are used by mt76 and while I was here and it only was
a handfull I figured I should just clean this all up.
There is one problem in that between 802.11az and 802.11-2024 action
frame formats have changed; I got compile errors from iwlwifi(4) given
I updated them to -2024 so we remain on older versions for the moment.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
The logic in device_release_driver() got disabled in 93b14194acaf2
and since left alone. Add a pr_debug() call so we have a chance to
notice if that code is actually still in need to be fixed and re-enabled.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
This adds empty implementations of pm_vt_switch_(un)register which
are used by nvidia-drm. We do not need to specify anything here as
a VT switch always happens on suspend/resume.
Sponsored by: NVIDIA
Reviewed by: kbowling (mentor), emaste
Differential Revision: https://reviews.freebsd.org/D53400
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't use __LP64__ to decide the value, as it gives the wrong result on
CHERI platforms. Just define it in terms of __SIZEOF_LONG__. Make a
similar adjustment for BITS_PER_LONG_LONG while here.
Reviewed by: bz, dumbbell, emaste
MFC after: 1 week
Sponsored by: CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision: https://reviews.freebsd.org/D53135
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This includes some type cleanups as well as some shuffling of structs
and functions to sort dependencies out. Few new functions and defines
as well as new struct members. Minor fixes to style and debug logging.
This is the majority of changes. None of these should conflict with
current in-tree drivers. The final bit of changes will come along with
the driver updates adding an extra argument to function pointers.
MFC after: 3 days
|
| |
|
|
|
|
|
| |
For the moment add skeleton functions for netif_device_attach/detach()
needed by rtw8[89] v6.17.
MFC after; 3 days
|
| |
|
|
|
|
|
| |
This likely belongs in socket code which we do not have in LinuxKPI.
Needed by a wirless driver at v6.17.
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
We do not support Wireless Ethernet Dispatch (wed) on the mt76 (yet).
Add pr_debug calls with TODO in case we run into the calls anyway so
we could deal with them.
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Given we do not yet support "wake" bits in device there is little need
doing it in PCI if we cannot check if we are supposed to do the
operation in first place. Once we would implement this, we would need
to also do the appropriate PCI (pme) checks before enabling (disabling)
it.
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D53208
|
| |
|
|
|
|
|
|
|
| |
We do not currently aim to support crypto FIPS compliance in LinuxKPI
so keep this turned off.
MFC after: 3 days
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D53207
|
| |
|
|
|
|
|
|
|
| |
Needed by multiple wireless driver for the v6.17 update (likely earlier
versions already).
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D53206
|
| |
|
|
|
|
|
|
|
|
| |
The return type now is void; I believe no one ever used this
so we can just chnage it. The only active platform_driver_register()
calls seems to be in ath1[01]k and mt76 and there in unsupported code.
MFC after: 3 days
Reviewed by: dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D53205
|
| |
|
|
|
|
|
|
| |
We will see how much we will need them and how to fill them at that
point. They are left with a pr_debug("TODO") for now.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53204
|
| |
|
|
|
|
|
|
| |
The former is needed by a wireless driver at v6.17.
MFC after: 3 days
Reviewed by: dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D53203
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like lkpi_pci_get_domain_bus_and_slot() implement lkpi_pci_get_slot()
using pci_find_bsf() instead of pci_find_dbsf() (no domain).
This is needed for a wireless driver.
Unfortunately the name [pci_get_slot()] collides with the native PCI
function. Add a guard around it and disable the use when the native
version is required (in lkpifill_pci_dev() and in bnxt/bnxt_en; if the
latter gets fixed we can probably also fix work around it in the former;
further conflicts in drm-kmod 6.1-lts, 6.6-lts, and master were resolved).
Sponsored by: The FreeBSD Foundation (initially)
MFC aftre: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52065
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Chace Linux change fca76071bab2 ("lib/string_helpers: Split out
string_choices.h") from v6.5. Everything that we implemented from
string_helpers.h has moved, so rename the file, update the include
guards, and add a new dummy string_helpers.h that just #includes it.
This matches Linux for the functionality that we have.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52606
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
dem_kfree() is called from all over the place and should actually
do something; contrary to lkpi_devm_kmalloc_release() it can also
take a const void *. We have to __DECONST() that though as the
entire devres framework does otherwise not take a const argument.
This was discovered during the rtw89 upadte to 6.16.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52082
|
| |
|
|
|
|
|
|
|
| |
Needed by a wifi driver update.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52080
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It seems overflow.h wsa imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for wireless driver updates.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Obtained from: git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
038d61fd642278 (tag: v6.16)
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52078
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use __builtin_object_size() by default.
If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditional
checks but in order to be able to MFC this without checking all
compiler versions simply keep it this way for now.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52077
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds guard support for non-real-types like rcu locking meaning
that we need to keep the lock state separately ourselves. _T is still
special and needs to be updated. Given it may not be used it needs
an __unused attribute (we are using the LinuxKPI __maybe_unused which
indeed is more expressive in this case).
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52076
|
| |
|
|
|
|
|
|
|
| |
A wifi driver update needs this.
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52075
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
del_timer() got renamed to timer_delete() approximately in Linux 6.2
(similar for *_sync and likely others).
Keep the old functions as compat; unclear when we can gc them.
We should also re-define them with a linuxkpi_ prefix to avoid possible
conflicts in the future if we do a full pass over this at some point.
Sponsored by: The FreeBSD Foundation (intiially)
MFC after: 3 days
X-MFC; preserve symbols, not inline
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52074
|
| |
|
|
|
|
|
|
|
|
|
|
| |
With Linux 6.16 from_timer() got renamed to timer_container_of(); add
the LINUXKPI_VERSION check with a default to the current version.
Update all in-tree consumers (apart from wireless drivers managed
otherwise).
Sponsored by: The FreeBSD Foundation (initially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52073
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The code introduced abs_diff() as migrated from drm to standard
linux headers. The LINUXKPI_VERSION check did not allow this to
be visible by default in-tree. Make sure the v6.6 check is optional.
drm-kmod always defines LINUXKPI_VERSION so this should be fine.
Sponsored by: The FreeBSD Foundation (initially)
Fixes: afc450fac9f04
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52071
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Factor out the pci_request_region() implementation into an internal
function and make pci_request_region() a simple wrapperaround it.
Likewise implement pcim_request_all_regions() as a loop calling
pci_request_region() for each entry.
In two cases which we returned an error before (bar index is valid but
bar is not (no len), and neither IO nor MEM) we now reutrn success
(nothing to do for us). Otherwise callers, especially
pcim_request_all_regions() would error out for the wrong reasons.
This seems to also match the expected behaviour of pci_request_region().
Sponsored by: The FreeBSD Foundation (intially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52068
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Like pci_iomap() add the devres version pcim_iomap() using the former
to get the resource.
Add a helper function to validate that the bar is within a valid range
and sprinkle that check also to other related functions.
Sponsored by: The FreeBSD Foundation (intially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52067
|
| |
|
|
|
|
|
|
|
|
|
| |
Implement for_each_pci_dev() needed by a wireless driver update.
For that also improve pci_get_device() and add the functionality to
support the odev argument to start searching from that.
Sponsored by: The FreeBSD Foundation (intially)
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52066
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A port using linux(kpi) header files but not using skbuffs is hitting
the case that it cannot find opt_wlan.h. Give up to the idea that
skbuff.h is only used by wireless drivers (or in-tree) and that
IEEE80211_DEBUG (via opt_lwan.h) could autmatically compile in debug
support.
It is likely time to add a LINUXKPI_DEBUG knob in the near future
(also for linuxkpi_debug or linuxkpi_debug_rcu).
PR: 289268
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial thought of migrating the LinuxKPI 802.11 enum into net80211
for shared use did not work out well. Currently in the need for yet
another adjustment, I decided to undo/de-couple net80211 and
LinuxKPI 802.11 again.
The enum name now gets used in LinuxKPI based wifi drivers and it
turns out it is spelt differntly than what I used initially.
This creates a conflict.
net80211 still in the need to be able to express BW_320 in an uint8_t
will likely be fine with the current solution as well. Rename the
enum and prefixes in net80211 to "net80211" instead of "ieee80211".
Apart from the names/prefix we leave the values the same.
In LinuxKPI add the enum with the expected name and use it there
throughout to make modern versions of LinuxKPI based wifi drivers
compile.
Sponsored by: The FreeBSD Foundation
Fixes: ca389486a9599, 2c8b0d6205f6f
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D52064
|
| |
|
|
|
|
|
|
|
|
|
| |
Given the checksum offloading flags are mutually exclusive and are
not a bit mask, we can compress them into 2 bit for the four possible
values. Change the define but leave the type at uint8_t for now with
a comment. We can possible combine them with another sub-octet field
in the future.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
These structs as part of the union are used to handle raw packet data
so mark them all __packed.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
Implement str_disable_enable() needed by a wireless driver by using
the already existing str_enable_disable() with a toggled argument.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D52081
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Multicast filter updates are done at different times and either
triggered by net80211/if code or within LinuxKPI.
Keep the setting and address list and update that (only) if triggered
from net80211. Otherwise we will (depending on state) just update
additional flags.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
| |
No functional changes.
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
|