summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2007-03-23 20:02:43 -0400
committerDavid Zeuthen <davidz@redhat.com>2007-03-23 20:02:43 -0400
commit1e8845e9ad0a2583b21d962c1a683597ead69c65 (patch)
treec7e79a75b50239b68a033e7cc61874f4075c0346
parent0cd8dccc8382f26d3b3f68f6131aefd08b134232 (diff)
use libsmbios to add support for bluetooth, wlan RF kill on Dell laptops
-rw-r--r--NEWS2
-rw-r--r--configure.in31
-rw-r--r--fdi/policy/10osvendor/10-bluetooth-switch.fdi21
-rw-r--r--fdi/policy/10osvendor/Makefile.am2
-rw-r--r--tools/Makefile.am4
-rwxr-xr-x[-rw-r--r--]tools/hal-system-killswitch-get-power (renamed from tools/hal-system-bluetooth-get-power)4
-rwxr-xr-x[-rw-r--r--]tools/hal-system-killswitch-set-power (renamed from tools/hal-system-bluetooth-set-power)4
-rw-r--r--tools/linux/Makefile.am4
-rw-r--r--tools/linux/hal-system-bluetooth-get-power-linux22
-rw-r--r--tools/linux/hal-system-bluetooth-set-power-linux22
-rwxr-xr-xtools/linux/hal-system-killswitch-get-power-linux59
-rwxr-xr-xtools/linux/hal-system-killswitch-set-power-linux61
12 files changed, 158 insertions, 78 deletions
diff --git a/NEWS b/NEWS
index d16f1a10..cc4d80af 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Requirements for HAL 0.5.9 ""
- dbus >= 0.60 (with glib bindings)
- glib >= 2.6.0
- expat >= 1.95.8
- - hal-info >= git version as of 20070228
+ - hal-info >= git version as of 20070323
- libusb >= 0 0.1.10a (optional)
- pciutils >= 2.2.3 (optional
- dmidecode >= 2.7 (optional)
diff --git a/configure.in b/configure.in
index d9f61e6a..2f460ec6 100644
--- a/configure.in
+++ b/configure.in
@@ -325,8 +325,8 @@ if test "$LIB_SMBIOS" = "yes" ; then
int micro ;
if ( sscanf( LIBSMBIOS_RELEASE_VERSION , "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
- if ((major == 0 && minor == 11 && micro >= 6) ||
- (major >= 0 && minor > 11)) {
+ if ((major == 0 && minor == 13 && micro >= 4) ||
+ (major >= 0 && minor > 13)) {
return 0;
}
}
@@ -777,6 +777,30 @@ elif test "x$with_dell_backlight" = "x" ; then
fi
AM_CONDITIONAL(BUILD_DELL, test x$BUILD_DELL = xyes)
+dnl Dell RF KILL
+AC_ARG_WITH(dell-rfkill, [ --with-dell-rfkill Whether to build Dell RF-kill support (auto)])
+BUILD_DELL_RFKILL=no
+if test "x$with_dell_rfkill" = "xyes" ; then
+ BUILD_DELL=yes
+elif test "x$with_dell_rfkill" = "x" ; then
+ if test "$USE_SMBIOS" = "yes" ; then
+ case "${HALD_BACKEND}" in
+ linux)
+ case "${host}" in
+ i[[3456]]86-*-*)
+ BUILD_DELL_RFKILL=yes
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ fi
+fi
+AM_CONDITIONAL(BUILD_DELL_RFKILL, test x$BUILD_DELL_RFKILL = xyes)
+
dnl Sony PIC support
AC_ARG_ENABLE(sonypic,
AC_HELP_STRING([--enable-sonypic],[Build with Sony PIC support]),
@@ -913,7 +937,8 @@ echo "
OMAP utils: ${BUILD_OMAP} (Linux only, arm only)
CPU frequency scaling: ${BUILD_CPUFREQ} (Linux only)
USB wireless mouse power: ${BUILD_USBCSR} (Linux only, requires libusb)
- Dell Backlight ${BUILD_DELL} (Linux only, requires libsmbios >= 0.11.6)
+ Dell Backlight: ${BUILD_DELL} (Linux only, requires libsmbios >= 0.13.4)
+ Dell RF Kill: ${BUILD_DELL_RFKILL} (Linux only, requires libsmbios >= 0.13.4)
Maintainer mode: ${USE_MAINTAINER_MODE}
Building verbose mode: ${enable_verbose_mode}
diff --git a/fdi/policy/10osvendor/10-bluetooth-switch.fdi b/fdi/policy/10osvendor/10-bluetooth-switch.fdi
deleted file mode 100644
index bd3918e2..00000000
--- a/fdi/policy/10osvendor/10-bluetooth-switch.fdi
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deviceinfo version="0.2">
-
- <device>
- <match key="killswitch.type" string="bluetooth">
- <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.KillSwitch</append>
-
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_names" type="strlist">SetPower</append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_signatures" type="strlist">b</append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_argnames" type="strlist">power</append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_execpaths" type="strlist">hal-system-bluetooth-set-power</append>
-
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_names" type="strlist">GetPower</append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_signatures" type="strlist"></append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_argnames" type="strlist"></append>
- <append key="org.freedesktop.Hal.Device.KillSwitch.method_execpaths" type="strlist">hal-system-bluetooth-get-power</append>
- </match>
- </device>
-
-</deviceinfo>
diff --git a/fdi/policy/10osvendor/Makefile.am b/fdi/policy/10osvendor/Makefile.am
index 7b84aef4..98bbe927 100644
--- a/fdi/policy/10osvendor/Makefile.am
+++ b/fdi/policy/10osvendor/Makefile.am
@@ -5,7 +5,7 @@ dist_fdi_DATA = \
10-keyboard-policy.fdi \
10-power-mgmt-policy.fdi \
10-toshiba-buttons.fdi \
- 10-bluetooth-switch.fdi \
+ 10-rfkill-switch.fdi \
10-laptop-panel-mgmt-policy.fdi \
15-storage-luks.fdi \
20-storage-methods.fdi
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 492d2f88..2b962209 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -120,8 +120,8 @@ script_SCRIPTS = \
hal-system-lcd-get-brightness \
hal-system-lcd-set-brightness \
hal-system-power-set-power-save \
- hal-system-bluetooth-get-power \
- hal-system-bluetooth-set-power
+ hal-system-killswitch-get-power \
+ hal-system-killswitch-set-power
EXTRA_DIST=$(man_MANS) $(MAN_IN_FILES) gen-libgphoto-hal-fdi $(script_SCRIPTS)
diff --git a/tools/hal-system-bluetooth-get-power b/tools/hal-system-killswitch-get-power
index 4de48bd2..67ba021e 100644..100755
--- a/tools/hal-system-bluetooth-get-power
+++ b/tools/hal-system-killswitch-get-power
@@ -17,8 +17,8 @@ fi
# TODO: check privilege
-if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-bluetooth-get-power-$HALD_UNAME_S ]; then
- exec ./$HALD_UNAME_S/hal-system-bluetooth-get-power-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-killswitch-get-power-$HALD_UNAME_S ]; then
+ exec ./$HALD_UNAME_S/hal-system-killswitch-get-power-$HALD_UNAME_S $@
else
echo "org.freedesktop.Hal.Device.UnknownError" >&2
echo "No back-end for your operating system" >&2
diff --git a/tools/hal-system-bluetooth-set-power b/tools/hal-system-killswitch-set-power
index 7c80a26f..4175c607 100644..100755
--- a/tools/hal-system-bluetooth-set-power
+++ b/tools/hal-system-killswitch-set-power
@@ -21,8 +21,8 @@ fi
read value
export value
-if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-bluetooth-set-power-$HALD_UNAME_S ]; then
- exec ./$HALD_UNAME_S/hal-system-bluetooth-set-power-$HALD_UNAME_S $@
+if [ -n "$HALD_UNAME_S" -a -x ./$HALD_UNAME_S/hal-system-killswitch-set-power-$HALD_UNAME_S ]; then
+ exec ./$HALD_UNAME_S/hal-system-killswitch-set-power-$HALD_UNAME_S $@
else
echo "org.freedesktop.Hal.Device.UnknownError" >&2
echo "No back-end for your operating system" >&2
diff --git a/tools/linux/Makefile.am b/tools/linux/Makefile.am
index d3bd9756..ea4e873d 100644
--- a/tools/linux/Makefile.am
+++ b/tools/linux/Makefile.am
@@ -16,8 +16,8 @@ script_SCRIPTS = \
hal-system-lcd-get-brightness-linux \
hal-system-lcd-set-brightness-linux \
hal-system-power-set-power-save-linux \
- hal-system-bluetooth-get-power-linux \
- hal-system-bluetooth-set-power-linux
+ hal-system-killswitch-get-power-linux \
+ hal-system-killswitch-set-power-linux
EXTRA_DIST = 90-hal.rules $(script_SCRIPTS)
diff --git a/tools/linux/hal-system-bluetooth-get-power-linux b/tools/linux/hal-system-bluetooth-get-power-linux
deleted file mode 100644
index 6dd8c772..00000000
--- a/tools/linux/hal-system-bluetooth-get-power-linux
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2007 Bastien Nocera <bnocera@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
- value="`hal-system-sonypic getbluetooth`"
- if [ $? -ne 0 ]; then
- echo "org.freedesktop.Hal.Device.BluetoothButton.NotSupported" >&2
- exit 1
- fi
- exit ${value}
-else
- echo "org.freedesktop.Hal.Device.BluetoothButton.NotSupported" >&2
- echo "Access type not supported" >&2
- exit 1
-fi
-
diff --git a/tools/linux/hal-system-bluetooth-set-power-linux b/tools/linux/hal-system-bluetooth-set-power-linux
deleted file mode 100644
index f3c80add..00000000
--- a/tools/linux/hal-system-bluetooth-set-power-linux
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2007 Bastien Nocera <bnocera@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
- hal-system-sonypic setbluetooth $value
- if [ $? -ne 0 ]; then
- echo "org.freedesktop.Hal.Device.BluetoothButton.NotSupported" >&2
- exit 1
- fi
- exit 0
-else
- echo "org.freedesktop.Hal.Device.BluetoothButton.NotSupported" >&2
- echo "Access type not supported" >&2
- exit 1
-fi
-
diff --git a/tools/linux/hal-system-killswitch-get-power-linux b/tools/linux/hal-system-killswitch-get-power-linux
new file mode 100755
index 00000000..7249694b
--- /dev/null
+++ b/tools/linux/hal-system-killswitch-get-power-linux
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Copyright (C) 2007 Bastien Nocera <bnocera@redhat.com>
+# Copyright (C) 2007 David Zeuthen <davidz@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
+ value="`hal-system-sonypic getbluetooth`"
+ if [ $? -ne 0 ]; then
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ echo "hal-system-sonypic returned unexpected value" >&2
+ exit 1
+ fi
+ exit ${value}
+ elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+ # TODO: write our own binary that links with libsmbios?
+ dellWirelessCtl --st_bt
+ 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
+elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+ # TODO: write our own binary that links with libsmbios?
+ dellWirelessCtl --st_wlan
+ 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
+ exit 1
+fi
diff --git a/tools/linux/hal-system-killswitch-set-power-linux b/tools/linux/hal-system-killswitch-set-power-linux
new file mode 100755
index 00000000..b2073722
--- /dev/null
+++ b/tools/linux/hal-system-killswitch-set-power-linux
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Copyright (C) 2007 Bastien Nocera <bnocera@redhat.com>
+# Copyright (C) 2007 David Zeuthen <davidz@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+if [ "$HAL_PROP_KILLSWITCH_TYPE" = "bluetooth" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "sonypic" ]; then
+ hal-system-sonypic setbluetooth $value
+ if [ $? -ne 0 ]; then
+ echo "org.freedesktop.Hal.Device.KillSwitch.NotSupported" >&2
+ exit 1
+ fi
+ exit 0
+ elif [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+ # TODO: write our own binary that links with libsmbios?
+ if [ "$value" = "true" ]; then
+ dellWirelessCtl --bt 1
+ ret=$?
+ else
+ dellWirelessCtl --bt 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
+elif [ "$HAL_PROP_KILLSWITCH_TYPE" = "wlan" ]; then
+ if [ "$HAL_PROP_KILLSWITCH_ACCESS_METHOD" = "dell" ]; then
+ # TODO: write our own binary that links with libsmbios?
+ if [ "$value" = "true" ]; then
+ dellWirelessCtl --wlan 1
+ ret=$?
+ else
+ dellWirelessCtl --wlan 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
+ exit 1
+fi
+