FreeBSD sendfile() may perform a partial transfer and return EAGAIN if
the socket is non-blocking. Linux sendfile() expects no error in this
case, so squash EAGAIN.
PR: 282495
Tested by: pieter@krikkit.xyz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47447
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.
PR: kern/274538
Reviewed By: kib (earlier version), olce
Differential Revision: https://reviews.freebsd.org/D47391
The changes from 4aff4048 were based on net80211 which is still using
if_private.h details. Adjust the code to no longer depend on internal
details of ifnet. We also switch the "check"-functionn from if_init to
if_transmit which we can query. Given we do have a per-vif eventhandler
we could do without that check but would still need to check
if_getflags() for IFF_UP.
Sponsored by: The FreeBSD Foundation
Reported by: jhibbits
Fixes: 4aff4048
MFC after: 3 days
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D47490
Add sys/sytm.h for __diagused which unbreaks compilation of
drm-kmod 5.10-lts on main.
Sponsored by: The FreeBSD Foundation
Reported by: Evgenii Khramtsov
PR: 282479
Fixes: 5c92f84bb6
MFC after: 3 days
Annotate lkpi_ic_recv_action(), lkpi_ic_send_action(), and
lkpi_ic_ampdu_enable() with HT specifc debug logging as we only hook
them up currently for debug tracing but later should not need them
anymore.
Start the implementation for lkpi_ic_addba_request(),
lkpi_ic_addba_response(), and lkpi_ic_addba_stop().
Improve the implementation of lkpi_ic_ampdu_rx_start() and
lkpi_ic_ampdu_rx_stop().
Sponsored by: The FreeBSD Foundation (commit)
MFC after: 3 days
If a LinuxkPI base wireless driver does not support the (*ampdu_action)()
ieee80211_ops function for offloading parts to firmware there is no
reason for us to hook into the net80211 callbacks either but simply
to let software (net80211) handle this.
Sponsored by: The FreeBSD Foundation (commit)
MFC after: 3 days
All changes are no-ops and are one of:
- Name changes of obsolete system calls in comments
- Correct prefixes on unimplemented freebsd32 system calls
- Currently unused macros for FreeBSD 14 compatablity
Bring in the LinuxKPI 802.11 compat bits which are altering
the mac80211 KPI.
* In struct ieee80211_bss_conf chandef -> chanreq.
* Various struct ieee80211_ops gained a link_id arguemnt,
stop gained a suspend flag.
* Various functions gained a link_id argument.
* ieee80211_tx_status() was renamed to ieee80211_tx_status_skb()
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Bring ing the LinuxKPI 802.11 compat bits which are not altering
the mac80211 ops KPI.
* Add various functions for drvier updates.
* Add functions (some compat code to I assume cleanup some
mac80211 ops) emulating chanctx changes doing (*config) updates.
* Adjust structs and defines.
* Deal with an enum growing more than 32 bits in printf.
* Add a mtx to struct wiphy which is exposed to the drivers.
Handle initialization and destruction for now.
* Implementation of wiphy_work and wiphy_delayed_work.
* Set was_assoc for deassoc/deauth in prep_tx_info.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Update rcu_dereference_{check,protected}() to call the check and log
once if it fails and if the RCU debug sysctl is turned on.
Also add proper checks for conditions passed in to these functions.
For that implement linux_rcu_read_lock_held() (lots of help from wulf).
(While here also remove extraneous extern for function prototypes).
Update lockdep_is_held() to always be an inline function with argument
annotation so that we do no longer have unused variables
in callers which only call lockdep_is_held().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D46842
PCI_IRQ_LEGACY was added in 366d68f283 (likely) for rtw88 only.
The define now got renamed and I cannot find any other use but
rtw88 and rtw89.
We keep the old name as comapt while driver updates are in
progress enabling it defining LINUXKPI_VERSION for the two drivers.
Sponsored by; The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46822
Add alloc_netdev_dummy() which is needed by an updated rtw88 driver.
Given we already call linuxkpi_init_dummy_netdev() ourselves allow the
setup function to be NULL to not initialize and start a tasq td twice.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D46802
Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.
LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).
Sponsored by: Netflix
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D46137
systrace.c fails to build if we're using a common compiler.h for both
openzfs and linuxkpi. The issue is easy enough to fix: don't redefined
lower_32_bits if it's already defined in linux.h, since it's the least
'standardized'. This will allow systrace.c to build using an equivalent
macro.
MFC After: 3 days
Sponsored by: Netflix
iwlwifi v6.11 started to use guard(). _T in the implementation needs
to be exposed to the driver which uses it in DEFINE_GUARD().
Given this is the first instance of attribute(cleanup) in the tree:
- gcc has support for it since at least 2003-06-04
(0bfa5f65bfb186f10d43304946fd7fcd69988732)
- llvm gained support on 2009-01-31
(d277d790e0f6f23043397ba919619b5c3e157ff3, llvm-svn 63462).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46843
Add time_is_before_jiffies() as needed by iwlwifi from v6.11.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46841
rtw89 TX path was faulting in linuxkpi_ieee80211_next_txq() due to a
"double scheduling" check in linuxkpI_ieee80211_schedule_txq() being
incorrect:
the next pointer may be NULL there if the element is the last in the
tailq, so correctly check tqe_prev. Without the fix we may have queued
the same element to the tailq twice, and because it was the last element
and had a NULL tqe_next, that NULL value would get propogated into
another node's tqe_prev on removal, and other such nastiness.
With this rtw89 no longer panics.
Reviewed by: bz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47006
Move some ieee8022_{is,has,get}_... functions working on header fields
from mac80211.h to ieee80211.h to avoid problems with #includes.
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Commit ff39d74aa9 ignored AT_NO_AUTOMOUNT for statx(), but did not
change fstat64() or newfstatat(), which also take an equivalent flags
argument. Add a linux_to_bsd_stat_flags() helper and use it in all
three places.
PR: 281526
Reviewed by: trasz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46711
Upstream new defines, enum values, etc. for coming driver updates which
are non-conflicting with the current state.
The only notable change is the rename of the enum ieee80211_ap_reg_power
but the enum name had not been used so far by any driver in the tree
(only in mac80211.h) but an updated version of ath11k does use it so we
need to correct our initial naming.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Add new enums to netdevice.h (including one which is referenced but
no value of it is used in a driver so we have to add a "dummy" value
to avoid an empty enum).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Add pci_err() as a wrapper to dev_err() as needed by an updated driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46660
Native Linux implementation sets this as a maximum between 1 and
ht/vht/eht rx SS'es, FreeBSD does the same, but uses 0 as a minimum,
which leads setting it to 0 if we're not in ht/vht case.
This 0 was breaking rtw89 driver, when it was trying to determine
SS number by subtracting 1 from rx_nss and passing the value to the
hardware.
After this patch rtw89 association and simple ping work reliably,
but more work is needed to make the driver robust with heavy traffic
(iperf3) and being long idle.
Reviewed by: bz
Approved by: bz
Sponsored by: Future Crew LLC
Differential Revision: https://reviews.freebsd.org/D46528
Factor out module_pci_driver() from 366d68f283 into a general
module_driver() so other bus attachments can also use the same kind
of macro without duplicating all the lines.
Redefine module_pci_driver() using the new general macro.
No functional changes intended.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D46467
As a consequence lkpi_ieee80211_ifalloc() now does not fail. Remove
unneeded NULL check.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45852
Add a version of no_printk(), which seems to be there to have format
string checking while never calling the printk. It seems a very weird
thing and it needs a return code and for some reason my initial
while (0) { } version hadn't worked while porting over new code but
could have been further downstream format string problems.
if (0) seems to do the job though I would have expected that to more
likely simply get optimised out without any futher format checking.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46463
Add an implementation of eth_hdr() needed by a wireless driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46462
Used by an updated wireless driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46461
Add a get_random_u8() implementation following the u36 and u64 versions.
We'll likely want to macro-ify them in the future and add all the types
which makes sense just to be done.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46464
Callers of cdev_pager_free_page in the kernel always have object->type
== OBJT_MGTDEVICE. Define a function for them to call that skips the
runtime type check in cdev_pager_free.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D46389
When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
commands on half-failed drives.
Fixes: 9229b3105d (nvme: Fail passthrough commands right away in failed state)
Sponsored by: Netflix
Make the system call honor `AT_SYMLINK_NOFOLLOW`.
Also enable this from `linux_faccessat2` where the issue arised the first time.
Update manual pages accordingly.
PR: 275295
Reported by: kenrap@kennethraplee.com
Approved by: kib@
Differential Revision: https://reviews.freebsd.org/D46267
They are functionally equivalent, but the updated form mirrors the tests
in sys/net/ethernet.h and avoids confusion.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21037
disable hdmi_audio_infoframe_pack_for_dp function for now as it depends
on not imported yet drm sources and is not used by drm-kmod.
Reviewed by: manu
Sponsored by: Serenity CyberSecurity, LLC
Differential Revision: https://reviews.freebsd.org/D46224