Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi add function switch to switch on/off "wireless ...



details:   https://anonhg.NetBSD.org/src/rev/af2e3f594ff0
branches:  trunk
changeset: 780203:af2e3f594ff0
user:      spz <spz%NetBSD.org@localhost>
date:      Sun Jul 15 11:52:01 2012 +0000

description:
add function switch to switch on/off "wireless WAN", aka GSM et al modem
not tested to actually work, extensively tested not to do any harm if you
don't have a wwan

diffstat:

 sys/dev/acpi/thinkpad_acpi.c |  18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diffs (67 lines):

diff -r 5103b3ea9489 -r af2e3f594ff0 sys/dev/acpi/thinkpad_acpi.c
--- a/sys/dev/acpi/thinkpad_acpi.c      Sun Jul 15 10:55:27 2012 +0000
+++ b/sys/dev/acpi/thinkpad_acpi.c      Sun Jul 15 11:52:01 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.39 2011/06/20 15:00:04 pgoyette Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.40 2012/07/15 11:52:01 spz Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.39 2011/06/20 15:00:04 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.40 2012/07/15 11:52:01 spz Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -79,7 +79,7 @@
 #define        THINKPAD_NOTIFY_BatteryInfo     0x003
 #define        THINKPAD_NOTIFY_SleepButton     0x004
 #define        THINKPAD_NOTIFY_WirelessSwitch  0x005
-#define        THINKPAD_NOTIFY_FnF6            0x006
+#define        THINKPAD_NOTIFY_wWANSwitch      0x006
 #define        THINKPAD_NOTIFY_DisplayCycle    0x007
 #define        THINKPAD_NOTIFY_PointerSwitch   0x008
 #define        THINKPAD_NOTIFY_EjectButton     0x009
@@ -120,6 +120,7 @@
 static void    thinkpad_fan_refresh(struct sysmon_envsys *, envsys_data_t *);
 
 static void    thinkpad_wireless_toggle(thinkpad_softc_t *);
+static void    thinkpad_wwan_toggle(thinkpad_softc_t *);
 
 static bool    thinkpad_resume(device_t, const pmf_qual_t *);
 static void    thinkpad_brightness_up(device_t);
@@ -348,6 +349,9 @@
                case THINKPAD_NOTIFY_WirelessSwitch:
                        thinkpad_wireless_toggle(sc);
                        break;
+               case THINKPAD_NOTIFY_wWANSwitch:
+                       thinkpad_wwan_toggle(sc);
+                       break;
                case THINKPAD_NOTIFY_SleepButton:
                        if (sc->sc_smpsw_valid == false)
                                break;
@@ -405,7 +409,6 @@
                            PSWITCH_EVENT_PRESSED);
                        break;
                case THINKPAD_NOTIFY_FnF1:
-               case THINKPAD_NOTIFY_FnF6:
                case THINKPAD_NOTIFY_PointerSwitch:
                case THINKPAD_NOTIFY_FnF10:
                case THINKPAD_NOTIFY_FnF11:
@@ -590,6 +593,13 @@
        (void)AcpiEvaluateObject(sc->sc_node->ad_handle, "GWAN", NULL, NULL);
 }
 
+static void
+thinkpad_wwan_toggle(thinkpad_softc_t *sc)
+{
+       /* Ignore return value, as the hardware may not support wireless WAN */
+       (void)AcpiEvaluateObject(sc->sc_node->ad_handle, "WTGL", NULL, NULL);
+}
+
 static uint8_t
 thinkpad_brightness_read(thinkpad_softc_t *sc)
 {



Home | Main Index | Thread Index | Old Index