acpi: Forbid requesting S4 when S4BIOS is not supported
Pending the OS-supported hibernate functionality, prevent requesting S4
when S4BIOS is not supported.
To this end, make sure that acpi_supported_stypes[] indicates that
POWER_STYPE_FW_HIBERNATE is not supported if 'acpi_s4bios_supported' is
false, even if S4 is supported by the platform (which is only
a power-down-like state, without any support to save the system image by
itself). This will cause requests to enter S4, which are translated to
POWER_STYPE_FW_HIBERNATE before reaching
acpi_ReqSleepState()/acpi_EnterSleepState(), to fail in this case.
Retire the 'hw.acpi.s4bios' sysctl knob, as having it to 0 by default
(S4BIOS not supported) or setting it to 0 (default is 1 when S4BIOS is
supported) could only lead, on a S4 request, to a power down without any
possibility to restore the system (and, since a recent commit, it has
not been possible anymore to force it to 1 when S4BIOS is not announced
supported in the FACS table, which would cause a failure or a crash).
[14 lines not shown]
libusb: implement zlp flag in libusb transfer
The USB protocol defines a Zero-Length Packet (ZLP) to signal the end of
a transfer when the data size is an exact multiple of the Maximum Packet
Size (MPS). Without a ZLP in such cases, the device may not be able to
determine that the transfer has completed.
This flag is added to libusb to allow the user send a ZLP in the end
of libusb_xfer.
Reviewed by: adrian
Sponsored by: The FreeBSD Foundataion
Differential Revision: https://reviews.freebsd.org/D51759
libusb: implement IAD parser
libusb provide functions to parse interface association descriptor. This
descriptor indicates that a function is composed by multiple interface
and which interfaces is associate to the target function. This
descriptor is not a separate USB require, instead, it comes with the
config descriptor.
Reviewed by: adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50958
libusb: implement libusb_get_max_alt_packet_size
The libusb has a function to calculate the size from given interface,
alt_setting, endpoint. Implementing it by refactoring the calculating
function for libusb_get_max_iso_packet_size.
Reviewed by: adrian
Sponsored By: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51225
libusb: implement libusb_set_option
Implement libusb_set_option for API compatibility of libusb upstream
The implementation status of each option is as following:
LIBUSB_OPTION_LOG_LEVEL: just like libusb_set_debug
LIBUSB_OPTION_LOG_CB: add callback support for DPRINTF
LIBUSB_OPTION_NO_DEVICE_DISCOVERY: disable initialization of devd and
netlink when register. Also, create no thread when registration of
callback happens.
LIBUSB_OPTION_USE_USBDK: no needed as USBDK is for Windows
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50818
tests.7: Remove an unused configuration variable
No existing tests require it, and I cannot understand what kinds of test
scenarios are supposed to require it. Just remove it.
While here, improve the documentation of test variables a bit.
Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56604
(cherry picked from commit 6bd97b5f3778aa36bcf89ff870bb1483b301a9be)
rpcsec_tls: Avoid a socket reference underflow in rpctls_server()
The upcall_sockets tree owns a ref on any resident socket. When a
socket is removed after a TLS handshake failure, rpctls_rpc_failed()
thus calls soclose().
rpctls_server() does not acquire an extra ref to compensate for this.
So, if the upcall fails, e.g., because rpc.tlsservd is not running,
we'll call soclose() to drop the reference, but this effectively
releases the xprt layer's reference.
Fix the problem by explicitly acquiring a socket reference when adding
a socket to the upcall tree.
PR: 289734
Reviewed by: rmacklem, glebius
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57555
[2 lines not shown]
tests: Fix race condition in aslr_setuid
Use a cloexec pipe to block the parent until the child is ready.
While here, redirect the output from ping to /dev/null, and mark the
test as requiring the inet feature since we ping the IPv4 loopback.
PR: 296116
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57734
jail.8: Fix two typos in the manual page
- s/Similarily/Similarly/
- s/passtrough/passthrough/
(cherry picked from commit d9e0452f0c8af6b0c03b0bb2e3b824095021e168)
LinuxKPI: 802.11: add function to update some rate related fields
Add lkpi_sta_supp_rates() which serves multiple purposes:
(a) build (and update) the supp_rates field on a sta link (deflink only
in our case still),
(b) build and update basic_rates on the vif->bss_conf and print a
warning in case we end up without any basic rate (should not happen
anymore, not even on initial startup sync),
(c) if HT or VHT are supported, then update the relevant br_mask fields
for the current band.
Deal with the various flags which trigger different updates by returning
them so the caller can act upon.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: make lkpi_sta_sync_from_ni() return bss_changes
This is a preparatory change with no functional changes.
Sponosred by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: add/change rate related tracing
Make use of the TRACE_RATES() macro and add various tracing events.
Also adjust some events formerly under TRACEOK to TRACE_RATES().
Ignoring the tracing, no other functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: consider emulate_chanctx in lkpi_sync_chanctx_cw_from_rx_bw()
Only return early if the bandwidth has not changed and we are not
using emulate_chanctx or the chandef.width already matches the new
bandwidth. Otherwise we have to continue to get all the values
updated.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: adjust timing of sync_from_ni in lkpi_sta_assoc_to_run()
We used to call the (*sta_state) downcall into the driver to set the
sta state to ASSOC. After that we did a lot of sync operations incl.
the lkpi_sta_sync_from_ni() which does a lot of rate and bandwith
adjustments. This sync call needs to happen before we set the sta
to assoc as drivers rely on some of this information, e.g., ht_cap and
vht_cap (and equivalents for later standards) at that point. Moving
this will make, e.g., mt7921 transmit at higher rates than just
basic_rates.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: track bandwidth/rx_nss change in lkpi_sta_sync_from_ni()
In lkpi_sta_sync_from_ni() track the bandwidth and rx_nss at the
beginning so at the end we can diff if they changed in order to generate
the appropriate RC*CHNAGED flags for the (*link_sta_rc_update) downcall.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap
During vap creating we inialize most [l]vif related variables.
Add a br_mask (bit rate mask) to the lvif and setup the legacy component
as it seems to be static.
Given we are looping over the bands, also initialize the bss_conf
basic_rates. At this point we only have all bitrates for the band
or the mandatory bitrates for the band available. In order to not
hint usage of possibly unsupported bit rates set it up with the
manadatory bit rates only, which should get us through the mgmt
frames, etc. to get to assoc state. By then we will do updates.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
LinuxKPI: 802.11: add 11g check to lkpi_ic_getradiocaps()
Replace an early comment with code and add a (simplified) 11g check.
We make use of the annotated bitrate flags we added (see
lkpi_wiphy_band_annotate()) and check if on the 2GHz band there are
any bitrates which are 11g. Upon the first one found we do set the
IEEE80211_MODE_11G to announce to net80211 that the 2.4Ghz channels
may operate on 11g as well.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days