hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Fri Jan 25 08:07:46 PST 2008
doc/spec/hal-spec-properties.xml | 8 +++++++-
policy/hal-killswitch.policy | 9 +++++++++
tools/linux/hal-system-killswitch-get-power-linux | 18 ++++++++++++++++++
tools/linux/hal-system-killswitch-set-power-linux | 22 ++++++++++++++++++++++
4 files changed, 56 insertions(+), 1 deletion(-)
New commits:
commit ebd33452ff434252758db2b88def82432373be53
Author: Faidon Liambotis <paravoid at debian.org>
Date: Fri Jan 25 17:01:50 2008 +0100
add a WWAN (Wireless WAN/Cellular) killswitch for Dell laptops
HAL is already using dellWirelessCtl to control Dell's kill switch for
Bluetooth and WLAN. The same utility allows the switching of the WWAN
(Wireless WAN aka Cellular) cards shipped in some laptops.
Include this in HAL, mostly for completness right now. It may get more
useful in the feature; other vendors have began shipping WWAN too.
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 75cad45..45889c7 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -6834,7 +6834,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
<entry></entry>
<entry>wlan</entry>
<entry></entry>
- <entry>Kill switch is for turning Wireless networking on/off</entry>
+ <entry>Kill switch is for turning Wireless LAN (WLAN) networking on/off</entry>
</row>
<row>
<entry></entry>
@@ -6843,6 +6843,12 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
<entry>Kill switch is for turning Bluetooth on/off</entry>
</row>
<row>
+ <entry></entry>
+ <entry>wwan</entry>
+ <entry></entry>
+ <entry>Kill switch is for turning Wireless WAN (WWAN) networking on/off</entry>
+ </row>
+ <row>
<entry>
<literal>killswitch.access_method</literal> (string)
</entry>
diff --git a/policy/hal-killswitch.policy b/policy/hal-killswitch.policy
index dce0339..713bb0d 100644
--- a/policy/hal-killswitch.policy
+++ b/policy/hal-killswitch.policy
@@ -34,4 +34,13 @@ details.
</defaults>
</action>
+ <action id="org.freedesktop.hal.killswitch.wwan">
+ <description>Turn WWAN radio On/Off</description>
+ <message>System policy prevents turning the WWAN radio On/Off</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
+ </action>
+
</policyconfig>
diff --git a/tools/linux/hal-system-killswitch-get-power-linux b/tools/linux/hal-system-killswitch-get-power-linux
index 5a1fb3f..191cb56 100755
--- a/tools/linux/hal-system-killswitch-get-power-linux
+++ b/tools/linux/hal-system-killswitch-get-power-linux
@@ -68,6 +68,24 @@ elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
echo "Access type not supported" >&2
exit 1
fi
+elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wwan" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+ # TODO: write our own binary that links with libsmbios?
+ /usr/bin/dellWirelessCtl --st_wwan
+ value=$?
+ if [ "$value" = "0" ]; then
+ exit 1
+ elif [ "$value" = "1" ]; then
+ exit 0
+ else
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ echo "dellWirelessCtl returned $value" >&2
+ fi
+ else
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ echo "Access type not supported" >&2
+ exit 1
+ fi
else
echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
echo "Killswitch type not supported" >&2
diff --git a/tools/linux/hal-system-killswitch-set-power-linux b/tools/linux/hal-system-killswitch-set-power-linux
index 4120c2d..2a99dde 100755
--- a/tools/linux/hal-system-killswitch-set-power-linux
+++ b/tools/linux/hal-system-killswitch-set-power-linux
@@ -76,6 +76,28 @@ elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
echo "Access type not supported" >&2
exit 1
fi
+elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wwan" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" -a -x /usr/bin/dellWirelessCtl ]; then
+
+ # As a side effect we disable the physical kill switch
+
+ # TODO: write our own binary that links with libsmbios?
+ if [ "$value" = "true" ]; then
+ /usr/bin/dellWirelessCtl --sw_wwan 0 --wwan 1
+ ret=$?
+ else
+ /usr/bin/dellWirelessCtl --sw_wwan 0 --wwan 0
+ ret=$?
+ fi
+ if [ "$ret" != "0" ]; then
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ echo "dellWirelessCtl returned $ret" >&2
+ fi
+ else
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ echo "Access type not supported" >&2
+ exit 1
+ fi
else
echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
echo "Killswitch type not supported" >&2
More information about the hal-commit
mailing list