Commit graph

296671 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
Baptiste Daroussin
ba5834b8e1 libusb: fix hotplug sigbus
When a hotplug callback has been registered, and the program using
libusb is calling libusb_exit then the thread handler is set to
NO_THREAD which result in the variable controlling the loop the be set
to 0, it does a last pass through device available without having done
a scan, which result in a sigbus after it tried to unregister all the
devices.

directly break the loop instead and cleanup the list of devices

this fixes the tests with LGPLed libusb's hotplugtest program

MFC After:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D48298
2025-01-04 11:20:49 +01:00
Gordon Bergling
d633a7d121 timeout(1): Add -v/--verbose option to show diagnosis info
The -v/--verbose option enables this utility to show diagnosis
info to stderr about any signal sent on timeout.

This implementation refers to GNU coreutils's timeout(1).

Reviewed by:	bapt, Alexander Ziaee (manpages)
Approved by:	bapt (src)
Obtained from:	DragonFlyBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48225
2025-01-04 09:52:56 +01: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
Gordon Bergling
6145586a6c ascii(7): Correct the history section
The man page ascii(7) first appears in the first edition manual.

Reviewed by:	imp, Alexander Ziaee
Obtained from:	OpenBSD
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D48224
2025-01-04 09:25:39 +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
Jung-uk Kim
98a2c01a88 Import ACPICA 20241212 2025-01-03 16:53:44 -05:00
Jung-uk Kim
ae8106ed3a Import ACPICA 20240927 2025-01-03 16:51:31 -05:00
Jung-uk Kim
e690145f81 Import ACPICA 20240827 2025-01-03 16:49:36 -05:00
Jung-uk Kim
b6246dbb66 Import ACPICA 20240321 2025-01-03 16:45:56 -05: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
Eric A. Borisch
d72f87c0fd
tcpdump/print-pflog: Print uid with host endianness
PR:		283799
Reported by:	eborisch@gmail.com
Reviewed by:	jrm, kp
Fixes:		0a7e5f1f02
2025-01-03 13:37:45 -04: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
John Baldwin
9c87cbbcaa cpu_machdep.9: New manpage describing the semantics of several cpu_*
This page is not exhaustive but covers all of the MD interface
functions currently declared in <sys/proc.h>.

Requested by:	kib
Reviewed by:	kib
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D48022
2025-01-03 11:02:43 -05:00
John Baldwin
ecb5fe3c5e nv.9: Add a new subsection documenting kernel-specific behavior
Reviewed by:	emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D48257
2025-01-03 10:51:51 -05:00
John Baldwin
ae1cc4182b nv.9: Editorial pass
Various rewording tweaks and clarifications to some behavior (e.g.
nvlist_size doesn't require calling nvlist_pack first).

Reviewed by:	pjd
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D48256
2025-01-03 10:51:28 -05:00
John Baldwin
826509a3c3 open.2: Editorial pass
- Use a typical tagged list for the open flags instead of a literal
  block.  This permits using markup in the flag descriptions.  Also,
  drop the offset to avoid indenting the entire list.

- Note that O_RESOLVE_BENEATH only applies to openat(2)

- Use a clearer description of O_CLOEXEC (what it means, not the
  internal flag it sets)

- Note that exactly one permission flag is required.

- Split up a paragraph on various flags so that each flag gets its own
  paragraph.  Some flags already had their own paragraph, so this is
  more consistent.  It also makes it clearer which flag a sentence is
  talking about when a flag has more than one sentence.

- Appease some errors from igor and man2ps

- In the discussion about a returned directory descriptor opened with
  O_SEARCH, avoid the use of Fa fd since the descriptor in question is
  a return value and not an argument to open or openat.

- Various and sundry markup and language tweaks

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D48253
2025-01-03 10:48:24 -05:00
John Baldwin
f586d52599 .cirrus-ci: Update the non-manual GCC build job to GCC 13
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D48291
2025-01-03 10:44:44 -05:00
John Baldwin
40ed89ffc3 .cirrus: Add manual amd64 and aarch64 jobs using GCC 14
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D48290
2025-01-03 10:44:33 -05:00
John Baldwin
22956bc9dc pac: Consistently use item count as the first argument to calloc
Reported by:	GCC 14 -Wcalloc-transposed-args
2025-01-03 10:44:27 -05:00
John Baldwin
f94513a3a3 pac: Use strdup and asprintf in place of dubious string building
GCC 14 warned about transposed arguments to calloc, but these cases
are better served by more abstract string functions.
2025-01-03 10:44:22 -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
Mark Johnston
526bd072b3 syslogd: Fix resource leaks
- nvlist_append_nvlist_array() makes a copy of the input nvlist, so the
  pattern of nvlist_append_nvlist_array(... cfline(...)) would leak
  memory and descriptors.  Pass the entire config nvlist to cfline()
  instead since this is needed for a future change.
- In parse_action(), free the linked list returned by getaddrinfo().
- Remove some checks at the beginning of close_filed().  For some log
  types we'll always have f->f_file == -1, in which case we wouldn't
  release other resources, such as forwarding sockets.
- After converting a filed to an nvlist, free the filed resources.

Fixes:	2567168dc4 ("syslogd: Refresh configuration using libcasper")
Reviewed by:	jfree
Differential Revision:	https://reviews.freebsd.org/D48250
2025-01-03 01:51:19 +00:00
Mark Johnston
1da99b479a syslogd tests: Permit starting syslogd with multiple -b options 2025-01-03 01:50:59 +00:00
Mark Johnston
3fb2371efd syslogd tests: Use atf_check when sending SIGHUP to syslogd 2025-01-03 01:50:39 +00: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