Commit graph

153674 commits

Author SHA1 Message Date
Bjoern A. Zeeb
95a7aa8009 LinuxKPI: 802.11: implement wiphy_{,un}lock()
This will help us to get minimally better lock coverage in iwlwifi
though not yet against the LinuxKPI implementation which will likely
switch to this in the future.  At least the TODO() logging noise is
out of the way.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-01-04 14:00:13 +00:00
Emmanuel Vadot
f57db7955a modules: dtb: allwinner: Remove sun8i-h2-plus-orangepi-r1.dts
Remove sun8i-h2-plus-orangepi-r1.dts for now, latest update changed some
/delete-node/ places and this confuse our dtc.
2025-01-04 09:38:50 +01:00
Jung-uk Kim
62e841ccce acpica: Import ACPICA 20241212 2025-01-03 17:58:38 -05:00
Jung-uk Kim
1a259ad4ab acpica: Merge ACPICA 20240927 2025-01-03 17:42:12 -05:00
Jung-uk Kim
92f570c32e acpica: Import ACPICA 20240827 2025-01-03 17:41:26 -05:00
Jung-uk Kim
804fe26603 acpica: Import ACPICA 20240321 2025-01-03 17:35:05 -05:00
Gleb Smirnoff
e9255dafa1 pf: netlink KPI use cleanup
- use nlf_p_empty instead of declaring own empty array
- don't declare _IN() macro when we don't parse a header

Reviewed by:		kp
Differential Revision:	https://reviews.freebsd.org/D48306
2025-01-03 14:25:10 -08:00
Michael Tuexen
88766e7af5 TCP BBR: fix integer overflow
Use 64-bit arithmetic.

Reviewed by:		rrs
CID:			1523806
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48302
2025-01-03 19:44:43 +01:00
Andrew Turner
b714eacb79 acpi: Pass the correct device to acpi_pcib_osc
Fix a copy-and-paste error in acpi_pcib_request_feature where the
child device was passed into acpi_pcib_osc rather than the pcib
device.

Reviewed by:	garga, jhb
Fixes:	ba1904937d ("acpica: Extract _OSC parsing to a common file")
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48285
2025-01-03 16:10:41 +00:00
Andrew Turner
143dff0f9c pci: Only claim to support PCI ASPM on x86
We claim to support Active State Power Management, but don't appear to
do anything different in the kernel when it's enabled other than tell
the firmware we do.

This breaks VMware Fusion on Apple Silicon when it's enabled as it
expects the kernel to enable the ports. As it is reported to be needed
on some x86 servers keep it enabled there, but disable on non-x86
architectures.

Reported by:	kp, tuexen
Reviewed by:	tuexen, mav, imp, jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48303
2025-01-03 16:10:41 +00:00
John Baldwin
0e742cc774 cpu_set_upcall / linux_clone_thread: Remove calls to cpu_thread_clean
This is intended to clean state of a thread at the end of its
lifecycle during wait(), not the beginning of its life cycle.

Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D48023
2025-01-03 11:03:08 -05:00
Michael Tuexen
4173a3a009 TCP BBR: simplify expression
rsm cannot be NULL, when calling bbr_update_bbr_info().
So no need to check partially for it. No functional change intended.

Reviewed by:		rrs
CID:			1523803
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48293
2025-01-03 14:22:25 +01:00
Michael Tuexen
deb4252e9e TCP RACK: remove un-needed assignment
No functional change intended.

Reviewed by:		rrs
CID:			1523768
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48292
2025-01-03 14:20:19 +01:00
Adrian Chadd
64ecfc27db rtwn: add forcerate flag to TX descriptor setup
When doing firmware rate control there will be situations where
the rate being passed in needs to actually override the rate
control selection.  So add a flag to the descriptor setup path
to indicate that indeed this particular rate should be forced,
rather than rely on the firmware rate control.

This is currently a no-op as firmware rate control isn't working
in-tree, but it is working for me locally with other changes.
Without this, there's no way to force low rates for management,
DHCP traffic, and to allow fixed rate via "ifconfig wlanX ucastrate Y"
to function.

Locally tested:

* RTL8192CU, STA mode (firmware and driver/net80211 rate control)

Differential Revision:	https://reviews.freebsd.org/D48100
Reviewed by:	bz, gavin
2025-01-02 17:24:01 -08:00
Adrian Chadd
2be951a526 rtwn: enable VHT if it's configured in the device
If the driver attach path adds the VHT flag then add the 20/40/80 MHz
VHT channels.

This is a no-op right now as nothing is enabling it.

Differential Revision:	https://reviews.freebsd.org/D48097
Reviewed by:	bz
2025-01-02 17:18:16 -08:00
John Baldwin
925e1016b1 puc: Use device_delete_children if attach fails
This is slightly simpler than deleting individual devices.

Differential Revision:	https://reviews.freebsd.org/D47974
2025-01-02 13:25:38 -05:00
John Baldwin
d174ffca3a mfi: Use bus_generic_detach to simplify deleting children during detach
Differential Revision:	https://reviews.freebsd.org/D47973
2025-01-02 13:25:27 -05:00
John Baldwin
11a9117871 Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to
device_delete_child.

