Bluetooth and power stuff
David Zeuthen
david at fubar.dk
Mon May 1 11:27:24 PDT 2006
Hi,
On Mon, 2006-05-01 at 18:25 +0100, Richard Hughes wrote:
> Bluetooth devices can be powered up and down using acpi (with a format
> depending on your machine vendor):
>
> echo disable >/proc/acpi/ibm/bluetooth;
> echo enable >/proc/acpi/ibm/bluetooth;
>
> Is this something we should add to hal as EnableBluetooth() and
> DisableBluetooth() power methods?
So, I think what we need to do is to solve the general problem here.
It's called "Selective Suspend" [1] and ideally what we should do is to
export an interface
org.freedesktop.Hal.Device.DevicePowerManagement
(just like we have org.freedesktop.Hal.Device.SystemPowerManagement)
with methods for doing this. I *think* we want to export this interface
on bus devices, e.g. (snippet from lshal -t)
pci_8086_2448
pci_104c_ac46_0
pci_104c_ac46
pci_8086_101e <-- *
net_00_0d_60_fc_3e_71
pci_14b9_a504 <-- *
net_00_0e_9b_43_f7_1f
.....
pci_8086_24ca
pci_8086_24ca_ide_0_0 <-- *
storage_serial_NP0JT48299J8
volume_uuid_1a28b356_9955_44f9_b268_6ed6639978f5
volume_uuid_c66f3d19_2e10_44c0_9bd6_a8fefc476f7d
....
usb_device_c76_5_noserial
usb_device_c76_5_noserial_if0 <-- *
usb_device_c76_5_noserial_if0_scsi_host
usb_device_c76_5_noserial_if0_scsi_host_scsi_device_lun0
storage_model_TS256MJF2A
volume_uuid_4441_2867
* : implements org.freedesktop.Hal.Device.DevicePowerManagement
and applications like e.g. NetworkManager would use find the physical
device simply be referencing net.physical_device [2] [3]; ditto for
storage, you would use storage.physical_device and so forth.
Now, the big question is what methods do the interface
org.freedesktop.Hal.Device.DevicePowerManagement
implement. It should satisfy
- Must be able to put the device to sleep
- Must be able to power off the device (to comply with FAA/FCC
requirements)
- Must be able to power up a device
- Control aspects of run-time power management policy (should be
enforced by the kernel, e.g. transparently put the sound card to
sleep when no one has open fd's on it)
- Should be the same interface across USB, PCI, whatever, hence it
needs to be somewhat extensible and needs to be somewhat abstract
(e.g. we PCI power states like D1-D3 won't work on USB)
but I don't really know what it's going to look like as I'm not sure the
Linux kernel guys have settled on the format yet. And it raises the
question of how this is going to work on Solaris and FreeBSD too :-)
Ideas welcome.
David
[1] : http://www.google.com/search?hl=en&lr=&c2coff=1&q=%22selective+suspend%22+wikipedia&btnG=Search
[2] : for implementing the Airplane mode where the radio is powered
down; simply 'ifconfig eth0 down' doesn't power down the device
[3] : Note that _only_ NetworkManager, being the entity in control of
all networking, knows when it's sane to power off the radio (which
is when being plugged into wired ethernet).
More information about the hal
mailing list