The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.
Reviewed by: Minsoo Choo <minsoo@minsoo.io>, imp
Differential Revision: https://reviews.freebsd.org/D56517
Older SMC firmware exposed AUPO as a Wake-on-LAN control. On updated
firmware, the key controls automatic power-on when AC power is restored
after a power loss; WoL is handled by the GBE controller instead.
Rename the sysctl to reflect the current semantics. No compatibility
alias is provided as the sysctl has not appeared in any release.
Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D56747
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.
MFC after: 3 days
Relnotes: yes
Reported by: adamw, arrowd, linimon
Differential Revision: https://reviews.freebsd.org/D55441
Which contains only the source code file.
While here, remove trailing empty lines in the end of the page.
Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D56659
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.
The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.
The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.
This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.
The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.
Reviewed by: bz, olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
Import groups(7) from NetBSD, with tweaks for our system. The group
list is sorted by GID. All the group names from /usr/src/etc/group
are described, except "uucp". The FILES section was added on top of
the original manual page.
PR: 264966
Relnotes: yes
MFC after: 3 days
Obtained from: NetBSD
Reviewed by: des, ziaee
Differential Revision: https://reviews.freebsd.org/D54114
Removes the deprecated loader tunable fixup_needs_csum. Removes also
the sysctl counter rx_csum_bad_offset that is no longer in use.
Reviewed by: tuexen
Event: Wiesbaden Hackathon 2026
Differential Revision: https://reviews.freebsd.org/D55588
- Rename `.Nm .rhosts` to `.Nm rhosts` to match the MLINK for the
manpage.
- Use `.Pa` instead of `.Nm` when discussing the paths for `.rhosts` and
`hosts.equiv.5` for explicitness and clarity.
Bump .Dd for the change.
MFC after: 1 week
- Add `.Nm` section for securelevel(7) to match corresponding MLINKS entry.
- Fix the spelling for mac(4) (the actual subsystem manpage is spelled out in
lowercase.
MFC after: 1 week
Remove the perfmon performance monitoring facility that was for Intel
Pentium and Pentium Pro processors.
Reviewed by: imp,mhorne,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/2155
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons. From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.
Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.
Reviewed by: csjp, des (earlier version)
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D56592
pf_route() and pf_route6() forward broadcast and multicast traffic
when a route-to rule matches, without any check against the output
interface's broadcast domain. This is a deliberate property of the
route option code path, but it is not documented and the workaround
is non-obvious.
Document the behavior in pf.conf(5) with example block-out rules on
the target interface, scoped with the received-on qualifier so that
only forwarded traffic is dropped while the router's own broadcast
and multicast traffic continues to pass.
Add regression tests covering the full broadcast/multicast and
forwarded/local matrix on both IPv4 and IPv6.
Reviewed by: glebius, kp
Approved by: kp (mentor)
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D56559
Many applications, desktop environments, window managers & text editors
favor the usage of Alt or Ctrl over Super (Cmd). On a Macbook it is
quite annoying that the Super (Cmd) key gets pride of place by the spacebar.
The standard MacBook Cmd key location only really makes sense for macOS
or maybe in some tiling wm if Mod4/Super is your main modifier.
For most mainstream desktops and window managers, having Alt or Ctrl
in that location makes much much more sense.
This patch adds two sysctls for swapping either Opt(Alt) or Ctrl with Cmd(Super).
Linux has similar sysctls to this; allowing a user to make an Apple
keyboard more "orthodox"/useful at a level that takes effect independent
of typing context - ie) tty, Xorg and/or wayland.
Having a sysctl to do these swaps means that a user doesn't have to faff
about with both creating a custom vt keymap AND figure out which magic
setxkbmap incantation one needs to make one's keyboard behave as desired
across environments.
Signed-off-by: ~Not Toby <0x2b@0xff.art>
Reviewed by: wulf
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/2141
Be more explicit that deleting old files and libraries needs to be
really after you're rebooted a third time and you're really actually
sure your applications aren't using old libs, following irc discussion.
Also adjust an example slightly to fit on 80 character console.
MFC after: 3 days
Discussed with: emaste, fuz, jhb
Differential Revision: https://reviews.freebsd.org/D54079
Previous authors appear to have prioritized brevity over clarity. This
unfortunately resulted in a manual page that left its reader with the
false impression that Kyua is difficult to use. Attempt to correct
this by providing more and simpler examples with longer explanations.
While here, correct outdated information about where Kyua stores its
logs and results.
MFC after: 1 week
Reviewed by: ziaee, ngie
Differential Revision: https://reviews.freebsd.org/D56475
Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing
in-tree uses it, but this will make it easier to keep building. Updated
src.conf.5 with a few extra changes...
Sponsored by: Netflix
Add a per-interface loader tunable dev.rge.%d.disable_aspm to
disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127.
Disabling ASPM reduces latency at the cost of higher power
consumption. Default is off (ASPM left as configured by BIOS).
Signed-off-by: Christos Longros <chris.longros@gmail.com>
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D56103
HID driver for Apple IR receivers (USB HID, vendor 0x05ac).
Supports Apple Remote and generic IR remotes using NEC protocol.
Supported hardware:
- Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440)
Apple Remote protocol (proprietary 5-byte HID reports):
- Key down/repeat/battery-low detection
- 17-key mapping with two-packet command support
- Synthesized key-up via 125ms callout timer
Generic IR remotes (NEC protocol):
- Format: [0x26][0x7f][0x80][code][~code]
- Checksum: code + ~code = 0xFF
- Default keymap with 8 common codes
- See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol
Output via evdev with standard KEY_* codes.
Raw HID access available at /dev/hidraw0 for custom remapping.
Based on protocol reverse-engineering by James McKenzie et al.
Reference: drivers/hid/hid-appleir.c (Linux)
Tested on Mac Mini 2011 (0x05ac:0x8242).
Differential Revision: https://reviews.freebsd.org/D55472
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
and control of undocumented features.
The interface provides four sysctls under dev.asmc.0.raw.*:
- key - Set the 4-character SMC key name (e.g., "AUPO")
- value - Read/write key value as a hex string
- len - Auto-detected key value length (can be overridden)
- type - Read-only 4-character type string (e.g., "ui8", "flt")
Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.
This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.
Reviewed by: ngie, adrian, markj
Differential Revision: https://reviews.freebsd.org/D54441
Break the examples into subsections, so that we can have multi-step
examples.
MFC after: 3 days (to 15 only)
Discussed with: ivy
Differential Revision: https://reviews.freebsd.org/D55526
This is a more extendable version than traditional hashinit(9). It allows
different kinds of slot headers with optional locks.
Implement traditional hashinit()/hashdestroy() on top of it.
Reviewed by: pouria, gallatin
Differential Revision: https://reviews.freebsd.org/D55904
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default. On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.
Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.
Update rge.4 to document WoL support.
Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.
Signed-off-by: Christos Longros <chris.longros@gmail.com>
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D56259
This is part 3 of the support for the new Intel Ethernet E610
family of devices
The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.
When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.
This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.
Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: ziaee, kbowling
Tested by: Mateusz Moga <mateusz.moga@intel.com>
MFC after: 1 weeks
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D53973
This patch changes the default value of the loader tunable
hw.virtio.pci.transitional to 1. This means, virtio uses the
modern mode for transitional devices by default.
The return values of vtpci_modern_probe() and vtpci_legacy_probei()
were chosen to prefer modern mode, but hw.virtio.pci.transitional=0
prevents modern mode.
Setting hw.virtio.pci.transitional to 1 by default seems a better fit.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D55894
WITHOUT_BZIP2_SUPPORT only affects a single binary, gzip(1); it doesn't
remove bzip2 support from other bits (e.g., libarchive) and there are
no similar options for gzip, xz or zstd.
WITHOUT_BZIP2 has not done anything at all since it was first added
in 2007.
MFC after: never
Discussed on: arch@
Reviewed by: imp, des, adrian, delphij, emaste
Differential Revision: https://reviews.freebsd.org/D56148
Sponsored by: https://www.patreon.com/bsdivy