Differential Revision:	https://reviews.freebsd.org/D47972
2025-01-02 13:25:12 -05:00
John Baldwin
0ac15e476d spibus: Use bus_generic_* directly instead of wrappers
Differential Revision:	https://reviews.freebsd.org/D47971
2025-01-02 13:25:01 -05:00
John Baldwin
aa48c1ae08 etherswitch: Cleanup detach and delete of child devices during detach
Call bus_generic_detach first and return any error.  Remove no longer
needed individual device_delete_child calls.

Differential Revision:	https://reviews.freebsd.org/D47970
2025-01-02 13:24:46 -05:00
John Baldwin
3ddaf8200b Use bus_generic_detach instead of device_delete_children in detach
While here, check for errors from bus_generic_detach and move it to
the start of detach if necessary.

Differential Revision:	https://reviews.freebsd.org/D47969
2025-01-02 13:24:28 -05:00
John Baldwin
20f932af29 bhnd bcma/siba: Remove duplicate call to device_delete_children
bcma/siba_add_children already call device_delete_children if an error
occurs.

Differential Revision:	https://reviews.freebsd.org/D47968
2025-01-02 13:24:13 -05:00
John Baldwin
919f911ea4 siba: Use device_delete_children in siba_add_children
Differential Revision:	https://reviews.freebsd.org/D47967
2025-01-02 13:23:54 -05:00
John Baldwin
64d1a02e4e Check for errors from bus_generic_detach in various drivers
In some cases, move the call to bus_generic_detach earlier so that any
detach failures from child devices do not leave the parent device
partially detached.

Differential Revision:	https://reviews.freebsd.org/D47966
2025-01-02 13:23:41 -05:00
John Baldwin
6da28bb2a3 csa/emu10kx: Simplify deleting child devices
Use bus_generic_detach to detach and delete all child devices instead
of several explicit calls to device_delete_child.

Differential Revision:	https://reviews.freebsd.org/D47965
2025-01-02 13:23:28 -05:00
John Baldwin
faf0bf43df cgem: Cleanup detaching of child miibus device
Move bus_generic_detach earlier in place of the existing
device_delete_child.

Differential Revision:	https://reviews.freebsd.org/D47964
2025-01-02 13:23:16 -05:00
John Baldwin
e74465f177 cpsw: Remove duplicate call to bus_generic_detach
Differential Revision:	https://reviews.freebsd.org/D47963
2025-01-02 13:23:02 -05:00
John Baldwin
160179ea3e Remove now-redundant calls to device_delete_children
Earlier calls to bus_generic_detach now take care of deleting
children.

Differential Revision:	https://reviews.freebsd.org/D47962
2025-01-02 13:22:50 -05:00
John Baldwin
4e62c3cafa Remove now-redundant calls to device_delete_child
Deleting a child explicitly before calling bus_generic_detach is now
redundant, so remove those calls and rely on bus_generic_detach to
delete children instead.

Differential Revision:	https://reviews.freebsd.org/D47961
2025-01-02 13:22:35 -05:00
John Baldwin
cf416f56eb Use the new bus_generic_detach directly in place of home-grown versions
Differential Revision:	https://reviews.freebsd.org/D47960
2025-01-02 13:22:20 -05:00
John Baldwin
b196276c20 bus_generic_detach: Delete children after detaching them
This provides better semantics as a standalone DEVMETHOD for
device_attach as bus drivers should remove child devices they created
as part of detach cleanup.  The implementation calls
bus_detach_children() first to permit child devices an opportunity to
veto the detach operation.  If that succeeds, device_delete_children()
is used to delete the child devices.

This requires fixing various drivers that were deleting devices
explicitly (via a device_t pointer cached in the softc) after calling
bus_generic_detach to stop doing that and just rely on
bus_generic_detach to remove child devices.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47959
2025-01-02 13:21:30 -05:00
John Baldwin
28f5e880e8 Use device_delete_children instead of explicit calls to device_delete_child
This is simpler and more robust in the face of potential double-frees
(e.g. if called after bus_generic_detach which will delete devices in
a future commit).

Reviewed by:	manu, imp
Differential Revision:	https://reviews.freebsd.org/D47958
2025-01-02 13:20:21 -05:00
John Baldwin
e9d3857040 Use bus_detach_children instead of bus_generic_detach
These drivers perform additional teardown steps in between detaching
child devices and deleting child devices.

Differential Revision:	https://reviews.freebsd.org/D47957
2025-01-02 13:19:39 -05:00
Ruslan Bukin
9be0058ea0 riscv vmm: virtual timer support.
Add a virtual timer implementation based on SBI Time extension.
This is needed for Eswin EIC7700 SoC which does not include the newer SSTC
extension.

Timer interrupt pending bit (STIP) could not be cleared in the guest system,
so rework interrupts handling: add new "interrupts_pending" field. Use it
for timer interrupt only for now, but later we can extend to store all
pending interrupts (Timer, IPI and External).

With this I'm able to boot FreeBSD (SMP) guest on HiFive Premier P550,
which is the first real hardware with RISC-V 'H'-spec included.

