From: Thomas Renninger <trenn@suse.de>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-kernel@vger.kernel.org, Ivo van Doorn <IvDoorn@gmail.com>
Subject: Re: [PATCH 11/15] rfkill: add notifier chains support
Date: Mon, 19 May 2008 10:44:03 +0200 [thread overview]
Message-ID: <1211186644.21269.274.camel@queen.suse.de> (raw)
In-Reply-To: <1211136485-19878-12-git-send-email-hmh@hmh.eng.br>
On Sun, 2008-05-18 at 15:48 -0300, Henrique de Moraes Holschuh wrote:
> Add a notifier chain for use by the rfkill class. This notifier chain
> signals the following events (more to be added when needed):
>
> 1. rfkill: rfkill device state has changed
>
> A pointer to the rfkill struct will be passed as a parameter.
>
> The notifier message types have been added to include/linux/rfkill.h
> instead of to include/linux/notifier.h in order to avoid the madness of
> modifying a header used globally (and that triggers an almost full tree
> rebuild every time it is touched) with information that is of interest only
> to code that includes the rfkill.h header.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> include/linux/rfkill.h | 7 +++++
> net/rfkill/rfkill.c | 70 +++++++++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 74 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
> index c0cab7d..98667be 100644
> --- a/include/linux/rfkill.h
> +++ b/include/linux/rfkill.h
> @@ -117,4 +117,11 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill)
> #endif
> }
>
> +/* rfkill notification chain */
> +#define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill
> + switch has changed */
> +
> +int register_rfkill_notifier(struct notifier_block *nb);
> +int unregister_rfkill_notifier(struct notifier_block *nb);
> +
> #endif /* RFKILL_H */
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index f11220b..251defe 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -46,6 +46,49 @@ MODULE_PARM_DESC(default_state,
>
> static enum rfkill_state rfkill_states[RFKILL_TYPE_MAX];
>
> +static BLOCKING_NOTIFIER_HEAD(rfkill_notifier_list);
> +
> +
> +/**
> + * register_rfkill_notifier - Add notifier to rfkill notifier chain
> + * @nb: pointer to the new entry to add to the chain
> + *
> + * See blocking_notifier_chain_register() for return value and further
> + * observations.
> + *
> + * Adds a notifier to the rfkill notifier chain. The chain will be
> + * called with a pointer to the relevant rfkill structure as a parameter,
> + * refer to include/linux/rfkill.h for the possible events.
> + *
> + * Notifiers added to this chain are to always return NOTIFY_DONE. This
> + * chain is a blocking notifier chain: notifiers can sleep.
> + *
> + * Calls to this chain may have been done through a workqueue. One must
> + * one must assume unordered assynchronous behaviour, there is no way to
One must, one must..., asynchronous
...
Thomas
next prev parent reply other threads:[~2008-05-19 8:44 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-18 18:47 [RFC] rfkill class rework Henrique de Moraes Holschuh
2008-05-18 18:47 ` [PATCH 01/15] ACPI: thinkpad-acpi: fix initialization error paths Henrique de Moraes Holschuh
2008-05-18 18:47 ` [PATCH 02/15] ACPI: thinkpad-acpi: fix LED handling on older ThinkPads Henrique de Moraes Holschuh
2008-05-18 18:47 ` [PATCH 03/15] Input: rename SW_RADIO to SW_RFKILL_ALL (v2) Henrique de Moraes Holschuh
2008-05-18 18:47 ` [PATCH 04/15] rfkill: clarify meaning of rfkill states Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-18 18:47 ` [PATCH 05/15] rfkill: fix minor typo in kernel doc Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-18 18:47 ` [PATCH 06/15] rfkill: handle SW_RFKILL_ALL events Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-18 18:47 ` [PATCH 07/15] rfkill: add parameter to disable radios by default Henrique de Moraes Holschuh
2008-05-18 18:47 ` [PATCH 08/15] rfkill: add read-write rfkill switch support Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-18 18:47 ` [PATCH 09/15] rfkill: add the WWAN radio type Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-21 1:12 ` Henrique de Moraes Holschuh
2008-05-21 3:35 ` Inaky Perez-Gonzalez
2008-05-21 3:42 ` Henrique de Moraes Holschuh
2008-05-21 6:48 ` Inaky Perez-Gonzalez
2008-05-21 14:07 ` Henrique de Moraes Holschuh
2008-05-18 18:48 ` [PATCH 10/15] rfkill: rework suspend and resume handlers Henrique de Moraes Holschuh
2008-05-20 10:08 ` Ivo van Doorn
2008-05-18 18:48 ` [PATCH 11/15] rfkill: add notifier chains support Henrique de Moraes Holschuh
2008-05-19 8:44 ` Thomas Renninger [this message]
2008-05-19 13:10 ` Henrique de Moraes Holschuh
2008-05-20 10:09 ` Ivo van Doorn
2008-05-18 18:48 ` [PATCH 12/15] rfkill: add type string helper Henrique de Moraes Holschuh
2008-05-20 10:09 ` Ivo van Doorn
2008-05-18 18:48 ` [PATCH 13/15] rfkill: add uevent notifications Henrique de Moraes Holschuh
2008-05-20 10:09 ` Ivo van Doorn
2008-05-18 18:48 ` [PATCH 14/15] rfkill: do not allow userspace to override ALL RADIOS OFF Henrique de Moraes Holschuh
2008-05-20 10:09 ` Ivo van Doorn
2008-05-22 20:51 ` Henrique de Moraes Holschuh
2008-05-23 14:15 ` Ivo van Doorn
2008-05-27 14:08 ` Henrique de Moraes Holschuh
2008-05-27 14:38 ` Ivo van Doorn
2008-05-27 17:41 ` Henrique de Moraes Holschuh
2008-05-27 18:13 ` Ivo van Doorn
2008-05-18 18:48 ` [PATCH 15/15] rfkill: document rw rfkill switches and clarify input subsystem interactions Henrique de Moraes Holschuh
2008-05-19 17:51 ` Randy Dunlap
2008-05-19 22:04 ` Henrique de Moraes Holschuh
2008-05-19 22:52 ` Elias Oltmanns
2008-05-19 22:56 ` Randy Dunlap
2008-05-20 10:09 ` Ivo van Doorn
2008-05-20 15:54 ` Henrique de Moraes Holschuh
2008-05-20 17:18 ` Ivo van Doorn
2008-05-21 1:44 ` Henrique de Moraes Holschuh
2008-05-29 0:45 ` [PATCH 15/15] rfkill: document rw rfkill switches and clarify input subsystem interactions (v2) Henrique de Moraes Holschuh
2008-05-29 13:02 ` Ivo van Doorn
2008-05-29 16:26 ` Henrique de Moraes Holschuh
2008-05-29 17:19 ` Ivo van Doorn
2008-05-29 17:22 ` Henrique de Moraes Holschuh
2008-05-29 17:40 ` Ivo van Doorn
2008-05-29 17:46 ` Henrique de Moraes Holschuh
2008-05-29 18:58 ` Dmitry Torokhov
2008-05-29 21:16 ` Henrique de Moraes Holschuh
2008-05-29 21:25 ` [PATCH] Input: rename SW_RADIO to SW_RFKILL_ALL (v2) Henrique de Moraes Holschuh
2008-06-04 3:11 ` [PATCH 15/15] rfkill: document rw rfkill switches and clarify input subsystem interactions (v2) Henrique de Moraes Holschuh
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=1211186644.21269.274.camel@queen.suse.de \
--to=trenn@suse.de \
--cc=IvDoorn@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome