All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, linux-input@vger.kernel.org,
	dmitry.torokhov@gmail.com, marcel@holtmann.org,
	Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 2/2] rfkill: Add support for KEY_RFKILL
Date: Tue, 16 Feb 2010 16:36:25 -0500	[thread overview]
Message-ID: <1266356185-10324-2-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1266356185-10324-1-git-send-email-mjg@redhat.com>

Add support for handling KEY_RFKILL in the rfkill input module. This
simply toggles the state of all rfkill devices. The comment in rfkill.h
is also updated to reflect that RFKILL_TYPE_ALL may be used inside the
kernel.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 include/linux/rfkill.h |    2 +-
 net/rfkill/input.c     |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 97059d0..4f82326 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -29,7 +29,7 @@
 /**
  * enum rfkill_type - type of rfkill switch.
  *
- * @RFKILL_TYPE_ALL: toggles all switches (userspace only)
+ * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
  * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
  * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
  * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index a7295ad..3713d7e 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle *handle, unsigned int type,
 		case KEY_WIMAX:
 			rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
 			break;
+		case KEY_RFKILL:
+			rfkill_schedule_toggle(RFKILL_TYPE_ALL);
+			break;
 		}
 	} else if (type == EV_SW && code == SW_RFKILL_ALL)
 		rfkill_schedule_evsw_rfkillall(data);
@@ -295,6 +298,11 @@ static const struct input_device_id rfkill_ids[] = {
 		.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
 	},
 	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+		.evbit = { BIT_MASK(EV_KEY) },
+		.keybit = { [BIT_WORD(KEY_RFKILL)] = BIT_MASK(KEY_RFKILL) },
+	},
+	{
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_SWBIT,
 		.evbit = { BIT(EV_SW) },
 		.swbit = { [BIT_WORD(SW_RFKILL_ALL)] = BIT_MASK(SW_RFKILL_ALL) },
-- 
1.6.6.1


WARNING: multiple messages have this Message-ID (diff)
From: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org,
	Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 2/2] rfkill: Add support for KEY_RFKILL
Date: Tue, 16 Feb 2010 16:36:25 -0500	[thread overview]
Message-ID: <1266356185-10324-2-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1266356185-10324-1-git-send-email-mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Add support for handling KEY_RFKILL in the rfkill input module. This
simply toggles the state of all rfkill devices. The comment in rfkill.h
is also updated to reflect that RFKILL_TYPE_ALL may be used inside the
kernel.

Signed-off-by: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/linux/rfkill.h |    2 +-
 net/rfkill/input.c     |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 97059d0..4f82326 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -29,7 +29,7 @@
 /**
  * enum rfkill_type - type of rfkill switch.
  *
- * @RFKILL_TYPE_ALL: toggles all switches (userspace only)
+ * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
  * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
  * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
  * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index a7295ad..3713d7e 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle *handle, unsigned int type,
 		case KEY_WIMAX:
 			rfkill_schedule_toggle(RFKILL_TYPE_WIMAX);
 			break;
+		case KEY_RFKILL:
+			rfkill_schedule_toggle(RFKILL_TYPE_ALL);
+			break;
 		}
 	} else if (type == EV_SW && code == SW_RFKILL_ALL)
 		rfkill_schedule_evsw_rfkillall(data);
@@ -295,6 +298,11 @@ static const struct input_device_id rfkill_ids[] = {
 		.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
 	},
 	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+		.evbit = { BIT_MASK(EV_KEY) },
+		.keybit = { [BIT_WORD(KEY_RFKILL)] = BIT_MASK(KEY_RFKILL) },
+	},
+	{
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_SWBIT,
 		.evbit = { BIT(EV_SW) },
 		.swbit = { [BIT_WORD(SW_RFKILL_ALL)] = BIT_MASK(SW_RFKILL_ALL) },
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-02-16 21:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 21:36 [PATCH 1/2] input: Add KEY_RFKILL Matthew Garrett
2010-02-16 21:36 ` Matthew Garrett [this message]
2010-02-16 21:36   ` [PATCH 2/2] rfkill: Add support for KEY_RFKILL Matthew Garrett
2010-02-16 23:04   ` Marcel Holtmann
2010-02-16 23:05 ` [PATCH 1/2] input: Add KEY_RFKILL Marcel Holtmann
2010-02-17  5:22 ` Dmitry Torokhov
2010-02-17 18:03   ` Matthew Garrett
2010-02-17 18:03     ` Matthew Garrett
2010-02-17 18:43     ` Christian Lamparter
2010-02-17 18:45       ` Matthew Garrett
2010-02-17 18:45         ` Matthew Garrett
2010-02-17 18:49         ` Bastien Nocera
2010-02-17 22:34           ` Peter Hutterer
2010-02-17 22:34             ` Peter Hutterer
2010-02-18  4:16             ` Dmitry Torokhov
2010-02-18  4:29               ` Peter Hutterer
2010-02-18  4:29                 ` Peter Hutterer
2010-02-17 19:18         ` Christian Lamparter
2010-02-17 19:17       ` Dmitry Torokhov
2010-02-17 19:42         ` Christian Lamparter
2010-02-17 19:42           ` Christian Lamparter
2010-02-17 19:54           ` Dmitry Torokhov
2010-02-17 20:02             ` Matthew Garrett
2010-02-17 20:49               ` Dmitry Torokhov
2010-02-17 20:50                 ` Matthew Garrett
2010-02-17 20:50                   ` Matthew Garrett
2010-02-17 20:18             ` Christian Lamparter
2010-02-17 20:52               ` Dmitry Torokhov
2010-02-17 20:52                 ` Dmitry Torokhov
2010-02-17 21:12                 ` pat-lkml
2010-02-17 21:12                   ` pat-lkml-Jx9fsTfDDR3YtjvyW6yDsg
2010-02-17 21:28                 ` Christian Lamparter
2010-02-17 21:40                   ` Dmitry Torokhov
2010-02-17 21:40                     ` Dmitry Torokhov
2010-02-17 22:03                     ` Christian Lamparter
2010-02-20  9:18                       ` Dmitry Torokhov
2010-02-20  9:18                         ` Dmitry Torokhov
2010-02-19 14:33             ` Henrique de Moraes Holschuh
2010-02-17 19:18     ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2009-09-10 17:21 Matthew Garrett
2009-09-10 17:21 ` [PATCH 2/2] rfkill: Add support for KEY_RFKILL Matthew Garrett
2009-09-10 17:21   ` Matthew Garrett
2009-11-13  5:33   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266356185-10324-2-git-send-email-mjg@redhat.com \
    --to=mjg@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.