Unlike bwi(4), bwn(4) does not rely on ic_headroom (despite having it
set) but splits the bwn_txhdr (first) segment into its own transaction.
Remove ic_headroom to avoid net80211 troubles with not enough space in
the mbuf around ieee80211_mbuf_adjust().
PR: 275616
(cherry picked from commit 59dba901f227420647e4856f03cb782a3375c220)
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
(cherry picked from commit 9fb914634eff85b3b36bcbf39c1faf2967b0aa9e)
This reverts commit 6c3e93cb5a for
sys/dev/ath/if_ath.c only.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 82506f26c03aa312b91e01a797f31e061749a76d)
This reverts commit b65f813c1a.
As a side effect this also seems to fix wtap which seems to have
lost the epoch over the input path in between.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 1c6dd33d26eb02c6145383a49150965eeca61120)
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
Tested by: few (rtwn, ath, iwlwifi, ...)
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D42427
(cherry picked from commit de607e3c230be88f6232b9c9fd6c37199648dc8c)
Avoid panics in case ieee80211_dump_node() gets called before a
channel context is set.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c93be3079be5f07fe3596ec389826e45f5dc82bd)
The iwlwifi driver already supports the chipset as "Bz TBD"
(also in 14.0). Add the firmware for it. Successfully tested
for 0x8086/0x272b/0x8086/0x00f4 on arm64 thanks to donated
hardware [1].
Firmware was obtained from linux-firmware at
9552083a783e5e48b90de674d4e3bf23bb855ab0 .
Sponsored by: The FreeBSD Foundation
Sponsored by: Martin Hoehne / minipci.biz (B200 card) [1]
MFC after: 3 days
(cherry picked from commit b647615ede46af66cd0c8bd5a321d4a2cccdabe0)
Both drivers are not yet attached to the build so this change is
for people currently trying them out.
In 96ab16ebab6319dce9b3041961b0ab6e20a4fecc the sys/rman.h include
was removed. In various wireless drivers we prefer to directly use
bus_dma functions rather than io* LinuxKPI once. In order to cast
the pointer we need sys/rman.h back for our native 'struct resource'
in their pci.c implementations.
Long-term we should consider providing some lkpi_-FreeBSD-specific
wrapper functions to avoid this problem.
MFC after: 3 days
(cherry picked from commit c8e7f78a3d28ff6e6223ed136ada8e1e2f34965e)
Improve log messages to be more helpful in error cases.
Change one LinuxKPI sleep function as we cannot call the original
one from a context we cannot sleep.
Both cases were hit during testing.
MFC after: 3 days
(cherry picked from commit 118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74)
Start scaling arrays dynamically instead of using MAXCPU, resulting in
extra allocations on startup but reducing the overall memory footprint.
For the static single CPU mask we provide two versions to further save
memory depending on a low or high CPU count system. The threshold to
switch is currently at 128 CPUs on 64bit platforms.
More detailed comments on the implementations can be found in the code.
If I am not wrong on a MAXCPU=65536 system the memory footprint should
roughly go down from 512M to 1.5M for the static single CPU mask.
Submitted by: olce (most of this final version)
Sponsored by: The FreeBSD Foundation
PR: 274316
Differential Revision: https://reviews.freebsd.org/D42345
(cherry picked from commit 488e8a7faca51a71987fbf00cd36cfcd19269db7)
Sort the dev_<loglevel> functions by loglevel order, add the dev_alert()
version and an indentation change.
No functional changes.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D43719
(cherry picked from commit 70617458676eb0b0076aa19657d21f2a9f3b704a)
Amdgpu driver does a lot of memory allocations in FPU-protected sections
of code for certain display cores, e.g. for DCN30. This does not work
on FreeBSD as its malloc function can not be run within a critical
section. Check this condition and temporally exit from FPU-protected
context to workaround issue and reduce source code patching.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu (previous version)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42822
(cherry picked from commit c0b8047bdc13040eafb162c4b7b5dba11034ff4b)
acpi_dev_present detects that a given ACPI device is present based on
Hardware ID, Unique ID and Hardware Revision of the device.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42823
(cherry picked from commit 04952a9456e226460d1d95c42ea53861b1133b1a)
It does a Read-Modify-Write operation using clear and set bitmasks on
PCI Express Capability Register at pos. As certain PCI Express
Capability Registers are accessed concurrently in RMW fashion, hence
require locking which is handled transparently to the caller.
Sponsored by: Serenity CyberSecurity, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42821
(cherry picked from commit 808ae4e29b6b9c9acc7eab013c5045370df8182a)
We assume that backlight (in Linux term) is always "native".
Also stub acpi_video_register_backlight()
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42814
(cherry picked from commit 745067c58514c4323dc16697e19f59dd08a8e963)
and bitmap_shift_right() functions to linux/bitmap.h
They perform calculation of two bitmaps intersection,
copying the contents of u32 array of bits to bitmap and
logical right shifting of the bits in a bitmap.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42812
(cherry picked from commit 5ae2e6f913fa1df5f3262255558b76af05409a09)
Cancel a work not waiting for it to finish.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42811
(cherry picked from commit 1b2f43a7427ebf51561867f6c497833268014512)
Linux uses it only if SHRINKER_DEBUG config option is enabled. Ignore it.
Sponsored by: Serenity Cyber Security, LLC
Reviewers: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42809
(cherry picked from commit a39ed121eab16bd2579422f71df7ef29b55965d1)
ida_alloc_min() allocates an unused ID. between min and INT_MAX.
While here allow end parameter of ida_simple_get() be larger than
INT_MAX. Linux caps the value to INT_MAX.
Sponsored by: Serenity Cyber Security, LLC
Reviewers: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42806
(cherry picked from commit c7312643b7e5f01adc2a3094c5139f5dcab5f0a4)
It is implemented like ktime_get_raw_ns() function but uses less
precise getnanouptime() call.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42804
(cherry picked from commit e964da141523e1eec2322082936cdb20ba0cf4a7)
And move it along BUILD_BUG family in to
linux/build_bug.h to match Linux.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42800
(cherry picked from commit 31ef29091b0fbadefb4ccfb21e4b30ca7ddca3ed)