diff options
| author | spz <spz@NetBSD.org> | 2012-07-15 11:52:01 +0000 |
|---|---|---|
| committer | spz <spz@NetBSD.org> | 2012-07-15 11:52:01 +0000 |
| commit | 8fea2fb3e441b7bf2ffe9abc981f5eaf5c470c14 (patch) | |
| tree | 2f5a88677c6ee9a4866ac9e8d07e4a915148fc08 /sys/dev | |
| parent | 7136b0ae2001fd363d78b0725206a1b31759efb4 (diff) | |
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 (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/thinkpad_acpi.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/acpi/thinkpad_acpi.c b/sys/dev/acpi/thinkpad_acpi.c index 611ee93ac2b..babdf58c07b 100644 --- a/sys/dev/acpi/thinkpad_acpi.c +++ b/sys/dev/acpi/thinkpad_acpi.c @@ -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> @@ -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 @@ typedef struct thinkpad_softc { #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_temp_refresh(struct sysmon_envsys *, envsys_data_t *); 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 @@ thinkpad_get_hotkeys(void *opaque) 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 @@ thinkpad_get_hotkeys(void *opaque) 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 @@ thinkpad_wireless_toggle(thinkpad_softc_t *sc) (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) { |
