1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
3 * Intel MIC Platform Software Stack (MPSS)
5 * This file is provided under a dual BSD/GPLv2 license. When using or
6 * redistributing this file, you may do so under either license.
10 * Copyright(c) 2014 Intel Corporation.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
23 * Copyright(c) 2014 Intel Corporation.
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions
29 * * Redistributions of source code must retain the above copyright
30 * notice, this list of conditions and the following disclaimer.
31 * * Redistributions in binary form must reproduce the above copyright
32 * notice, this list of conditions and the following disclaimer in
33 * the documentation and/or other materials provided with the
35 * * Neither the name of Intel Corporation nor the names of its
36 * contributors may be used to endorse or promote products derived
37 * from this software without specific prior written permission.
39 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
42 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 * -----------------------------------------
56 * SCIF IOCTL interface information
57 * -----------------------------------------
62 #include <linux/types.h>
65 * struct scif_port_id - SCIF port information
66 * @node: node on which port resides
67 * @port: local port number
75 * struct scifioctl_connect - used for SCIF_CONNECT IOCTL
76 * @self: used to read back the assigned port_id
77 * @peer: destination node and port to connect to
79 struct scifioctl_connect {
80 struct scif_port_id self;
81 struct scif_port_id peer;
85 * struct scifioctl_accept - used for SCIF_ACCEPTREQ IOCTL
87 * @peer: global id of peer endpoint
88 * @endpt: new connected endpoint descriptor
90 struct scifioctl_accept {
92 struct scif_port_id peer;
97 * struct scifioctl_msg - used for SCIF_SEND/SCIF_RECV IOCTL
98 * @msg: message buffer address
99 * @len: message length
101 * @out_len: number of bytes sent/received
103 struct scifioctl_msg {
111 * struct scifioctl_reg - used for SCIF_REG IOCTL
112 * @addr: starting virtual address
113 * @len: length of range
114 * @offset: offset of window
115 * @prot: read/write protection
117 * @out_offset: offset returned
119 struct scifioctl_reg {
129 * struct scifioctl_unreg - used for SCIF_UNREG IOCTL
130 * @offset: start of range to unregister
131 * @len: length of range to unregister
133 struct scifioctl_unreg {
139 * struct scifioctl_copy - used for SCIF DMA copy IOCTLs
141 * @loffset: offset in local registered address space to/from
143 * @len: length of range to copy
144 * @roffset: offset in remote registered address space to/from
146 * @addr: user virtual address to/from which to copy
149 * This structure is used for SCIF_READFROM, SCIF_WRITETO, SCIF_VREADFROM
150 * and SCIF_VREADFROM IOCTL's.
152 struct scifioctl_copy {
161 * struct scifioctl_fence_mark - used for SCIF_FENCE_MARK IOCTL
163 * @mark: fence handle which is a pointer to a __s32
165 struct scifioctl_fence_mark {
171 * struct scifioctl_fence_signal - used for SCIF_FENCE_SIGNAL IOCTL
172 * @loff: local offset
173 * @lval: value to write to loffset
174 * @roff: remote offset
175 * @rval: value to write to roffset
178 struct scifioctl_fence_signal {
187 * struct scifioctl_node_ids - used for SCIF_GET_NODEIDS IOCTL
188 * @nodes: pointer to an array of node_ids
189 * @self: ID of the current node
190 * @len: length of array
192 struct scifioctl_node_ids {
198 #define SCIF_BIND _IOWR('s', 1, __u64)
199 #define SCIF_LISTEN _IOW('s', 2, __s32)
200 #define SCIF_CONNECT _IOWR('s', 3, struct scifioctl_connect)
201 #define SCIF_ACCEPTREQ _IOWR('s', 4, struct scifioctl_accept)
202 #define SCIF_ACCEPTREG _IOWR('s', 5, __u64)
203 #define SCIF_SEND _IOWR('s', 6, struct scifioctl_msg)
204 #define SCIF_RECV _IOWR('s', 7, struct scifioctl_msg)
205 #define SCIF_REG _IOWR('s', 8, struct scifioctl_reg)
206 #define SCIF_UNREG _IOWR('s', 9, struct scifioctl_unreg)
207 #define SCIF_READFROM _IOWR('s', 10, struct scifioctl_copy)
208 #define SCIF_WRITETO _IOWR('s', 11, struct scifioctl_copy)
209 #define SCIF_VREADFROM _IOWR('s', 12, struct scifioctl_copy)
210 #define SCIF_VWRITETO _IOWR('s', 13, struct scifioctl_copy)
211 #define SCIF_GET_NODEIDS _IOWR('s', 14, struct scifioctl_node_ids)
212 #define SCIF_FENCE_MARK _IOWR('s', 15, struct scifioctl_fence_mark)
213 #define SCIF_FENCE_WAIT _IOWR('s', 16, __s32)
214 #define SCIF_FENCE_SIGNAL _IOWR('s', 17, struct scifioctl_fence_signal)
216 #endif /* SCIF_IOCTL_H */