login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
April
»
12
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Ivo van Doorn <ivdoorn@...>
To: Henrique de Moraes Holschuh <hmh@...>
Cc: <linux-kernel@...>, John W. Linville <linville@...>, Dmitry Torokhov <dtor@...>
Subject:
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
Date: Saturday, April 12, 2008 - 6:36 am
On Friday 11 April 2008, Henrique de Moraes Holschuh wrote:
quoted text
> The *_RADIO input events are related to all radios in a system. There are > two: KEY_RADIO and SW_RADIO. > > Teach rfkill-input how to handle them. In particular, SW_RADIO is not a > toggle, but an absolute enable-or-disable command.
Not sure what you are trying to achieve here, who triggers the SW_RADIO and why?
quoted text
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> > Cc: Ivo van Doorn <IvDoorn@gmail.com> > Cc: John W. Linville <linville@tuxdriver.com> > Cc: Dmitry Torokhov <dtor@mail.ru> > --- > net/rfkill/rfkill-input.c | 57 +++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 55 insertions(+), 2 deletions(-) > > diff --git a/net/rfkill/rfkill-input.c b/net/rfkill/rfkill-input.c > index e4b051d..7d1e520 100644 > --- a/net/rfkill/rfkill-input.c > +++ b/net/rfkill/rfkill-input.c > @@ -55,6 +55,22 @@ static void rfkill_task_handler(struct work_struct *work) > mutex_unlock(&task->mutex); > } > > +static void rfkill_schedule_set(struct rfkill_task *task, > + enum rfkill_state desired_state) > +{ > + unsigned long flags; > + > + spin_lock_irqsave(&task->lock, flags); > + > + if (time_after(jiffies, task->last + msecs_to_jiffies(200))) { > + task->desired_state = desired_state; > + task->last = jiffies; > + schedule_work(&task->work); > + } > + > + spin_unlock_irqrestore(&task->lock, flags); > +} > + > static void rfkill_schedule_toggle(struct rfkill_task *task) > { > unsigned long flags; > @@ -87,9 +103,9 @@ static DEFINE_RFKILL_TASK(rfkill_uwb, RFKILL_TYPE_UWB); > static DEFINE_RFKILL_TASK(rfkill_wimax, RFKILL_TYPE_WIMAX); > > static void rfkill_event(struct input_handle *handle, unsigned int type, > - unsigned int code, int down) > + unsigned int code, int data) > { > - if (type == EV_KEY && down == 1) { > + if (type == EV_KEY && data == 1) { > switch (code) { > case KEY_WLAN: > rfkill_schedule_toggle(&rfkill_wlan); > @@ -103,6 +119,33 @@ static void rfkill_event(struct input_handle *handle, unsigned int type, > case KEY_WIMAX: > rfkill_schedule_toggle(&rfkill_wimax); > break; > + case KEY_RADIO: > + /* EVERY radio type */ > + rfkill_schedule_toggle(&rfkill_wimax); > + rfkill_schedule_toggle(&rfkill_uwb); > + rfkill_schedule_toggle(&rfkill_bt); > + rfkill_schedule_toggle(&rfkill_wlan); > + break; > + default: > + break; > + } > + } else if (type == EV_SW) { > + switch (code) { > + case SW_RADIO: > + /* EVERY radio type. data != 0 means radios ON */ > + rfkill_schedule_set(&rfkill_wimax, > + (data)? RFKILL_STATE_ON: > + RFKILL_STATE_OFF); > + rfkill_schedule_set(&rfkill_uwb, > + (data)? RFKILL_STATE_ON: > + RFKILL_STATE_OFF); > + rfkill_schedule_set(&rfkill_bt, > + (data)? RFKILL_STATE_ON: > + RFKILL_STATE_OFF); > + rfkill_schedule_set(&rfkill_wlan, > + (data)? RFKILL_STATE_ON: > + RFKILL_STATE_OFF); > + break; > default: > break; > } > @@ -168,6 +211,16 @@ static const struct input_device_id rfkill_ids[] = { > .evbit = { BIT_MASK(EV_KEY) }, > .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) }, > }, > + { > + .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, > + .evbit = { BIT(EV_KEY) }, > + .keybit = { [BIT_WORD(KEY_RADIO)] = BIT_MASK(KEY_RADIO) }, > + }, > + { > + .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_SWBIT, > + .evbit = { BIT(EV_SW) }, > + .swbit = { [BIT_WORD(SW_RADIO)] = BIT_MASK(SW_RADIO) }, > + }, > { } > }; >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[GIT PATCH] rfkill support for r/w and r/o rfkill switches
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, John W. Linville
, (Wed Apr 16, 2:37 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, Ivo van Doorn
, (Wed Apr 16, 3:26 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, John W. Linville
, (Wed Apr 16, 3:58 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, Ivo van Doorn
, (Wed Apr 16, 4:40 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, David Miller
, (Wed Apr 16, 9:29 pm)
Re: [GIT PATCH] rfkill support for r/w and r/o rfkill switches
, Ivo van Doorn
, (Sat Apr 12, 6:36 am)
[PATCH 6/8] rfkill: add the WWAN radio type
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Ivo van Doorn
, (Sat Apr 12, 6:36 am)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 8:15 am)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Inaky Perez-Gonzalez
, (Sat Apr 12, 7:23 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Henrique de Moraes Holschuh...
, (Sun Apr 13, 1:25 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Ivo van Doorn
, (Sun Apr 13, 1:37 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Henrique de Moraes Holschuh...
, (Sun Apr 13, 2:16 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Dmitry Torokhov
, (Mon Apr 14, 12:20 am)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Ivo van Doorn
, (Sat Apr 12, 8:28 am)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Inaky Perez-Gonzalez
, (Fri Apr 11, 4:44 pm)
Re: [PATCH 6/8] rfkill: add the WWAN radio type
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:53 pm)
[PATCH 8/8] rfkill: add parameter to disable radios by default
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Ivo van Doorn
, (Sat Apr 12, 6:36 am)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 8:56 am)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Ivo van Doorn
, (Sat Apr 12, 9:43 am)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 10:43 am)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Ivo van Doorn
, (Sat Apr 12, 12:24 pm)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 2:36 pm)
Re: [PATCH 8/8] rfkill: add parameter to disable radios by d...
, Ivo van Doorn
, (Sat Apr 12, 3:15 pm)
[PATCH 5/8] rfkill: add read-only rfkill switch support
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
[PATCH 7/8] rfkill: add an "any radio" switch type and funct...
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 7/8] rfkill: add an "any radio" switch type and f...
, Pavel Machek
, (Sat Apr 12, 3:57 pm)
Re: [PATCH 7/8] rfkill: add an "any radio" switch type and f...
, Henrique de Moraes Holschuh...
, (Sun Apr 13, 1:40 pm)
[PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Dmitry Torokhov
, (Sat Apr 12, 11:47 am)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 2:02 pm)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Ivo van Doorn
, (Sat Apr 12, 2:14 pm)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Carlos Corbacho
, (Sat Apr 12, 3:09 pm)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 4:36 pm)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Ivo van Doorn
, (Sat Apr 12, 6:36 am)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 8:05 am)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Ivo van Doorn
, (Sat Apr 12, 8:23 am)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Henrique de Moraes Holschuh...
, (Sat Apr 12, 9:08 am)
Re: [PATCH 3/8] rfkill: handle KEY_RADIO and SW_RADIO events
, Ivo van Doorn
, (Sat Apr 12, 9:17 am)
[PATCH 2/8] rfkill: fix minor typo in kernel doc
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
[PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Ivo van Doorn
, (Sat Apr 12, 6:36 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Sun Apr 13, 9:20 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Ivo van Doorn
, (Mon Apr 14, 8:00 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Carlos Corbacho
, (Mon Apr 14, 3:06 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Ivo van Doorn
, (Mon Apr 14, 5:04 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Mon Apr 14, 5:46 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Ivo Van Doorn
, (Tue Apr 15, 4:14 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Dmitry Torokhov
, (Mon Apr 14, 4:23 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Carlos Corbacho
, (Tue Apr 15, 3:27 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Dmitry Torokhov
, (Tue Apr 15, 8:58 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Dmitry Torokhov
, (Mon Apr 14, 10:16 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Mon Apr 14, 10:36 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Dmitry Torokhov
, (Mon Apr 14, 11:19 am)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Mon Apr 14, 12:33 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Dmitry Torokhov
, (Mon Apr 14, 2:05 pm)
Re: [PATCH 4/8] rfkill: add read-write rfkill switch support
, Henrique de Moraes Holschuh...
, (Mon Apr 14, 5:41 pm)
[PATCH 1/8] rfkill: clarify meaning of rfkill states
, Henrique de Moraes Holschuh...
, (Fri Apr 11, 4:37 pm)
Re: [PATCH 1/8] rfkill: clarify meaning of rfkill states
, Dmitry Torokhov
, (Mon Apr 14, 12:22 am)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Ryan Hope
reiser4 for 2.6.27-rc1
James Bottomley
Re: Integration of SCST in the mainstream Linux kernel
majkls
sys_chroot+sys_fchdir Fix
Chuck Ebbert
Why do so many machines need "noapic"?
git
:
Junio C Hamano
Re: [PATCH] Teach remote machinery about remotes.default config variable
Kyle Moffett
Using GIT to store /etc (Or: How to make GIT store all file permission bits)
Alan Chandler
Question around git-shell usage in Everyday Git
Jakub Narebski
Re: VCS comparison table
openbsd-misc
:
Richard Stallman
Real men don't attack straw men
Sunnz
How do I configure sendmail?
Edd Barrett
Re: Cold Boot Attacks on Encryption Keys
Jussi Peltola
Re: Remote Admin Card - Dell DRAC or HP ILO2 ?
linux-activists
:
Stephen Pierce
SLS
Jim Winstead Jr.
Re: Root Disk/Book Disk Compatibility
Les Andrzejewski
X386/WD90C31/SUMSUNG SYNC MASTER 4
Dave `geek' Gymer
WARNING (was Re: New afio release)
Latest forum posts
Is there anything like Real-time drivers?
41 minutes ago
Linux general
trouble with my Asus Mainboard
1 hour ago
Linux kernel
what is "callback function"?.can anyone explain me please..
1 day ago
Linux general
unable to remove block device driver module
1 day ago
Linux kernel
I can't allocate more than 4 MB with pci_alloc_consistent
2 days ago
Linux kernel
Resetting the bios password for Toshiba Laptop
3 days ago
Hardware
Kernel panic while installing fedora core 5 or ubuntu
3 days ago
Hardware
Interactive Linux kernel map
3 days ago
Linux kernel
unable to add a variable in buffer_head struct
3 days ago
Linux kernel
Linux Input driver - setting scaling/resolution on USB mouse
4 days ago
Linux kernel
Show all forums...
Recent Tags
Rik van Riel
filesystem
git 1.6
Andrew Morton
quote
git 1.6.0
Jared Hulbert
cramfs
git
2.6.27
-rc
Linux
release
GCC
Junio Hamano
Ingo Molnar
Linus Torvalds
performance
squashfs
AXFS
more tags
Colocation donated by:
Who's online
There are currently
6 users
and
961 guests
online.
Online users
Jeremy
Mr_Z
Liberator
espenfjo
strcmp
mmessano
Syndicate
speck-geostationary