Differential Revision: https://reviews.freebsd.org/D48133
2025-01-02 16:02:39 +00:00
Michael Tuexen
8471791eb6 TCP RACK: simplify condition
It is already known that rsm != NULL, so no need to check for it.

Reviewed by:		rrs
CID:			1523815
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48282
2025-01-02 16:19:30 +01:00
Michael Tuexen
c7e81cc043 TCP BBR: do not log an uninitialized value
Reviewed by:		rrs
CID:			1523789
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48281
2025-01-02 16:17:05 +01:00
Emmanuel Vadot
b2d2a78ad8 Import device-tree files from Linux 6.12 2025-01-02 10:12:13 +01:00
Emmanuel Vadot
0e8011faf5 Import device-tree files from Linux 6.11 2025-01-02 10:10:48 +01:00
Emmanuel Vadot
7d0873ebb8 Import device-tree files from Linux 6.10 2025-01-02 10:09:19 +01:00
Emmanuel Vadot
01950c46b8 Import device-tree files from Linux 6.9 2025-01-02 10:06:22 +01:00
Michael Tuexen
3b9da3dcd1 TCP RACK: avoid using uninitialized tot_idle variable
Reviewed by:		rrs
CID:			1540027
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48277
2025-01-01 18:42:00 +01:00
Michael Tuexen
1781324db2 TCP BBR: remove code which is never executed
USEC_2_TICKS() returns at least 1.

Reviewed by:		rrs
CID:			1523775
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D4827
2025-01-01 18:39:23 +01:00
Xin LI
b55baa8139 copyright: Happy New Year 2025 2025-01-01 00:04:28 +00:00
Adrian Chadd
cbc331d153 rtwn: fix builds on non-x86 platforms
The powerpcspe build is spitting out uint64_t != unsigned long, so this
fails.  Comment out the logging for now to unbreak the build.
2024-12-31 14:45:52 -08:00
Adrian Chadd
aa17878371 rtwn: print out the firmware file being loaded
The firmware version isn't enough; different firmware is loaded
for different revisions of a given chip.  So print out the file too;
it'll make handling reports much easier.

Differential Revision:	https://reviews.freebsd.org/D48067
Reviewed by:	emaste
2024-12-31 13:58:17 -08:00
Michael Tuexen
5ec914e06c TCP BBR: fix condition when sending a tail loss probe
Reviewed by:		rrs
CID:			1523793
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48274
2024-12-31 22:03:13 +01:00
Michael Tuexen
0ce13b1d58 TCP RACK: add comment
Indicate that the missing of the break is intentionally.

Reviewed by:		rrs
CID:			1523782
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48273
2024-12-31 21:51:58 +01:00
Adrian Chadd
06b7335701 rtwn: add rtwn_ctl_vhtrate(), some cleanups
* remove the hard-coded ridx values in rate2ridx(), use the RIDX
  defines for CCK/OFDM rates

* Add a placeholder rtwn_ctl_vhtrate() which returns the dot11rate
  control rate to use for the given VHT rate index.  Since net80211
  currently doesn't have any VHT PHY tables, there's no mapping for
  us to leverage so just return OFDM 12M for now.

* Use the new macro to convert rate index to MCS rate

* Add a printf() in rate2ridx if it's passed a HT/VHT rate.

Differential Revision:	https://reviews.freebsd.org/D48098
Reviewed by:	bz
2024-12-31 11:13:26 -08:00
Adrian Chadd
307f9c3515 rtwn: only set INIRATE if we're not doing firmware rate control.
This register (array) controls the initial rate to use for each
MACID.  There's no need to set it if firmware rate control is enabled -
it'll actually be under firmware control (and we can read it back to
see what choices the firmware is making.)

Locally tested:

* RTL8188EU, STA
* RTL8192CU, STA
* RTL8192EU, STA

Differential Revision:	https://reviews.freebsd.org/D48094
Reviewed by:	bz
2024-12-31 11:12:57 -08:00
Adrian Chadd
af2e102c40 rtwn: enable periodic TX reporting support on RTL8188EU NICs.
The RTL8188E firmware doesn't have the "full" offload firmware
rate control.  Instead, the vendor driver has a bunch of logic
in the driver for rate probing and selection.

Part of this is the periodic TX report - which uploads a summary
of multi-rate retries and drops per MAC.  Using it drastically
cuts down on the TX notifications - it's fired from a timer
(defaulting to ~ 1.6 seconds) and is a single receive frame in
the normal bulk RX path.

I've not ported / reimplemented the whole vendor driver rate adaption
code - instead, I'm just using the normal net80211 rate control APIs.
It seems to behave OK - I get 25-30mbit down and 20mbit up using TCP/
speedtest.

Locally tested:

* RTL8188EU, STA mode

Differential Revision:	 https://reviews.freebsd.org/D48088
Reviewed by:	fuz, bz
Obtained from:	https://github.com/lwfinger/rtl8188eu/blob/master/hal/Hal8188ERateAdaptive.c
2024-12-31 11:11:33 -08:00