lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Jul 2006 15:56:45 -0700
From:	Greg KH <greg@...ah.com>
To:	Pavel Machek <pavel@...e.cz>
Cc:	"Brown, Len" <len.brown@...el.com>,
	Shem Multinymous <multinymous@...il.com>,
	Matthew Garrett <mjg59@...f.ucam.org>, vojtech@...e.cz,
	kernel list <linux-kernel@...r.kernel.org>,
	linux-thinkpad@...ux-thinkpad.org, linux-acpi@...r.kernel.org
Subject: Re: Generic battery interface

> > sysfs is great for demos from a shell prompt,
> > but isn't such a great programming interface, either
> > from inside the kernel or from user-space.

I would tend to dispute this point :)

> Anyone volunteers write battery layer? If so, I'd go with /dev/XXX,
> otherwise I'd go with /sys/XXX, because it is simpler to code, and I
> believe it is also good enough...

Please go with /sys/battery/batteryN/XXXX, not an ioctl filled /dev/
interface that can not easily be scripted.

That way it is extensable (if the specific battery type just doesn't
provide a specific functionality, that sysfs file will not be present),
it allows for polling if needed, and would unify all the different types
of batteries.

Look at the kind of documentation the hwmon and i2c people have
created[1] for how to specify sysfs interfaces for different types of
sensor devices.  It should not be that hard to create the same for
something as "simple" as a battery :)

thanks,

greg k-h

[1] Documentation/hwmon/sysfs-interface
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