diff options
Diffstat (limited to 'include/uapi/linux/userio.h')
-rw-r--r-- | include/uapi/linux/userio.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/uapi/linux/userio.h b/include/uapi/linux/userio.h new file mode 100644 index 000000000000..37d147f0a13a --- /dev/null +++ b/include/uapi/linux/userio.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * userio: virtual serio device support | ||
3 | * Copyright (C) 2015 Red Hat | ||
4 | * Copyright (C) 2015 Lyude (Stephen Chandler Paul) <cpaul@redhat.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU Lesser General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
14 | * details. | ||
15 | * | ||
16 | * This is the public header used for user-space communication with the userio | ||
17 | * driver. __attribute__((__packed__)) is used for all structs to keep ABI | ||
18 | * compatibility between all architectures. | ||
19 | */ | ||
20 | |||
21 | #ifndef _USERIO_H | ||
22 | #define _USERIO_H | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | |||
26 | enum userio_cmd_type { | ||
27 | USERIO_CMD_REGISTER = 0, | ||
28 | USERIO_CMD_SET_PORT_TYPE = 1, | ||
29 | USERIO_CMD_SEND_INTERRUPT = 2 | ||
30 | }; | ||
31 | |||
32 | /* | ||
33 | * userio Commands | ||
34 | * All commands sent to /dev/userio are encoded using this structure. The type | ||
35 | * field should contain a USERIO_CMD* value that indicates what kind of command | ||
36 | * is being sent to userio. The data field should contain the accompanying | ||
37 | * argument for the command, if there is one. | ||
38 | */ | ||
39 | struct userio_cmd { | ||
40 | __u8 type; | ||
41 | __u8 data; | ||
42 | } __attribute__((__packed__)); | ||
43 | |||
44 | #endif /* !_USERIO_H */ | ||