aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/btrfs.h1
-rw-r--r--include/uapi/linux/in6.h23
-rw-r--r--include/uapi/linux/mic_ioctl.h2
-rw-r--r--include/uapi/linux/nvme.h11
-rw-r--r--include/uapi/xen/Kbuild2
-rw-r--r--include/uapi/xen/gntalloc.h82
-rw-r--r--include/uapi/xen/gntdev.h150
7 files changed, 253 insertions, 18 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 1b8a0f4c9590..b4d69092fbdb 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -558,7 +558,6 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
558#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64) 558#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
559#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ 559#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
560 struct btrfs_ioctl_space_args) 560 struct btrfs_ioctl_space_args)
561#define BTRFS_IOC_GLOBAL_RSV _IOR(BTRFS_IOCTL_MAGIC, 20, __u64)
562#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) 561#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
563#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) 562#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
564#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ 563#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 633b93cac1ed..e9a1d2d973b6 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -128,22 +128,13 @@ struct in6_flowlabel_req {
128 * IPV6 extension headers 128 * IPV6 extension headers
129 */ 129 */
130#if __UAPI_DEF_IPPROTO_V6 130#if __UAPI_DEF_IPPROTO_V6
131enum { 131#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
132 IPPROTO_HOPOPTS = 0, /* IPv6 hop-by-hop options */ 132#define IPPROTO_ROUTING 43 /* IPv6 routing header */
133#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS 133#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
134 IPPROTO_ROUTING = 43, /* IPv6 routing header */ 134#define IPPROTO_ICMPV6 58 /* ICMPv6 */
135#define IPPROTO_ROUTING IPPROTO_ROUTING 135#define IPPROTO_NONE 59 /* IPv6 no next header */
136 IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header */ 136#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
137#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT 137#define IPPROTO_MH 135 /* IPv6 mobility header */
138 IPPROTO_ICMPV6 = 58, /* ICMPv6 */
139#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
140 IPPROTO_NONE = 59, /* IPv6 no next header */
141#define IPPROTO_NONE IPPROTO_NONE
142 IPPROTO_DSTOPTS = 60, /* IPv6 destination options */
143#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
144 IPPROTO_MH = 135, /* IPv6 mobility header */
145#define IPPROTO_MH IPPROTO_MH
146};
147#endif /* __UAPI_DEF_IPPROTO_V6 */ 138#endif /* __UAPI_DEF_IPPROTO_V6 */
148 139
149/* 140/*
diff --git a/include/uapi/linux/mic_ioctl.h b/include/uapi/linux/mic_ioctl.h
index 7fabba5059cf..feb0b4c0814c 100644
--- a/include/uapi/linux/mic_ioctl.h
+++ b/include/uapi/linux/mic_ioctl.h
@@ -39,7 +39,7 @@ struct mic_copy_desc {
39#else 39#else
40 struct iovec *iov; 40 struct iovec *iov;
41#endif 41#endif
42 int iovcnt; 42 __u32 iovcnt;
43 __u8 vr_idx; 43 __u8 vr_idx;
44 __u8 update_used; 44 __u8 update_used;
45 __u32 out_len; 45 __u32 out_len;
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index 989c04e0c563..e5ab62201119 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -350,6 +350,16 @@ struct nvme_delete_queue {
350 __u32 rsvd11[5]; 350 __u32 rsvd11[5];
351}; 351};
352 352
353struct nvme_abort_cmd {
354 __u8 opcode;
355 __u8 flags;
356 __u16 command_id;
357 __u32 rsvd1[9];
358 __le16 sqid;
359 __u16 cid;
360 __u32 rsvd11[5];
361};
362
353struct nvme_download_firmware { 363struct nvme_download_firmware {
354 __u8 opcode; 364 __u8 opcode;
355 __u8 flags; 365 __u8 flags;
@@ -384,6 +394,7 @@ struct nvme_command {
384 struct nvme_download_firmware dlfw; 394 struct nvme_download_firmware dlfw;
385 struct nvme_format_cmd format; 395 struct nvme_format_cmd format;
386 struct nvme_dsm_cmd dsm; 396 struct nvme_dsm_cmd dsm;
397 struct nvme_abort_cmd abort;
387 }; 398 };
388}; 399};
389 400
diff --git a/include/uapi/xen/Kbuild b/include/uapi/xen/Kbuild
index 61257cb14653..5c459628e8c7 100644
--- a/include/uapi/xen/Kbuild
+++ b/include/uapi/xen/Kbuild
@@ -1,3 +1,5 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += evtchn.h 2header-y += evtchn.h
3header-y += gntalloc.h
4header-y += gntdev.h
3header-y += privcmd.h 5header-y += privcmd.h
diff --git a/include/uapi/xen/gntalloc.h b/include/uapi/xen/gntalloc.h
new file mode 100644
index 000000000000..76bd58065f4f
--- /dev/null
+++ b/include/uapi/xen/gntalloc.h
@@ -0,0 +1,82 @@
1/******************************************************************************
2 * gntalloc.h
3 *
4 * Interface to /dev/xen/gntalloc.
5 *
6 * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
7 *
8 * This file is in the public domain.
9 */
10
11#ifndef __LINUX_PUBLIC_GNTALLOC_H__
12#define __LINUX_PUBLIC_GNTALLOC_H__
13
14/*
15 * Allocates a new page and creates a new grant reference.
16 */
17#define IOCTL_GNTALLOC_ALLOC_GREF \
18_IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref))
19struct ioctl_gntalloc_alloc_gref {
20 /* IN parameters */
21 /* The ID of the domain to be given access to the grants. */
22 uint16_t domid;
23 /* Flags for this mapping */
24 uint16_t flags;
25 /* Number of pages to map */
26 uint32_t count;
27 /* OUT parameters */
28 /* The offset to be used on a subsequent call to mmap(). */
29 uint64_t index;
30 /* The grant references of the newly created grant, one per page */
31 /* Variable size, depending on count */
32 uint32_t gref_ids[1];
33};
34
35#define GNTALLOC_FLAG_WRITABLE 1
36
37/*
38 * Deallocates the grant reference, allowing the associated page to be freed if
39 * no other domains are using it.
40 */
41#define IOCTL_GNTALLOC_DEALLOC_GREF \
42_IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref))
43struct ioctl_gntalloc_dealloc_gref {
44 /* IN parameters */
45 /* The offset returned in the map operation */
46 uint64_t index;
47 /* Number of references to unmap */
48 uint32_t count;
49};
50
51/*
52 * Sets up an unmap notification within the page, so that the other side can do
53 * cleanup if this side crashes. Required to implement cross-domain robust
54 * mutexes or close notification on communication channels.
55 *
56 * Each mapped page only supports one notification; multiple calls referring to
57 * the same page overwrite the previous notification. You must clear the
58 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
59 * to occur.
60 */
61#define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \
62_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify))
63struct ioctl_gntalloc_unmap_notify {
64 /* IN parameters */
65 /* Offset in the file descriptor for a byte within the page (same as
66 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
67 * be cleared. Otherwise, it can be any byte in the page whose
68 * notification we are adjusting.
69 */
70 uint64_t index;
71 /* Action(s) to take on unmap */
72 uint32_t action;
73 /* Event channel to notify */
74 uint32_t event_channel_port;
75};
76
77/* Clear (set to zero) the byte specified by index */
78#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
79/* Send an interrupt on the indicated event channel */
80#define UNMAP_NOTIFY_SEND_EVENT 0x2
81
82#endif /* __LINUX_PUBLIC_GNTALLOC_H__ */
diff --git a/include/uapi/xen/gntdev.h b/include/uapi/xen/gntdev.h
new file mode 100644
index 000000000000..5304bd3c84c5
--- /dev/null
+++ b/include/uapi/xen/gntdev.h
@@ -0,0 +1,150 @@
1/******************************************************************************
2 * gntdev.h
3 *
4 * Interface to /dev/xen/gntdev.
5 *
6 * Copyright (c) 2007, D G Murray
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __LINUX_PUBLIC_GNTDEV_H__
34#define __LINUX_PUBLIC_GNTDEV_H__
35
36struct ioctl_gntdev_grant_ref {
37 /* The domain ID of the grant to be mapped. */
38 uint32_t domid;
39 /* The grant reference of the grant to be mapped. */
40 uint32_t ref;
41};
42
43/*
44 * Inserts the grant references into the mapping table of an instance
45 * of gntdev. N.B. This does not perform the mapping, which is deferred
46 * until mmap() is called with @index as the offset.
47 */
48#define IOCTL_GNTDEV_MAP_GRANT_REF \
49_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
50struct ioctl_gntdev_map_grant_ref {
51 /* IN parameters */
52 /* The number of grants to be mapped. */
53 uint32_t count;
54 uint32_t pad;
55 /* OUT parameters */
56 /* The offset to be used on a subsequent call to mmap(). */
57 uint64_t index;
58 /* Variable IN parameter. */
59 /* Array of grant references, of size @count. */
60 struct ioctl_gntdev_grant_ref refs[1];
61};
62
63/*
64 * Removes the grant references from the mapping table of an instance of
65 * of gntdev. N.B. munmap() must be called on the relevant virtual address(es)
66 * before this ioctl is called, or an error will result.
67 */
68#define IOCTL_GNTDEV_UNMAP_GRANT_REF \
69_IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
70struct ioctl_gntdev_unmap_grant_ref {
71 /* IN parameters */
72 /* The offset was returned by the corresponding map operation. */
73 uint64_t index;
74 /* The number of pages to be unmapped. */
75 uint32_t count;
76 uint32_t pad;
77};
78
79/*
80 * Returns the offset in the driver's address space that corresponds
81 * to @vaddr. This can be used to perform a munmap(), followed by an
82 * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
83 * the caller. The number of pages that were allocated at the same time as
84 * @vaddr is returned in @count.
85 *
86 * N.B. Where more than one page has been mapped into a contiguous range, the
87 * supplied @vaddr must correspond to the start of the range; otherwise
88 * an error will result. It is only possible to munmap() the entire
89 * contiguously-allocated range at once, and not any subrange thereof.
90 */
91#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \
92_IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
93struct ioctl_gntdev_get_offset_for_vaddr {
94 /* IN parameters */
95 /* The virtual address of the first mapped page in a range. */
96 uint64_t vaddr;
97 /* OUT parameters */
98 /* The offset that was used in the initial mmap() operation. */
99 uint64_t offset;
100 /* The number of pages mapped in the VM area that begins at @vaddr. */
101 uint32_t count;
102 uint32_t pad;
103};
104
105/*
106 * Sets the maximum number of grants that may mapped at once by this gntdev
107 * instance.
108 *
109 * N.B. This must be called before any other ioctl is performed on the device.
110 */
111#define IOCTL_GNTDEV_SET_MAX_GRANTS \
112_IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
113struct ioctl_gntdev_set_max_grants {
114 /* IN parameter */
115 /* The maximum number of grants that may be mapped at once. */
116 uint32_t count;
117};
118
119/*
120 * Sets up an unmap notification within the page, so that the other side can do
121 * cleanup if this side crashes. Required to implement cross-domain robust
122 * mutexes or close notification on communication channels.
123 *
124 * Each mapped page only supports one notification; multiple calls referring to
125 * the same page overwrite the previous notification. You must clear the
126 * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it
127 * to occur.
128 */
129#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \
130_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
131struct ioctl_gntdev_unmap_notify {
132 /* IN parameters */
133 /* Offset in the file descriptor for a byte within the page (same as
134 * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to
135 * be cleared. Otherwise, it can be any byte in the page whose
136 * notification we are adjusting.
137 */
138 uint64_t index;
139 /* Action(s) to take on unmap */
140 uint32_t action;
141 /* Event channel to notify */
142 uint32_t event_channel_port;
143};
144
145/* Clear (set to zero) the byte specified by index */
146#define UNMAP_NOTIFY_CLEAR_BYTE 0x1
147/* Send an interrupt on the indicated event channel */
148#define UNMAP_NOTIFY_SEND_EVENT 0x2
149
150#endif /* __LINUX_PUBLIC_GNTDEV_H__ */