Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jun 2014 08:18:47 +0200
From:      CeDeROM <cederom@tlen.pl>
To:        Anthony Jenkins <Anthony.B.Jenkins@att.net>, freebsd-hackers@freebsd.org,  freebsd-acpi@freebsd.org, Armin Gruner <ag@muc.de>
Subject:   Re: sysctl hw.acpi.acline
Message-ID:  <CAFYkXjm9giHjdVUDTEJ3zvN3XRmRDOBoww%2B5GiUERh_UFg4hcA@mail.gmail.com>
In-Reply-To: <20140617002905.GW31367@funkthat.com>
References:  <CAFYkXj=cN=A7ZRs-N5xoER51=daMaaS4uBCQLpfnOC0=Mg0WuA@mail.gmail.com> <539F56E9.8070809@muc.de> <CAFYkXjn4nxAcvZjsjUR5HPz6tY_rNyb5Hg98QtaK3n0hGZxPFA@mail.gmail.com> <539F6B3F.2000308@att.net> <CAFYkXj=7pa6mECqjWnpAyE%2BB7MhDFb8KPYfbWa0-hGW67ki1bw@mail.gmail.com> <20140617002905.GW31367@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 17, 2014 at 2:29 AM, John-Mark Gurney <jmg@funkthat.com> wrote:
> CeDeROM wrote this message on Tue, Jun 17, 2014 at 00:25 +0200:
>> On Tue, Jun 17, 2014 at 12:10 AM, Anthony Jenkins
>> <Anthony.B.Jenkins@att.net> wrote:
>> > The absence of hw.acpi.battery and child oids probably implies there is no battery and the system may be assumed to be on line (A/C) power.
>>
>> Hello Anthony! I would prefer to have that information clearly defined
>> in the manual :-) I guessed that this is a quick fix to first check
>
> Which manual?

man acpi


> ACPI have tons of optional stuff that isn't required to be present,
> and apparently acline is one of them.  Also, acline is only useful
> if there are multiple power sources, what if you have a desktop
> machine always running off a battery, if we defaulted acline=1, then
> you'd complain that the status is wrong... :)

There is no information in the ACPI Manual that the OID's are optional
and may not exist in some cases. This is exactly the problem, an
undefined and undocumented situation. Maybe its just worth putting a
note :-)

"
     hw.acpi.acline
             AC line state (1 means online, 0 means on battery power).
"

I expect code based on this oid to work on both desktop and laptop
with no additional guessing. For me this manual information means that
acline oid is always available, and will show 1 in case of desktop
where no battery (maybe no UPS as well) is available. There is no
information that this oid is optional. For desktop/server a battery
power would mean UPS, right, so then I would also expect to see the
battery charge status information.. but I understand this would be
more complicated than in a laptop thus may not be implemented. Still,
I would always expect power source type OID to tell me what is the
power source, even if there can be only one.

Best regards :-)
Tomek


-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjm9giHjdVUDTEJ3zvN3XRmRDOBoww%2B5GiUERh_UFg4hcA>