Sudeep Dutt | 7df20f2 | 2015-04-29 05:32:28 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Intel MIC Platform Software Stack (MPSS) |
| 3 | * |
| 4 | * This file is provided under a dual BSD/GPLv2 license. When using or |
| 5 | * redistributing this file, you may do so under either license. |
| 6 | * |
| 7 | * GPL LICENSE SUMMARY |
| 8 | * |
| 9 | * Copyright(c) 2014 Intel Corporation. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of version 2 of the GNU General Public License as |
| 13 | * published by the Free Software Foundation. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, but |
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 | * General Public License for more details. |
| 19 | * |
| 20 | * BSD LICENSE |
| 21 | * |
| 22 | * Copyright(c) 2014 Intel Corporation. |
| 23 | * |
| 24 | * Redistribution and use in source and binary forms, with or without |
| 25 | * modification, are permitted provided that the following conditions |
| 26 | * are met: |
| 27 | * |
| 28 | * * Redistributions of source code must retain the above copyright |
| 29 | * notice, this list of conditions and the following disclaimer. |
| 30 | * * Redistributions in binary form must reproduce the above copyright |
| 31 | * notice, this list of conditions and the following disclaimer in |
| 32 | * the documentation and/or other materials provided with the |
| 33 | * distribution. |
| 34 | * * Neither the name of Intel Corporation nor the names of its |
| 35 | * contributors may be used to endorse or promote products derived |
| 36 | * from this software without specific prior written permission. |
| 37 | * |
| 38 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 39 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 40 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 41 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 42 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 43 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 44 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 45 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 46 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 47 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 48 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 49 | * |
| 50 | * Intel SCIF driver. |
| 51 | * |
| 52 | */ |
| 53 | /* |
| 54 | * ----------------------------------------- |
| 55 | * SCIF IOCTL interface information |
| 56 | * ----------------------------------------- |
| 57 | */ |
| 58 | #ifndef SCIF_IOCTL_H |
| 59 | #define SCIF_IOCTL_H |
| 60 | |
| 61 | #include <linux/types.h> |
| 62 | |
| 63 | /** |
| 64 | * struct scif_port_id - SCIF port information |
| 65 | * @node: node on which port resides |
| 66 | * @port: local port number |
| 67 | */ |
| 68 | struct scif_port_id { |
| 69 | __u16 node; |
| 70 | __u16 port; |
| 71 | }; |
| 72 | |
| 73 | /** |
| 74 | * struct scifioctl_connect - used for SCIF_CONNECT IOCTL |
| 75 | * @self: used to read back the assigned port_id |
| 76 | * @peer: destination node and port to connect to |
| 77 | */ |
| 78 | struct scifioctl_connect { |
| 79 | struct scif_port_id self; |
| 80 | struct scif_port_id peer; |
| 81 | }; |
| 82 | |
| 83 | /** |
| 84 | * struct scifioctl_accept - used for SCIF_ACCEPTREQ IOCTL |
| 85 | * @flags: flags |
| 86 | * @peer: global id of peer endpoint |
| 87 | * @endpt: new connected endpoint descriptor |
| 88 | */ |
| 89 | struct scifioctl_accept { |
| 90 | __s32 flags; |
| 91 | struct scif_port_id peer; |
| 92 | __u64 endpt; |
| 93 | }; |
| 94 | |
| 95 | /** |
| 96 | * struct scifioctl_msg - used for SCIF_SEND/SCIF_RECV IOCTL |
| 97 | * @msg: message buffer address |
| 98 | * @len: message length |
| 99 | * @flags: flags |
| 100 | * @out_len: number of bytes sent/received |
| 101 | */ |
| 102 | struct scifioctl_msg { |
| 103 | __u64 msg; |
| 104 | __s32 len; |
| 105 | __s32 flags; |
| 106 | __s32 out_len; |
| 107 | }; |
| 108 | |
| 109 | /** |
| 110 | * struct scifioctl_node_ids - used for SCIF_GET_NODEIDS IOCTL |
| 111 | * @nodes: pointer to an array of node_ids |
| 112 | * @self: ID of the current node |
| 113 | * @len: length of array |
| 114 | */ |
| 115 | struct scifioctl_node_ids { |
| 116 | __u64 nodes; |
| 117 | __u64 self; |
| 118 | __s32 len; |
| 119 | }; |
| 120 | |
| 121 | #define SCIF_BIND _IOWR('s', 1, __u64) |
| 122 | #define SCIF_LISTEN _IOW('s', 2, __s32) |
| 123 | #define SCIF_CONNECT _IOWR('s', 3, struct scifioctl_connect) |
| 124 | #define SCIF_ACCEPTREQ _IOWR('s', 4, struct scifioctl_accept) |
| 125 | #define SCIF_ACCEPTREG _IOWR('s', 5, __u64) |
| 126 | #define SCIF_SEND _IOWR('s', 6, struct scifioctl_msg) |
| 127 | #define SCIF_RECV _IOWR('s', 7, struct scifioctl_msg) |
| 128 | #define SCIF_GET_NODEIDS _IOWR('s', 14, struct scifioctl_node_ids) |
| 129 | |
| 130 | #endif /* SCIF_IOCTL_H */ |