aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/bsg.h11
-rw-r--r--include/uapi/linux/fcntl.h15
-rw-r--r--include/uapi/linux/in6.h2
-rw-r--r--include/uapi/linux/kexec.h11
-rw-r--r--include/uapi/linux/kvm.h6
-rw-r--r--include/uapi/linux/memfd.h8
-rw-r--r--include/uapi/linux/serio.h1
-rw-r--r--include/uapi/linux/uhid.h120
-rw-r--r--include/uapi/linux/uinput.h9
-rw-r--r--include/uapi/linux/vfio.h34
-rw-r--r--include/uapi/linux/virtio_blk.h5
11 files changed, 189 insertions, 33 deletions
diff --git a/include/uapi/linux/bsg.h b/include/uapi/linux/bsg.h
index 7a12e1c0f371..02986cf8b6f1 100644
--- a/include/uapi/linux/bsg.h
+++ b/include/uapi/linux/bsg.h
@@ -10,12 +10,13 @@
10#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 10#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
11 11
12/* 12/*
13 * For flags member below 13 * For flag constants below:
14 * sg.h sg_io_hdr also has bits defined for it's flags member. However 14 * sg.h sg_io_hdr also has bits defined for it's flags member. These
15 * none of these bits are implemented/used by bsg. The bits below are 15 * two flag values (0x10 and 0x20) have the same meaning in sg.h . For
16 * allocated to not conflict with sg.h ones anyway. 16 * bsg the BSG_FLAG_Q_AT_HEAD flag is ignored since it is the deafult.
17 */ 17 */
18#define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */ 18#define BSG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */
19#define BSG_FLAG_Q_AT_HEAD 0x20
19 20
20struct sg_io_v4 { 21struct sg_io_v4 {
21 __s32 guard; /* [i] 'Q' to differentiate from v3 */ 22 __s32 guard; /* [i] 'Q' to differentiate from v3 */
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
index 074b886c6be0..beed138bd359 100644
--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -28,6 +28,21 @@
28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) 28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
29 29
30/* 30/*
31 * Set/Get seals
32 */
33#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
34#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
35
36/*
37 * Types of seals
38 */
39#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
40#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
41#define F_SEAL_GROW 0x0004 /* prevent file from growing */
42#define F_SEAL_WRITE 0x0008 /* prevent writes */
43/* (1U << 31) is reserved for signed error codes */
44
45/*
31 * Types of directory notifications that may be requested. 46 * Types of directory notifications that may be requested.
32 */ 47 */
33#define DN_ACCESS 0x00000001 /* File accessed */ 48#define DN_ACCESS 0x00000001 /* File accessed */
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 22b7a69619d8..74a2a1773494 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -233,7 +233,6 @@ struct in6_flowlabel_req {
233#if 0 /* not yet */ 233#if 0 /* not yet */
234#define IPV6_USE_MIN_MTU 63 234#define IPV6_USE_MIN_MTU 63
235#endif 235#endif
236#define IPV6_AUTOFLOWLABEL 64
237 236
238/* 237/*
239 * Netfilter (1) 238 * Netfilter (1)
@@ -262,6 +261,7 @@ struct in6_flowlabel_req {
262 * IP6T_SO_ORIGINAL_DST 80 261 * IP6T_SO_ORIGINAL_DST 80
263 */ 262 */
264 263
264#define IPV6_AUTOFLOWLABEL 70
265/* RFC5014: Source address selection */ 265/* RFC5014: Source address selection */
266#define IPV6_ADDR_PREFERENCES 72 266#define IPV6_ADDR_PREFERENCES 72
267 267
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h
index d6629d49a243..6925f5b42f89 100644
--- a/include/uapi/linux/kexec.h
+++ b/include/uapi/linux/kexec.h
@@ -13,6 +13,17 @@
13#define KEXEC_PRESERVE_CONTEXT 0x00000002 13#define KEXEC_PRESERVE_CONTEXT 0x00000002
14#define KEXEC_ARCH_MASK 0xffff0000 14#define KEXEC_ARCH_MASK 0xffff0000
15 15
16/*
17 * Kexec file load interface flags.
18 * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
19 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
20 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
21 * fd field.
22 */
23#define KEXEC_FILE_UNLOAD 0x00000001
24#define KEXEC_FILE_ON_CRASH 0x00000002
25#define KEXEC_FILE_NO_INITRAMFS 0x00000004
26
16/* These values match the ELF architecture values. 27/* These values match the ELF architecture values.
17 * Unless there is a good reason that should continue to be the case. 28 * Unless there is a good reason that should continue to be the case.
18 */ 29 */
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 9b744af871d7..cf3a2ff440e4 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -162,7 +162,7 @@ struct kvm_pit_config {
162#define KVM_EXIT_TPR_ACCESS 12 162#define KVM_EXIT_TPR_ACCESS 12
163#define KVM_EXIT_S390_SIEIC 13 163#define KVM_EXIT_S390_SIEIC 13
164#define KVM_EXIT_S390_RESET 14 164#define KVM_EXIT_S390_RESET 14
165#define KVM_EXIT_DCR 15 165#define KVM_EXIT_DCR 15 /* deprecated */
166#define KVM_EXIT_NMI 16 166#define KVM_EXIT_NMI 16
167#define KVM_EXIT_INTERNAL_ERROR 17 167#define KVM_EXIT_INTERNAL_ERROR 17
168#define KVM_EXIT_OSI 18 168#define KVM_EXIT_OSI 18
@@ -268,7 +268,7 @@ struct kvm_run {
268 __u64 trans_exc_code; 268 __u64 trans_exc_code;
269 __u32 pgm_code; 269 __u32 pgm_code;
270 } s390_ucontrol; 270 } s390_ucontrol;
271 /* KVM_EXIT_DCR */ 271 /* KVM_EXIT_DCR (deprecated) */
272 struct { 272 struct {
273 __u32 dcrn; 273 __u32 dcrn;
274 __u32 data; 274 __u32 data;
@@ -763,6 +763,8 @@ struct kvm_ppc_smmu_info {
763#define KVM_CAP_VM_ATTRIBUTES 101 763#define KVM_CAP_VM_ATTRIBUTES 101
764#define KVM_CAP_ARM_PSCI_0_2 102 764#define KVM_CAP_ARM_PSCI_0_2 102
765#define KVM_CAP_PPC_FIXUP_HCALL 103 765#define KVM_CAP_PPC_FIXUP_HCALL 103
766#define KVM_CAP_PPC_ENABLE_HCALL 104
767#define KVM_CAP_CHECK_EXTENSION_VM 105
766 768
767#ifdef KVM_CAP_IRQ_ROUTING 769#ifdef KVM_CAP_IRQ_ROUTING
768 770
diff --git a/include/uapi/linux/memfd.h b/include/uapi/linux/memfd.h
new file mode 100644
index 000000000000..534e364bda92
--- /dev/null
+++ b/include/uapi/linux/memfd.h
@@ -0,0 +1,8 @@
1#ifndef _UAPI_LINUX_MEMFD_H
2#define _UAPI_LINUX_MEMFD_H
3
4/* flags for memfd_create(2) (unsigned int) */
5#define MFD_CLOEXEC 0x0001U
6#define MFD_ALLOW_SEALING 0x0002U
7
8#endif /* _UAPI_LINUX_MEMFD_H */
diff --git a/include/uapi/linux/serio.h b/include/uapi/linux/serio.h
index 9f53fa7fc132..becdd78295cc 100644
--- a/include/uapi/linux/serio.h
+++ b/include/uapi/linux/serio.h
@@ -76,5 +76,6 @@
76#define SERIO_HAMPSHIRE 0x3b 76#define SERIO_HAMPSHIRE 0x3b
77#define SERIO_PS2MULT 0x3c 77#define SERIO_PS2MULT 0x3c
78#define SERIO_TSC40 0x3d 78#define SERIO_TSC40 0x3d
79#define SERIO_WACOM_IV 0x3e
79 80
80#endif /* _UAPI_SERIO_H */ 81#endif /* _UAPI_SERIO_H */
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
index 1e3b09c191cd..aaa86d6bd1dd 100644
--- a/include/uapi/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
@@ -24,35 +24,23 @@
24#include <linux/hid.h> 24#include <linux/hid.h>
25 25
26enum uhid_event_type { 26enum uhid_event_type {
27 UHID_CREATE, 27 __UHID_LEGACY_CREATE,
28 UHID_DESTROY, 28 UHID_DESTROY,
29 UHID_START, 29 UHID_START,
30 UHID_STOP, 30 UHID_STOP,
31 UHID_OPEN, 31 UHID_OPEN,
32 UHID_CLOSE, 32 UHID_CLOSE,
33 UHID_OUTPUT, 33 UHID_OUTPUT,
34 UHID_OUTPUT_EV, /* obsolete! */ 34 __UHID_LEGACY_OUTPUT_EV,
35 UHID_INPUT, 35 __UHID_LEGACY_INPUT,
36 UHID_FEATURE, 36 UHID_GET_REPORT,
37 UHID_FEATURE_ANSWER, 37 UHID_GET_REPORT_REPLY,
38 UHID_CREATE2, 38 UHID_CREATE2,
39 UHID_INPUT2, 39 UHID_INPUT2,
40 UHID_SET_REPORT,
41 UHID_SET_REPORT_REPLY,
40}; 42};
41 43
42struct uhid_create_req {
43 __u8 name[128];
44 __u8 phys[64];
45 __u8 uniq[64];
46 __u8 __user *rd_data;
47 __u16 rd_size;
48
49 __u16 bus;
50 __u32 vendor;
51 __u32 product;
52 __u32 version;
53 __u32 country;
54} __attribute__((__packed__));
55
56struct uhid_create2_req { 44struct uhid_create2_req {
57 __u8 name[128]; 45 __u8 name[128];
58 __u8 phys[64]; 46 __u8 phys[64];
@@ -66,6 +54,16 @@ struct uhid_create2_req {
66 __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE]; 54 __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE];
67} __attribute__((__packed__)); 55} __attribute__((__packed__));
68 56
57enum uhid_dev_flag {
58 UHID_DEV_NUMBERED_FEATURE_REPORTS = (1ULL << 0),
59 UHID_DEV_NUMBERED_OUTPUT_REPORTS = (1ULL << 1),
60 UHID_DEV_NUMBERED_INPUT_REPORTS = (1ULL << 2),
61};
62
63struct uhid_start_req {
64 __u64 dev_flags;
65};
66
69#define UHID_DATA_MAX 4096 67#define UHID_DATA_MAX 4096
70 68
71enum uhid_report_type { 69enum uhid_report_type {
@@ -74,36 +72,94 @@ enum uhid_report_type {
74 UHID_INPUT_REPORT, 72 UHID_INPUT_REPORT,
75}; 73};
76 74
77struct uhid_input_req { 75struct uhid_input2_req {
76 __u16 size;
77 __u8 data[UHID_DATA_MAX];
78} __attribute__((__packed__));
79
80struct uhid_output_req {
78 __u8 data[UHID_DATA_MAX]; 81 __u8 data[UHID_DATA_MAX];
79 __u16 size; 82 __u16 size;
83 __u8 rtype;
80} __attribute__((__packed__)); 84} __attribute__((__packed__));
81 85
82struct uhid_input2_req { 86struct uhid_get_report_req {
87 __u32 id;
88 __u8 rnum;
89 __u8 rtype;
90} __attribute__((__packed__));
91
92struct uhid_get_report_reply_req {
93 __u32 id;
94 __u16 err;
83 __u16 size; 95 __u16 size;
84 __u8 data[UHID_DATA_MAX]; 96 __u8 data[UHID_DATA_MAX];
85} __attribute__((__packed__)); 97} __attribute__((__packed__));
86 98
87struct uhid_output_req { 99struct uhid_set_report_req {
100 __u32 id;
101 __u8 rnum;
102 __u8 rtype;
103 __u16 size;
104 __u8 data[UHID_DATA_MAX];
105} __attribute__((__packed__));
106
107struct uhid_set_report_reply_req {
108 __u32 id;
109 __u16 err;
110} __attribute__((__packed__));
111
112/*
113 * Compat Layer
114 * All these commands and requests are obsolete. You should avoid using them in
115 * new code. We support them for backwards-compatibility, but you might not get
116 * access to new feature in case you use them.
117 */
118
119enum uhid_legacy_event_type {
120 UHID_CREATE = __UHID_LEGACY_CREATE,
121 UHID_OUTPUT_EV = __UHID_LEGACY_OUTPUT_EV,
122 UHID_INPUT = __UHID_LEGACY_INPUT,
123 UHID_FEATURE = UHID_GET_REPORT,
124 UHID_FEATURE_ANSWER = UHID_GET_REPORT_REPLY,
125};
126
127/* Obsolete! Use UHID_CREATE2. */
128struct uhid_create_req {
129 __u8 name[128];
130 __u8 phys[64];
131 __u8 uniq[64];
132 __u8 __user *rd_data;
133 __u16 rd_size;
134
135 __u16 bus;
136 __u32 vendor;
137 __u32 product;
138 __u32 version;
139 __u32 country;
140} __attribute__((__packed__));
141
142/* Obsolete! Use UHID_INPUT2. */
143struct uhid_input_req {
88 __u8 data[UHID_DATA_MAX]; 144 __u8 data[UHID_DATA_MAX];
89 __u16 size; 145 __u16 size;
90 __u8 rtype;
91} __attribute__((__packed__)); 146} __attribute__((__packed__));
92 147
93/* Obsolete! Newer kernels will no longer send these events but instead convert 148/* Obsolete! Kernel uses UHID_OUTPUT exclusively now. */
94 * it into raw output reports via UHID_OUTPUT. */
95struct uhid_output_ev_req { 149struct uhid_output_ev_req {
96 __u16 type; 150 __u16 type;
97 __u16 code; 151 __u16 code;
98 __s32 value; 152 __s32 value;
99} __attribute__((__packed__)); 153} __attribute__((__packed__));
100 154
155/* Obsolete! Kernel uses ABI compatible UHID_GET_REPORT. */
101struct uhid_feature_req { 156struct uhid_feature_req {
102 __u32 id; 157 __u32 id;
103 __u8 rnum; 158 __u8 rnum;
104 __u8 rtype; 159 __u8 rtype;
105} __attribute__((__packed__)); 160} __attribute__((__packed__));
106 161
162/* Obsolete! Use ABI compatible UHID_GET_REPORT_REPLY. */
107struct uhid_feature_answer_req { 163struct uhid_feature_answer_req {
108 __u32 id; 164 __u32 id;
109 __u16 err; 165 __u16 err;
@@ -111,6 +167,15 @@ struct uhid_feature_answer_req {
111 __u8 data[UHID_DATA_MAX]; 167 __u8 data[UHID_DATA_MAX];
112} __attribute__((__packed__)); 168} __attribute__((__packed__));
113 169
170/*
171 * UHID Events
172 * All UHID events from and to the kernel are encoded as "struct uhid_event".
173 * The "type" field contains a UHID_* type identifier. All payload depends on
174 * that type and can be accessed via ev->u.XYZ accordingly.
175 * If user-space writes short events, they're extended with 0s by the kernel. If
176 * the kernel writes short events, user-space shall extend them with 0s.
177 */
178
114struct uhid_event { 179struct uhid_event {
115 __u32 type; 180 __u32 type;
116 181
@@ -120,9 +185,14 @@ struct uhid_event {
120 struct uhid_output_req output; 185 struct uhid_output_req output;
121 struct uhid_output_ev_req output_ev; 186 struct uhid_output_ev_req output_ev;
122 struct uhid_feature_req feature; 187 struct uhid_feature_req feature;
188 struct uhid_get_report_req get_report;
123 struct uhid_feature_answer_req feature_answer; 189 struct uhid_feature_answer_req feature_answer;
190 struct uhid_get_report_reply_req get_report_reply;
124 struct uhid_create2_req create2; 191 struct uhid_create2_req create2;
125 struct uhid_input2_req input2; 192 struct uhid_input2_req input2;
193 struct uhid_set_report_req set_report;
194 struct uhid_set_report_reply_req set_report_reply;
195 struct uhid_start_req start;
126 } u; 196 } u;
127} __attribute__((__packed__)); 197} __attribute__((__packed__));
128 198
diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h
index 0389b489bbba..baeab83deb64 100644
--- a/include/uapi/linux/uinput.h
+++ b/include/uapi/linux/uinput.h
@@ -84,6 +84,15 @@ struct uinput_ff_erase {
84 */ 84 */
85#define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 300, len) 85#define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 300, len)
86 86
87/**
88 * UI_GET_VERSION - Return version of uinput protocol
89 *
90 * This writes uinput protocol version implemented by the kernel into
91 * the integer pointed to by the ioctl argument. The protocol version
92 * is hard-coded in the kernel and is independent of the uinput device.
93 */
94#define UI_GET_VERSION _IOR(UINPUT_IOCTL_BASE, 301, unsigned int)
95
87/* 96/*
88 * To write a force-feedback-capable driver, the upload_effect 97 * To write a force-feedback-capable driver, the upload_effect
89 * and erase_effect callbacks in input_dev must be implemented. 98 * and erase_effect callbacks in input_dev must be implemented.
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index cb9023d4f063..6612974c64bf 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -30,6 +30,9 @@
30 */ 30 */
31#define VFIO_DMA_CC_IOMMU 4 31#define VFIO_DMA_CC_IOMMU 4
32 32
33/* Check if EEH is supported */
34#define VFIO_EEH 5
35
33/* 36/*
34 * The IOCTL interface is designed for extensibility by embedding the 37 * The IOCTL interface is designed for extensibility by embedding the
35 * structure length (argsz) and flags into structures passed between 38 * structure length (argsz) and flags into structures passed between
@@ -455,6 +458,37 @@ struct vfio_iommu_spapr_tce_info {
455 458
456#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) 459#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
457 460
461/*
462 * EEH PE operation struct provides ways to:
463 * - enable/disable EEH functionality;
464 * - unfreeze IO/DMA for frozen PE;
465 * - read PE state;
466 * - reset PE;
467 * - configure PE.
468 */
469struct vfio_eeh_pe_op {
470 __u32 argsz;
471 __u32 flags;
472 __u32 op;
473};
474
475#define VFIO_EEH_PE_DISABLE 0 /* Disable EEH functionality */
476#define VFIO_EEH_PE_ENABLE 1 /* Enable EEH functionality */
477#define VFIO_EEH_PE_UNFREEZE_IO 2 /* Enable IO for frozen PE */
478#define VFIO_EEH_PE_UNFREEZE_DMA 3 /* Enable DMA for frozen PE */
479#define VFIO_EEH_PE_GET_STATE 4 /* PE state retrieval */
480#define VFIO_EEH_PE_STATE_NORMAL 0 /* PE in functional state */
481#define VFIO_EEH_PE_STATE_RESET 1 /* PE reset in progress */
482#define VFIO_EEH_PE_STATE_STOPPED 2 /* Stopped DMA and IO */
483#define VFIO_EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
484#define VFIO_EEH_PE_STATE_UNAVAIL 5 /* State unavailable */
485#define VFIO_EEH_PE_RESET_DEACTIVATE 5 /* Deassert PE reset */
486#define VFIO_EEH_PE_RESET_HOT 6 /* Assert hot reset */
487#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7 /* Assert fundamental reset */
488#define VFIO_EEH_PE_CONFIGURE 8 /* PE configuration */
489
490#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
491
458/* ***************************************************************** */ 492/* ***************************************************************** */
459 493
460#endif /* _UAPIVFIO_H */ 494#endif /* _UAPIVFIO_H */
diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h
index 6d8e61c48563..9ad67b267584 100644
--- a/include/uapi/linux/virtio_blk.h
+++ b/include/uapi/linux/virtio_blk.h
@@ -40,6 +40,7 @@
40#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ 40#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */
41#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ 41#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
42#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ 42#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */
43#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */
43 44
44#ifndef __KERNEL__ 45#ifndef __KERNEL__
45/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ 46/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */
@@ -77,6 +78,10 @@ struct virtio_blk_config {
77 78
78 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ 79 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
79 __u8 wce; 80 __u8 wce;
81 __u8 unused;
82
83 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
84 __u16 num_queues;
80} __attribute__((packed)); 85} __attribute__((packed));
81 86
82/* 87/*