X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=include%2Flinux%2Frfkill.h;h=741d1a62cc3f28e68ff4ce0f2e0ac5ef636aabb7;hb=f6ac436dcc4c34709bcde355f3f2254ac0a183d4;hp=c5f6e54ec6ae6dd42106b340823e85f84250ec04;hpb=6ce37a58e334ef773f88283939afc9f4965c7697;p=linux-2.6 diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index c5f6e54ec6..741d1a62cc 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h @@ -68,7 +68,8 @@ enum rfkill_state { * @user_claim_unsupported: Whether the hardware supports exclusive * RF-kill control by userspace. Set this before registering. * @user_claim: Set when the switch is controlled exlusively by userspace. - * @mutex: Guards switch state transitions + * @mutex: Guards switch state transitions. It serializes callbacks + * and also protects the state. * @data: Pointer to the RF button drivers private data which will be * passed along when toggling radio state. * @toggle_radio(): Mandatory handler to control state of the radio. @@ -89,12 +90,13 @@ struct rfkill { const char *name; enum rfkill_type type; - enum rfkill_state state; bool user_claim_unsupported; bool user_claim; + /* the mutex serializes callbacks and also protects + * the state */ struct mutex mutex; - + enum rfkill_state state; void *data; int (*toggle_radio)(void *data, enum rfkill_state state); int (*get_state)(void *data, enum rfkill_state *state);