From owner-acpi-jp@jp.freebsd.org  Thu Dec 14 20:42:18 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id UAA69284;
	Thu, 14 Dec 2000 20:42:18 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mass.osd.bsdi.com ([167.216.157.206])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id UAA69276;
	Thu, 14 Dec 2000 20:42:14 +0900 (JST)
	(envelope-from msmith@mass.osd.bsdi.com)
Received: from mass.osd.bsdi.com (localhost [127.0.0.1])
	by mass.osd.bsdi.com (8.11.1/8.11.1) with ESMTP id eBEBqC901666;
	Thu, 14 Dec 2000 03:52:12 -0800 (PST)
	(envelope-from msmith@mass.osd.bsdi.com)
Message-Id: <200012141152.eBEBqC901666@mass.osd.bsdi.com>
X-Mailer: exmh version 2.1.1 10/15/1999
To: acpi-jp@jp.freebsd.org
cc: iwasaki@jp.freebsd.org
In-reply-to: Your message of "Fri, 08 Dec 2000 00:08:36 +0900."
             <20001208000836H.haro@tk.kubota.co.jp> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Thu, 14 Dec 2000 03:52:12 -0800
From: Mike Smith <msmith@freebsd.org>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 964
Subject: [acpi-jp 964] Re: Some power device driver. 
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: msmith@freebsd.org

> ::>  4) Added creation of /dev/acpi_acad to etc/MAKEDEV
> ::
> ::I think this should be /dev/acpi_acad0 if we intend to support DEVFS.
> ::/dev/acpi_acad created by MAKEDEV would be hid by mounting DEVFS, so
> ::better to refer the same device filename as what created by
> ::make_dev().
> ::Or, always assuming there is only one AC Adapter on the machine, and
> ::have hard coded 'acpi_acad' in the device driver too.  This is another
> ::solution, but I prefer the formar.
> 
> '/dev/acpi_acad0' is fine with me.

Now that I've added ioctl registration to /dev/acpi, I hope that you'll 
consider just using /dev/acpi, and reserving some ioctls to interface to 
the battery, eg.

struct acpi_battery_info {
	...
};

union acpi_battery_args {
	int				arg;
	struct acpi_battery_info	batt;
};

#define ACPI_GET_BATTERY_INFO	_IOWR('A', 0x100, union acpi_battery_args);

Then in your ioctl handler, test for 'arg' == -1 and return the number
of batteries in arg, or otherwise return the info for battery 'arg' in
'batt'.

(This interface is also robust if the battery args structure size 
 changes, since that will change the ioctl number...)

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E


