diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-07-21 20:18:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-29 16:36:33 -0400 |
commit | f1b23361a0f15497d4c6795a2935b2e98064ddfb (patch) | |
tree | 78c3b671562de9180e9e7d385a2f851e5fe67aa1 /include/linux/rfkill.h | |
parent | 37f55e9d78d1b63047b1b7ae175cdce650547ba8 (diff) |
rfkill: document the rfkill struct locking (v2)
Reorder fields in struct rfkill and add comments to make it clear
which fields are protected by rfkill->mutex.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/rfkill.h')
-rw-r--r-- | include/linux/rfkill.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index c5f6e54ec6ae..741d1a62cc3f 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -68,7 +68,8 @@ enum rfkill_state { | |||
68 | * @user_claim_unsupported: Whether the hardware supports exclusive | 68 | * @user_claim_unsupported: Whether the hardware supports exclusive |
69 | * RF-kill control by userspace. Set this before registering. | 69 | * RF-kill control by userspace. Set this before registering. |
70 | * @user_claim: Set when the switch is controlled exlusively by userspace. | 70 | * @user_claim: Set when the switch is controlled exlusively by userspace. |
71 | * @mutex: Guards switch state transitions | 71 | * @mutex: Guards switch state transitions. It serializes callbacks |
72 | * and also protects the state. | ||
72 | * @data: Pointer to the RF button drivers private data which will be | 73 | * @data: Pointer to the RF button drivers private data which will be |
73 | * passed along when toggling radio state. | 74 | * passed along when toggling radio state. |
74 | * @toggle_radio(): Mandatory handler to control state of the radio. | 75 | * @toggle_radio(): Mandatory handler to control state of the radio. |
@@ -89,12 +90,13 @@ struct rfkill { | |||
89 | const char *name; | 90 | const char *name; |
90 | enum rfkill_type type; | 91 | enum rfkill_type type; |
91 | 92 | ||
92 | enum rfkill_state state; | ||
93 | bool user_claim_unsupported; | 93 | bool user_claim_unsupported; |
94 | bool user_claim; | 94 | bool user_claim; |
95 | 95 | ||
96 | /* the mutex serializes callbacks and also protects | ||
97 | * the state */ | ||
96 | struct mutex mutex; | 98 | struct mutex mutex; |
97 | 99 | enum rfkill_state state; | |
98 | void *data; | 100 | void *data; |
99 | int (*toggle_radio)(void *data, enum rfkill_state state); | 101 | int (*toggle_radio)(void *data, enum rfkill_state state); |
100 | int (*get_state)(void *data, enum rfkill_state *state); | 102 | int (*get_state)(void *data, enum rfkill_state *state); |