| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that all dependencies are implemented improve our chanctx emulation.
Some drivers still rely on chandef information for channel work.
In order to only do chanctx updates within mac80211 in Linux and
likewise in the LinuxKPI 802.11 compat layer, emulation functions
were introduced which claim to support chanctx driver operation but
in reality convert these to chandef field updates and (*config)
downcalls.
This is relevant to several mt76 chipsets (at least 7615, 7915),
and rtw88 and certain rtw89 chipsets (8851b, and the ones not supporting
SCAN_OFFLOAD or BEACON_FILTER) for us.
Migrate the logic out of the header and improve it.
Make use of the introduced dflt_chandef and scan_chandef fields,
add comparison of chandefs to see if we have to update, etc.
Also add strict checks for driver settings in linuxkpi_ieee80211_alloc_hw()
to make sure all preconditions are correctly met. Store the result
if we are using the emulation functions in a field, so we can later
check on it and also leave a note to the users if emulation is used
in order to improve debugging on possible problem reports.
Use the new field that we use emulation in lkpi_ic_set_channel() instead
of a hand crafted check.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Fixes: ac1d519c01ca8 ("LinuxKPI: 802.11: adjustments for v6.11..")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.
Note that no consumers of the code are currently connected to the kernel
build.
Reported by: Stanislav Fort <stanislav.fort@aisle.com>
Reviewed by: bz, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56371
|
| |
|
|
|
|
|
|
|
| |
This is used by the i915 DRM driver for some time to log more details
about a GPU error, but the code was commented out.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56282
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55740
|
| |
|
|
|
|
|
|
|
|
|
| |
There are the same as `MIN()` and `MAX()` except that they take a type
to cast both arguments to compare.
The DRM generic code started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55739
|
| |
|
|
|
|
| |
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55738
|
| |
|
|
|
|
|
|
|
|
|
| |
This in the Linux version of `struct resource`, not the FreeBSD native
structure.
The amdgpu DRM driver started to use it in Linux 6.11.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55737
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To be exact, there was a dummy file with no content before. This commit
defines `struct mfd_cell` and adds two function stubs.
The function stubs are not implemented but still return success. They
log a message to indicate they need to be implemented.
Also, unlike Linux, <linux/mfd/core.h> includes <linux/ioport.h>. This
works around the fact that we can't include <linux/ioport.h> from
<linux/pci.h>, due to a conflict with the FreeBSD-native `struct
resource`.
The amdgpu DRM driver started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55736
|
| |
|
|
|
|
|
|
|
| |
It only defines the `struct linux_logo` structure for now. It does not
define any actual logo.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55735
|
| |
|
|
|
|
|
|
|
|
| |
For now, only define it for x86 architectures.
The DRM generic code started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55734
|
| |
|
|
|
|
|
|
|
|
| |
This is a kernel configuration constant that is expected to be defined.
The DRM generic code started to use it in Linux 6.11.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55733
|
| |
|
|
|
|
|
|
|
| |
The DRM generic code started to use `kmsg_dump_get_buffer()` and
`kmsg_dump_rewind()` in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55732
|
| |
|
|
|
|
|
|
|
|
| |
For now, the macro is not implemented and it returns 0.
The DRM generic code started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55731
|
| |
|
|
|
|
|
|
| |
This matches the declaration on Linux.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55730
|
| |
|
|
|
|
|
|
| |
The DRM generic code started to use `strtomem_pad()` in Linux 6.11.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55729
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For instance, this is used by DRM drivers to declare the EDID property
of an GPU output connector:
sysctl -b sys.device.drmn1.card0.card0-DP-1.edid | edid-decode
...
Block 0, Base EDID:
EDID Structure Version & Revision: 1.4
Vendor & Product Identification:
Manufacturer: SAM
Model: 29814
Serial Number: 810635354 (0x3051505a)
Made in: week 15 of 2025
...
Reviewed by: bz, emaste, wulf
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55176
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compiling drm-kmod on !X86 does not include asm/smp.h which includes
preempt.h on FreeBSD. In order to compile drm-kmod on other
architectures add the secondary #includes for preempt.h to
spinlock.h and hardirq.h (which now also gets included from highmem.h)
to connect the #include chain.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
PR: 279864
Reviewed by: jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D55974
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I noticed that the buf_size < 0 check can never be true (it's a
size_t) and decided to check for this condition by an alternate
expression, and I also noticed that a read_size of 0 would incorrectly
return -EFAULT. Instead, return success for both of these cases as
reading beyond the EOF of a normal file also returns EOF, not EINVAL.
Reviewed by: bz
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D55845
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Linux file_operations API expects the read and write operations
to take a single user buffer pointer (along with the length and the
file offset as an in/out parameter).
However, the debugfs_fill function was violating this part of the
contract as it was passing down kernel pointers instead. An earlier
commit (5668c22a13c6befa9b8486387d38457c40ce7af4) hacked around this
by modifying simple_read_from_buffer() to treat its user pointer
argument as a kernel pointer instead. However, other commits keep
tripping over this same API mismatch
(e.g. 78e25e65bf381303c8bdac9a713ab7b26a854b8c passes a kernel pointer
to copy_from_user in fops_str_write).
Instead, change debugfs_fill to use the "raw" pseudofs mode where the
uio is passed down to directly to the fill callback rather than an
sbuf. debufs_fill now iterates over the iovec in the uio similar to
the implementation of uiomove invoking the read or write operation on
each user pointer.
This also fixes a tiny bug where the initial file offset from
uio_offset was ignored. Instead, the operations were always invoked
with a file offset of 0.
As part of this, revert the the changes to simple_read_from_buffer()
from commit 5668c22a13c6befa9b8486387d38457c40ce7af4.
Also as part of this, the simple_attr_read/write methods and seq_read
now also need to accept and handle user pointers (also matching the
API in Linux).
For simple_attr_write*(), copy the user buffer into a kernel buffer
before parsing. Also, do not permit writes at an offset as it's
unclear what the semantics for those would even be (perhaps you would
write out the formatted value into a buffer first and then allow the
copy_from_user to overwrite/extend that buffer and then re-parse the
integer value?). The old handling of *ppos for writes was definitely
wrong before and only worked for an offset of 0 anyway.
Reviewed by: bz
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D55833
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various macros (dma_map_sg_attrs, dma_unmap_sg_attrs,
dma_map_single_attrs, and dma_unmap_single_attrs) currently supress
passing on the attrs argument. Their implementation (even though at
times still marked the argument __unused; we remove that) have long
gained support for handling the argument.
With ofed fixed (5edf24aac1d09), pass the argument through so that
other drivers using these functions may hopefully work just a bit
better as well.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55391
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Over time struct ieee80211_prep_tx_info has grown further fields.
One which is becoming mandatory is the subtype (of the mgmt frame).
iwlwifi(mld) has a WARN for it if it does not match, so we now have
to set this for proper operation. In addition we are tyring to improve
the situation of setting/unsetting (prepare_tx/complete_tx) in various
states and cleanup the use of other fields but link_id which we now
leave as a marker for the future everywhere.
The general problem we are facing is that our hook surface in this case
is the state machine but likely would have to be tx/rx mgmt frames but
we would alos have to driver the TX queues from there which is tricky.
The long-term answer is to change net80211.
Further the hardware flag DEAUTH_NEED_MGD_TX_PREP is dead and was
removed again in favour of leting drivers deal with it. iwlwifi(mvm)
likely being the only driver which ever used this.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BUILD_BUG_ON_ZERO() macro returns an (int)0 if it does not fail
at build time. LinuxKPI sort() has it as a guard for an unsupported
argument but ignores the return value.
This leads to gcc complaining:
/usr/src/sys/compat/linuxkpi/common/include/linux/build_bug.h:60:33: error: statement with no effect [-Werror=unused-value]
60 | #define BUILD_BUG_ON_ZERO(x) ((int)sizeof(struct { int:-((x) != 0); }))
| ^
/usr/src/sys/compat/linuxkpi/common/include/linux/sort.h:37:9: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
37 | BUILD_BUG_ON_ZERO(swap); \
| ^~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/dev/rtw89/core.c:2575:9: note: in expansion of macro 'sort'
2575 | sort(drift, RTW89_BCN_TRACK_STAT_NR, sizeof(*drift), cmp_u16, NULL);
Change to BUILD_BUG_ON() for the statement version.
Reported by: CI
Co-authored-by: bz
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55634
|
| |
|
|
|
|
|
| |
Needed by brcmfmac v6.19.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
sys/compat/linuxkpi/common/include/linux/platform_data/brcmfmac.h
is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
e5f0a698b34ed76002dc5cff3804a61c80233a7a ( tag: v6.17 ).
Currently only PCIe is made to compile.
It does load firmware (if needed, e.g., on arm64 with an alignment
issue fixed), and starts to come up.
To make it work there is a cfg80211 layer and netdevice integration
to do, so do not hold your breath just yet.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "cleanup.h" implementation got a bit more complicated.
For one we now use a macro to concatenate a prefix, the name, and a
suffix for variable and function declarations. This was triggered
by the fact that the "guard_" prefix we used was confusing. We now
use a generic "cleanup_" which is only encoded in the single place
rather than all over the file.
As already indicated by the comment the DEFINE_LOCK_GUARD_0()
macro got split up and a _1 version which also takes a type got
implemented and is used for a spinlock variant used by rtw89(4)
via the new scoped_guard() bits.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54808
|
| |
|
|
|
|
|
|
|
|
| |
USB structures are defined with the native USB implementation.
Just leave a comment why they are not here.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D54991
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the MODULE_DEVICE_TABLE macro to module.h where it belongs
in preparation for different bus (e.g., USB, SDIO) support.
The various struct <bus>_device_id, if not elsewhere, should be
defined in mod_devicetable.h.
This is the next step after 2f5666c1727c.
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D54900
|
| |
|
|
|
|
|
|
|
|
|
| |
Switch from using if () else to a direct return (?:) code.
No functional changes.
Suggested by: kib (D55029)
Sponosred by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste (before removing more () as suggested by him)
Differential Revision: https://reviews.freebsd.org/D55088
|
| |
|
|
|
|
|
|
|
| |
Needed by a wireless driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D55029
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tag is used to perform lookup in a different way.
New functions were introduced:
* to set, check and clear a tag
* to walk through a radix tree based on a given tag
Furthermore, the `radix_tree_delete()` function was modified to clear
tags on deletion.
The amdgpu DRM driver started to use this in Linux 6.10.
While here, the `radix_tree_gang_lookup()` function was added because it
is very close to `radix_tree_gang_lookup_tag()`, but it is not used by
the DRM drivers as of this commit.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54503
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add <linux/eventfd.h> and expose the `eventfd_*()` API. This is used by
DRM drivers for some time, but the code was commented out so far.
Note that Linux uses `struct eventfd_ctx`, but FreeBSD defines `struct
eventfd`. We define `eventfd_ctx` as a synonym to `eventfd`.
Reviewed by: christos, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50853
|
| |
|
|
|
|
|
|
|
|
|
| |
rtw89(4) uses a static_assert() with hweight<n> calls. In order to
avoid compile time errors, deal with the case when the arguments to
hweight<n> are complie time constant.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54806
|
| |
|
|
|
|
|
|
|
|
| |
Add a version of umin() simply using MIN() assuming that the Linux
upstream code properly check that the arguments are unsigned, etc.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54807
|
| |
|
|
|
|
|
|
|
|
|
| |
dmam_free_coherent() is used by an updated mt76 driver at v6.19-rc6.
We need to surgically find the devres information and destroy it before
calling dma_free_coherent.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54810
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While iwlwifi supportes PTP, LinuxKPI does not and we only add the
definitons to avoid mangling upstream drivers.
iwlwifi(4) does not even support the (*settime64) callback but only
returns -EOPNOTSUPP.
Sponosred by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54802
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It is a wrapper above a `char *` to track the overall available space in
the buffer as well as the used space. This wrapper does not manage
memory allocation.
The DRM generic code started to use this in Linux 6.10.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54488
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).
Notable change: license got switched from ISC to BSD-3-Clause-Clear.
util.h is now imported from upstream given it is no longer GPL-only.
See the upstream repository 909675fd4344f73aad5f75f123bd271ada2ab9fb
and a96fed2825d8dfb068bf640419c619b5f2df4218.
For us the new version should also help with page pools and DMA32.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
| |
mt76(4) is using this along with a mac80211.h functiontion pointer to
resolve a path in an offload case.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
Add more defines and a mac80211 op function pointer used by
mt76(4) at Linux v6.19-rc6.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Add skb_queue_splice() and use it in skb_queue_splice_init() which
already had that functionality (plus the init bit).
The new function is used by rtw89(4).
Sponosred by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
What we used to call enum ieee80211_tx_rate_flags is now used as
enum mac80211_rate_control_flags for the ieee80211_tx_rate.flags
in rtw89(4). Rename the enum and move it to mac80211 as it seems
to belong there.
Sponsonred by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
rtw89(4) accesses eht_mcs[].
Add the field to struct cfg80211_bitrate_mask.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Management MIC element (MME) can have 8 or 16 octets MIC. Add a second
structure used by at least iwlwifi and update reference to latest
standard version.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I was looking at rate work for another problem and found more flags
in ath9k (which we will likely never need). The documentation then
revealed the "mandatory" flags as well and with discussions about
cfg80211 going on I decided to use the momentum and split our
"supp_rates" setup between lkpi_lsta_alloc() and wiphy_register().
There should be no functional change.
While there also initialize max_rc_amsdu_len.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
pcie_get_speed_cap() has a hard coded skip of 3 devices at the
beginning. It is either called on a pdev or on a result from
pci_upstream_bridge(). In the latter case skipping another three
devices might get us to acpi0 or nexus, neither of which is a
PCI device still and pci_get_vendor() will panic() on that.
Sponsored by: The FreeBSD Foundation (commit)
GHI: https://github.com/freebsd/drm-kmod/issues/393
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D53862
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In order to compile iwlwifi(4), which is reported to work on RISC-V,
include the ACPI headers to avoid adding further FreeBSD-specific #ifdefs
to the driver. With this iwlwifi(4) just compiles on RISC-V (at least
if ACPI support is turned off in the module Makefile).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D54692
|
| |
|
|
|
|
|
|
|
|
|
| |
`rol64()` and `rol32()` are used by <linux/siphash.h>. The former was
added previously, before <linux/siphash.h> was added. However the latter
was not, and it broke the build on armv7.
Reported by: adrian
Reviewed by: adrian, rpokala
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54588
|
| |
|
|
|
|
|
|
|
|
| |
The i915 DRM driver depends on this namespace pollution to access
`debugfs_*` functions, after several explicit #include of
<linux/debugfs.h> were removed in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54494
|
| |
|
|
|
|
|
|
| |
The i915 DRM driver started to use it in Linux 6.10.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54493
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This header declares register/unregister functions to allow a piece of
code to tell what function to call in case of a panic. Several panic
handlers may be registered.
The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.
Reviewed by: bz, christos
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54492
|