Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rfkill.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 - 2007 Ivo van Doorn
3  * Copyright (C) 2007 Dmitry Torokhov
4  * Copyright 2009 Johannes Berg <[email protected]>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 #ifndef _UAPI__RFKILL_H
19 #define _UAPI__RFKILL_H
20 
21 
22 #include <linux/types.h>
23 
24 /* define userspace visible states */
25 #define RFKILL_STATE_SOFT_BLOCKED 0
26 #define RFKILL_STATE_UNBLOCKED 1
27 #define RFKILL_STATE_HARD_BLOCKED 2
28 
52 };
53 
66 };
67 
79 struct rfkill_event {
84 } __attribute__((packed));
85 
86 /*
87  * We are planning to be backward and forward compatible with changes
88  * to the event struct, by adding new, optional, members at the end.
89  * When reading an event (whether the kernel from userspace or vice
90  * versa) we need to accept anything that's at least as large as the
91  * version 1 event size, but might be able to accept other sizes in
92  * the future.
93  *
94  * One exception is the kernel -- we already have two event sizes in
95  * that we've made the 'hard' member optional since our only option
96  * is to ignore it anyway.
97  */
98 #define RFKILL_EVENT_SIZE_V1 8
99 
100 /* ioctl for turning off rfkill-input (if present) */
101 #define RFKILL_IOC_MAGIC 'R'
102 #define RFKILL_IOC_NOINPUT 1
103 #define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
104 
105 /* and that's all userspace gets */
106 
107 #endif /* _UAPI__RFKILL_H */