libsysdecode: use local sysdecode.h
Replace <sysdecode.h> with "sysdecode.h" so local builds use the in-tree header
in lib/libsysdecode instead of a stale installed copy in /usr/include, avoiding
build failures after updating sysdecode.h.
Signed-off-by: Ishan Agrawal <iagrawal9990 at gmail.com>
Sponsored-by: Google LLC (GSoC 2026)
Reviewed by: kp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2338
xhci: Fix packet xfer larger than 64kb
Previously, multiple frames of xfers are split into many tds. In the
refactor process, we forget to consider this. The td builder is already
allocate with enough numbers of tds. What we need to do is to fill the
normal trbs for muiltiple tds when building trbs.
PR: 297053
Tested by: phk, oleglelchuk at gmail.com
Fixes: e0b235ecd4fa ("xhci: Refactor xhci_generic_setup code")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58465
mkimg: Add ms-basic-data alias for GPT
While preparing GPT-schemed RaspberryPi images for the NanoBSD
Reimagined GSoC 2026 project, a discrepancy was identified between
mkimg(1) and gpart(8) regarding Microsoft Basic Data partitions (GUID
!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7).
Currently, mkimg(1) relies on the MBR-centric name "ntfs" to identify
this partition type under the GPT scheme. Conversely, gpart(8)
identifies this type as "ms-basic-data".
To allow automation scripts (such as those consuming from gpart backup)
to use a common partition type across tools, add ALIAS_MS_BASIC_DATA as
a valid alias.
This is part of a larger effort to avoid a custom, MBR-based image
generation logic for embedded SoCs like the Raspberry Pi, standardizing
on GPT layouts across all supported FreeBSD embedded devices.
[5 lines not shown]
mkimg: Add ms-basic-data alias for GPT
While preparing GPT-schemed RaspberryPi images for the NanoBSD
Reimagined GSoC 2026 project, a discrepancy was identified between
mkimg(1) and gpart(8) regarding Microsoft Basic Data partitions (GUID
!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7).
Currently, mkimg(1) relies on the MBR-centric name "ntfs" to identify
this partition type under the GPT scheme. Conversely, gpart(8)
identifies this type as "ms-basic-data".
To allow automation scripts (such as those consuming from gpart backup)
to use a common partition type across tools, add ALIAS_MS_BASIC_DATA as
a valid alias.
This is part of a larger effort to avoid a custom, MBR-based image
generation logic for embedded SoCs like the Raspberry Pi, standardizing
on GPT layouts across all supported FreeBSD embedded devices.
[5 lines not shown]
cam/cd: avoid integer divide fault in cdstart()
If something goes very badly (e.g. forcibly removing a medium while
the OS tries to start it), this could end up in params.blksize being 0
(and params.disksize 1). Avoid an integer divide fault, panicking the
kernel, by bailing out before.
MFC after: 3 days
mt76: disable debugfs due to missing piece still in review
Until D57524 is not reviewed and committed we will have a missing
function declaration which prevents us to compile (in) debugfs for
mt76 core and mt7921. Temporary disable debugfs again.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c589dc4ef77d8e165e449a861c3705002ca4a762)
mt76: further adjust debugfs compile time options
The debugfs options between the various modules (core and chipsets)
are not 100% de-coupled. This means we may run into unresolveable
symbols at load time of the modules if we enable certain options
generally or for core but not for the chipset.
For now: always build the core module with debugfs support.
Migrate the CONFIG_MAC80211_DEBUGFS flag into the Makefile of each
chipset so we can individually turn it on.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit ec17c2454bf03f954e460bfe3c95e35f638ba71e)
LinuxKPI: page pool updates and add to the build
Split implementation out from the header files.
This "page pool" is the very minimalistic version we need in order to
support packets on mt76.
We allocate the page pool in order to have the meta data available of
which we only make limited use.
This implementation does no pooling, it does no page fragments for now,
it always hands out a full page and frees it upon return.
It is written in a way that it can be in the tree before the 'struct page'
work it depends on has landed in order to reduce friction for people who
want to try mt7921 (or others later) upfront. We use the same #ifdef
as in the struct page work for that reason so one knob will turn everything
on or off.
Once the struct page work has landed and settled we can start filling this
with more complexity.
[9 lines not shown]
LinuxKPI: page.h: resort lines
Two of the "page macros" can be abstracted elsewhere in the upcoming
struct page work, so sort them away from the four which are here to
stay.
No functional change.
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D58299
(cherry picked from commit 0b8d22019dcf708a8d047817963658783cd53c46)
LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT
With upcoming changes to 'struct page' this will make the lines
easier to read by using the predefined macros from param.h.
Sponsored by: The FreeBSD Foundation
Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D58298
(cherry picked from commit f45506c6a6f4742cd5129d636902b61045c4754b)
LinuxKPI: prefer struct page [*] over struct vm_page[_t]
LinuxKPI is based on Linux 'struct page' which is currently aliased
to struct vm_page. Upcoming changes may change that so start using
'struct page *' instead vm_page_t to make future changes transparent.
This is a continuation of 9e9c682ff3a1 and should be a NOP.
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D58297
(cherry picked from commit ac4b43b7b9dd2dac5d7caf5d4c7aa0d670d38aec)
LinuxKPI: move clear_page() within the linux/page.h file
clear_page() would normally live in asm/page.h but adding the file
and fixing the dependencies would be too much for a single line.
Move the function to the end of the file with a clear separator
and make it clear that it does not operate on a 'struct page'
but on a page address by changing the argument name and leaving
a comment.
The function is currently used by at least mthca(4) as the only
in-tree consumer, and drm-kmod ttm_pool.c.
No functional changes.
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D58296
(cherry picked from commit 0845efe88b355547b103dca90e69e46a3ebdd016)
LinuxKPI: pci: fix dma handle type in match function
dma_addr_t is a vm_paddr_t which is a uint of some width. Rather than
passing pointers of it around pass the value.
Comparing the addresses of different storage for the same dma handle
(the actual bug here) will not work when passed to the devres match
function.
Sponsored by: The FreeBSD Foundation
Fixes: 0a575891211ef ("implement dmam_free_coherent()")
Differential Revision: https://reviews.freebsd.org/D58285
(cherry picked from commit 2099bf27126f6fef10128c3cd0ea8476c88b28c5)
LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold)
We would lock the downcalls during normal operation but not during
vap (vif) creation as there was no need for locking.
Add the missing locking there as drivers seem to always expect it
(by assertion) and cannot distinguish between state.
Add the assertions to the downcalls as we need both of them locked
and both of them can sleep.
PR: 296185 ("rtw89(4) freezes the system with INVARIANTS kernel")
Debugged by: Artem Bunichev (temcbun gmail.com)
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 5d479b75a8944faeabb367d1234a9fc3fefa8df1)