From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 17 06:18:48 2014 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4ADA160C; Tue, 17 Jun 2014 06:18:48 +0000 (UTC) Received: from mail-oa0-x22a.google.com (mail-oa0-x22a.google.com [IPv6:2607:f8b0:4003:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07C5828BB; Tue, 17 Jun 2014 06:18:47 +0000 (UTC) Received: by mail-oa0-f42.google.com with SMTP id eb12so7492979oac.1 for ; Mon, 16 Jun 2014 23:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=L8vzFcyDtgr0v7LmyDT/OvJoVfcHKp6NPymQN6WiQ0o=; b=YB0iy/1KQMkvUG5jYsZzgXsF+EKTmoUCZ2fVhWTVGtBm+IbPwDfc6RRvP8+rfIjD3g kKrJzBJjd6PGczpG767q9YXIBfOdOwod096KE2BJ/KqRKC21kV98iYNJkoEehgJ9j5dJ sPAfeRbheMmY0Y6QrFWFgSroEZd88DOwFQaW0/IX3UeG6YdKUwxyentJakYX5PpGY2zD mPMjOnhbIJ5gU5MzFvPzsCMA+juw7Z8nvdm88epbsRrAAwatJZGn91oo773JyeZx6HsZ WMu8jcIWqXu7ZjRvxZ0olZ0ViUudKrlP8nngOPCC/yVJ8DhzV75qIBOMpmz3x77qwQf1 EGlg== MIME-Version: 1.0 X-Received: by 10.60.65.136 with SMTP id x8mr24682263oes.30.1402985927259; Mon, 16 Jun 2014 23:18:47 -0700 (PDT) Sender: tomek.cedro@gmail.com Received: by 10.202.75.207 with HTTP; Mon, 16 Jun 2014 23:18:47 -0700 (PDT) In-Reply-To: <20140617002905.GW31367@funkthat.com> References: <539F56E9.8070809@muc.de> <539F6B3F.2000308@att.net> <20140617002905.GW31367@funkthat.com> Date: Tue, 17 Jun 2014 08:18:47 +0200 X-Google-Sender-Auth: caOaO78el1i6Sl9_09F6OM-9Bac Message-ID: Subject: Re: sysctl hw.acpi.acline From: CeDeROM To: Anthony Jenkins , freebsd-hackers@freebsd.org, freebsd-acpi@freebsd.org, Armin Gruner Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2014 06:18:48 -0000 On Tue, Jun 17, 2014 at 2:29 AM, John-Mark Gurney 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 >> 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