From nobody Fri Sep 04 23:07:30 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hcBv725RCz6qS9n for ; Fri, 04 Sep 2026 23:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hcBv66pPYz3mXd for ; Fri, 04 Sep 2026 23:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788563251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaZzgGpp+wjE3h1E5pyLMRtLjAoOj+SpbPc0mswU2Fs=; b=V8wwakLZd1WKLrI9iisDT2AkRPsaXElp3OxoB3N0Xgw2ThadJ0cEQKRIVFKAmOmLNZGCEU Q4FG44y6C5OF62NYPyPxb47XenxPZl9/ej6upzxoQB1k4iodPBG5npZpyQzgopnECQYjjS k7Gct3uANJ9LI0rWsLcCBw+c5em1tKXuw9tTZ0oprx5hxaqPYIb5GFws/eGFHD4+88BLff 9rprpkzbZ6QhPQHRUYO0EOm2vRynx3ehWuDzpex/DVFoKfAWb4K5nczITxzVyBl3x9meTj 1DAs9rpI+Dvru4T2RGdMRO5SMVCLWUd56OoOa+xkHWzLpdJTN9NfXzMeEeK8GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788563251; a=rsa-sha256; cv=none; b=OLTHykWWTXn0OEH79HrgzCkwJmCNf5vPm/CIZ3Emc9+xXzXSt6Npx4dUBF97gyPEburu5v SzorLi6mXfeMStwIp4Xl84hgrkatLNhfSVRDHfh46twmDbAQKEsUvzasEXFcD2SFabeJGQ EF9ViOX5o4Q6K/xkNkkfAROqUnFQSdb8ghSCpkJnX/wL+9TPI9S05ivTHUnvMerqc1QIi3 F1A22g8uEpyBn8s3DM/m+EMXcrMKhRXHjunnZfXbcdyTlWo6KH6AqGZ3OSQqiC3r1sFUow kBR/xK0sFlZrGsfQ5xQaHFrLkoVJoxtqE0N10QLynC+u6u6lLyTOzX4KN+chUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788563251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oaZzgGpp+wjE3h1E5pyLMRtLjAoOj+SpbPc0mswU2Fs=; b=aI9pujZznKgCwy/6aP1EjYyV4QVClLLCv9it5OD6v7Em+uIACfpSZ0tCEkPT78h++dpMGz j5dBHj0Y9zCIq/Bjrayw9CLj0G4nBWJcleqb4esoOIzRH/vvImwdt0P4nhazdU9vgq9UnP cJNZf2AauiijApKX9RK5md57UIV5Bbcmos+OMrTyl+Ip5Hgv6Fjvvgif/oKHFh2iPNfTY0 DLGz5YqF3IZ4Z8TtG1iYlUwegSNitMz90xy6LDFvrSpWIkmIVpwQATkmg/ZGb01BFNj4iJ XeM4cxUU3tmKyPuT+QV6/N07zjbIvbQEkItl9eKTuWlSQABiItt0CgJiAJsTNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcBv65sjkz4xy for ; Fri, 04 Sep 2026 23:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 430eb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 04 Sep 2026 23:07:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: 0fb34d22351e - stable/15 - asmc: rename wol sysctl to auto_poweron List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0fb34d22351e2816082047bf0b586af50db3caba Auto-Submitted: auto-generated Date: Fri, 04 Sep 2026 23:07:30 +0000 Message-Id: <6a9b4f32.430eb.2414e604@gitrepo.freebsd.org> The branch stable/15 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=0fb34d22351e2816082047bf0b586af50db3caba commit 0fb34d22351e2816082047bf0b586af50db3caba Author: Abdelkader Boudih AuthorDate: 2026-05-04 14:26:44 +0000 Commit: Enji Cooper CommitDate: 2026-09-04 23:07:00 +0000 asmc: rename wol sysctl to auto_poweron 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 (cherry picked from commit 36b399f55e3fa16063188b6f8ad8eaaf8c2215ab) --- share/man/man4/asmc.4 | 9 ++++++++- sys/dev/asmc/asmc.c | 24 ++++++++++-------------- sys/dev/asmc/asmcvar.h | 4 +++- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/share/man/man4/asmc.4 b/share/man/man4/asmc.4 index 37976922acae..9216f48498fd 100644 --- a/share/man/man4/asmc.4 +++ b/share/man/man4/asmc.4 @@ -1,4 +1,4 @@ -.\"- +.\" .\" Copyright (c) 2007, 2008, 2009 Rui Paulo .\" All rights reserved. .\" @@ -112,6 +112,13 @@ minimum fan speed, the minimum speed and the maximum speed respectively. .Pp All values are in RPM. +.Sh POWER MANAGEMENT +The +.Va dev.asmc.%d.auto_poweron +sysctl controls whether the machine automatically powers on when AC power +is restored after an unclean power loss +.Pq SMC key Dq AUPO . +A value of 1 enables automatic power-on; 0 disables it. .Sh RAW SMC KEY ACCESS When the kernel is compiled with the .Dv ASMC_DEBUG diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 5fe89d85be6d..8cd7842d03fd 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -123,7 +123,7 @@ static int asmc_mbp_sysctl_light_left(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_right(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS); -static int asmc_wol_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_aupo_sysctl(SYSCTL_HANDLER_ARGS); static int asmc_key_getinfo(device_t, const char *, uint8_t *, char *); @@ -793,14 +793,14 @@ asmc_init(device_t dev) device_printf(dev, "SMC revision: %x.%x%x%x\n", buf[0], buf[1], buf[2], ntohs(*(uint16_t *)buf + 4)); - /* Wake-on-LAN convenience sysctl */ + /* Auto power-on after AC power loss (AUPO). */ if (asmc_key_read(dev, ASMC_KEY_AUPO, buf, 1) == 0) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "wol", + OID_AUTO, "auto_poweron", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, - dev, 0, asmc_wol_sysctl, "I", - "Wake-on-LAN enable (0=off, 1=on)"); + dev, 0, asmc_aupo_sysctl, "I", + "Auto power-on after AC power loss (0=off, 1=on)"); } sc->sc_nfan = asmc_fan_count(dev); @@ -1222,7 +1222,7 @@ out: /* * Raw SMC key access sysctls - enables reading/writing any SMC key by name * Usage: - * sysctl dev.asmc.0.raw.key=AUPO # Set key, auto-detects length + * sysctl dev.asmc.0.raw.key=TC0P # Set key, auto-detects length * sysctl dev.asmc.0.raw.value # Read current value (hex bytes) * sysctl dev.asmc.0.raw.value=01 # Write new value */ @@ -2338,18 +2338,17 @@ asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS) } /* - * Wake-on-LAN convenience sysctl. - * Reading returns 1 if WoL is enabled, 0 if disabled. - * Writing 1 enables WoL, 0 disables it. + * Auto power-on after AC power loss (AUPO key). + * When non-zero the machine boots automatically when AC is restored + * after an unclean power loss. Useful for always-on servers / home labs. */ static int -asmc_wol_sysctl(SYSCTL_HANDLER_ARGS) +asmc_aupo_sysctl(SYSCTL_HANDLER_ARGS) { device_t dev = (device_t)arg1; uint8_t aupo; int val, error; - /* Read current AUPO value */ if (asmc_key_read(dev, ASMC_KEY_AUPO, &aupo, 1) != 0) return (EIO); @@ -2358,10 +2357,7 @@ asmc_wol_sysctl(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); - /* Clamp to 0 or 1 */ aupo = (val != 0) ? 1 : 0; - - /* Write AUPO */ if (asmc_key_write(dev, ASMC_KEY_AUPO, &aupo, 1) != 0) return (EIO); diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 9bb89de1b1d3..90e1d93c51be 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -175,7 +175,9 @@ struct asmc_softc { #define ASMC_KEY_CLAMSHELL "MSLD" /* RO; 1 byte */ /* - * Auto power on / Wake-on-LAN. + * Auto power-on after AC power loss (AUPO). + * When set, the machine boots automatically when AC power is restored + * after an unclean power loss. This is NOT Wake-on-LAN. */ #define ASMC_KEY_AUPO "AUPO" /* RW; 1 byte */