input: Add KEY_RFKILL
Subsystems (3)
PATCH 1/2 input: Add KEY_RFKILL
Most laptops have keys that are intended to toggle all device state, not just wifi. These are currently generally mapped to KEY_WLAN. As a result, rfkill will only kill or enable wifi in response to the key press. This confuses users and can make it difficult for them to enable bluetooth and wwan devices.
This patch adds a new keycode, KEY_RFKILL_ALL. It indicates that the system should toggle the state of all rfkillable devices.
--- include/linux/input.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/input.h +2 -0
@@ -595,6 +595,8 @@ struct input_absinfo {#define KEY_NUMERIC_STAR 0x20a#define KEY_NUMERIC_POUND 0x20b +#define KEY_RFKILL 0x20c/* Key that controls all radios */ +/* We avoid low common keys in module aliases so they don't get huge. */ #define KEY_MIN_INTERESTING KEY_MUTE#define KEY_MAX 0x2ff
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1252603292-20830-1-git-send-email-mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH 2/2 rfkill: Add support for KEY_RFKILL
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.
--- include/linux/rfkill.h | 2 +- net/rfkill/input.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletions(-)
include/linux/rfkill.h +1 -1
@@ -32,7 +32,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.
net/rfkill/input.c +8 -0
@@ -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) },
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] rfkill: Add support for KEY_RFKILL
Hi Matthew,
Quoted 6 lines
Add support for handling
KEY_RFKILLin the rfkill input module. This simply toggles the state of all rfkill devices. The comment inrfkill.his also updated to reflect thatRFKILL_TYPE_ALLmay be used inside the kernel.Signed-off-by Matthew Garrett <[email protected]>
looks good and seems to got lost somehow.
Regards
Marcel
Quoted 6 lines · Matthew Garrett
This patch adds a new keycode,
KEY_RFKILL_ALL.include/linux/input.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)+#define
KEY_RFKILL0x20c/* Key that controls all radios */
But this above is KEY_RFKILL, not KEY_RKILL_ALL. Typo?
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 43e72e890909101027saf1ed35u23936729eccf3f92-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 10 lines · Luis R. Rodriguez
Quoted 6 lines · Matthew Garrett
This patch adds a new keycode,
KEY_RFKILL_ALL.include/linux/input.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)+#define
KEY_RFKILL0x20c/* Key that controls all radios */But this above is
KEY_RFKILL, notKEY_RKILL_ALL. Typo?
Sorry, yes - forgot to update the commit message to match the change in the patch and subject.
Signature · 5 lines
Matthew Garrett | [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Matthew Garrett
Most laptops have keys that are intended to toggle all device state, not just wifi. These are currently generally mapped to
KEY_WLAN. As a result, rfkill will only kill or enable wifi in response to the key press. This confuses users and can make it difficult for them to enable bluetooth and wwan devices.This patch adds a new keycode,
KEY_RFKILL_ALL. It indicates that the
The new name in description does not match the code...
Quoted 1 line
system should toggle the state of all rfkillable devices.
Hmm, rfkill changes usually go through net tree so unless they want me to push it though I'll just ACK the new keycode.
Quoted 2 lines
Signed-off-by Matthew Garrett <[email protected]>
Quoted 17 lines
--- include/linux/input.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)include/linux/input.h +2
-0@@ -595,6 +595,8 @@ struct input_absinfo {#define KEY_NUMERIC_STAR 0x20a#define KEY_NUMERIC_POUND 0x20b +#define KEY_RFKILL 0x20c/* Key that controls all radios */ +/* We avoid low common keys in module aliases so they don't get huge. */ #define KEY_MIN_INTERESTING KEY_MUTE#define KEY_MAX 0x2ff
Signature · 1 line
Dmitry
A message that is not in the archive (sent off-list or not yet received): 20090911051259.GC23210-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org
Marcel Holtmann
Acked-byHi Matthew,
Quoted 12 lines
Quoted 7 lines
Most laptops have keys that are intended to toggle all device state, not just wifi. These are currently generally mapped to
KEY_WLAN. As a result, rfkill will only kill or enable wifi in response to the key press. This confuses users and can make it difficult for them to enable bluetooth and wwan devices.This patch adds a new keycode,
KEY_RFKILL_ALL. It indicates that theThe new name in description does not match the code...
Quoted 1 line
system should toggle the state of all rfkillable devices.
Quoted 7 lines
Hmm, rfkill changes usually go through net tree so unless they want me to push it though I'll just ACK the new keycode.
Quoted 2 lines
Signed-off-by Matthew Garrett <[email protected]>
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html