Showing the changes to include/uapi/linux (67 of 10186 files). Show all
Unified · Split
| @@ -0,0 +1,73 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
| 2 | /* Copyright (C) 2017 Arm Ltd. */ | ||
| 3 | #ifndef _UAPI_LINUX_ARM_SDEI_H | ||
| 4 | #define _UAPI_LINUX_ARM_SDEI_H | ||
| 5 | |||
| 6 | #define SDEI_1_0_FN_BASE 0xC4000020 | ||
| 7 | #define SDEI_1_0_MASK 0xFFFFFFE0 | ||
| 8 | #define SDEI_1_0_FN(n) (SDEI_1_0_FN_BASE + (n)) | ||
| 9 | |||
| 10 | #define SDEI_1_0_FN_SDEI_VERSION SDEI_1_0_FN(0x00) | ||
| 11 | #define SDEI_1_0_FN_SDEI_EVENT_REGISTER SDEI_1_0_FN(0x01) | ||
| 12 | #define SDEI_1_0_FN_SDEI_EVENT_ENABLE SDEI_1_0_FN(0x02) | ||
| 13 | #define SDEI_1_0_FN_SDEI_EVENT_DISABLE SDEI_1_0_FN(0x03) | ||
| 14 | #define SDEI_1_0_FN_SDEI_EVENT_CONTEXT SDEI_1_0_FN(0x04) | ||
| 15 | #define SDEI_1_0_FN_SDEI_EVENT_COMPLETE SDEI_1_0_FN(0x05) | ||
| 16 | #define SDEI_1_0_FN_SDEI_EVENT_COMPLETE_AND_RESUME SDEI_1_0_FN(0x06) | ||
| 17 | #define SDEI_1_0_FN_SDEI_EVENT_UNREGISTER SDEI_1_0_FN(0x07) | ||
| 18 | #define SDEI_1_0_FN_SDEI_EVENT_STATUS SDEI_1_0_FN(0x08) | ||
| 19 | #define SDEI_1_0_FN_SDEI_EVENT_GET_INFO SDEI_1_0_FN(0x09) | ||
| 20 | #define SDEI_1_0_FN_SDEI_EVENT_ROUTING_SET SDEI_1_0_FN(0x0A) | ||
| 21 | #define SDEI_1_0_FN_SDEI_PE_MASK SDEI_1_0_FN(0x0B) | ||
| 22 | #define SDEI_1_0_FN_SDEI_PE_UNMASK SDEI_1_0_FN(0x0C) | ||
| 23 | #define SDEI_1_0_FN_SDEI_INTERRUPT_BIND SDEI_1_0_FN(0x0D) | ||
| 24 | #define SDEI_1_0_FN_SDEI_INTERRUPT_RELEASE SDEI_1_0_FN(0x0E) | ||
| 25 | #define SDEI_1_0_FN_SDEI_PRIVATE_RESET SDEI_1_0_FN(0x11) | ||
| 26 | #define SDEI_1_0_FN_SDEI_SHARED_RESET SDEI_1_0_FN(0x12) | ||
| 27 | |||
| 28 | #define SDEI_VERSION_MAJOR_SHIFT 48 | ||
| 29 | #define SDEI_VERSION_MAJOR_MASK 0x7fff | ||
| 30 | #define SDEI_VERSION_MINOR_SHIFT 32 | ||
| 31 | #define SDEI_VERSION_MINOR_MASK 0xffff | ||
| 32 | #define SDEI_VERSION_VENDOR_SHIFT 0 | ||
| 33 | #define SDEI_VERSION_VENDOR_MASK 0xffffffff | ||
| 34 | |||
| 35 | #define SDEI_VERSION_MAJOR(x) (x>>SDEI_VERSION_MAJOR_SHIFT & SDEI_VERSION_MAJOR_MASK) | ||
| 36 | #define SDEI_VERSION_MINOR(x) (x>>SDEI_VERSION_MINOR_SHIFT & SDEI_VERSION_MINOR_MASK) | ||
| 37 | #define SDEI_VERSION_VENDOR(x) (x>>SDEI_VERSION_VENDOR_SHIFT & SDEI_VERSION_VENDOR_MASK) | ||
| 38 | |||
| 39 | /* SDEI return values */ | ||
| 40 | #define SDEI_SUCCESS 0 | ||
| 41 | #define SDEI_NOT_SUPPORTED -1 | ||
| 42 | #define SDEI_INVALID_PARAMETERS -2 | ||
| 43 | #define SDEI_DENIED -3 | ||
| 44 | #define SDEI_PENDING -5 | ||
| 45 | #define SDEI_OUT_OF_RESOURCE -10 | ||
| 46 | |||
| 47 | /* EVENT_REGISTER flags */ | ||
| 48 | #define SDEI_EVENT_REGISTER_RM_ANY 0 | ||
| 49 | #define SDEI_EVENT_REGISTER_RM_PE 1 | ||
| 50 | |||
| 51 | /* EVENT_STATUS return value bits */ | ||
| 52 | #define SDEI_EVENT_STATUS_RUNNING 2 | ||
| 53 | #define SDEI_EVENT_STATUS_ENABLED 1 | ||
| 54 | #define SDEI_EVENT_STATUS_REGISTERED 0 | ||
| 55 | |||
| 56 | /* EVENT_COMPLETE status values */ | ||
| 57 | #define SDEI_EV_HANDLED 0 | ||
| 58 | #define SDEI_EV_FAILED 1 | ||
| 59 | |||
| 60 | /* GET_INFO values */ | ||
| 61 | #define SDEI_EVENT_INFO_EV_TYPE 0 | ||
| 62 | #define SDEI_EVENT_INFO_EV_SIGNALED 1 | ||
| 63 | #define SDEI_EVENT_INFO_EV_PRIORITY 2 | ||
| 64 | #define SDEI_EVENT_INFO_EV_ROUTING_MODE 3 | ||
| 65 | #define SDEI_EVENT_INFO_EV_ROUTING_AFF 4 | ||
| 66 | |||
| 67 | /* and their results */ | ||
| 68 | #define SDEI_EVENT_TYPE_PRIVATE 0 | ||
| 69 | #define SDEI_EVENT_TYPE_SHARED 1 | ||
| 70 | #define SDEI_EVENT_PRIORITY_NORMAL 0 | ||
| 71 | #define SDEI_EVENT_PRIORITY_CRITICAL 1 | ||
| 72 | |||
| 73 | #endif /* _UAPI_LINUX_ARM_SDEI_H */ | ||
| @@ -0,0 +1,644 @@ | |||
| 1 | /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */ | ||
| 2 | /* Copyright (C) 2007-2017 B.A.T.M.A.N. contributors: | ||
| 3 | * | ||
| 4 | * Marek Lindner, Simon Wunderlich | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of version 2 of the GNU General Public | ||
| 8 | * License as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _UAPI_LINUX_BATADV_PACKET_H_ | ||
| 20 | #define _UAPI_LINUX_BATADV_PACKET_H_ | ||
| 21 | |||
| 22 | #include <asm/byteorder.h> | ||
| 23 | #include <linux/if_ether.h> | ||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 26 | /** | ||
| 27 | * batadv_tp_is_error() - Check throughput meter return code for error | ||
| 28 | * @n: throughput meter return code | ||
| 29 | * | ||
| 30 | * Return: 0 when not error was detected, != 0 otherwise | ||
| 31 | */ | ||
| 32 | #define batadv_tp_is_error(n) ((__u8)(n) > 127 ? 1 : 0) | ||
| 33 | |||
| 34 | /** | ||
| 35 | * enum batadv_packettype - types for batman-adv encapsulated packets | ||
| 36 | * @BATADV_IV_OGM: originator messages for B.A.T.M.A.N. IV | ||
| 37 | * @BATADV_BCAST: broadcast packets carrying broadcast payload | ||
| 38 | * @BATADV_CODED: network coded packets | ||
| 39 | * @BATADV_ELP: echo location packets for B.A.T.M.A.N. V | ||
| 40 | * @BATADV_OGM2: originator messages for B.A.T.M.A.N. V | ||
| 41 | * | ||
| 42 | * @BATADV_UNICAST: unicast packets carrying unicast payload traffic | ||
| 43 | * @BATADV_UNICAST_FRAG: unicast packets carrying a fragment of the original | ||
| 44 | * payload packet | ||
| 45 | * @BATADV_UNICAST_4ADDR: unicast packet including the originator address of | ||
| 46 | * the sender | ||
| 47 | * @BATADV_ICMP: unicast packet like IP ICMP used for ping or traceroute | ||
| 48 | * @BATADV_UNICAST_TVLV: unicast packet carrying TVLV containers | ||
| 49 | */ | ||
| 50 | enum batadv_packettype { | ||
| 51 | /* 0x00 - 0x3f: local packets or special rules for handling */ | ||
| 52 | BATADV_IV_OGM = 0x00, | ||
| 53 | BATADV_BCAST = 0x01, | ||
| 54 | BATADV_CODED = 0x02, | ||
| 55 | BATADV_ELP = 0x03, | ||
| 56 | BATADV_OGM2 = 0x04, | ||
| 57 | /* 0x40 - 0x7f: unicast */ | ||
| 58 | #define BATADV_UNICAST_MIN 0x40 | ||
| 59 | BATADV_UNICAST = 0x40, | ||
| 60 | BATADV_UNICAST_FRAG = 0x41, | ||
| 61 | BATADV_UNICAST_4ADDR = 0x42, | ||
| 62 | BATADV_ICMP = 0x43, | ||
| 63 | BATADV_UNICAST_TVLV = 0x44, | ||
| 64 | #define BATADV_UNICAST_MAX 0x7f | ||
| 65 | /* 0x80 - 0xff: reserved */ | ||
| 66 | }; | ||
| 67 | |||
| 68 | /** | ||
| 69 | * enum batadv_subtype - packet subtype for unicast4addr | ||
| 70 | * @BATADV_P_DATA: user payload | ||
| 71 | * @BATADV_P_DAT_DHT_GET: DHT request message | ||
| 72 | * @BATADV_P_DAT_DHT_PUT: DHT store message | ||
| 73 | * @BATADV_P_DAT_CACHE_REPLY: ARP reply generated by DAT | ||
| 74 | */ | ||
| 75 | enum batadv_subtype { | ||
| 76 | BATADV_P_DATA = 0x01, | ||
| 77 | BATADV_P_DAT_DHT_GET = 0x02, | ||
| 78 | BATADV_P_DAT_DHT_PUT = 0x03, | ||
| 79 | BATADV_P_DAT_CACHE_REPLY = 0x04, | ||
| 80 | }; | ||
| 81 | |||
| 82 | /* this file is included by batctl which needs these defines */ | ||
| 83 | #define BATADV_COMPAT_VERSION 15 | ||
| 84 | |||
| 85 | /** | ||
| 86 | * enum batadv_iv_flags - flags used in B.A.T.M.A.N. IV OGM packets | ||
| 87 | * @BATADV_NOT_BEST_NEXT_HOP: flag is set when ogm packet is forwarded and was | ||
| 88 | * previously received from someone else than the best neighbor. | ||
| 89 | * @BATADV_PRIMARIES_FIRST_HOP: flag unused. | ||
| 90 | * @BATADV_DIRECTLINK: flag is for the first hop or if rebroadcasted from a | ||
| 91 | * one hop neighbor on the interface where it was originally received. | ||
| 92 | */ | ||
| 93 | enum batadv_iv_flags { | ||
| 94 | BATADV_NOT_BEST_NEXT_HOP = 1UL << 0, | ||
| 95 | BATADV_PRIMARIES_FIRST_HOP = 1UL << 1, | ||
| 96 | BATADV_DIRECTLINK = 1UL << 2, | ||
| 97 | }; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * enum batadv_icmp_packettype - ICMP message types | ||
| 101 | * @BATADV_ECHO_REPLY: success reply to BATADV_ECHO_REQUEST | ||
| 102 | * @BATADV_DESTINATION_UNREACHABLE: failure when route to destination not found | ||
| 103 | * @BATADV_ECHO_REQUEST: request BATADV_ECHO_REPLY from destination | ||
| 104 | * @BATADV_TTL_EXCEEDED: error after BATADV_ECHO_REQUEST traversed too many hops | ||
| 105 | * @BATADV_PARAMETER_PROBLEM: return code for malformed messages | ||
| 106 | * @BATADV_TP: throughput meter packet | ||
| 107 | */ | ||
| 108 | enum batadv_icmp_packettype { | ||
| 109 | BATADV_ECHO_REPLY = 0, | ||
| 110 | BATADV_DESTINATION_UNREACHABLE = 3, | ||
| 111 | BATADV_ECHO_REQUEST = 8, | ||
| 112 | BATADV_TTL_EXCEEDED = 11, | ||
| 113 | BATADV_PARAMETER_PROBLEM = 12, | ||
| 114 | BATADV_TP = 15, | ||
| 115 | }; | ||
| 116 | |||
| 117 | /** | ||
| 118 | * enum batadv_mcast_flags - flags for multicast capabilities and settings | ||
| 119 | * @BATADV_MCAST_WANT_ALL_UNSNOOPABLES: we want all packets destined for | ||
| 120 | * 224.0.0.0/24 or ff02::1 | ||
| 121 | * @BATADV_MCAST_WANT_ALL_IPV4: we want all IPv4 multicast packets | ||
| 122 | * @BATADV_MCAST_WANT_ALL_IPV6: we want all IPv6 multicast packets | ||
| 123 | */ | ||
| 124 | enum batadv_mcast_flags { | ||
| 125 | BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0, | ||
| 126 | BATADV_MCAST_WANT_ALL_IPV4 = 1UL << 1, | ||
| 127 | BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2, | ||
| 128 | }; | ||
| 129 | |||
| 130 | /* tt data subtypes */ | ||
| 131 | #define BATADV_TT_DATA_TYPE_MASK 0x0F | ||
| 132 | |||
| 133 | /** | ||
| 134 | * enum batadv_tt_data_flags - flags for tt data tvlv | ||
| 135 | * @BATADV_TT_OGM_DIFF: TT diff propagated through OGM | ||
| 136 | * @BATADV_TT_REQUEST: TT request message | ||
| 137 | * @BATADV_TT_RESPONSE: TT response message | ||
| 138 | * @BATADV_TT_FULL_TABLE: contains full table to replace existing table | ||
| 139 | */ | ||
| 140 | enum batadv_tt_data_flags { | ||
| 141 | BATADV_TT_OGM_DIFF = 1UL << 0, | ||
| 142 | BATADV_TT_REQUEST = 1UL << 1, | ||
| 143 | BATADV_TT_RESPONSE = 1UL << 2, | ||
| 144 | BATADV_TT_FULL_TABLE = 1UL << 4, | ||
| 145 | }; | ||
| 146 | |||
| 147 | /** | ||
| 148 | * enum batadv_vlan_flags - flags for the four MSB of any vlan ID field | ||
| 149 | * @BATADV_VLAN_HAS_TAG: whether the field contains a valid vlan tag or not | ||
| 150 | */ | ||
| 151 | enum batadv_vlan_flags { | ||
| 152 | BATADV_VLAN_HAS_TAG = 1UL << 15, | ||
| 153 | }; | ||
| 154 | |||
| 155 | /** | ||
| 156 | * enum batadv_bla_claimframe - claim frame types for the bridge loop avoidance | ||
| 157 | * @BATADV_CLAIM_TYPE_CLAIM: claim of a client mac address | ||
| 158 | * @BATADV_CLAIM_TYPE_UNCLAIM: unclaim of a client mac address | ||
| 159 | * @BATADV_CLAIM_TYPE_ANNOUNCE: announcement of backbone with current crc | ||
| 160 | * @BATADV_CLAIM_TYPE_REQUEST: request of full claim table | ||
| 161 | * @BATADV_CLAIM_TYPE_LOOPDETECT: mesh-traversing loop detect packet | ||
| 162 | */ | ||
| 163 | enum batadv_bla_claimframe { | ||
| 164 | BATADV_CLAIM_TYPE_CLAIM = 0x00, | ||
| 165 | BATADV_CLAIM_TYPE_UNCLAIM = 0x01, | ||
| 166 | BATADV_CLAIM_TYPE_ANNOUNCE = 0x02, | ||
| 167 | BATADV_CLAIM_TYPE_REQUEST = 0x03, | ||
| 168 | BATADV_CLAIM_TYPE_LOOPDETECT = 0x04, | ||
| 169 | }; | ||
| 170 | |||
| 171 | /** | ||
| 172 | * enum batadv_tvlv_type - tvlv type definitions | ||
| 173 | * @BATADV_TVLV_GW: gateway tvlv | ||
| 174 | * @BATADV_TVLV_DAT: distributed arp table tvlv | ||
| 175 | * @BATADV_TVLV_NC: network coding tvlv | ||
| 176 | * @BATADV_TVLV_TT: translation table tvlv | ||
| 177 | * @BATADV_TVLV_ROAM: roaming advertisement tvlv | ||
| 178 | * @BATADV_TVLV_MCAST: multicast capability tvlv | ||
| 179 | */ | ||
| 180 | enum batadv_tvlv_type { | ||
| 181 | BATADV_TVLV_GW = 0x01, | ||
| 182 | BATADV_TVLV_DAT = 0x02, | ||
| 183 | BATADV_TVLV_NC = 0x03, | ||
| 184 | BATADV_TVLV_TT = 0x04, | ||
| 185 | BATADV_TVLV_ROAM = 0x05, | ||
| 186 | BATADV_TVLV_MCAST = 0x06, | ||
| 187 | }; | ||
| 188 | |||
| 189 | #pragma pack(2) | ||
| 190 | /* the destination hardware field in the ARP frame is used to | ||
| 191 | * transport the claim type and the group id | ||
| 192 | */ | ||
| 193 | struct batadv_bla_claim_dst { | ||
| 194 | __u8 magic[3]; /* FF:43:05 */ | ||
| 195 | __u8 type; /* bla_claimframe */ | ||
| 196 | __be16 group; /* group id */ | ||
| 197 | }; | ||
| 198 | |||
| 199 | #pragma pack() | ||
| 200 | |||
| 201 | /** | ||
| 202 | * struct batadv_ogm_packet - ogm (routing protocol) packet | ||
| 203 | * @packet_type: batman-adv packet type, part of the general header | ||
| 204 | * @version: batman-adv protocol version, part of the genereal header | ||
| 205 | * @ttl: time to live for this packet, part of the genereal header | ||
| 206 | * @flags: contains routing relevant flags - see enum batadv_iv_flags | ||
| 207 | * @seqno: sequence identification | ||
| 208 | * @orig: address of the source node | ||
| 209 | * @prev_sender: address of the previous sender | ||
| 210 | * @reserved: reserved byte for alignment | ||
| 211 | * @tq: transmission quality | ||
| 212 | * @tvlv_len: length of tvlv data following the ogm header | ||
| 213 | */ | ||
| 214 | struct batadv_ogm_packet { | ||
| 215 | __u8 packet_type; | ||
| 216 | __u8 version; | ||
| 217 | __u8 ttl; | ||
| 218 | __u8 flags; | ||
| 219 | __be32 seqno; | ||
| 220 | __u8 orig[ETH_ALEN]; | ||
| 221 | __u8 prev_sender[ETH_ALEN]; | ||
| 222 | __u8 reserved; | ||
| 223 | __u8 tq; | ||
| 224 | __be16 tvlv_len; | ||
| 225 | /* __packed is not needed as the struct size is divisible by 4, | ||
| 226 | * and the largest data type in this struct has a size of 4. | ||
| 227 | */ | ||
| 228 | }; | ||
| 229 | |||
| 230 | #define BATADV_OGM_HLEN sizeof(struct batadv_ogm_packet) | ||
| 231 | |||
| 232 | /** | ||
| 233 | * struct batadv_ogm2_packet - ogm2 (routing protocol) packet | ||
| 234 | * @packet_type: batman-adv packet type, part of the general header | ||
| 235 | * @version: batman-adv protocol version, part of the general header | ||
| 236 | * @ttl: time to live for this packet, part of the general header | ||
| 237 | * @flags: reseved for routing relevant flags - currently always 0 | ||
| 238 | * @seqno: sequence number | ||
| 239 | * @orig: originator mac address | ||
| 240 | * @tvlv_len: length of the appended tvlv buffer (in bytes) | ||
| 241 | * @throughput: the currently flooded path throughput | ||
| 242 | */ | ||
| 243 | struct batadv_ogm2_packet { | ||
| 244 | __u8 packet_type; | ||
| 245 | __u8 version; | ||
| 246 | __u8 ttl; | ||
| 247 | __u8 flags; | ||
| 248 | __be32 seqno; | ||
| 249 | __u8 orig[ETH_ALEN]; | ||
| 250 | __be16 tvlv_len; | ||
| 251 | __be32 throughput; | ||
| 252 | /* __packed is not needed as the struct size is divisible by 4, | ||
| 253 | * and the largest data type in this struct has a size of 4. | ||
| 254 | */ | ||
| 255 | }; | ||
| 256 | |||
| 257 | #define BATADV_OGM2_HLEN sizeof(struct batadv_ogm2_packet) | ||
| 258 | |||
| 259 | /** | ||
| 260 | * struct batadv_elp_packet - elp (neighbor discovery) packet | ||
| 261 | * @packet_type: batman-adv packet type, part of the general header | ||
| 262 | * @version: batman-adv protocol version, part of the genereal header | ||
| 263 | * @orig: originator mac address | ||
| 264 | * @seqno: sequence number | ||
| 265 | * @elp_interval: currently used ELP sending interval in ms | ||
| 266 | */ | ||
| 267 | struct batadv_elp_packet { | ||
| 268 | __u8 packet_type; | ||
| 269 | __u8 version; | ||
| 270 | __u8 orig[ETH_ALEN]; | ||
| 271 | __be32 seqno; | ||
| 272 | __be32 elp_interval; | ||
| 273 | }; | ||
| 274 | |||
| 275 | #define BATADV_ELP_HLEN sizeof(struct batadv_elp_packet) | ||
| 276 | |||
| 277 | /** | ||
| 278 | * struct batadv_icmp_header - common members among all the ICMP packets | ||
| 279 | * @packet_type: batman-adv packet type, part of the general header | ||
| 280 | * @version: batman-adv protocol version, part of the genereal header | ||
| 281 | * @ttl: time to live for this packet, part of the genereal header | ||
| 282 | * @msg_type: ICMP packet type | ||
| 283 | * @dst: address of the destination node | ||
| 284 | * @orig: address of the source node | ||
| 285 | * @uid: local ICMP socket identifier | ||
| 286 | * @align: not used - useful for alignment purposes only | ||
| 287 | * | ||
| 288 | * This structure is used for ICMP packets parsing only and it is never sent | ||
| 289 | * over the wire. The alignment field at the end is there to ensure that | ||
| 290 | * members are padded the same way as they are in real packets. | ||
| 291 | */ | ||
| 292 | struct batadv_icmp_header { | ||
| 293 | __u8 packet_type; | ||
| 294 | __u8 version; | ||
| 295 | __u8 ttl; | ||
| 296 | __u8 msg_type; /* see ICMP message types above */ | ||
| 297 | __u8 dst[ETH_ALEN]; | ||
| 298 | __u8 orig[ETH_ALEN]; | ||
| 299 | __u8 uid; | ||
| 300 | __u8 align[3]; | ||
| 301 | }; | ||
| 302 | |||
| 303 | /** | ||
| 304 | * struct batadv_icmp_packet - ICMP packet | ||
| 305 | * @packet_type: batman-adv packet type, part of the general header | ||
| 306 | * @version: batman-adv protocol version, part of the genereal header | ||
| 307 | * @ttl: time to live for this packet, part of the genereal header | ||
| 308 | * @msg_type: ICMP packet type | ||
| 309 | * @dst: address of the destination node | ||
| 310 | * @orig: address of the source node | ||
| 311 | * @uid: local ICMP socket identifier | ||
| 312 | * @reserved: not used - useful for alignment | ||
| 313 | * @seqno: ICMP sequence number | ||
| 314 | */ | ||
| 315 | struct batadv_icmp_packet { | ||
| 316 | __u8 packet_type; | ||
| 317 | __u8 version; | ||
| 318 | __u8 ttl; | ||
| 319 | __u8 msg_type; /* see ICMP message types above */ | ||
| 320 | __u8 dst[ETH_ALEN]; | ||
| 321 | __u8 orig[ETH_ALEN]; | ||
| 322 | __u8 uid; | ||
| 323 | __u8 reserved; | ||
| 324 | __be16 seqno; | ||
| 325 | }; | ||
| 326 | |||
| 327 | /** | ||
| 328 | * struct batadv_icmp_tp_packet - ICMP TP Meter packet | ||
| 329 | * @packet_type: batman-adv packet type, part of the general header | ||
| 330 | * @version: batman-adv protocol version, part of the genereal header | ||
| 331 | * @ttl: time to live for this packet, part of the genereal header | ||
| 332 | * @msg_type: ICMP packet type | ||
| 333 | * @dst: address of the destination node | ||
| 334 | * @orig: address of the source node | ||
| 335 | * @uid: local ICMP socket identifier | ||
| 336 | * @subtype: TP packet subtype (see batadv_icmp_tp_subtype) | ||
| 337 | * @session: TP session identifier | ||
| 338 | * @seqno: the TP sequence number | ||
| 339 | * @timestamp: time when the packet has been sent. This value is filled in a | ||
| 340 | * TP_MSG and echoed back in the next TP_ACK so that the sender can compute the | ||
| 341 | * RTT. Since it is read only by the host which wrote it, there is no need to | ||
| 342 | * store it using network order | ||
| 343 | */ | ||
| 344 | struct batadv_icmp_tp_packet { | ||
| 345 | __u8 packet_type; | ||
| 346 | __u8 version; | ||
| 347 | __u8 ttl; | ||
| 348 | __u8 msg_type; /* see ICMP message types above */ | ||
| 349 | __u8 dst[ETH_ALEN]; | ||
| 350 | __u8 orig[ETH_ALEN]; | ||
| 351 | __u8 uid; | ||
| 352 | __u8 subtype; | ||
| 353 | __u8 session[2]; | ||
| 354 | __be32 seqno; | ||
| 355 | __be32 timestamp; | ||
| 356 | }; | ||
| 357 | |||
| 358 | /** | ||
| 359 | * enum batadv_icmp_tp_subtype - ICMP TP Meter packet subtypes | ||
| 360 | * @BATADV_TP_MSG: Msg from sender to receiver | ||
| 361 | * @BATADV_TP_ACK: acknowledgment from receiver to sender | ||
| 362 | */ | ||
| 363 | enum batadv_icmp_tp_subtype { | ||
| 364 | BATADV_TP_MSG = 0, | ||
| 365 | BATADV_TP_ACK, | ||
| 366 | }; | ||
| 367 | |||
| 368 | #define BATADV_RR_LEN 16 | ||
| 369 | |||
| 370 | /** | ||
| 371 | * struct batadv_icmp_packet_rr - ICMP RouteRecord packet | ||
| 372 | * @packet_type: batman-adv packet type, part of the general header | ||
| 373 | * @version: batman-adv protocol version, part of the genereal header | ||
| 374 | * @ttl: time to live for this packet, part of the genereal header | ||
| 375 | * @msg_type: ICMP packet type | ||
| 376 | * @dst: address of the destination node | ||
| 377 | * @orig: address of the source node | ||
| 378 | * @uid: local ICMP socket identifier | ||
| 379 | * @rr_cur: number of entries the rr array | ||
| 380 | * @seqno: ICMP sequence number | ||
| 381 | * @rr: route record array | ||
| 382 | */ | ||
| 383 | struct batadv_icmp_packet_rr { | ||
| 384 | __u8 packet_type; | ||
| 385 | __u8 version; | ||
| 386 | __u8 ttl; | ||
| 387 | __u8 msg_type; /* see ICMP message types above */ | ||
| 388 | __u8 dst[ETH_ALEN]; | ||
| 389 | __u8 orig[ETH_ALEN]; | ||
| 390 | __u8 uid; | ||
| 391 | __u8 rr_cur; | ||
| 392 | __be16 seqno; | ||
| 393 | __u8 rr[BATADV_RR_LEN][ETH_ALEN]; | ||
| 394 | }; | ||
| 395 | |||
| 396 | #define BATADV_ICMP_MAX_PACKET_SIZE sizeof(struct batadv_icmp_packet_rr) | ||
| 397 | |||
| 398 | /* All packet headers in front of an ethernet header have to be completely | ||
| 399 | * divisible by 2 but not by 4 to make the payload after the ethernet | ||
| 400 | * header again 4 bytes boundary aligned. | ||
| 401 | * | ||
| 402 | * A packing of 2 is necessary to avoid extra padding at the end of the struct | ||
| 403 | * caused by a structure member which is larger than two bytes. Otherwise | ||
| 404 | * the structure would not fulfill the previously mentioned rule to avoid the | ||
| 405 | * misalignment of the payload after the ethernet header. It may also lead to | ||
| 406 | * leakage of information when the padding it not initialized before sending. | ||
| 407 | */ | ||
| 408 | #pragma pack(2) | ||
| 409 | |||
| 410 | /** | ||
| 411 | * struct batadv_unicast_packet - unicast packet for network payload | ||
| 412 | * @packet_type: batman-adv packet type, part of the general header | ||
| 413 | * @version: batman-adv protocol version, part of the genereal header | ||
| 414 | * @ttl: time to live for this packet, part of the genereal header | ||
| 415 | * @ttvn: translation table version number | ||
| 416 | * @dest: originator destination of the unicast packet | ||
| 417 | */ | ||
| 418 | struct batadv_unicast_packet { | ||
| 419 | __u8 packet_type; | ||
| 420 | __u8 version; | ||
| 421 | __u8 ttl; | ||
| 422 | __u8 ttvn; /* destination translation table version number */ | ||
| 423 | __u8 dest[ETH_ALEN]; | ||
| 424 | /* "4 bytes boundary + 2 bytes" long to make the payload after the | ||
| 425 | * following ethernet header again 4 bytes boundary aligned | ||
| 426 | */ | ||
| 427 | }; | ||
| 428 | |||
| 429 | /** | ||
| 430 | * struct batadv_unicast_4addr_packet - extended unicast packet | ||
| 431 | * @u: common unicast packet header | ||
| 432 | * @src: address of the source | ||
| 433 | * @subtype: packet subtype | ||
| 434 | * @reserved: reserved byte for alignment | ||
| 435 | */ | ||
| 436 | struct batadv_unicast_4addr_packet { | ||
| 437 | struct batadv_unicast_packet u; | ||
| 438 | __u8 src[ETH_ALEN]; | ||
| 439 | __u8 subtype; | ||
| 440 | __u8 reserved; | ||
| 441 | /* "4 bytes boundary + 2 bytes" long to make the payload after the | ||
| 442 | * following ethernet header again 4 bytes boundary aligned | ||
| 443 | */ | ||
| 444 | }; | ||
| 445 | |||
| 446 | /** | ||
| 447 | * struct batadv_frag_packet - fragmented packet | ||
| 448 | * @packet_type: batman-adv packet type, part of the general header | ||
| 449 | * @version: batman-adv protocol version, part of the genereal header | ||
| 450 | * @ttl: time to live for this packet, part of the genereal header | ||
| 451 | * @dest: final destination used when routing fragments | ||
| 452 | * @orig: originator of the fragment used when merging the packet | ||
| 453 | * @no: fragment number within this sequence | ||
| 454 | * @priority: priority of frame, from ToS IP precedence or 802.1p | ||
| 455 | * @reserved: reserved byte for alignment | ||
| 456 | * @seqno: sequence identification | ||
| 457 | * @total_size: size of the merged packet | ||
| 458 | */ | ||
| 459 | struct batadv_frag_packet { | ||
| 460 | __u8 packet_type; | ||
| 461 | __u8 version; /* batman version field */ | ||
| 462 | __u8 ttl; | ||
| 463 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 464 | __u8 no:4; | ||
| 465 | __u8 priority:3; | ||
| 466 | __u8 reserved:1; | ||
| 467 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 468 | __u8 reserved:1; | ||
| 469 | __u8 priority:3; | ||
| 470 | __u8 no:4; | ||
| 471 | #else | ||
| 472 | #error "unknown bitfield endianness" | ||
| 473 | #endif | ||
| 474 | __u8 dest[ETH_ALEN]; | ||
| 475 | __u8 orig[ETH_ALEN]; | ||
| 476 | __be16 seqno; | ||
| 477 | __be16 total_size; | ||
| 478 | }; | ||
| 479 | |||
| 480 | /** | ||
| 481 | * struct batadv_bcast_packet - broadcast packet for network payload | ||
| 482 | * @packet_type: batman-adv packet type, part of the general header | ||
| 483 | * @version: batman-adv protocol version, part of the genereal header | ||
| 484 | * @ttl: time to live for this packet, part of the genereal header | ||
| 485 | * @reserved: reserved byte for alignment | ||
| 486 | * @seqno: sequence identification | ||
| 487 | * @orig: originator of the broadcast packet | ||
| 488 | */ | ||
| 489 | struct batadv_bcast_packet { | ||
| 490 | __u8 packet_type; | ||
| 491 | __u8 version; /* batman version field */ | ||
| 492 | __u8 ttl; | ||
| 493 | __u8 reserved; | ||
| 494 | __be32 seqno; | ||
| 495 | __u8 orig[ETH_ALEN]; | ||
| 496 | /* "4 bytes boundary + 2 bytes" long to make the payload after the | ||
| 497 | * following ethernet header again 4 bytes boundary aligned | ||
| 498 | */ | ||
| 499 | }; | ||
| 500 | |||
| 501 | /** | ||
| 502 | * struct batadv_coded_packet - network coded packet | ||
| 503 | * @packet_type: batman-adv packet type, part of the general header | ||
| 504 | * @version: batman-adv protocol version, part of the genereal header | ||
| 505 | * @ttl: time to live for this packet, part of the genereal header | ||
| 506 | * @first_source: original source of first included packet | ||
| 507 | * @first_orig_dest: original destinal of first included packet | ||
| 508 | * @first_crc: checksum of first included packet | ||
| 509 | * @first_ttvn: tt-version number of first included packet | ||
| 510 | * @second_ttl: ttl of second packet | ||
| 511 | * @second_dest: second receiver of this coded packet | ||
| 512 | * @second_source: original source of second included packet | ||
| 513 | * @second_orig_dest: original destination of second included packet | ||
| 514 | * @second_crc: checksum of second included packet | ||
| 515 | * @second_ttvn: tt version number of second included packet | ||
| 516 | * @coded_len: length of network coded part of the payload | ||
| 517 | */ | ||
| 518 | struct batadv_coded_packet { | ||
| 519 | __u8 packet_type; | ||
| 520 | __u8 version; /* batman version field */ | ||
| 521 | __u8 ttl; | ||
| 522 | __u8 first_ttvn; | ||
| 523 | /* __u8 first_dest[ETH_ALEN]; - saved in mac header destination */ | ||
| 524 | __u8 first_source[ETH_ALEN]; | ||
| 525 | __u8 first_orig_dest[ETH_ALEN]; | ||
| 526 | __be32 first_crc; | ||
| 527 | __u8 second_ttl; | ||
| 528 | __u8 second_ttvn; | ||
| 529 | __u8 second_dest[ETH_ALEN]; | ||
| 530 | __u8 second_source[ETH_ALEN]; | ||
| 531 | __u8 second_orig_dest[ETH_ALEN]; | ||
| 532 | __be32 second_crc; | ||
| 533 | __be16 coded_len; | ||
| 534 | }; | ||
| 535 | |||
| 536 | #pragma pack() | ||
| 537 | |||
| 538 | /** | ||
| 539 | * struct batadv_unicast_tvlv_packet - generic unicast packet with tvlv payload | ||
| 540 | * @packet_type: batman-adv packet type, part of the general header | ||
| 541 | * @version: batman-adv protocol version, part of the genereal header | ||
| 542 | * @ttl: time to live for this packet, part of the genereal header | ||
| 543 | * @reserved: reserved field (for packet alignment) | ||
| 544 | * @src: address of the source | ||
| 545 | * @dst: address of the destination | ||
| 546 | * @tvlv_len: length of tvlv data following the unicast tvlv header | ||
| 547 | * @align: 2 bytes to align the header to a 4 byte boundary | ||
| 548 | */ | ||
| 549 | struct batadv_unicast_tvlv_packet { | ||
| 550 | __u8 packet_type; | ||
| 551 | __u8 version; /* batman version field */ | ||
| 552 | __u8 ttl; | ||
| 553 | __u8 reserved; | ||
| 554 | __u8 dst[ETH_ALEN]; | ||
| 555 | __u8 src[ETH_ALEN]; | ||
| 556 | __be16 tvlv_len; | ||
| 557 | __u16 align; | ||
| 558 | }; | ||
| 559 | |||
| 560 | /** | ||
| 561 | * struct batadv_tvlv_hdr - base tvlv header struct | ||
| 562 | * @type: tvlv container type (see batadv_tvlv_type) | ||
| 563 | * @version: tvlv container version | ||
| 564 | * @len: tvlv container length | ||
| 565 | */ | ||
| 566 | struct batadv_tvlv_hdr { | ||
| 567 | __u8 type; | ||
| 568 | __u8 version; | ||
| 569 | __be16 len; | ||
| 570 | }; | ||
| 571 | |||
| 572 | /** | ||
| 573 | * struct batadv_tvlv_gateway_data - gateway data propagated through gw tvlv | ||
| 574 | * container | ||
| 575 | * @bandwidth_down: advertised uplink download bandwidth | ||
| 576 | * @bandwidth_up: advertised uplink upload bandwidth | ||
| 577 | */ | ||
| 578 | struct batadv_tvlv_gateway_data { | ||
| 579 | __be32 bandwidth_down; | ||
| 580 | __be32 bandwidth_up; | ||
| 581 | }; | ||
| 582 | |||
| 583 | /** | ||
| 584 | * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container | ||
| 585 | * @flags: translation table flags (see batadv_tt_data_flags) | ||
| 586 | * @ttvn: translation table version number | ||
| 587 | * @num_vlan: number of announced VLANs. In the TVLV this struct is followed by | ||
| 588 | * one batadv_tvlv_tt_vlan_data object per announced vlan | ||
| 589 | */ | ||
| 590 | struct batadv_tvlv_tt_data { | ||
| 591 | __u8 flags; | ||
| 592 | __u8 ttvn; | ||
| 593 | __be16 num_vlan; | ||
| 594 | }; | ||
| 595 | |||
| 596 | /** | ||
| 597 | * struct batadv_tvlv_tt_vlan_data - vlan specific tt data propagated through | ||
| 598 | * the tt tvlv container | ||
| 599 | * @crc: crc32 checksum of the entries belonging to this vlan | ||
| 600 | * @vid: vlan identifier | ||
| 601 | * @reserved: unused, useful for alignment purposes | ||
| 602 | */ | ||
| 603 | struct batadv_tvlv_tt_vlan_data { | ||
| 604 | __be32 crc; | ||
| 605 | __be16 vid; | ||
| 606 | __u16 reserved; | ||
| 607 | }; | ||
| 608 | |||
| 609 | /** | ||
| 610 | * struct batadv_tvlv_tt_change - translation table diff data | ||
| 611 | * @flags: status indicators concerning the non-mesh client (see | ||
| 612 | * batadv_tt_client_flags) | ||
| 613 | * @reserved: reserved field - useful for alignment purposes only | ||
| 614 | * @addr: mac address of non-mesh client that triggered this tt change | ||
| 615 | * @vid: VLAN identifier | ||
| 616 | */ | ||
| 617 | struct batadv_tvlv_tt_change { | ||
| 618 | __u8 flags; | ||
| 619 | __u8 reserved[3]; | ||
| 620 | __u8 addr[ETH_ALEN]; | ||
| 621 | __be16 vid; | ||
| 622 | }; | ||
| 623 | |||
| 624 | /** | ||
| 625 | * struct batadv_tvlv_roam_adv - roaming advertisement | ||
| 626 | * @client: mac address of roaming client | ||
| 627 | * @vid: VLAN identifier | ||
| 628 | */ | ||
| 629 | struct batadv_tvlv_roam_adv { | ||
| 630 | __u8 client[ETH_ALEN]; | ||
| 631 | __be16 vid; | ||
| 632 | }; | ||
| 633 | |||
| 634 | /** | ||
| 635 | * struct batadv_tvlv_mcast_data - payload of a multicast tvlv | ||
| 636 | * @flags: multicast flags announced by the orig node | ||
| 637 | * @reserved: reserved field | ||
| 638 | */ | ||
| 639 | struct batadv_tvlv_mcast_data { | ||
| 640 | __u8 flags; | ||
| 641 | __u8 reserved[3]; | ||
| 642 | }; | ||
| 643 | |||
| 644 | #endif /* _UAPI_LINUX_BATADV_PACKET_H_ */ | ||
| @@ -1,18 +1,25 @@ | |||
| 1 | /* SPDX-License-Identifier: MIT */ | ||
| 1 | /* Copyright (C) 2016-2017 B.A.T.M.A.N. contributors: | 2 | /* Copyright (C) 2016-2017 B.A.T.M.A.N. contributors: |
| 2 | * | 3 | * |
| 3 | * Matthias Schiffer | 4 | * Matthias Schiffer |
| 4 | * | 5 | * |
| 5 | * Permission to use, copy, modify, and/or distribute this software for any | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | * purpose with or without fee is hereby granted, provided that the above | 7 | * copy of this software and associated documentation files (the "Software"), |
| 7 | * copyright notice and this permission notice appear in all copies. | 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | * Software is furnished to do so, subject to the following conditions: | ||
| 8 | * | 12 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 13 | * The above copyright notice and this permission notice shall be included in |
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 14 | * all copies or substantial portions of the Software. |
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 15 | * |
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 16 | */ | 23 | */ |
| 17 | 24 | ||
| 18 | #ifndef _UAPI_LINUX_BATMAN_ADV_H_ | 25 | #ifndef _UAPI_LINUX_BATMAN_ADV_H_ |
| @@ -17,7 +17,7 @@ · 16 unmodified lines | |||
| 17 | #define BPF_ALU64 0x07 /* alu mode in double word width */ | 17 | #define BPF_ALU64 0x07 /* alu mode in double word width */ |
| 18 | 18 | ||
| 19 | /* ld/ldx fields */ | 19 | /* ld/ldx fields */ |
| 20 | #define BPF_DW 0x18 /* double word */ | 20 | #define BPF_DW 0x18 /* double word (64-bit) */ |
| 21 | #define BPF_XADD 0xc0 /* exclusive add */ | 21 | #define BPF_XADD 0xc0 /* exclusive add */ |
| 22 | 22 | ||
| 23 | /* alu/jmp fields */ | 23 | /* alu/jmp fields */ |
| @@ -197,8 +197,14 @@ enum bpf_attach_type { · 173 unmodified lines | |||
| 197 | */ | 197 | */ |
| 198 | #define BPF_F_STRICT_ALIGNMENT (1U << 0) | 198 | #define BPF_F_STRICT_ALIGNMENT (1U << 0) |
| 199 | 199 | ||
| 200 | /* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */ | ||
| 200 | #define BPF_PSEUDO_MAP_FD 1 | 201 | #define BPF_PSEUDO_MAP_FD 1 |
| 201 | 202 | ||
| 203 | /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative | ||
| 204 | * offset to another bpf function | ||
| 205 | */ | ||
| 206 | #define BPF_PSEUDO_CALL 1 | ||
| 207 | |||
| 202 | /* flags for BPF_MAP_UPDATE_ELEM command */ | 208 | /* flags for BPF_MAP_UPDATE_ELEM command */ |
| 203 | #define BPF_ANY 0 /* create new element or update existing */ | 209 | #define BPF_ANY 0 /* create new element or update existing */ |
| 204 | #define BPF_NOEXIST 1 /* create new element if it didn't exist */ | 210 | #define BPF_NOEXIST 1 /* create new element if it didn't exist */ |
| @@ -239,6 +245,7 @@ union bpf_attr { · 34 unmodified lines | |||
| 239 | * BPF_F_NUMA_NODE is set). | 245 | * BPF_F_NUMA_NODE is set). |
| 240 | */ | 246 | */ |
| 241 | char map_name[BPF_OBJ_NAME_LEN]; | 247 | char map_name[BPF_OBJ_NAME_LEN]; |
| 248 | __u32 map_ifindex; /* ifindex of netdev to create on */ | ||
| 242 | }; | 249 | }; |
| 243 | 250 | ||
| 244 | struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ | 251 | struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ |
| @@ -635,6 +642,14 @@ union bpf_attr { · 390 unmodified lines | |||
| 635 | * @optlen: length of optval in bytes | 642 | * @optlen: length of optval in bytes |
| 636 | * Return: 0 or negative error | 643 | * Return: 0 or negative error |
| 637 | * | 644 | * |
| 645 | * int bpf_sock_ops_cb_flags_set(bpf_sock_ops, flags) | ||
| 646 | * Set callback flags for sock_ops | ||
| 647 | * @bpf_sock_ops: pointer to bpf_sock_ops_kern struct | ||
| 648 | * @flags: flags value | ||
| 649 | * Return: 0 for no error | ||
| 650 | * -EINVAL if there is no full tcp socket | ||
| 651 | * bits in flags that are not supported by current kernel | ||
| 652 | * | ||
| 638 | * int bpf_skb_adjust_room(skb, len_diff, mode, flags) | 653 | * int bpf_skb_adjust_room(skb, len_diff, mode, flags) |
| 639 | * Grow or shrink room in sk_buff. | 654 | * Grow or shrink room in sk_buff. |
| 640 | * @skb: pointer to skb | 655 | * @skb: pointer to skb |
| @@ -677,6 +692,10 @@ union bpf_attr { · 36 unmodified lines | |||
| 677 | * @buf: buf to fill | 692 | * @buf: buf to fill |
| 678 | * @buf_size: size of the buf | 693 | * @buf_size: size of the buf |
| 679 | * Return : 0 on success or negative error code | 694 | * Return : 0 on success or negative error code |
| 695 | * | ||
| 696 | * int bpf_override_return(pt_regs, rc) | ||
| 697 | * @pt_regs: pointer to struct pt_regs | ||
| 698 | * @rc: the return value to set | ||
| 680 | */ | 699 | */ |
| 681 | #define __BPF_FUNC_MAPPER(FN) \ | 700 | #define __BPF_FUNC_MAPPER(FN) \ |
| 682 | FN(unspec), \ | 701 | FN(unspec), \ |
| @@ -736,7 +755,9 @@ union bpf_attr { · 53 unmodified lines | |||
| 736 | FN(xdp_adjust_meta), \ | 755 | FN(xdp_adjust_meta), \ |
| 737 | FN(perf_event_read_value), \ | 756 | FN(perf_event_read_value), \ |
| 738 | FN(perf_prog_read_value), \ | 757 | FN(perf_prog_read_value), \ |
| 739 | FN(getsockopt), | 758 | FN(getsockopt), \ |
| 759 | FN(override_return), \ | ||
| 760 | FN(sock_ops_cb_flags_set), | ||
| 740 | 761 | ||
| 741 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper | 762 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 742 | * function eBPF program intends to call | 763 | * function eBPF program intends to call |
| @@ -888,6 +909,9 @@ struct xdp_md { · 145 unmodified lines | |||
| 888 | __u32 data; | 909 | __u32 data; |
| 889 | __u32 data_end; | 910 | __u32 data_end; |
| 890 | __u32 data_meta; | 911 | __u32 data_meta; |
| 912 | /* Below access go through struct xdp_rxq_info */ | ||
| 913 | __u32 ingress_ifindex; /* rxq->dev->ifindex */ | ||
| 914 | __u32 rx_queue_index; /* rxq->queue_index */ | ||
| 891 | }; | 915 | }; |
| 892 | 916 | ||
| 893 | enum sk_action { | 917 | enum sk_action { |
| @@ -910,6 +934,9 @@ struct bpf_prog_info { · 16 unmodified lines | |||
| 910 | __u32 nr_map_ids; | 934 | __u32 nr_map_ids; |
| 911 | __aligned_u64 map_ids; | 935 | __aligned_u64 map_ids; |
| 912 | char name[BPF_OBJ_NAME_LEN]; | 936 | char name[BPF_OBJ_NAME_LEN]; |
| 937 | __u32 ifindex; | ||
| 938 | __u64 netns_dev; | ||
| 939 | __u64 netns_ino; | ||
| 913 | } __attribute__((aligned(8))); | 940 | } __attribute__((aligned(8))); |
| 914 | 941 | ||
| 915 | struct bpf_map_info { | 942 | struct bpf_map_info { |
| @@ -920,6 +947,9 @@ struct bpf_map_info { · 4 unmodified lines | |||
| 920 | __u32 max_entries; | 947 | __u32 max_entries; |
| 921 | __u32 map_flags; | 948 | __u32 map_flags; |
| 922 | char name[BPF_OBJ_NAME_LEN]; | 949 | char name[BPF_OBJ_NAME_LEN]; |
| 950 | __u32 ifindex; | ||
| 951 | __u64 netns_dev; | ||
| 952 | __u64 netns_ino; | ||
| 923 | } __attribute__((aligned(8))); | 953 | } __attribute__((aligned(8))); |
| 924 | 954 | ||
| 925 | /* User bpf_sock_ops struct to access socket values and specify request ops | 955 | /* User bpf_sock_ops struct to access socket values and specify request ops |
| @@ -931,8 +961,9 @@ struct bpf_map_info { · 5 unmodified lines | |||
| 931 | struct bpf_sock_ops { | 961 | struct bpf_sock_ops { |
| 932 | __u32 op; | 962 | __u32 op; |
| 933 | union { | 963 | union { |
| 934 | __u32 reply; | 964 | __u32 args[4]; /* Optionally passed to bpf program */ |
| 935 | __u32 replylong[4]; | 965 | __u32 reply; /* Returned by bpf program */ |
| 966 | __u32 replylong[4]; /* Optionally returned by bpf prog */ | ||
| 936 | }; | 967 | }; |
| 937 | __u32 family; | 968 | __u32 family; |
| 938 | __u32 remote_ip4; /* Stored in network byte order */ | 969 | __u32 remote_ip4; /* Stored in network byte order */ |
| @@ -941,8 +972,45 @@ struct bpf_sock_ops { · 2 unmodified lines | |||
| 941 | __u32 local_ip6[4]; /* Stored in network byte order */ | 972 | __u32 local_ip6[4]; /* Stored in network byte order */ |
| 942 | __u32 remote_port; /* Stored in network byte order */ | 973 | __u32 remote_port; /* Stored in network byte order */ |
| 943 | __u32 local_port; /* stored in host byte order */ | 974 | __u32 local_port; /* stored in host byte order */ |
| 975 | __u32 is_fullsock; /* Some TCP fields are only valid if | ||
| 976 | * there is a full socket. If not, the | ||
| 977 | * fields read as zero. | ||
| 978 | */ | ||
| 979 | __u32 snd_cwnd; | ||
| 980 | __u32 srtt_us; /* Averaged RTT << 3 in usecs */ | ||
| 981 | __u32 bpf_sock_ops_cb_flags; /* flags defined in uapi/linux/tcp.h */ | ||
| 982 | __u32 state; | ||
| 983 | __u32 rtt_min; | ||
| 984 | __u32 snd_ssthresh; | ||
| 985 | __u32 rcv_nxt; | ||
| 986 | __u32 snd_nxt; | ||
| 987 | __u32 snd_una; | ||
| 988 | __u32 mss_cache; | ||
| 989 | __u32 ecn_flags; | ||
| 990 | __u32 rate_delivered; | ||
| 991 | __u32 rate_interval_us; | ||
| 992 | __u32 packets_out; | ||
| 993 | __u32 retrans_out; | ||
| 994 | __u32 total_retrans; | ||
| 995 | __u32 segs_in; | ||
| 996 | __u32 data_segs_in; | ||
| 997 | __u32 segs_out; | ||
| 998 | __u32 data_segs_out; | ||
| 999 | __u32 lost_out; | ||
| 1000 | __u32 sacked_out; | ||
| 1001 | __u32 sk_txhash; | ||
| 1002 | __u64 bytes_received; | ||
| 1003 | __u64 bytes_acked; | ||
| 944 | }; | 1004 | }; |
| 945 | 1005 | ||
| 1006 | /* Definitions for bpf_sock_ops_cb_flags */ | ||
| 1007 | #define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0) | ||
| 1008 | #define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1) | ||
| 1009 | #define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2) | ||
| 1010 | #define BPF_SOCK_OPS_ALL_CB_FLAGS 0x7 /* Mask of all currently | ||
| 1011 | * supported cb flags | ||
| 1012 | */ | ||
| 1013 | |||
| 946 | /* List of known BPF sock_ops operators. | 1014 | /* List of known BPF sock_ops operators. |
| 947 | * New entries can only be added at the end | 1015 | * New entries can only be added at the end |
| 948 | */ | 1016 | */ |
| @@ -976,6 +1044,43 @@ enum { · 27 unmodified lines | |||
| 976 | * a congestion threshold. RTTs above | 1044 | * a congestion threshold. RTTs above |
| 977 | * this indicate congestion | 1045 | * this indicate congestion |
| 978 | */ | 1046 | */ |
| 1047 | BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered. | ||
| 1048 | * Arg1: value of icsk_retransmits | ||
| 1049 | * Arg2: value of icsk_rto | ||
| 1050 | * Arg3: whether RTO has expired | ||
| 1051 | */ | ||
| 1052 | BPF_SOCK_OPS_RETRANS_CB, /* Called when skb is retransmitted. | ||
| 1053 | * Arg1: sequence number of 1st byte | ||
| 1054 | * Arg2: # segments | ||
| 1055 | * Arg3: return value of | ||
| 1056 | * tcp_transmit_skb (0 => success) | ||
| 1057 | */ | ||
| 1058 | BPF_SOCK_OPS_STATE_CB, /* Called when TCP changes state. | ||
| 1059 | * Arg1: old_state | ||
| 1060 | * Arg2: new_state | ||
| 1061 | */ | ||
| 1062 | }; | ||
| 1063 | |||
| 1064 | /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect | ||
| 1065 | * changes between the TCP and BPF versions. Ideally this should never happen. | ||
| 1066 | * If it does, we need to add code to convert them before calling | ||
| 1067 | * the BPF sock_ops function. | ||
| 1068 | */ | ||
| 1069 | enum { | ||
| 1070 | BPF_TCP_ESTABLISHED = 1, | ||
| 1071 | BPF_TCP_SYN_SENT, | ||
| 1072 | BPF_TCP_SYN_RECV, | ||
| 1073 | BPF_TCP_FIN_WAIT1, | ||
| 1074 | BPF_TCP_FIN_WAIT2, | ||
| 1075 | BPF_TCP_TIME_WAIT, | ||
| 1076 | BPF_TCP_CLOSE, | ||
| 1077 | BPF_TCP_CLOSE_WAIT, | ||
| 1078 | BPF_TCP_LAST_ACK, | ||
| 1079 | BPF_TCP_LISTEN, | ||
| 1080 | BPF_TCP_CLOSING, /* Now a valid state */ | ||
| 1081 | BPF_TCP_NEW_SYN_RECV, | ||
| 1082 | |||
| 1083 | BPF_TCP_MAX_STATES /* Leave at the end! */ | ||
| 979 | }; | 1084 | }; |
| 980 | 1085 | ||
| 981 | #define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ | 1086 | #define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ |
| @@ -995,7 +1100,8 @@ struct bpf_perf_event_value { · 13 unmodified lines | |||
| 995 | #define BPF_DEVCG_DEV_CHAR (1ULL << 1) | 1100 | #define BPF_DEVCG_DEV_CHAR (1ULL << 1) |
| 996 | 1101 | ||
| 997 | struct bpf_cgroup_dev_ctx { | 1102 | struct bpf_cgroup_dev_ctx { |
| 998 | __u32 access_type; /* (access << 16) | type */ | 1103 | /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */ |
| 1104 | __u32 access_type; | ||
| 999 | __u32 major; | 1105 | __u32 major; |
| 1000 | __u32 minor; | 1106 | __u32 minor; |
| 1001 | }; | 1107 | }; |
| @@ -15,9 +15,10 @@ · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | /* ld/ldx fields */ | 16 | /* ld/ldx fields */ |
| 17 | #define BPF_SIZE(code) ((code) & 0x18) | 17 | #define BPF_SIZE(code) ((code) & 0x18) |
| 18 | #define BPF_W 0x00 | 18 | #define BPF_W 0x00 /* 32-bit */ |
| 19 | #define BPF_H 0x08 | 19 | #define BPF_H 0x08 /* 16-bit */ |
| 20 | #define BPF_B 0x10 | 20 | #define BPF_B 0x10 /* 8-bit */ |
| 21 | /* eBPF BPF_DW 0x18 64-bit */ | ||
| 21 | #define BPF_MODE(code) ((code) & 0xe0) | 22 | #define BPF_MODE(code) ((code) & 0xe0) |
| 22 | #define BPF_IMM 0x00 | 23 | #define BPF_IMM 0x00 |
| 23 | #define BPF_ABS 0x20 | 24 | #define BPF_ABS 0x20 |
| @@ -132,6 +132,7 @@ enum { · 131 unmodified lines | |||
| 132 | IFLA_CAN_TERMINATION_CONST, | 132 | IFLA_CAN_TERMINATION_CONST, |
| 133 | IFLA_CAN_BITRATE_CONST, | 133 | IFLA_CAN_BITRATE_CONST, |
| 134 | IFLA_CAN_DATA_BITRATE_CONST, | 134 | IFLA_CAN_DATA_BITRATE_CONST, |
| 135 | IFLA_CAN_BITRATE_MAX, | ||
| 135 | __IFLA_CAN_MAX | 136 | __IFLA_CAN_MAX |
| 136 | }; | 137 | }; |
| 137 | 138 | ||
| @@ -70,6 +70,13 @@ enum devlink_command { · 69 unmodified lines | |||
| 70 | DEVLINK_CMD_DPIPE_ENTRIES_GET, | 70 | DEVLINK_CMD_DPIPE_ENTRIES_GET, |
| 71 | DEVLINK_CMD_DPIPE_HEADERS_GET, | 71 | DEVLINK_CMD_DPIPE_HEADERS_GET, |
| 72 | DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, | 72 | DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET, |
| 73 | DEVLINK_CMD_RESOURCE_SET, | ||
| 74 | DEVLINK_CMD_RESOURCE_DUMP, | ||
| 75 | |||
| 76 | /* Hot driver reload, makes configuration changes take place. The | ||
| 77 | * devlink instance is not released during the process. | ||
| 78 | */ | ||
| 79 | DEVLINK_CMD_RELOAD, | ||
| 73 | 80 | ||
| 74 | /* add new commands above here */ | 81 | /* add new commands above here */ |
| 75 | __DEVLINK_CMD_MAX, | 82 | __DEVLINK_CMD_MAX, |
| @@ -202,6 +209,20 @@ enum devlink_attr { · 126 unmodified lines | |||
| 202 | DEVLINK_ATTR_PAD, | 209 | DEVLINK_ATTR_PAD, |
| 203 | 210 | ||
| 204 | DEVLINK_ATTR_ESWITCH_ENCAP_MODE, /* u8 */ | 211 | DEVLINK_ATTR_ESWITCH_ENCAP_MODE, /* u8 */ |
| 212 | DEVLINK_ATTR_RESOURCE_LIST, /* nested */ | ||
| 213 | DEVLINK_ATTR_RESOURCE, /* nested */ | ||
| 214 | DEVLINK_ATTR_RESOURCE_NAME, /* string */ | ||
| 215 | DEVLINK_ATTR_RESOURCE_ID, /* u64 */ | ||
| 216 | DEVLINK_ATTR_RESOURCE_SIZE, /* u64 */ | ||
| 217 | DEVLINK_ATTR_RESOURCE_SIZE_NEW, /* u64 */ | ||
| 218 | DEVLINK_ATTR_RESOURCE_SIZE_VALID, /* u8 */ | ||
| 219 | DEVLINK_ATTR_RESOURCE_SIZE_MIN, /* u64 */ | ||
| 220 | DEVLINK_ATTR_RESOURCE_SIZE_MAX, /* u64 */ | ||
| 221 | DEVLINK_ATTR_RESOURCE_SIZE_GRAN, /* u64 */ | ||
| 222 | DEVLINK_ATTR_RESOURCE_UNIT, /* u8 */ | ||
| 223 | DEVLINK_ATTR_RESOURCE_OCC, /* u64 */ | ||
| 224 | DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID, /* u64 */ | ||
| 225 | DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,/* u64 */ | ||
| 205 | 226 | ||
| 206 | /* add new attributes above here, update the policy in devlink.c */ | 227 | /* add new attributes above here, update the policy in devlink.c */ |
| 207 | 228 | ||
| @@ -245,4 +266,8 @@ enum devlink_dpipe_header_id { · 37 unmodified lines | |||
| 245 | DEVLINK_DPIPE_HEADER_IPV6, | 266 | DEVLINK_DPIPE_HEADER_IPV6, |
| 246 | }; | 267 | }; |
| 247 | 268 | ||
| 269 | enum devlink_resource_unit { | ||
| 270 | DEVLINK_RESOURCE_UNIT_ENTRY, | ||
| 271 | }; | ||
| 272 | |||
| 248 | #endif /* _UAPI_LINUX_DEVLINK_H_ */ | 273 | #endif /* _UAPI_LINUX_DEVLINK_H_ */ |
| @@ -211,6 +211,61 @@ struct dmx_stc { · 210 unmodified lines | |||
| 211 | __u64 stc; | 211 | __u64 stc; |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | /** | ||
| 215 | * struct dmx_buffer - dmx buffer info | ||
| 216 | * | ||
| 217 | * @index: id number of the buffer | ||
| 218 | * @bytesused: number of bytes occupied by data in the buffer (payload); | ||
| 219 | * @offset: for buffers with memory == DMX_MEMORY_MMAP; | ||
| 220 | * offset from the start of the device memory for this plane, | ||
| 221 | * (or a "cookie" that should be passed to mmap() as offset) | ||
| 222 | * @length: size in bytes of the buffer | ||
| 223 | * | ||
| 224 | * Contains data exchanged by application and driver using one of the streaming | ||
| 225 | * I/O methods. | ||
| 226 | */ | ||
| 227 | struct dmx_buffer { | ||
| 228 | __u32 index; | ||
| 229 | __u32 bytesused; | ||
| 230 | __u32 offset; | ||
| 231 | __u32 length; | ||
| 232 | }; | ||
| 233 | |||
| 234 | /** | ||
| 235 | * struct dmx_requestbuffers - request dmx buffer information | ||
| 236 | * | ||
| 237 | * @count: number of requested buffers, | ||
| 238 | * @size: size in bytes of the requested buffer | ||
| 239 | * | ||
| 240 | * Contains data used for requesting a dmx buffer. | ||
| 241 | * All reserved fields must be set to zero. | ||
| 242 | */ | ||
| 243 | struct dmx_requestbuffers { | ||
| 244 | __u32 count; | ||
| 245 | __u32 size; | ||
| 246 | }; | ||
| 247 | |||
| 248 | /** | ||
| 249 | * struct dmx_exportbuffer - export of dmx buffer as DMABUF file descriptor | ||
| 250 | * | ||
| 251 | * @index: id number of the buffer | ||
| 252 | * @flags: flags for newly created file, currently only O_CLOEXEC is | ||
| 253 | * supported, refer to manual of open syscall for more details | ||
| 254 | * @fd: file descriptor associated with DMABUF (set by driver) | ||
| 255 | * | ||
| 256 | * Contains data used for exporting a dmx buffer as DMABUF file descriptor. | ||
| 257 | * The buffer is identified by a 'cookie' returned by DMX_QUERYBUF | ||
| 258 | * (identical to the cookie used to mmap() the buffer to userspace). All | ||
| 259 | * reserved fields must be set to zero. The field reserved0 is expected to | ||
| 260 | * become a structure 'type' allowing an alternative layout of the structure | ||
| 261 | * content. Therefore this field should not be used for any other extensions. | ||
| 262 | */ | ||
| 263 | struct dmx_exportbuffer { | ||
| 264 | __u32 index; | ||
| 265 | __u32 flags; | ||
| 266 | __s32 fd; | ||
| 267 | }; | ||
| 268 | |||
| 214 | #define DMX_START _IO('o', 41) | 269 | #define DMX_START _IO('o', 41) |
| 215 | #define DMX_STOP _IO('o', 42) | 270 | #define DMX_STOP _IO('o', 42) |
| 216 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) | 271 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) |
| @@ -231,4 +286,10 @@ typedef struct dmx_filter dmx_filter_t; · 14 unmodified lines | |||
| 231 | 286 | ||
| 232 | #endif | 287 | #endif |
| 233 | 288 | ||
| 234 | #endif /* _UAPI_DVBDMX_H_ */ | 289 | #define DMX_REQBUFS _IOWR('o', 60, struct dmx_requestbuffers) |
| 290 | #define DMX_QUERYBUF _IOWR('o', 61, struct dmx_buffer) | ||
| 291 | #define DMX_EXPBUF _IOWR('o', 62, struct dmx_exportbuffer) | ||
| 292 | #define DMX_QBUF _IOWR('o', 63, struct dmx_buffer) | ||
| 293 | #define DMX_DQBUF _IOWR('o', 64, struct dmx_buffer) | ||
| 294 | |||
| 295 | #endif /* _DVBDMX_H_ */ | ||
| @@ -547,7 +547,10 @@ enum fe_interleaving { · 546 unmodified lines | |||
| 547 | #define DTV_STAT_ERROR_BLOCK_COUNT 68 | 547 | #define DTV_STAT_ERROR_BLOCK_COUNT 68 |
| 548 | #define DTV_STAT_TOTAL_BLOCK_COUNT 69 | 548 | #define DTV_STAT_TOTAL_BLOCK_COUNT 69 |
| 549 | 549 | ||
| 550 | #define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT | 550 | /* Physical layer scrambling */ |
| 551 | #define DTV_SCRAMBLING_SEQUENCE_INDEX 70 | ||
| 552 | |||
| 553 | #define DTV_MAX_COMMAND DTV_SCRAMBLING_SEQUENCE_INDEX | ||
| 551 | 554 | ||
| 552 | /** | 555 | /** |
| 553 | * enum fe_pilot - Type of pilot tone | 556 | * enum fe_pilot - Type of pilot tone |
| @@ -756,16 +759,15 @@ enum fecap_scale_params { · 202 unmodified lines | |||
| 756 | /** | 759 | /** |
| 757 | * struct dtv_stats - Used for reading a DTV status property | 760 | * struct dtv_stats - Used for reading a DTV status property |
| 758 | * | 761 | * |
| 759 | * @scale: Filled with enum fecap_scale_params - the scale | 762 | * @scale: |
| 760 | * in usage for that parameter | 763 | * Filled with enum fecap_scale_params - the scale in usage |
| 761 | * | 764 | * for that parameter |
| 762 | * The ``{unnamed_union}`` may have either one of the values below: | ||
| 763 | * | 765 | * |
| 764 | * %svalue | 766 | * @svalue: |
| 765 | * integer value of the measure, for %FE_SCALE_DECIBEL, | 767 | * integer value of the measure, for %FE_SCALE_DECIBEL, |
| 766 | * used for dB measures. The unit is 0.001 dB. | 768 | * used for dB measures. The unit is 0.001 dB. |
| 767 | * | 769 | * |
| 768 | * %uvalue | 770 | * @uvalue: |
| 769 | * unsigned integer value of the measure, used when @scale is | 771 | * unsigned integer value of the measure, used when @scale is |
| 770 | * either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER. | 772 | * either %FE_SCALE_RELATIVE or %FE_SCALE_COUNTER. |
| 771 | * | 773 | * |
| @@ -828,19 +830,19 @@ struct dtv_fe_stats { · 56 unmodified lines | |||
| 828 | /** | 830 | /** |
| 829 | * struct dtv_property - store one of frontend command and its value | 831 | * struct dtv_property - store one of frontend command and its value |
| 830 | * | 832 | * |
| 831 | * @cmd: Digital TV command. | 833 | * @cmd: Digital TV command. |
| 832 | * @reserved: Not used. | 834 | * @reserved: Not used. |
| 833 | * @u: Union with the values for the command. | 835 | * @u: Union with the values for the command. |
| 834 | * @result: Unused | 836 | * @u.data: A unsigned 32 bits integer with command value. |
| 835 | * | 837 | * @u.buffer: Struct to store bigger properties. |
| 836 | * The @u union may have either one of the values below: | 838 | * Currently unused. |
| 839 | * @u.buffer.data: an unsigned 32-bits array. | ||
| 840 | * @u.buffer.len: number of elements of the buffer. | ||
| 841 | * @u.buffer.reserved1: Reserved. | ||
| 842 | * @u.buffer.reserved2: Reserved. | ||
| 843 | * @u.st: a &struct dtv_fe_stats array of statistics. | ||
| 844 | * @result: Currently unused. | ||
| 837 | * | 845 | * |
| 838 | * %data | ||
| 839 | * an unsigned 32-bits number. | ||
| 840 | * %st | ||
| 841 | * a &struct dtv_fe_stats array of statistics. | ||
| 842 | * %buffer | ||
| 843 | * a buffer of up to 32 characters (currently unused). | ||
| 844 | */ | 846 | */ |
| 845 | struct dtv_property { | 847 | struct dtv_property { |
| 846 | __u32 cmd; | 848 | __u32 cmd; |
| @@ -25,6 +25,6 @@ · 24 unmodified lines | |||
| 25 | #define _DVBVERSION_H_ | 25 | #define _DVBVERSION_H_ |
| 26 | 26 | ||
| 27 | #define DVB_API_VERSION 5 | 27 | #define DVB_API_VERSION 5 |
| 28 | #define DVB_API_VERSION_MINOR 10 | 28 | #define DVB_API_VERSION_MINOR 11 |
| 29 | 29 | ||
| 30 | #endif /*_DVBVERSION_H_*/ | 30 | #endif /*_DVBVERSION_H_*/ |
| @@ -83,11 +83,11 @@ typedef enum { · 82 unmodified lines | |||
| 83 | #define VIDEO_CMD_CONTINUE (3) | 83 | #define VIDEO_CMD_CONTINUE (3) |
| 84 | 84 | ||
| 85 | /* Flags for VIDEO_CMD_FREEZE */ | 85 | /* Flags for VIDEO_CMD_FREEZE */ |
| 86 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) | 86 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) |
| 87 | 87 | ||
| 88 | /* Flags for VIDEO_CMD_STOP */ | 88 | /* Flags for VIDEO_CMD_STOP */ |
| 89 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) | 89 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) |
| 90 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) | 90 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) |
| 91 | 91 | ||
| 92 | /* Play input formats: */ | 92 | /* Play input formats: */ |
| 93 | /* The decoder has no special format requirements */ | 93 | /* The decoder has no special format requirements */ |
| @@ -124,8 +124,8 @@ struct video_command { · 30 unmodified lines | |||
| 124 | /* FIELD_UNKNOWN can be used if the hardware does not know whether | 124 | /* FIELD_UNKNOWN can be used if the hardware does not know whether |
| 125 | the Vsync is for an odd, even or progressive (i.e. non-interlaced) | 125 | the Vsync is for an odd, even or progressive (i.e. non-interlaced) |
| 126 | field. */ | 126 | field. */ |
| 127 | #define VIDEO_VSYNC_FIELD_UNKNOWN (0) | 127 | #define VIDEO_VSYNC_FIELD_UNKNOWN (0) |
| 128 | #define VIDEO_VSYNC_FIELD_ODD (1) | 128 | #define VIDEO_VSYNC_FIELD_ODD (1) |
| 129 | #define VIDEO_VSYNC_FIELD_EVEN (2) | 129 | #define VIDEO_VSYNC_FIELD_EVEN (2) |
| 130 | #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) | 130 | #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) |
| 131 | 131 | ||
| @@ -133,8 +133,8 @@ struct video_event { · 1 unmodified line | |||
| 133 | __s32 type; | 133 | __s32 type; |
| 134 | #define VIDEO_EVENT_SIZE_CHANGED 1 | 134 | #define VIDEO_EVENT_SIZE_CHANGED 1 |
| 135 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 | 135 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 |
| 136 | #define VIDEO_EVENT_DECODER_STOPPED 3 | 136 | #define VIDEO_EVENT_DECODER_STOPPED 3 |
| 137 | #define VIDEO_EVENT_VSYNC 4 | 137 | #define VIDEO_EVENT_VSYNC 4 |
| 138 | /* unused, make sure to use atomic time for y2038 if it ever gets used */ | 138 | /* unused, make sure to use atomic time for y2038 if it ever gets used */ |
| 139 | long timestamp; | 139 | long timestamp; |
| 140 | union { | 140 | union { |
| @@ -268,9 +268,9 @@ typedef __u16 video_attributes_t; · 127 unmodified lines | |||
| 268 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | 268 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) |
| 269 | 269 | ||
| 270 | /* Read the number of displayed frames since the decoder was started */ | 270 | /* Read the number of displayed frames since the decoder was started */ |
| 271 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) | 271 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) |
| 272 | 272 | ||
| 273 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) | 273 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) |
| 274 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) | 274 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) |
| 275 | 275 | ||
| 276 | #endif /* _UAPI_DVBVIDEO_H_ */ | 276 | #endif /* _UAPI_DVBVIDEO_H_ */ |
| @@ -396,6 +396,7 @@ typedef struct elf64_shdr { · 395 unmodified lines | |||
| 396 | #define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */ | 396 | #define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */ |
| 397 | #define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */ | 397 | #define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */ |
| 398 | #define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */ | 398 | #define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */ |
| 399 | #define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */ | ||
| 399 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 400 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
| 400 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 401 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
| 401 | #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ | 402 | #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ |
| @@ -0,0 +1,52 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
| 2 | /* | ||
| 3 | * ERSPAN Tunnel Metadata | ||
| 4 | * | ||
| 5 | * Copyright (c) 2018 VMware | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 | ||
| 9 | * as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * Userspace API for metadata mode ERSPAN tunnel | ||
| 12 | */ | ||
| 13 | #ifndef _UAPI_ERSPAN_H | ||
| 14 | #define _UAPI_ERSPAN_H | ||
| 15 | |||
| 16 | #include <linux/types.h> /* For __beXX in userspace */ | ||
| 17 | #include <asm/byteorder.h> | ||
| 18 | |||
| 19 | /* ERSPAN version 2 metadata header */ | ||
| 20 | struct erspan_md2 { | ||
| 21 | __be32 timestamp; | ||
| 22 | __be16 sgt; /* security group tag */ | ||
| 23 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 24 | __u8 hwid_upper:2, | ||
| 25 | ft:5, | ||
| 26 | p:1; | ||
| 27 | __u8 o:1, | ||
| 28 | gra:2, | ||
| 29 | dir:1, | ||
| 30 | hwid:4; | ||
| 31 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
| 32 | __u8 p:1, | ||
| 33 | ft:5, | ||
| 34 | hwid_upper:2; | ||
| 35 | __u8 hwid:4, | ||
| 36 | dir:1, | ||
| 37 | gra:2, | ||
| 38 | o:1; | ||
| 39 | #else | ||
| 40 | #error "Please fix <asm/byteorder.h>" | ||
| 41 | #endif | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct erspan_metadata { | ||
| 45 | int version; | ||
| 46 | union { | ||
| 47 | __be32 index; /* Version 1 (type II)*/ | ||
| 48 | struct erspan_md2 md2; /* Version 2 (type III) */ | ||
| 49 | } u; | ||
| 50 | }; | ||
| 51 | |||
| 52 | #endif /* _UAPI_ERSPAN_H */ | ||
| @@ -1686,6 +1686,7 @@ enum ethtool_reset_flags { · 1685 unmodified lines | |||
| 1686 | ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */ | 1686 | ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */ |
| 1687 | ETH_RESET_RAM = 1 << 7, /* RAM shared between | 1687 | ETH_RESET_RAM = 1 << 7, /* RAM shared between |
| 1688 | * multiple components */ | 1688 | * multiple components */ |
| 1689 | ETH_RESET_AP = 1 << 8, /* Application processor */ | ||
| 1689 | 1690 | ||
| 1690 | ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to | 1691 | ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to |
| 1691 | * this interface */ | 1692 | * this interface */ |
| @@ -28,20 +28,21 @@ · 27 unmodified lines | |||
| 28 | #define EPOLL_CTL_MOD 3 | 28 | #define EPOLL_CTL_MOD 3 |
| 29 | 29 | ||
| 30 | /* Epoll event masks */ | 30 | /* Epoll event masks */ |
| 31 | #define EPOLLIN 0x00000001 | 31 | #define EPOLLIN (__force __poll_t)0x00000001 |
| 32 | #define EPOLLPRI 0x00000002 | 32 | #define EPOLLPRI (__force __poll_t)0x00000002 |
| 33 | #define EPOLLOUT 0x00000004 | 33 | #define EPOLLOUT (__force __poll_t)0x00000004 |
| 34 | #define EPOLLERR 0x00000008 | 34 | #define EPOLLERR (__force __poll_t)0x00000008 |
| 35 | #define EPOLLHUP 0x00000010 | 35 | #define EPOLLHUP (__force __poll_t)0x00000010 |
| 36 | #define EPOLLRDNORM 0x00000040 | 36 | #define EPOLLNVAL (__force __poll_t)0x00000020 |
| 37 | #define EPOLLRDBAND 0x00000080 | 37 | #define EPOLLRDNORM (__force __poll_t)0x00000040 |
| 38 | #define EPOLLWRNORM 0x00000100 | 38 | #define EPOLLRDBAND (__force __poll_t)0x00000080 |
| 39 | #define EPOLLWRBAND 0x00000200 | 39 | #define EPOLLWRNORM (__force __poll_t)0x00000100 |
| 40 | #define EPOLLMSG 0x00000400 | 40 | #define EPOLLWRBAND (__force __poll_t)0x00000200 |
| 41 | #define EPOLLRDHUP 0x00002000 | 41 | #define EPOLLMSG (__force __poll_t)0x00000400 |
| 42 | #define EPOLLRDHUP (__force __poll_t)0x00002000 | ||
| 42 | 43 | ||
| 43 | /* Set exclusive wakeup mode for the target file descriptor */ | 44 | /* Set exclusive wakeup mode for the target file descriptor */ |
| 44 | #define EPOLLEXCLUSIVE (1U << 28) | 45 | #define EPOLLEXCLUSIVE (__force __poll_t)(1U << 28) |
| 45 | 46 | ||
| 46 | /* | 47 | /* |
| 47 | * Request the handling of system wakeup events so as to prevent system suspends | 48 | * Request the handling of system wakeup events so as to prevent system suspends |
| @@ -53,13 +54,13 @@ · 5 unmodified lines | |||
| 53 | * | 54 | * |
| 54 | * Requires CAP_BLOCK_SUSPEND | 55 | * Requires CAP_BLOCK_SUSPEND |
| 55 | */ | 56 | */ |
| 56 | #define EPOLLWAKEUP (1U << 29) | 57 | #define EPOLLWAKEUP (__force __poll_t)(1U << 29) |
| 57 | 58 | ||
| 58 | /* Set the One Shot behaviour for the target file descriptor */ | 59 | /* Set the One Shot behaviour for the target file descriptor */ |
| 59 | #define EPOLLONESHOT (1U << 30) | 60 | #define EPOLLONESHOT (__force __poll_t)(1U << 30) |
| 60 | 61 | ||
| 61 | /* Set the Edge Triggered behaviour for the target file descriptor */ | 62 | /* Set the Edge Triggered behaviour for the target file descriptor */ |
| 62 | #define EPOLLET (1U << 31) | 63 | #define EPOLLET (__force __poll_t)(1U << 31) |
| 63 | 64 | ||
| 64 | /* | 65 | /* |
| 65 | * On x86-64 make the 64bit structure have the same alignment as the | 66 | * On x86-64 make the 64bit structure have the same alignment as the |
| @@ -74,7 +75,7 @@ · 8 unmodified lines | |||
| 74 | #endif | 75 | #endif |
| 75 | 76 | ||
| 76 | struct epoll_event { | 77 | struct epoll_event { |
| 77 | __u32 events; | 78 | __poll_t events; |
| 78 | __u64 data; | 79 | __u64 data; |
| 79 | } EPOLL_PACKED; | 80 | } EPOLL_PACKED; |
| 80 | 81 | ||
| @@ -377,7 +377,11 @@ typedef int __bitwise __kernel_rwf_t; · 376 unmodified lines | |||
| 377 | /* per-IO, return -EAGAIN if operation would block */ | 377 | /* per-IO, return -EAGAIN if operation would block */ |
| 378 | #define RWF_NOWAIT ((__force __kernel_rwf_t)0x00000008) | 378 | #define RWF_NOWAIT ((__force __kernel_rwf_t)0x00000008) |
| 379 | 379 | ||
| 380 | /* per-IO O_APPEND */ | ||
| 381 | #define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) | ||
| 382 | |||
| 380 | /* mask of flags supported by the kernel */ | 383 | /* mask of flags supported by the kernel */ |
| 381 | #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT) | 384 | #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ |
| 385 | RWF_APPEND) | ||
| 382 | 386 | ||
| 383 | #endif /* _UAPI_LINUX_FS_H */ | 387 | #endif /* _UAPI_LINUX_FS_H */ |
| @@ -187,10 +187,19 @@ struct gfs2_rgrp { · 186 unmodified lines | |||
| 187 | __be32 rg_flags; | 187 | __be32 rg_flags; |
| 188 | __be32 rg_free; | 188 | __be32 rg_free; |
| 189 | __be32 rg_dinodes; | 189 | __be32 rg_dinodes; |
| 190 | __be32 __pad; | 190 | union { |
| 191 | __be32 __pad; | ||
| 192 | __be32 rg_skip; /* Distance to the next rgrp in fs blocks */ | ||
| 193 | }; | ||
| 191 | __be64 rg_igeneration; | 194 | __be64 rg_igeneration; |
| 192 | 195 | /* The following 3 fields are duplicated from gfs2_rindex to reduce | |
| 193 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ | 196 | reliance on the rindex */ |
| 197 | __be64 rg_data0; /* First data location */ | ||
| 198 | __be32 rg_data; /* Number of data blocks in rgrp */ | ||
| 199 | __be32 rg_bitbytes; /* Number of bytes in data bitmaps */ | ||
| 200 | __be32 rg_crc; /* crc32 of the structure with this field 0 */ | ||
| 201 | |||
| 202 | __u8 rg_reserved[60]; /* Several fields from gfs1 now reserved */ | ||
| 194 | }; | 203 | }; |
| 195 | 204 | ||
| 196 | /* | 205 | /* |
| @@ -394,7 +403,36 @@ struct gfs2_ea_header { · 197 unmodified lines | |||
| 394 | * Log header structure | 403 | * Log header structure |
| 395 | */ | 404 | */ |
| 396 | 405 | ||
| 397 | #define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */ | 406 | #define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */ |
| 407 | #define GFS2_LOG_HEAD_FLUSH_NORMAL 0x00000002 /* normal log flush */ | ||
| 408 | #define GFS2_LOG_HEAD_FLUSH_SYNC 0x00000004 /* Sync log flush */ | ||
| 409 | #define GFS2_LOG_HEAD_FLUSH_SHUTDOWN 0x00000008 /* Shutdown log flush */ | ||
| 410 | #define GFS2_LOG_HEAD_FLUSH_FREEZE 0x00000010 /* Freeze flush */ | ||
| 411 | #define GFS2_LOG_HEAD_RECOVERY 0x00000020 /* Journal recovery */ | ||
| 412 | #define GFS2_LOG_HEAD_USERSPACE 0x80000000 /* Written by gfs2-utils */ | ||
| 413 | |||
| 414 | /* Log flush callers */ | ||
| 415 | #define GFS2_LFC_SHUTDOWN 0x00000100 | ||
| 416 | #define GFS2_LFC_JDATA_WPAGES 0x00000200 | ||
| 417 | #define GFS2_LFC_SET_FLAGS 0x00000400 | ||
| 418 | #define GFS2_LFC_AIL_EMPTY_GL 0x00000800 | ||
| 419 | #define GFS2_LFC_AIL_FLUSH 0x00001000 | ||
| 420 | #define GFS2_LFC_RGRP_GO_SYNC 0x00002000 | ||
| 421 | #define GFS2_LFC_INODE_GO_SYNC 0x00004000 | ||
| 422 | #define GFS2_LFC_INODE_GO_INVAL 0x00008000 | ||
| 423 | #define GFS2_LFC_FREEZE_GO_SYNC 0x00010000 | ||
| 424 | #define GFS2_LFC_KILL_SB 0x00020000 | ||
| 425 | #define GFS2_LFC_DO_SYNC 0x00040000 | ||
| 426 | #define GFS2_LFC_INPLACE_RESERVE 0x00080000 | ||
| 427 | #define GFS2_LFC_WRITE_INODE 0x00100000 | ||
| 428 | #define GFS2_LFC_MAKE_FS_RO 0x00200000 | ||
| 429 | #define GFS2_LFC_SYNC_FS 0x00400000 | ||
| 430 | #define GFS2_LFC_EVICT_INODE 0x00800000 | ||
| 431 | #define GFS2_LFC_TRANS_END 0x01000000 | ||
| 432 | #define GFS2_LFC_LOGD_JFLUSH_REQD 0x02000000 | ||
| 433 | #define GFS2_LFC_LOGD_AIL_FLUSH_REQD 0x04000000 | ||
| 434 | |||
| 435 | #define LH_V1_SIZE (offsetofend(struct gfs2_log_header, lh_hash)) | ||
| 398 | 436 | ||
| 399 | struct gfs2_log_header { | 437 | struct gfs2_log_header { |
| 400 | struct gfs2_meta_header lh_header; | 438 | struct gfs2_meta_header lh_header; |
| @@ -403,7 +441,21 @@ struct gfs2_log_header { · 2 unmodified lines | |||
| 403 | __be32 lh_flags; /* GFS2_LOG_HEAD_... */ | 441 | __be32 lh_flags; /* GFS2_LOG_HEAD_... */ |
| 404 | __be32 lh_tail; /* Block number of log tail */ | 442 | __be32 lh_tail; /* Block number of log tail */ |
| 405 | __be32 lh_blkno; | 443 | __be32 lh_blkno; |
| 406 | __be32 lh_hash; | 444 | __be32 lh_hash; /* crc up to here with this field 0 */ |
| 445 | |||
| 446 | /* Version 2 additional fields start here */ | ||
| 447 | __be32 lh_crc; /* crc32c from lh_nsec to end of block */ | ||
| 448 | __be32 lh_nsec; /* Nanoseconds of timestamp */ | ||
| 449 | __be64 lh_sec; /* Seconds of timestamp */ | ||
| 450 | __be64 lh_addr; /* Block addr of this log header (absolute) */ | ||
| 451 | __be64 lh_jinode; /* Journal inode number */ | ||
| 452 | __be64 lh_statfs_addr; /* Local statfs inode number */ | ||
| 453 | __be64 lh_quota_addr; /* Local quota change inode number */ | ||
| 454 | |||
| 455 | /* Statfs local changes (i.e. diff from global statfs) */ | ||
| 456 | __be64 lh_local_total; | ||
| 457 | __be64 lh_local_free; | ||
| 458 | __be64 lh_local_dinodes; | ||
| 407 | }; | 459 | }; |
| 408 | 460 | ||
| 409 | /* | 461 | /* |
| @@ -72,6 +72,9 @@ struct i2c_msg { · 71 unmodified lines | |||
| 72 | #define I2C_M_RD 0x0001 /* read data, from slave to master */ | 72 | #define I2C_M_RD 0x0001 /* read data, from slave to master */ |
| 73 | /* I2C_M_RD is guaranteed to be 0x0001! */ | 73 | /* I2C_M_RD is guaranteed to be 0x0001! */ |
| 74 | #define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ | 74 | #define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ |
| 75 | #define I2C_M_DMA_SAFE 0x0200 /* the buffer of this message is DMA safe */ | ||
| 76 | /* makes only sense in kernelspace */ | ||
| 77 | /* userspace buffers are copied anyway */ | ||
| 75 | #define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ | 78 | #define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ |
| 76 | #define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */ | 79 | #define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
| 77 | #define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ | 80 | #define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ |
| @@ -48,6 +48,7 @@ · 47 unmodified lines | |||
| 48 | #define ETH_P_PUP 0x0200 /* Xerox PUP packet */ | 48 | #define ETH_P_PUP 0x0200 /* Xerox PUP packet */ |
| 49 | #define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ | 49 | #define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ |
| 50 | #define ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */ | 50 | #define ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */ |
| 51 | #define ETH_P_ERSPAN2 0x22EB /* ERSPAN version 2 (type III) */ | ||
| 51 | #define ETH_P_IP 0x0800 /* Internet Protocol packet */ | 52 | #define ETH_P_IP 0x0800 /* Internet Protocol packet */ |
| 52 | #define ETH_P_X25 0x0805 /* CCITT X.25 */ | 53 | #define ETH_P_X25 0x0805 /* CCITT X.25 */ |
| 53 | #define ETH_P_ARP 0x0806 /* Address Resolution packet */ | 54 | #define ETH_P_ARP 0x0806 /* Address Resolution packet */ |
| @@ -161,6 +161,9 @@ enum { · 160 unmodified lines | |||
| 161 | IFLA_EVENT, | 161 | IFLA_EVENT, |
| 162 | IFLA_NEW_NETNSID, | 162 | IFLA_NEW_NETNSID, |
| 163 | IFLA_IF_NETNSID, | 163 | IFLA_IF_NETNSID, |
| 164 | IFLA_CARRIER_UP_COUNT, | ||
| 165 | IFLA_CARRIER_DOWN_COUNT, | ||
| 166 | IFLA_NEW_IFINDEX, | ||
| 164 | __IFLA_MAX | 167 | __IFLA_MAX |
| 165 | }; | 168 | }; |
| 166 | 169 | ||
| @@ -732,6 +735,8 @@ enum { · 565 unmodified lines | |||
| 732 | IFLA_VF_STATS_BROADCAST, | 735 | IFLA_VF_STATS_BROADCAST, |
| 733 | IFLA_VF_STATS_MULTICAST, | 736 | IFLA_VF_STATS_MULTICAST, |
| 734 | IFLA_VF_STATS_PAD, | 737 | IFLA_VF_STATS_PAD, |
| 738 | IFLA_VF_STATS_RX_DROPPED, | ||
| 739 | IFLA_VF_STATS_TX_DROPPED, | ||
| 735 | __IFLA_VF_STATS_MAX, | 740 | __IFLA_VF_STATS_MAX, |
| 736 | }; | 741 | }; |
| 737 | 742 | ||
| @@ -22,8 +22,13 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #define MACSEC_KEYID_LEN 16 | 23 | #define MACSEC_KEYID_LEN 16 |
| 24 | 24 | ||
| 25 | #define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL | 25 | /* cipher IDs as per IEEE802.1AEbn-2011 */ |
| 26 | #define MACSEC_DEFAULT_CIPHER_ALT 0x0080C20001000001ULL | 26 | #define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL |
| 27 | #define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL | ||
| 28 | |||
| 29 | /* deprecated cipher ID for GCM-AES-128 */ | ||
| 30 | #define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL | ||
| 31 | #define MACSEC_DEFAULT_CIPHER_ALT MACSEC_CIPHER_ID_GCM_AES_128 | ||
| 27 | 32 | ||
| 28 | #define MACSEC_MIN_ICV_LEN 8 | 33 | #define MACSEC_MIN_ICV_LEN 8 |
| 29 | #define MACSEC_MAX_ICV_LEN 32 | 34 | #define MACSEC_MAX_ICV_LEN 32 |
| @@ -57,6 +57,8 @@ · 56 unmodified lines | |||
| 57 | */ | 57 | */ |
| 58 | #define TUNSETVNETBE _IOW('T', 222, int) | 58 | #define TUNSETVNETBE _IOW('T', 222, int) |
| 59 | #define TUNGETVNETBE _IOR('T', 223, int) | 59 | #define TUNGETVNETBE _IOR('T', 223, int) |
| 60 | #define TUNSETSTEERINGEBPF _IOR('T', 224, int) | ||
| 61 | #define TUNSETFILTEREBPF _IOR('T', 225, int) | ||
| 60 | 62 | ||
| 61 | /* TUNSETIFF ifr flags */ | 63 | /* TUNSETIFF ifr flags */ |
| 62 | #define IFF_TUN 0x0001 | 64 | #define IFF_TUN 0x0001 |
| @@ -137,6 +137,9 @@ enum { · 136 unmodified lines | |||
| 137 | IFLA_GRE_IGNORE_DF, | 137 | IFLA_GRE_IGNORE_DF, |
| 138 | IFLA_GRE_FWMARK, | 138 | IFLA_GRE_FWMARK, |
| 139 | IFLA_GRE_ERSPAN_INDEX, | 139 | IFLA_GRE_ERSPAN_INDEX, |
| 140 | IFLA_GRE_ERSPAN_VER, | ||
| 141 | IFLA_GRE_ERSPAN_DIR, | ||
| 142 | IFLA_GRE_ERSPAN_HWID, | ||
| 140 | __IFLA_GRE_MAX, | 143 | __IFLA_GRE_MAX, |
| 141 | }; | 144 | }; |
| 142 | 145 | ||
| @@ -92,6 +92,8 @@ enum { · 91 unmodified lines | |||
| 92 | INET_DIAG_BC_D_COND, | 92 | INET_DIAG_BC_D_COND, |
| 93 | INET_DIAG_BC_DEV_COND, /* u32 ifindex */ | 93 | INET_DIAG_BC_DEV_COND, /* u32 ifindex */ |
| 94 | INET_DIAG_BC_MARK_COND, | 94 | INET_DIAG_BC_MARK_COND, |
| 95 | INET_DIAG_BC_S_EQ, | ||
| 96 | INET_DIAG_BC_D_EQ, | ||
| 95 | }; | 97 | }; |
| 96 | 98 | ||
| 97 | struct inet_diag_hostcond { | 99 | struct inet_diag_hostcond { |
| @@ -594,6 +594,7 @@ · 593 unmodified lines | |||
| 594 | #define BTN_DPAD_RIGHT 0x223 | 594 | #define BTN_DPAD_RIGHT 0x223 |
| 595 | 595 | ||
| 596 | #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ | 596 | #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ |
| 597 | #define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */ | ||
| 597 | 598 | ||
| 598 | #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ | 599 | #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ |
| 599 | #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ | 600 | #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ |
| @@ -21,10 +21,21 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| 23 | * The event structure itself | 23 | * The event structure itself |
| 24 | * Note that __USE_TIME_BITS64 is defined by libc based on | ||
| 25 | * application's request to use 64 bit time_t. | ||
| 24 | */ | 26 | */ |
| 25 | 27 | ||
| 26 | struct input_event { | 28 | struct input_event { |
| 29 | #if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL) | ||
| 27 | struct timeval time; | 30 | struct timeval time; |
| 31 | #define input_event_sec time.tv_sec | ||
| 32 | #define input_event_usec time.tv_usec | ||
| 33 | #else | ||
| 34 | __kernel_ulong_t __sec; | ||
| 35 | __kernel_ulong_t __usec; | ||
| 36 | #define input_event_sec __sec | ||
| 37 | #define input_event_usec __usec | ||
| 38 | #endif | ||
| 28 | __u16 type; | 39 | __u16 type; |
| 29 | __u16 code; | 40 | __u16 code; |
| 30 | __s32 value; | 41 | __s32 value; |
| @@ -58,7 +58,8 @@ struct kfd_ioctl_create_queue_args { · 57 unmodified lines | |||
| 58 | __u64 eop_buffer_address; /* to KFD */ | 58 | __u64 eop_buffer_address; /* to KFD */ |
| 59 | __u64 eop_buffer_size; /* to KFD */ | 59 | __u64 eop_buffer_size; /* to KFD */ |
| 60 | __u64 ctx_save_restore_address; /* to KFD */ | 60 | __u64 ctx_save_restore_address; /* to KFD */ |
| 61 | __u64 ctx_save_restore_size; /* to KFD */ | 61 | __u32 ctx_save_restore_size; /* to KFD */ |
| 62 | __u32 ctl_stack_size; /* to KFD */ | ||
| 62 | }; | 63 | }; |
| 63 | 64 | ||
| 64 | struct kfd_ioctl_destroy_queue_args { | 65 | struct kfd_ioctl_destroy_queue_args { |
| @@ -261,6 +262,13 @@ struct kfd_ioctl_get_tile_config_args { · 196 unmodified lines | |||
| 261 | */ | 262 | */ |
| 262 | }; | 263 | }; |
| 263 | 264 | ||
| 265 | struct kfd_ioctl_set_trap_handler_args { | ||
| 266 | uint64_t tba_addr; /* to KFD */ | ||
| 267 | uint64_t tma_addr; /* to KFD */ | ||
| 268 | uint32_t gpu_id; /* to KFD */ | ||
| 269 | uint32_t pad; | ||
| 270 | }; | ||
| 271 | |||
| 264 | #define AMDKFD_IOCTL_BASE 'K' | 272 | #define AMDKFD_IOCTL_BASE 'K' |
| 265 | #define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr) | 273 | #define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr) |
| 266 | #define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type) | 274 | #define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type) |
| @@ -321,7 +329,10 @@ struct kfd_ioctl_get_tile_config_args { · 54 unmodified lines | |||
| 321 | #define AMDKFD_IOC_GET_TILE_CONFIG \ | 329 | #define AMDKFD_IOC_GET_TILE_CONFIG \ |
| 322 | AMDKFD_IOWR(0x12, struct kfd_ioctl_get_tile_config_args) | 330 | AMDKFD_IOWR(0x12, struct kfd_ioctl_get_tile_config_args) |
| 323 | 331 | ||
| 332 | #define AMDKFD_IOC_SET_TRAP_HANDLER \ | ||
| 333 | AMDKFD_IOW(0x13, struct kfd_ioctl_set_trap_handler_args) | ||
| 334 | |||
| 324 | #define AMDKFD_COMMAND_START 0x01 | 335 | #define AMDKFD_COMMAND_START 0x01 |
| 325 | #define AMDKFD_COMMAND_END 0x13 | 336 | #define AMDKFD_COMMAND_END 0x14 |
| 326 | 337 | ||
| 327 | #endif | 338 | #endif |
| @@ -1362,6 +1362,96 @@ struct kvm_s390_ucas_mapping { · 1361 unmodified lines | |||
| 1362 | /* Available with KVM_CAP_S390_CMMA_MIGRATION */ | 1362 | /* Available with KVM_CAP_S390_CMMA_MIGRATION */ |
| 1363 | #define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log) | 1363 | #define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log) |
| 1364 | #define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log) | 1364 | #define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log) |
| 1365 | /* Memory Encryption Commands */ | ||
| 1366 | #define KVM_MEMORY_ENCRYPT_OP _IOWR(KVMIO, 0xba, unsigned long) | ||
| 1367 | |||
| 1368 | struct kvm_enc_region { | ||
| 1369 | __u64 addr; | ||
| 1370 | __u64 size; | ||
| 1371 | }; | ||
| 1372 | |||
| 1373 | #define KVM_MEMORY_ENCRYPT_REG_REGION _IOR(KVMIO, 0xbb, struct kvm_enc_region) | ||
| 1374 | #define KVM_MEMORY_ENCRYPT_UNREG_REGION _IOR(KVMIO, 0xbc, struct kvm_enc_region) | ||
| 1375 | |||
| 1376 | /* Secure Encrypted Virtualization command */ | ||
| 1377 | enum sev_cmd_id { | ||
| 1378 | /* Guest initialization commands */ | ||
| 1379 | KVM_SEV_INIT = 0, | ||
| 1380 | KVM_SEV_ES_INIT, | ||
| 1381 | /* Guest launch commands */ | ||
| 1382 | KVM_SEV_LAUNCH_START, | ||
| 1383 | KVM_SEV_LAUNCH_UPDATE_DATA, | ||
| 1384 | KVM_SEV_LAUNCH_UPDATE_VMSA, | ||
| 1385 | KVM_SEV_LAUNCH_SECRET, | ||
| 1386 | KVM_SEV_LAUNCH_MEASURE, | ||
| 1387 | KVM_SEV_LAUNCH_FINISH, | ||
| 1388 | /* Guest migration commands (outgoing) */ | ||
| 1389 | KVM_SEV_SEND_START, | ||
| 1390 | KVM_SEV_SEND_UPDATE_DATA, | ||
| 1391 | KVM_SEV_SEND_UPDATE_VMSA, | ||
| 1392 | KVM_SEV_SEND_FINISH, | ||
| 1393 | /* Guest migration commands (incoming) */ | ||
| 1394 | KVM_SEV_RECEIVE_START, | ||
| 1395 | KVM_SEV_RECEIVE_UPDATE_DATA, | ||
| 1396 | KVM_SEV_RECEIVE_UPDATE_VMSA, | ||
| 1397 | KVM_SEV_RECEIVE_FINISH, | ||
| 1398 | /* Guest status and debug commands */ | ||
| 1399 | KVM_SEV_GUEST_STATUS, | ||
| 1400 | KVM_SEV_DBG_DECRYPT, | ||
| 1401 | KVM_SEV_DBG_ENCRYPT, | ||
| 1402 | /* Guest certificates commands */ | ||
| 1403 | KVM_SEV_CERT_EXPORT, | ||
| 1404 | |||
| 1405 | KVM_SEV_NR_MAX, | ||
| 1406 | }; | ||
| 1407 | |||
| 1408 | struct kvm_sev_cmd { | ||
| 1409 | __u32 id; | ||
| 1410 | __u64 data; | ||
| 1411 | __u32 error; | ||
| 1412 | __u32 sev_fd; | ||
| 1413 | }; | ||
| 1414 | |||
| 1415 | struct kvm_sev_launch_start { | ||
| 1416 | __u32 handle; | ||
| 1417 | __u32 policy; | ||
| 1418 | __u64 dh_uaddr; | ||
| 1419 | __u32 dh_len; | ||
| 1420 | __u64 session_uaddr; | ||
| 1421 | __u32 session_len; | ||
| 1422 | }; | ||
| 1423 | |||
| 1424 | struct kvm_sev_launch_update_data { | ||
| 1425 | __u64 uaddr; | ||
| 1426 | __u32 len; | ||
| 1427 | }; | ||
| 1428 | |||
| 1429 | |||
| 1430 | struct kvm_sev_launch_secret { | ||
| 1431 | __u64 hdr_uaddr; | ||
| 1432 | __u32 hdr_len; | ||
| 1433 | __u64 guest_uaddr; | ||
| 1434 | __u32 guest_len; | ||
| 1435 | __u64 trans_uaddr; | ||
| 1436 | __u32 trans_len; | ||
| 1437 | }; | ||
| 1438 | |||
| 1439 | struct kvm_sev_launch_measure { | ||
| 1440 | __u64 uaddr; | ||
| 1441 | __u32 len; | ||
| 1442 | }; | ||
| 1443 | |||
| 1444 | struct kvm_sev_guest_status { | ||
| 1445 | __u32 handle; | ||
| 1446 | __u32 policy; | ||
| 1447 | __u32 state; | ||
| 1448 | }; | ||
| 1449 | |||
| 1450 | struct kvm_sev_dbg { | ||
| 1451 | __u64 src_uaddr; | ||
| 1452 | __u64 dst_uaddr; | ||
| 1453 | __u32 len; | ||
| 1454 | }; | ||
| 1365 | 1455 | ||
| 1366 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 1456 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
| 1367 | #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) | 1457 | #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) |
| @@ -65,7 +65,7 @@ struct sockaddr_l2tpip6 { · 64 unmodified lines | |||
| 65 | * TUNNEL_MODIFY - CONN_ID, udpcsum | 65 | * TUNNEL_MODIFY - CONN_ID, udpcsum |
| 66 | * TUNNEL_GETSTATS - CONN_ID, (stats) | 66 | * TUNNEL_GETSTATS - CONN_ID, (stats) |
| 67 | * TUNNEL_GET - CONN_ID, (...) | 67 | * TUNNEL_GET - CONN_ID, (...) |
| 68 | * SESSION_CREATE - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec | 68 | * SESSION_CREATE - SESSION_ID, PW_TYPE, data_seq, cookie, peer_cookie, l2spec |
| 69 | * SESSION_DELETE - SESSION_ID | 69 | * SESSION_DELETE - SESSION_ID |
| 70 | * SESSION_MODIFY - SESSION_ID, data_seq | 70 | * SESSION_MODIFY - SESSION_ID, data_seq |
| 71 | * SESSION_GET - SESSION_ID, (...) | 71 | * SESSION_GET - SESSION_ID, (...) |
| @@ -94,10 +94,10 @@ enum { · 22 unmodified lines | |||
| 94 | L2TP_ATTR_NONE, /* no data */ | 94 | L2TP_ATTR_NONE, /* no data */ |
| 95 | L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */ | 95 | L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */ |
| 96 | L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */ | 96 | L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */ |
| 97 | L2TP_ATTR_OFFSET, /* u16 */ | 97 | L2TP_ATTR_OFFSET, /* u16 (not used) */ |
| 98 | L2TP_ATTR_DATA_SEQ, /* u16 */ | 98 | L2TP_ATTR_DATA_SEQ, /* u16 */ |
| 99 | L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */ | 99 | L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */ |
| 100 | L2TP_ATTR_L2SPEC_LEN, /* u8, enum l2tp_l2spec_type */ | 100 | L2TP_ATTR_L2SPEC_LEN, /* u8 (not used) */ |
| 101 | L2TP_ATTR_PROTO_VERSION, /* u8 */ | 101 | L2TP_ATTR_PROTO_VERSION, /* u8 */ |
| 102 | L2TP_ATTR_IFNAME, /* string */ | 102 | L2TP_ATTR_IFNAME, /* string */ |
| 103 | L2TP_ATTR_CONN_ID, /* u32 */ | 103 | L2TP_ATTR_CONN_ID, /* u32 */ |
| @@ -47,12 +47,14 @@ · 46 unmodified lines | |||
| 47 | #define LIRC_MODE_RAW 0x00000001 | 47 | #define LIRC_MODE_RAW 0x00000001 |
| 48 | #define LIRC_MODE_PULSE 0x00000002 | 48 | #define LIRC_MODE_PULSE 0x00000002 |
| 49 | #define LIRC_MODE_MODE2 0x00000004 | 49 | #define LIRC_MODE_MODE2 0x00000004 |
| 50 | #define LIRC_MODE_SCANCODE 0x00000008 | ||
| 50 | #define LIRC_MODE_LIRCCODE 0x00000010 | 51 | #define LIRC_MODE_LIRCCODE 0x00000010 |
| 51 | 52 | ||
| 52 | 53 | ||
| 53 | #define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW) | 54 | #define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW) |
| 54 | #define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE) | 55 | #define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE) |
| 55 | #define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2) | 56 | #define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2) |
| 57 | #define LIRC_CAN_SEND_SCANCODE LIRC_MODE2SEND(LIRC_MODE_SCANCODE) | ||
| 56 | #define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE) | 58 | #define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE) |
| 57 | 59 | ||
| 58 | #define LIRC_CAN_SEND_MASK 0x0000003f | 60 | #define LIRC_CAN_SEND_MASK 0x0000003f |
| @@ -64,6 +66,7 @@ · 5 unmodified lines | |||
| 64 | #define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW) | 66 | #define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW) |
| 65 | #define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE) | 67 | #define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE) |
| 66 | #define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2) | 68 | #define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2) |
| 69 | #define LIRC_CAN_REC_SCANCODE LIRC_MODE2REC(LIRC_MODE_SCANCODE) | ||
| 67 | #define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE) | 70 | #define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE) |
| 68 | 71 | ||
| 69 | #define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK) | 72 | #define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK) |
| @@ -131,4 +134,83 @@ · 61 unmodified lines | |||
| 131 | 134 | ||
| 132 | #define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32) | 135 | #define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x00000023, __u32) |
| 133 | 136 | ||
| 137 | /* | ||
| 138 | * struct lirc_scancode - decoded scancode with protocol for use with | ||
| 139 | * LIRC_MODE_SCANCODE | ||
| 140 | * | ||
| 141 | * @timestamp: Timestamp in nanoseconds using CLOCK_MONOTONIC when IR | ||
| 142 | * was decoded. | ||
| 143 | * @flags: should be 0 for transmit. When receiving scancodes, | ||
| 144 | * LIRC_SCANCODE_FLAG_TOGGLE or LIRC_SCANCODE_FLAG_REPEAT can be set | ||
| 145 | * depending on the protocol | ||
| 146 | * @rc_proto: see enum rc_proto | ||
| 147 | * @keycode: the translated keycode. Set to 0 for transmit. | ||
| 148 | * @scancode: the scancode received or to be sent | ||
| 149 | */ | ||
| 150 | struct lirc_scancode { | ||
| 151 | __u64 timestamp; | ||
| 152 | __u16 flags; | ||
| 153 | __u16 rc_proto; | ||
| 154 | __u32 keycode; | ||
| 155 | __u64 scancode; | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* Set if the toggle bit of rc-5 or rc-6 is enabled */ | ||
| 159 | #define LIRC_SCANCODE_FLAG_TOGGLE 1 | ||
| 160 | /* Set if this is a nec or sanyo repeat */ | ||
| 161 | #define LIRC_SCANCODE_FLAG_REPEAT 2 | ||
| 162 | |||
| 163 | /** | ||
| 164 | * enum rc_proto - the Remote Controller protocol | ||
| 165 | * | ||
| 166 | * @RC_PROTO_UNKNOWN: Protocol not known | ||
| 167 | * @RC_PROTO_OTHER: Protocol known but proprietary | ||
| 168 | * @RC_PROTO_RC5: Philips RC5 protocol | ||
| 169 | * @RC_PROTO_RC5X_20: Philips RC5x 20 bit protocol | ||
| 170 | * @RC_PROTO_RC5_SZ: StreamZap variant of RC5 | ||
| 171 | * @RC_PROTO_JVC: JVC protocol | ||
| 172 | * @RC_PROTO_SONY12: Sony 12 bit protocol | ||
| 173 | * @RC_PROTO_SONY15: Sony 15 bit protocol | ||
| 174 | * @RC_PROTO_SONY20: Sony 20 bit protocol | ||
| 175 | * @RC_PROTO_NEC: NEC protocol | ||
| 176 | * @RC_PROTO_NECX: Extended NEC protocol | ||
| 177 | * @RC_PROTO_NEC32: NEC 32 bit protocol | ||
| 178 | * @RC_PROTO_SANYO: Sanyo protocol | ||
| 179 | * @RC_PROTO_MCIR2_KBD: RC6-ish MCE keyboard | ||
| 180 | * @RC_PROTO_MCIR2_MSE: RC6-ish MCE mouse | ||
| 181 | * @RC_PROTO_RC6_0: Philips RC6-0-16 protocol | ||
| 182 | * @RC_PROTO_RC6_6A_20: Philips RC6-6A-20 protocol | ||
| 183 | * @RC_PROTO_RC6_6A_24: Philips RC6-6A-24 protocol | ||
| 184 | * @RC_PROTO_RC6_6A_32: Philips RC6-6A-32 protocol | ||
| 185 | * @RC_PROTO_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocol | ||
| 186 | * @RC_PROTO_SHARP: Sharp protocol | ||
| 187 | * @RC_PROTO_XMP: XMP protocol | ||
| 188 | * @RC_PROTO_CEC: CEC protocol | ||
| 189 | */ | ||
| 190 | enum rc_proto { | ||
| 191 | RC_PROTO_UNKNOWN = 0, | ||
| 192 | RC_PROTO_OTHER = 1, | ||
| 193 | RC_PROTO_RC5 = 2, | ||
| 194 | RC_PROTO_RC5X_20 = 3, | ||
| 195 | RC_PROTO_RC5_SZ = 4, | ||
| 196 | RC_PROTO_JVC = 5, | ||
| 197 | RC_PROTO_SONY12 = 6, | ||
| 198 | RC_PROTO_SONY15 = 7, | ||
| 199 | RC_PROTO_SONY20 = 8, | ||
| 200 | RC_PROTO_NEC = 9, | ||
| 201 | RC_PROTO_NECX = 10, | ||
| 202 | RC_PROTO_NEC32 = 11, | ||
| 203 | RC_PROTO_SANYO = 12, | ||
| 204 | RC_PROTO_MCIR2_KBD = 13, | ||
| 205 | RC_PROTO_MCIR2_MSE = 14, | ||
| 206 | RC_PROTO_RC6_0 = 15, | ||
| 207 | RC_PROTO_RC6_6A_20 = 16, | ||
| 208 | RC_PROTO_RC6_6A_24 = 17, | ||
| 209 | RC_PROTO_RC6_6A_32 = 18, | ||
| 210 | RC_PROTO_RC6_MCE = 19, | ||
| 211 | RC_PROTO_SHARP = 20, | ||
| 212 | RC_PROTO_XMP = 21, | ||
| 213 | RC_PROTO_CEC = 22, | ||
| 214 | }; | ||
| 215 | |||
| 134 | #endif | 216 | #endif |
| @@ -8,6 +8,8 @@ · 7 unmodified lines | |||
| 8 | #ifndef _UAPI_LINUX_LP_H | 8 | #ifndef _UAPI_LINUX_LP_H |
| 9 | #define _UAPI_LINUX_LP_H | 9 | #define _UAPI_LINUX_LP_H |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/ioctl.h> | ||
| 11 | 13 | ||
| 12 | /* | 14 | /* |
| 13 | * Per POSIX guidelines, this module reserves the LP and lp prefixes | 15 | * Per POSIX guidelines, this module reserves the LP and lp prefixes |
| @@ -88,7 +90,15 @@ · 74 unmodified lines | |||
| 88 | #define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */ | 90 | #define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */ |
| 89 | #endif | 91 | #endif |
| 90 | #define LPGETFLAGS 0x060e /* get status flags */ | 92 | #define LPGETFLAGS 0x060e /* get status flags */ |
| 91 | #define LPSETTIMEOUT 0x060f /* set parport timeout */ | 93 | #define LPSETTIMEOUT_OLD 0x060f /* set parport timeout */ |
| 94 | #define LPSETTIMEOUT_NEW \ | ||
| 95 | _IOW(0x6, 0xf, __s64[2]) /* set parport timeout */ | ||
| 96 | #if __BITS_PER_LONG == 64 | ||
| 97 | #define LPSETTIMEOUT LPSETTIMEOUT_OLD | ||
| 98 | #else | ||
| 99 | #define LPSETTIMEOUT (sizeof(time_t) > sizeof(__kernel_long_t) ? \ | ||
| 100 | LPSETTIMEOUT_NEW : LPSETTIMEOUT_OLD) | ||
| 101 | #endif | ||
| 92 | 102 | ||
| 93 | /* timeout for printk'ing a timeout, in jiffies (100ths of a second). | 103 | /* timeout for printk'ing a timeout, in jiffies (100ths of a second). |
| 94 | This is also used for re-checking error conditions if LP_ABORT is | 104 | This is also used for re-checking error conditions if LP_ABORT is |
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | * enum membarrier_cmd - membarrier system call command | 31 | * enum membarrier_cmd - membarrier system call command |
| 32 | * @MEMBARRIER_CMD_QUERY: Query the set of supported commands. It returns | 32 | * @MEMBARRIER_CMD_QUERY: Query the set of supported commands. It returns |
| 33 | * a bitmask of valid commands. | 33 | * a bitmask of valid commands. |
| 34 | * @MEMBARRIER_CMD_SHARED: Execute a memory barrier on all running threads. | 34 | * @MEMBARRIER_CMD_GLOBAL: Execute a memory barrier on all running threads. |
| 35 | * Upon return from system call, the caller thread | 35 | * Upon return from system call, the caller thread |
| 36 | * is ensured that all running threads have passed | 36 | * is ensured that all running threads have passed |
| 37 | * through a state where all memory accesses to | 37 | * through a state where all memory accesses to |
| @@ -40,6 +40,28 @@ · 2 unmodified lines | |||
| 40 | * (non-running threads are de facto in such a | 40 | * (non-running threads are de facto in such a |
| 41 | * state). This covers threads from all processes | 41 | * state). This covers threads from all processes |
| 42 | * running on the system. This command returns 0. | 42 | * running on the system. This command returns 0. |
| 43 | * @MEMBARRIER_CMD_GLOBAL_EXPEDITED: | ||
| 44 | * Execute a memory barrier on all running threads | ||
| 45 | * of all processes which previously registered | ||
| 46 | * with MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED. | ||
| 47 | * Upon return from system call, the caller thread | ||
| 48 | * is ensured that all running threads have passed | ||
| 49 | * through a state where all memory accesses to | ||
| 50 | * user-space addresses match program order between | ||
| 51 | * entry to and return from the system call | ||
| 52 | * (non-running threads are de facto in such a | ||
| 53 | * state). This only covers threads from processes | ||
| 54 | * which registered with | ||
| 55 | * MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED. | ||
| 56 | * This command returns 0. Given that | ||
| 57 | * registration is about the intent to receive | ||
| 58 | * the barriers, it is valid to invoke | ||
| 59 | * MEMBARRIER_CMD_GLOBAL_EXPEDITED from a | ||
| 60 | * non-registered process. | ||
| 61 | * @MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: | ||
| 62 | * Register the process intent to receive | ||
| 63 | * MEMBARRIER_CMD_GLOBAL_EXPEDITED memory | ||
| 64 | * barriers. Always returns 0. | ||
| 43 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED: | 65 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED: |
| 44 | * Execute a memory barrier on each running | 66 | * Execute a memory barrier on each running |
| 45 | * thread belonging to the same process as the current | 67 | * thread belonging to the same process as the current |
| @@ -51,7 +73,7 @@ · 5 unmodified lines | |||
| 51 | * to and return from the system call | 73 | * to and return from the system call |
| 52 | * (non-running threads are de facto in such a | 74 | * (non-running threads are de facto in such a |
| 53 | * state). This only covers threads from the | 75 | * state). This only covers threads from the |
| 54 | * same processes as the caller thread. This | 76 | * same process as the caller thread. This |
| 55 | * command returns 0 on success. The | 77 | * command returns 0 on success. The |
| 56 | * "expedited" commands complete faster than | 78 | * "expedited" commands complete faster than |
| 57 | * the non-expedited ones, they never block, | 79 | * the non-expedited ones, they never block, |
| @@ -64,18 +86,54 @@ · 6 unmodified lines | |||
| 64 | * Register the process intent to use | 86 | * Register the process intent to use |
| 65 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED. Always | 87 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED. Always |
| 66 | * returns 0. | 88 | * returns 0. |
| 89 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: | ||
| 90 | * In addition to provide memory ordering | ||
| 91 | * guarantees described in | ||
| 92 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED, ensure | ||
| 93 | * the caller thread, upon return from system | ||
| 94 | * call, that all its running threads siblings | ||
| 95 | * have executed a core serializing | ||
| 96 | * instruction. (architectures are required to | ||
| 97 | * guarantee that non-running threads issue | ||
| 98 | * core serializing instructions before they | ||
| 99 | * resume user-space execution). This only | ||
| 100 | * covers threads from the same process as the | ||
| 101 | * caller thread. This command returns 0 on | ||
| 102 | * success. The "expedited" commands complete | ||
| 103 | * faster than the non-expedited ones, they | ||
| 104 | * never block, but have the downside of | ||
| 105 | * causing extra overhead. If this command is | ||
| 106 | * not implemented by an architecture, -EINVAL | ||
| 107 | * is returned. A process needs to register its | ||
| 108 | * intent to use the private expedited sync | ||
| 109 | * core command prior to using it, otherwise | ||
| 110 | * this command returns -EPERM. | ||
| 111 | * @MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: | ||
| 112 | * Register the process intent to use | ||
| 113 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE. | ||
| 114 | * If this command is not implemented by an | ||
| 115 | * architecture, -EINVAL is returned. | ||
| 116 | * Returns 0 on success. | ||
| 117 | * @MEMBARRIER_CMD_SHARED: | ||
| 118 | * Alias to MEMBARRIER_CMD_GLOBAL. Provided for | ||
| 119 | * header backward compatibility. | ||
| 67 | * | 120 | * |
| 68 | * Command to be passed to the membarrier system call. The commands need to | 121 | * Command to be passed to the membarrier system call. The commands need to |
| 69 | * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to | 122 | * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to |
| 70 | * the value 0. | 123 | * the value 0. |
| 71 | */ | 124 | */ |
| 72 | enum membarrier_cmd { | 125 | enum membarrier_cmd { |
| 73 | MEMBARRIER_CMD_QUERY = 0, | 126 | MEMBARRIER_CMD_QUERY = 0, |
| 74 | MEMBARRIER_CMD_SHARED = (1 << 0), | 127 | MEMBARRIER_CMD_GLOBAL = (1 << 0), |
| 75 | /* reserved for MEMBARRIER_CMD_SHARED_EXPEDITED (1 << 1) */ | 128 | MEMBARRIER_CMD_GLOBAL_EXPEDITED = (1 << 1), |
| 76 | /* reserved for MEMBARRIER_CMD_PRIVATE (1 << 2) */ | 129 | MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED = (1 << 2), |
| 77 | MEMBARRIER_CMD_PRIVATE_EXPEDITED = (1 << 3), | 130 | MEMBARRIER_CMD_PRIVATE_EXPEDITED = (1 << 3), |
| 78 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4), | 131 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4), |
| 132 | MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 5), | ||
| 133 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6), | ||
| 134 | |||
| 135 | /* Alias for header backward compatibility. */ | ||
| 136 | MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL, | ||
| 79 | }; | 137 | }; |
| 80 | 138 | ||
| 81 | #endif /* _UAPI_LINUX_MEMBARRIER_H */ | 139 | #endif /* _UAPI_LINUX_MEMBARRIER_H */ |
| @@ -15,54 +15,6 @@ · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | 17 | ||
| 18 | struct nd_cmd_smart { | ||
| 19 | __u32 status; | ||
| 20 | __u8 data[128]; | ||
| 21 | } __packed; | ||
| 22 | |||
| 23 | #define ND_SMART_HEALTH_VALID (1 << 0) | ||
| 24 | #define ND_SMART_SPARES_VALID (1 << 1) | ||
| 25 | #define ND_SMART_USED_VALID (1 << 2) | ||
| 26 | #define ND_SMART_TEMP_VALID (1 << 3) | ||
| 27 | #define ND_SMART_CTEMP_VALID (1 << 4) | ||
| 28 | #define ND_SMART_ALARM_VALID (1 << 9) | ||
| 29 | #define ND_SMART_SHUTDOWN_VALID (1 << 10) | ||
| 30 | #define ND_SMART_VENDOR_VALID (1 << 11) | ||
| 31 | #define ND_SMART_SPARE_TRIP (1 << 0) | ||
| 32 | #define ND_SMART_TEMP_TRIP (1 << 1) | ||
| 33 | #define ND_SMART_CTEMP_TRIP (1 << 2) | ||
| 34 | #define ND_SMART_NON_CRITICAL_HEALTH (1 << 0) | ||
| 35 | #define ND_SMART_CRITICAL_HEALTH (1 << 1) | ||
| 36 | #define ND_SMART_FATAL_HEALTH (1 << 2) | ||
| 37 | |||
| 38 | struct nd_smart_payload { | ||
| 39 | __u32 flags; | ||
| 40 | __u8 reserved0[4]; | ||
| 41 | __u8 health; | ||
| 42 | __u8 spares; | ||
| 43 | __u8 life_used; | ||
| 44 | __u8 alarm_flags; | ||
| 45 | __u16 temperature; | ||
| 46 | __u16 ctrl_temperature; | ||
| 47 | __u8 reserved1[15]; | ||
| 48 | __u8 shutdown_state; | ||
| 49 | __u32 vendor_size; | ||
| 50 | __u8 vendor_data[92]; | ||
| 51 | } __packed; | ||
| 52 | |||
| 53 | struct nd_cmd_smart_threshold { | ||
| 54 | __u32 status; | ||
| 55 | __u8 data[8]; | ||
| 56 | } __packed; | ||
| 57 | |||
| 58 | struct nd_smart_threshold_payload { | ||
| 59 | __u8 alarm_control; | ||
| 60 | __u8 reserved0; | ||
| 61 | __u16 temperature; | ||
| 62 | __u8 spares; | ||
| 63 | __u8 reserved[3]; | ||
| 64 | } __packed; | ||
| 65 | |||
| 66 | struct nd_cmd_dimm_flags { | 18 | struct nd_cmd_dimm_flags { |
| 67 | __u32 status; | 19 | __u32 status; |
| 68 | __u32 flags; | 20 | __u32 flags; |
| @@ -211,12 +163,6 @@ static inline const char *nvdimm_cmd_name(unsigned cmd) · 142 unmodified lines | |||
| 211 | 163 | ||
| 212 | #define ND_IOCTL 'N' | 164 | #define ND_IOCTL 'N' |
| 213 | 165 | ||
| 214 | #define ND_IOCTL_SMART _IOWR(ND_IOCTL, ND_CMD_SMART,\ | ||
| 215 | struct nd_cmd_smart) | ||
| 216 | |||
| 217 | #define ND_IOCTL_SMART_THRESHOLD _IOWR(ND_IOCTL, ND_CMD_SMART_THRESHOLD,\ | ||
| 218 | struct nd_cmd_smart_threshold) | ||
| 219 | |||
| 220 | #define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS,\ | 166 | #define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS,\ |
| 221 | struct nd_cmd_dimm_flags) | 167 | struct nd_cmd_dimm_flags) |
| 222 | 168 | ||
| @@ -263,7 +209,7 @@ enum nd_driver_flags { · 40 unmodified lines | |||
| 263 | }; | 209 | }; |
| 264 | 210 | ||
| 265 | enum { | 211 | enum { |
| 266 | ND_MIN_NAMESPACE_SIZE = 0x00400000, | 212 | ND_MIN_NAMESPACE_SIZE = PAGE_SIZE, |
| 267 | }; | 213 | }; |
| 268 | 214 | ||
| 269 | enum ars_masks { | 215 | enum ars_masks { |
| @@ -101,12 +101,16 @@ enum ip_conntrack_status { · 100 unmodified lines | |||
| 101 | IPS_HELPER_BIT = 13, | 101 | IPS_HELPER_BIT = 13, |
| 102 | IPS_HELPER = (1 << IPS_HELPER_BIT), | 102 | IPS_HELPER = (1 << IPS_HELPER_BIT), |
| 103 | 103 | ||
| 104 | /* Conntrack has been offloaded to flow table. */ | ||
| 105 | IPS_OFFLOAD_BIT = 14, | ||
| 106 | IPS_OFFLOAD = (1 << IPS_OFFLOAD_BIT), | ||
| 107 | |||
| 104 | /* Be careful here, modifying these bits can make things messy, | 108 | /* Be careful here, modifying these bits can make things messy, |
| 105 | * so don't let users modify them directly. | 109 | * so don't let users modify them directly. |
| 106 | */ | 110 | */ |
| 107 | IPS_UNCHANGEABLE_MASK = (IPS_NAT_DONE_MASK | IPS_NAT_MASK | | 111 | IPS_UNCHANGEABLE_MASK = (IPS_NAT_DONE_MASK | IPS_NAT_MASK | |
| 108 | IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING | | 112 | IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING | |
| 109 | IPS_SEQ_ADJUST | IPS_TEMPLATE), | 113 | IPS_SEQ_ADJUST | IPS_TEMPLATE | IPS_OFFLOAD), |
| 110 | 114 | ||
| 111 | __IPS_MAX_BIT = 14, | 115 | __IPS_MAX_BIT = 14, |
| 112 | }; | 116 | }; |
| @@ -92,6 +92,9 @@ enum nft_verdicts { · 91 unmodified lines | |||
| 92 | * @NFT_MSG_GETOBJ: get a stateful object (enum nft_obj_attributes) | 92 | * @NFT_MSG_GETOBJ: get a stateful object (enum nft_obj_attributes) |
| 93 | * @NFT_MSG_DELOBJ: delete a stateful object (enum nft_obj_attributes) | 93 | * @NFT_MSG_DELOBJ: delete a stateful object (enum nft_obj_attributes) |
| 94 | * @NFT_MSG_GETOBJ_RESET: get and reset a stateful object (enum nft_obj_attributes) | 94 | * @NFT_MSG_GETOBJ_RESET: get and reset a stateful object (enum nft_obj_attributes) |
| 95 | * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes) | ||
| 96 | * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes) | ||
| 97 | * @NFT_MSG_DELFLOWTABLE: delete flow table (enum nft_flowtable_attributes) | ||
| 95 | */ | 98 | */ |
| 96 | enum nf_tables_msg_types { | 99 | enum nf_tables_msg_types { |
| 97 | NFT_MSG_NEWTABLE, | 100 | NFT_MSG_NEWTABLE, |
| @@ -116,6 +119,9 @@ enum nf_tables_msg_types { · 18 unmodified lines | |||
| 116 | NFT_MSG_GETOBJ, | 119 | NFT_MSG_GETOBJ, |
| 117 | NFT_MSG_DELOBJ, | 120 | NFT_MSG_DELOBJ, |
| 118 | NFT_MSG_GETOBJ_RESET, | 121 | NFT_MSG_GETOBJ_RESET, |
| 122 | NFT_MSG_NEWFLOWTABLE, | ||
| 123 | NFT_MSG_GETFLOWTABLE, | ||
| 124 | NFT_MSG_DELFLOWTABLE, | ||
| 119 | NFT_MSG_MAX, | 125 | NFT_MSG_MAX, |
| 120 | }; | 126 | }; |
| 121 | 127 | ||
| @@ -168,6 +174,8 @@ enum nft_table_attributes { · 46 unmodified lines | |||
| 168 | NFTA_TABLE_NAME, | 174 | NFTA_TABLE_NAME, |
| 169 | NFTA_TABLE_FLAGS, | 175 | NFTA_TABLE_FLAGS, |
| 170 | NFTA_TABLE_USE, | 176 | NFTA_TABLE_USE, |
| 177 | NFTA_TABLE_HANDLE, | ||
| 178 | NFTA_TABLE_PAD, | ||
| 171 | __NFTA_TABLE_MAX | 179 | __NFTA_TABLE_MAX |
| 172 | }; | 180 | }; |
| 173 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) | 181 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) |
| @@ -311,6 +319,7 @@ enum nft_set_desc_attributes { · 137 unmodified lines | |||
| 311 | * @NFTA_SET_GC_INTERVAL: garbage collection interval (NLA_U32) | 319 | * @NFTA_SET_GC_INTERVAL: garbage collection interval (NLA_U32) |
| 312 | * @NFTA_SET_USERDATA: user data (NLA_BINARY) | 320 | * @NFTA_SET_USERDATA: user data (NLA_BINARY) |
| 313 | * @NFTA_SET_OBJ_TYPE: stateful object type (NLA_U32: NFT_OBJECT_*) | 321 | * @NFTA_SET_OBJ_TYPE: stateful object type (NLA_U32: NFT_OBJECT_*) |
| 322 | * @NFTA_SET_HANDLE: set handle (NLA_U64) | ||
| 314 | */ | 323 | */ |
| 315 | enum nft_set_attributes { | 324 | enum nft_set_attributes { |
| 316 | NFTA_SET_UNSPEC, | 325 | NFTA_SET_UNSPEC, |
| @@ -329,6 +338,7 @@ enum nft_set_attributes { · 12 unmodified lines | |||
| 329 | NFTA_SET_USERDATA, | 338 | NFTA_SET_USERDATA, |
| 330 | NFTA_SET_PAD, | 339 | NFTA_SET_PAD, |
| 331 | NFTA_SET_OBJ_TYPE, | 340 | NFTA_SET_OBJ_TYPE, |
| 341 | NFTA_SET_HANDLE, | ||
| 332 | __NFTA_SET_MAX | 342 | __NFTA_SET_MAX |
| 333 | }; | 343 | }; |
| 334 | #define NFTA_SET_MAX (__NFTA_SET_MAX - 1) | 344 | #define NFTA_SET_MAX (__NFTA_SET_MAX - 1) |
| @@ -777,6 +787,7 @@ enum nft_exthdr_attributes { · 442 unmodified lines | |||
| 777 | * @NFT_META_OIFGROUP: packet output interface group | 787 | * @NFT_META_OIFGROUP: packet output interface group |
| 778 | * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid) | 788 | * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid) |
| 779 | * @NFT_META_PRANDOM: a 32bit pseudo-random number | 789 | * @NFT_META_PRANDOM: a 32bit pseudo-random number |
| 790 | * @NFT_META_SECPATH: boolean, secpath_exists (!!skb->sp) | ||
| 780 | */ | 791 | */ |
| 781 | enum nft_meta_keys { | 792 | enum nft_meta_keys { |
| 782 | NFT_META_LEN, | 793 | NFT_META_LEN, |
| @@ -804,6 +815,7 @@ enum nft_meta_keys { · 21 unmodified lines | |||
| 804 | NFT_META_OIFGROUP, | 815 | NFT_META_OIFGROUP, |
| 805 | NFT_META_CGROUP, | 816 | NFT_META_CGROUP, |
| 806 | NFT_META_PRANDOM, | 817 | NFT_META_PRANDOM, |
| 818 | NFT_META_SECPATH, | ||
| 807 | }; | 819 | }; |
| 808 | 820 | ||
| 809 | /** | 821 | /** |
| @@ -949,6 +961,17 @@ enum nft_ct_attributes { · 139 unmodified lines | |||
| 949 | }; | 961 | }; |
| 950 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) | 962 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) |
| 951 | 963 | ||
| 964 | /** | ||
| 965 | * enum nft_flow_attributes - ct offload expression attributes | ||
| 966 | * @NFTA_FLOW_TABLE_NAME: flow table name (NLA_STRING) | ||
| 967 | */ | ||
| 968 | enum nft_offload_attributes { | ||
| 969 | NFTA_FLOW_UNSPEC, | ||
| 970 | NFTA_FLOW_TABLE_NAME, | ||
| 971 | __NFTA_FLOW_MAX, | ||
| 972 | }; | ||
| 973 | #define NFTA_FLOW_MAX (__NFTA_FLOW_MAX - 1) | ||
| 974 | |||
| 952 | enum nft_limit_type { | 975 | enum nft_limit_type { |
| 953 | NFT_LIMIT_PKTS, | 976 | NFT_LIMIT_PKTS, |
| 954 | NFT_LIMIT_PKT_BYTES | 977 | NFT_LIMIT_PKT_BYTES |
| @@ -1295,6 +1318,7 @@ enum nft_ct_helper_attributes { · 340 unmodified lines | |||
| 1295 | * @NFTA_OBJ_TYPE: stateful object type (NLA_U32) | 1318 | * @NFTA_OBJ_TYPE: stateful object type (NLA_U32) |
| 1296 | * @NFTA_OBJ_DATA: stateful object data (NLA_NESTED) | 1319 | * @NFTA_OBJ_DATA: stateful object data (NLA_NESTED) |
| 1297 | * @NFTA_OBJ_USE: number of references to this expression (NLA_U32) | 1320 | * @NFTA_OBJ_USE: number of references to this expression (NLA_U32) |
| 1321 | * @NFTA_OBJ_HANDLE: object handle (NLA_U64) | ||
| 1298 | */ | 1322 | */ |
| 1299 | enum nft_object_attributes { | 1323 | enum nft_object_attributes { |
| 1300 | NFTA_OBJ_UNSPEC, | 1324 | NFTA_OBJ_UNSPEC, |
| @@ -1303,10 +1327,62 @@ enum nft_object_attributes { · 2 unmodified lines | |||
| 1303 | NFTA_OBJ_TYPE, | 1327 | NFTA_OBJ_TYPE, |
| 1304 | NFTA_OBJ_DATA, | 1328 | NFTA_OBJ_DATA, |
| 1305 | NFTA_OBJ_USE, | 1329 | NFTA_OBJ_USE, |
| 1330 | NFTA_OBJ_HANDLE, | ||
| 1331 | NFTA_OBJ_PAD, | ||
| 1306 | __NFTA_OBJ_MAX | 1332 | __NFTA_OBJ_MAX |
| 1307 | }; | 1333 | }; |
| 1308 | #define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1) | 1334 | #define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1) |
| 1309 | 1335 | ||
| 1336 | /** | ||
| 1337 | * enum nft_flowtable_attributes - nf_tables flow table netlink attributes | ||
| 1338 | * | ||
| 1339 | * @NFTA_FLOWTABLE_TABLE: name of the table containing the expression (NLA_STRING) | ||
| 1340 | * @NFTA_FLOWTABLE_NAME: name of this flow table (NLA_STRING) | ||
| 1341 | * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32) | ||
| 1342 | * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32) | ||
| 1343 | * @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64) | ||
| 1344 | */ | ||
| 1345 | enum nft_flowtable_attributes { | ||
| 1346 | NFTA_FLOWTABLE_UNSPEC, | ||
| 1347 | NFTA_FLOWTABLE_TABLE, | ||
| 1348 | NFTA_FLOWTABLE_NAME, | ||
| 1349 | NFTA_FLOWTABLE_HOOK, | ||
| 1350 | NFTA_FLOWTABLE_USE, | ||
| 1351 | NFTA_FLOWTABLE_HANDLE, | ||
| 1352 | NFTA_FLOWTABLE_PAD, | ||
| 1353 | __NFTA_FLOWTABLE_MAX | ||
| 1354 | }; | ||
| 1355 | #define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1) | ||
| 1356 | |||
| 1357 | /** | ||
| 1358 | * enum nft_flowtable_hook_attributes - nf_tables flow table hook netlink attributes | ||
| 1359 | * | ||
| 1360 | * @NFTA_FLOWTABLE_HOOK_NUM: netfilter hook number (NLA_U32) | ||
| 1361 | * @NFTA_FLOWTABLE_HOOK_PRIORITY: netfilter hook priority (NLA_U32) | ||
| 1362 | * @NFTA_FLOWTABLE_HOOK_DEVS: input devices this flow table is bound to (NLA_NESTED) | ||
| 1363 | */ | ||
| 1364 | enum nft_flowtable_hook_attributes { | ||
| 1365 | NFTA_FLOWTABLE_HOOK_UNSPEC, | ||
| 1366 | NFTA_FLOWTABLE_HOOK_NUM, | ||
| 1367 | NFTA_FLOWTABLE_HOOK_PRIORITY, | ||
| 1368 | NFTA_FLOWTABLE_HOOK_DEVS, | ||
| 1369 | __NFTA_FLOWTABLE_HOOK_MAX | ||
| 1370 | }; | ||
| 1371 | #define NFTA_FLOWTABLE_HOOK_MAX (__NFTA_FLOWTABLE_HOOK_MAX - 1) | ||
| 1372 | |||
| 1373 | /** | ||
| 1374 | * enum nft_device_attributes - nf_tables device netlink attributes | ||
| 1375 | * | ||
| 1376 | * @NFTA_DEVICE_NAME: name of this device (NLA_STRING) | ||
| 1377 | */ | ||
| 1378 | enum nft_devices_attributes { | ||
| 1379 | NFTA_DEVICE_UNSPEC, | ||
| 1380 | NFTA_DEVICE_NAME, | ||
| 1381 | __NFTA_DEVICE_MAX | ||
| 1382 | }; | ||
| 1383 | #define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1) | ||
| 1384 | |||
| 1385 | |||
| 1310 | /** | 1386 | /** |
| 1311 | * enum nft_trace_attributes - nf_tables trace netlink attributes | 1387 | * enum nft_trace_attributes - nf_tables trace netlink attributes |
| 1312 | * | 1388 | * |
| @@ -27,7 +27,7 @@ struct xt_connlimit_info { · 26 unmodified lines | |||
| 27 | __u32 flags; | 27 | __u32 flags; |
| 28 | 28 | ||
| 29 | /* Used internally by the kernel */ | 29 | /* Used internally by the kernel */ |
| 30 | struct xt_connlimit_data *data __attribute__((aligned(8))); | 30 | struct nf_conncount_data *data __attribute__((aligned(8))); |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | #endif /* _XT_CONNLIMIT_H */ | 33 | #endif /* _XT_CONNLIMIT_H */ |
| @@ -15,6 +15,9 @@ · 14 unmodified lines | |||
| 15 | #define NF_ARP_IN 0 | 15 | #define NF_ARP_IN 0 |
| 16 | #define NF_ARP_OUT 1 | 16 | #define NF_ARP_OUT 1 |
| 17 | #define NF_ARP_FORWARD 2 | 17 | #define NF_ARP_FORWARD 2 |
| 18 | |||
| 19 | #ifndef __KERNEL__ | ||
| 18 | #define NF_ARP_NUMHOOKS 3 | 20 | #define NF_ARP_NUMHOOKS 3 |
| 21 | #endif | ||
| 19 | 22 | ||
| 20 | #endif /* __LINUX_ARP_NETFILTER_H */ | 23 | #endif /* __LINUX_ARP_NETFILTER_H */ |
| @@ -24,6 +24,9 @@ · 23 unmodified lines | |||
| 24 | #define NFC_DN_IF_IN 0x0004 | 24 | #define NFC_DN_IF_IN 0x0004 |
| 25 | /* Output device. */ | 25 | /* Output device. */ |
| 26 | #define NFC_DN_IF_OUT 0x0008 | 26 | #define NFC_DN_IF_OUT 0x0008 |
| 27 | |||
| 28 | /* kernel define is in netfilter_defs.h */ | ||
| 29 | #define NF_DN_NUMHOOKS 7 | ||
| 27 | #endif /* ! __KERNEL__ */ | 30 | #endif /* ! __KERNEL__ */ |
| 28 | 31 | ||
| 29 | /* DECnet Hooks */ | 32 | /* DECnet Hooks */ |
| @@ -41,7 +44,6 @@ · 11 unmodified lines | |||
| 41 | #define NF_DN_HELLO 5 | 44 | #define NF_DN_HELLO 5 |
| 42 | /* Input Routing Packets */ | 45 | /* Input Routing Packets */ |
| 43 | #define NF_DN_ROUTE 6 | 46 | #define NF_DN_ROUTE 6 |
| 44 | #define NF_DN_NUMHOOKS 7 | ||
| 45 | 47 | ||
| 46 | enum nf_dn_hook_priorities { | 48 | enum nf_dn_hook_priorities { |
| 47 | NF_DN_PRI_FIRST = INT_MIN, | 49 | NF_DN_PRI_FIRST = INT_MIN, |
| @@ -57,6 +57,7 @@ · 56 unmodified lines | |||
| 57 | 57 | ||
| 58 | enum nf_ip_hook_priorities { | 58 | enum nf_ip_hook_priorities { |
| 59 | NF_IP_PRI_FIRST = INT_MIN, | 59 | NF_IP_PRI_FIRST = INT_MIN, |
| 60 | NF_IP_PRI_RAW_BEFORE_DEFRAG = -450, | ||
| 60 | NF_IP_PRI_CONNTRACK_DEFRAG = -400, | 61 | NF_IP_PRI_CONNTRACK_DEFRAG = -400, |
| 61 | NF_IP_PRI_RAW = -300, | 62 | NF_IP_PRI_RAW = -300, |
| 62 | NF_IP_PRI_SELINUX_FIRST = -225, | 63 | NF_IP_PRI_SELINUX_FIRST = -225, |
| @@ -62,6 +62,7 @@ · 61 unmodified lines | |||
| 62 | 62 | ||
| 63 | enum nf_ip6_hook_priorities { | 63 | enum nf_ip6_hook_priorities { |
| 64 | NF_IP6_PRI_FIRST = INT_MIN, | 64 | NF_IP6_PRI_FIRST = INT_MIN, |
| 65 | NF_IP6_PRI_RAW_BEFORE_DEFRAG = -450, | ||
| 65 | NF_IP6_PRI_CONNTRACK_DEFRAG = -400, | 66 | NF_IP6_PRI_CONNTRACK_DEFRAG = -400, |
| 66 | NF_IP6_PRI_RAW = -300, | 67 | NF_IP6_PRI_RAW = -300, |
| 67 | NF_IP6_PRI_SELINUX_FIRST = -225, | 68 | NF_IP6_PRI_SELINUX_FIRST = -225, |
| @@ -0,0 +1,57 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
| 2 | #ifndef _IP6T_SRH_H | ||
| 3 | #define _IP6T_SRH_H | ||
| 4 | |||
| 5 | #include <linux/types.h> | ||
| 6 | #include <linux/netfilter.h> | ||
| 7 | |||
| 8 | /* Values for "mt_flags" field in struct ip6t_srh */ | ||
| 9 | #define IP6T_SRH_NEXTHDR 0x0001 | ||
| 10 | #define IP6T_SRH_LEN_EQ 0x0002 | ||
| 11 | #define IP6T_SRH_LEN_GT 0x0004 | ||
| 12 | #define IP6T_SRH_LEN_LT 0x0008 | ||
| 13 | #define IP6T_SRH_SEGS_EQ 0x0010 | ||
| 14 | #define IP6T_SRH_SEGS_GT 0x0020 | ||
| 15 | #define IP6T_SRH_SEGS_LT 0x0040 | ||
| 16 | #define IP6T_SRH_LAST_EQ 0x0080 | ||
| 17 | #define IP6T_SRH_LAST_GT 0x0100 | ||
| 18 | #define IP6T_SRH_LAST_LT 0x0200 | ||
| 19 | #define IP6T_SRH_TAG 0x0400 | ||
| 20 | #define IP6T_SRH_MASK 0x07FF | ||
| 21 | |||
| 22 | /* Values for "mt_invflags" field in struct ip6t_srh */ | ||
| 23 | #define IP6T_SRH_INV_NEXTHDR 0x0001 | ||
| 24 | #define IP6T_SRH_INV_LEN_EQ 0x0002 | ||
| 25 | #define IP6T_SRH_INV_LEN_GT 0x0004 | ||
| 26 | #define IP6T_SRH_INV_LEN_LT 0x0008 | ||
| 27 | #define IP6T_SRH_INV_SEGS_EQ 0x0010 | ||
| 28 | #define IP6T_SRH_INV_SEGS_GT 0x0020 | ||
| 29 | #define IP6T_SRH_INV_SEGS_LT 0x0040 | ||
| 30 | #define IP6T_SRH_INV_LAST_EQ 0x0080 | ||
| 31 | #define IP6T_SRH_INV_LAST_GT 0x0100 | ||
| 32 | #define IP6T_SRH_INV_LAST_LT 0x0200 | ||
| 33 | #define IP6T_SRH_INV_TAG 0x0400 | ||
| 34 | #define IP6T_SRH_INV_MASK 0x07FF | ||
| 35 | |||
| 36 | /** | ||
| 37 | * struct ip6t_srh - SRH match options | ||
| 38 | * @ next_hdr: Next header field of SRH | ||
| 39 | * @ hdr_len: Extension header length field of SRH | ||
| 40 | * @ segs_left: Segments left field of SRH | ||
| 41 | * @ last_entry: Last entry field of SRH | ||
| 42 | * @ tag: Tag field of SRH | ||
| 43 | * @ mt_flags: match options | ||
| 44 | * @ mt_invflags: Invert the sense of match options | ||
| 45 | */ | ||
| 46 | |||
| 47 | struct ip6t_srh { | ||
| 48 | __u8 next_hdr; | ||
| 49 | __u8 hdr_len; | ||
| 50 | __u8 segs_left; | ||
| 51 | __u8 last_entry; | ||
| 52 | __u16 tag; | ||
| 53 | __u16 mt_flags; | ||
| 54 | __u16 mt_invflags; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #endif /*_IP6T_SRH_H*/ | ||
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | #define NFS_PROGRAM 100003 | 13 | #define NFS_PROGRAM 100003 |
| 14 | #define NFS_PORT 2049 | 14 | #define NFS_PORT 2049 |
| 15 | #define NFS_RDMA_PORT 20049 | ||
| 15 | #define NFS_MAXDATA 8192 | 16 | #define NFS_MAXDATA 8192 |
| 16 | #define NFS_MAXPATHLEN 1024 | 17 | #define NFS_MAXPATHLEN 1024 |
| 17 | #define NFS_MAXNAMLEN 255 | 18 | #define NFS_MAXNAMLEN 255 |
| @@ -3862,6 +3862,9 @@ enum nl80211_bss_scan_width { · 3861 unmodified lines | |||
| 3862 | * @NL80211_BSS_PARENT_BSSID. (u64). | 3862 | * @NL80211_BSS_PARENT_BSSID. (u64). |
| 3863 | * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF | 3863 | * @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF |
| 3864 | * is set. | 3864 | * is set. |
| 3865 | * @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update. | ||
| 3866 | * Contains a nested array of signal strength attributes (u8, dBm), | ||
| 3867 | * using the nesting index as the antenna number. | ||
| 3865 | * @__NL80211_BSS_AFTER_LAST: internal | 3868 | * @__NL80211_BSS_AFTER_LAST: internal |
| 3866 | * @NL80211_BSS_MAX: highest BSS attribute | 3869 | * @NL80211_BSS_MAX: highest BSS attribute |
| 3867 | */ | 3870 | */ |
| @@ -3885,6 +3888,7 @@ enum nl80211_bss { · 17 unmodified lines | |||
| 3885 | NL80211_BSS_PAD, | 3888 | NL80211_BSS_PAD, |
| 3886 | NL80211_BSS_PARENT_TSF, | 3889 | NL80211_BSS_PARENT_TSF, |
| 3887 | NL80211_BSS_PARENT_BSSID, | 3890 | NL80211_BSS_PARENT_BSSID, |
| 3891 | NL80211_BSS_CHAIN_SIGNAL, | ||
| 3888 | 3892 | ||
| 3889 | /* keep last */ | 3893 | /* keep last */ |
| 3890 | __NL80211_BSS_AFTER_LAST, | 3894 | __NL80211_BSS_AFTER_LAST, |
| @@ -363,6 +363,7 @@ enum ovs_tunnel_key_attr { · 362 unmodified lines | |||
| 363 | OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */ | 363 | OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */ |
| 364 | OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */ | 364 | OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */ |
| 365 | OVS_TUNNEL_KEY_ATTR_PAD, | 365 | OVS_TUNNEL_KEY_ATTR_PAD, |
| 366 | OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* struct erspan_metadata */ | ||
| 366 | __OVS_TUNNEL_KEY_ATTR_MAX | 367 | __OVS_TUNNEL_KEY_ATTR_MAX |
| 367 | }; | 368 | }; |
| 368 | 369 | ||
| @@ -622,15 +622,19 @@ · 621 unmodified lines | |||
| 622 | * safely. | 622 | * safely. |
| 623 | */ | 623 | */ |
| 624 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 624 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
| 625 | #define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */ | ||
| 625 | #define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */ | 626 | #define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */ |
| 626 | #define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */ | 627 | #define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */ |
| 627 | #define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* Atomic 64-bit compare */ | 628 | #define PCI_EXP_DEVCAP2_ATOMIC_COMP32 0x00000080 /* 32b AtomicOp completion */ |
| 629 | #define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */ | ||
| 630 | #define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */ | ||
| 628 | #define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */ | 631 | #define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */ |
| 629 | #define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */ | 632 | #define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */ |
| 630 | #define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */ | 633 | #define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */ |
| 631 | #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ | 634 | #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ |
| 632 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 635 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
| 633 | #define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */ | 636 | #define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */ |
| 637 | #define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */ | ||
| 634 | #define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */ | 638 | #define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */ |
| 635 | #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */ | 639 | #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */ |
| 636 | #define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */ | 640 | #define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */ |
| @@ -966,26 +970,28 @@ · 329 unmodified lines | |||
| 966 | 970 | ||
| 967 | /* Downstream Port Containment */ | 971 | /* Downstream Port Containment */ |
| 968 | #define PCI_EXP_DPC_CAP 4 /* DPC Capability */ | 972 | #define PCI_EXP_DPC_CAP 4 /* DPC Capability */ |
| 969 | #define PCI_EXP_DPC_IRQ 0x1f /* DPC Interrupt Message Number */ | 973 | #define PCI_EXP_DPC_IRQ 0x001F /* Interrupt Message Number */ |
| 970 | #define PCI_EXP_DPC_CAP_RP_EXT 0x20 /* Root Port Extensions for DPC */ | 974 | #define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */ |
| 971 | #define PCI_EXP_DPC_CAP_POISONED_TLP 0x40 /* Poisoned TLP Egress Blocking Supported */ | 975 | #define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */ |
| 972 | #define PCI_EXP_DPC_CAP_SW_TRIGGER 0x80 /* Software Triggering Supported */ | 976 | #define PCI_EXP_DPC_CAP_SW_TRIGGER 0x0080 /* Software Triggering Supported */ |
| 973 | #define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0xF00 /* RP PIO log size */ | 977 | #define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */ |
| 974 | #define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */ | 978 | #define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */ |
| 975 | 979 | ||
| 976 | #define PCI_EXP_DPC_CTL 6 /* DPC control */ | 980 | #define PCI_EXP_DPC_CTL 6 /* DPC control */ |
| 977 | #define PCI_EXP_DPC_CTL_EN_NONFATAL 0x02 /* Enable trigger on ERR_NONFATAL message */ | 981 | #define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */ |
| 978 | #define PCI_EXP_DPC_CTL_INT_EN 0x08 /* DPC Interrupt Enable */ | 982 | #define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */ |
| 979 | 983 | ||
| 980 | #define PCI_EXP_DPC_STATUS 8 /* DPC Status */ | 984 | #define PCI_EXP_DPC_STATUS 8 /* DPC Status */ |
| 981 | #define PCI_EXP_DPC_STATUS_TRIGGER 0x01 /* Trigger Status */ | 985 | #define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */ |
| 982 | #define PCI_EXP_DPC_STATUS_INTERRUPT 0x08 /* Interrupt Status */ | 986 | #define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */ |
| 983 | #define PCI_EXP_DPC_RP_BUSY 0x10 /* Root Port Busy */ | 987 | #define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */ |
| 988 | #define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */ | ||
| 989 | #define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */ | ||
| 984 | 990 | ||
| 985 | #define PCI_EXP_DPC_SOURCE_ID 10 /* DPC Source Identifier */ | 991 | #define PCI_EXP_DPC_SOURCE_ID 10 /* DPC Source Identifier */ |
| 986 | 992 | ||
| 987 | #define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */ | 993 | #define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */ |
| 988 | #define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO MASK */ | 994 | #define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO Mask */ |
| 989 | #define PCI_EXP_DPC_RP_PIO_SEVERITY 0x14 /* RP PIO Severity */ | 995 | #define PCI_EXP_DPC_RP_PIO_SEVERITY 0x14 /* RP PIO Severity */ |
| 990 | #define PCI_EXP_DPC_RP_PIO_SYSERROR 0x18 /* RP PIO SysError */ | 996 | #define PCI_EXP_DPC_RP_PIO_SYSERROR 0x18 /* RP PIO SysError */ |
| 991 | #define PCI_EXP_DPC_RP_PIO_EXCEPTION 0x1C /* RP PIO Exception */ | 997 | #define PCI_EXP_DPC_RP_PIO_EXCEPTION 0x1C /* RP PIO Exception */ |
| @@ -422,6 +422,27 @@ struct perf_event_attr { · 421 unmodified lines | |||
| 422 | __u16 __reserved_2; /* align to __u64 */ | 422 | __u16 __reserved_2; /* align to __u64 */ |
| 423 | }; | 423 | }; |
| 424 | 424 | ||
| 425 | /* | ||
| 426 | * Structure used by below PERF_EVENT_IOC_QUERY_BPF command | ||
| 427 | * to query bpf programs attached to the same perf tracepoint | ||
| 428 | * as the given perf event. | ||
| 429 | */ | ||
| 430 | struct perf_event_query_bpf { | ||
| 431 | /* | ||
| 432 | * The below ids array length | ||
| 433 | */ | ||
| 434 | __u32 ids_len; | ||
| 435 | /* | ||
| 436 | * Set by the kernel to indicate the number of | ||
| 437 | * available programs | ||
| 438 | */ | ||
| 439 | __u32 prog_cnt; | ||
| 440 | /* | ||
| 441 | * User provided buffer to store program ids | ||
| 442 | */ | ||
| 443 | __u32 ids[0]; | ||
| 444 | }; | ||
| 445 | |||
| 425 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) | 446 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) |
| 426 | 447 | ||
| 427 | /* | 448 | /* |
| @@ -437,6 +458,7 @@ struct perf_event_attr { · 9 unmodified lines | |||
| 437 | #define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *) | 458 | #define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *) |
| 438 | #define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32) | 459 | #define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32) |
| 439 | #define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) | 460 | #define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) |
| 461 | #define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) | ||
| 440 | 462 | ||
| 441 | enum perf_event_ioc_flags { | 463 | enum perf_event_ioc_flags { |
| 442 | PERF_IOC_FLAG_GROUP = 1U << 0, | 464 | PERF_IOC_FLAG_GROUP = 1U << 0, |
| @@ -88,6 +88,9 @@ · 87 unmodified lines | |||
| 88 | (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT) | 88 | (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT) |
| 89 | #define PSCI_VERSION_MINOR(ver) \ | 89 | #define PSCI_VERSION_MINOR(ver) \ |
| 90 | ((ver) & PSCI_VERSION_MINOR_MASK) | 90 | ((ver) & PSCI_VERSION_MINOR_MASK) |
| 91 | #define PSCI_VERSION(maj, min) \ | ||
| 92 | ((((maj) << PSCI_VERSION_MAJOR_SHIFT) & PSCI_VERSION_MAJOR_MASK) | \ | ||
| 93 | ((min) & PSCI_VERSION_MINOR_MASK)) | ||
| 91 | 94 | ||
| 92 | /* PSCI features decoding (>=1.0) */ | 95 | /* PSCI features decoding (>=1.0) */ |
| 93 | #define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT 1 | 96 | #define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT 1 |
| @@ -0,0 +1,142 @@ | |||
| 1 | /* | ||
| 2 | * Userspace interface for AMD Secure Encrypted Virtualization (SEV) | ||
| 3 | * platform management commands. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2016-2017 Advanced Micro Devices, Inc. | ||
| 6 | * | ||
| 7 | * Author: Brijesh Singh <brijesh.singh@amd.com> | ||
| 8 | * | ||
| 9 | * SEV spec 0.14 is available at: | ||
| 10 | * http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify | ||
| 13 | * it under the terms of the GNU General Public License version 2 as | ||
| 14 | * published by the Free Software Foundation. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __PSP_SEV_USER_H__ | ||
| 18 | #define __PSP_SEV_USER_H__ | ||
| 19 | |||
| 20 | #include <linux/types.h> | ||
| 21 | |||
| 22 | /** | ||
| 23 | * SEV platform commands | ||
| 24 | */ | ||
| 25 | enum { | ||
| 26 | SEV_FACTORY_RESET = 0, | ||
| 27 | SEV_PLATFORM_STATUS, | ||
| 28 | SEV_PEK_GEN, | ||
| 29 | SEV_PEK_CSR, | ||
| 30 | SEV_PDH_GEN, | ||
| 31 | SEV_PDH_CERT_EXPORT, | ||
| 32 | SEV_PEK_CERT_IMPORT, | ||
| 33 | |||
| 34 | SEV_MAX, | ||
| 35 | }; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * SEV Firmware status code | ||
| 39 | */ | ||
| 40 | typedef enum { | ||
| 41 | SEV_RET_SUCCESS = 0, | ||
| 42 | SEV_RET_INVALID_PLATFORM_STATE, | ||
| 43 | SEV_RET_INVALID_GUEST_STATE, | ||
| 44 | SEV_RET_INAVLID_CONFIG, | ||
| 45 | SEV_RET_INVALID_len, | ||
| 46 | SEV_RET_ALREADY_OWNED, | ||
| 47 | SEV_RET_INVALID_CERTIFICATE, | ||
| 48 | SEV_RET_POLICY_FAILURE, | ||
| 49 | SEV_RET_INACTIVE, | ||
| 50 | SEV_RET_INVALID_ADDRESS, | ||
| 51 | SEV_RET_BAD_SIGNATURE, | ||
| 52 | SEV_RET_BAD_MEASUREMENT, | ||
| 53 | SEV_RET_ASID_OWNED, | ||
| 54 | SEV_RET_INVALID_ASID, | ||
| 55 | SEV_RET_WBINVD_REQUIRED, | ||
| 56 | SEV_RET_DFFLUSH_REQUIRED, | ||
| 57 | SEV_RET_INVALID_GUEST, | ||
| 58 | SEV_RET_INVALID_COMMAND, | ||
| 59 | SEV_RET_ACTIVE, | ||
| 60 | SEV_RET_HWSEV_RET_PLATFORM, | ||
| 61 | SEV_RET_HWSEV_RET_UNSAFE, | ||
| 62 | SEV_RET_UNSUPPORTED, | ||
| 63 | SEV_RET_MAX, | ||
| 64 | } sev_ret_code; | ||
| 65 | |||
| 66 | /** | ||
| 67 | * struct sev_user_data_status - PLATFORM_STATUS command parameters | ||
| 68 | * | ||
| 69 | * @major: major API version | ||
| 70 | * @minor: minor API version | ||
| 71 | * @state: platform state | ||
| 72 | * @flags: platform config flags | ||
| 73 | * @build: firmware build id for API version | ||
| 74 | * @guest_count: number of active guests | ||
| 75 | */ | ||
| 76 | struct sev_user_data_status { | ||
| 77 | __u8 api_major; /* Out */ | ||
| 78 | __u8 api_minor; /* Out */ | ||
| 79 | __u8 state; /* Out */ | ||
| 80 | __u32 flags; /* Out */ | ||
| 81 | __u8 build; /* Out */ | ||
| 82 | __u32 guest_count; /* Out */ | ||
| 83 | } __packed; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * struct sev_user_data_pek_csr - PEK_CSR command parameters | ||
| 87 | * | ||
| 88 | * @address: PEK certificate chain | ||
| 89 | * @length: length of certificate | ||
| 90 | */ | ||
| 91 | struct sev_user_data_pek_csr { | ||
| 92 | __u64 address; /* In */ | ||
| 93 | __u32 length; /* In/Out */ | ||
| 94 | } __packed; | ||
| 95 | |||
| 96 | /** | ||
| 97 | * struct sev_user_data_cert_import - PEK_CERT_IMPORT command parameters | ||
| 98 | * | ||
| 99 | * @pek_address: PEK certificate chain | ||
| 100 | * @pek_len: length of PEK certificate | ||
| 101 | * @oca_address: OCA certificate chain | ||
| 102 | * @oca_len: length of OCA certificate | ||
| 103 | */ | ||
| 104 | struct sev_user_data_pek_cert_import { | ||
| 105 | __u64 pek_cert_address; /* In */ | ||
| 106 | __u32 pek_cert_len; /* In */ | ||
| 107 | __u64 oca_cert_address; /* In */ | ||
| 108 | __u32 oca_cert_len; /* In */ | ||
| 109 | } __packed; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * struct sev_user_data_pdh_cert_export - PDH_CERT_EXPORT command parameters | ||
| 113 | * | ||
| 114 | * @pdh_address: PDH certificate address | ||
| 115 | * @pdh_len: length of PDH certificate | ||
| 116 | * @cert_chain_address: PDH certificate chain | ||
| 117 | * @cert_chain_len: length of PDH certificate chain | ||
| 118 | */ | ||
| 119 | struct sev_user_data_pdh_cert_export { | ||
| 120 | __u64 pdh_cert_address; /* In */ | ||
| 121 | __u32 pdh_cert_len; /* In/Out */ | ||
| 122 | __u64 cert_chain_address; /* In */ | ||
| 123 | __u32 cert_chain_len; /* In/Out */ | ||
| 124 | } __packed; | ||
| 125 | |||
| 126 | /** | ||
| 127 | * struct sev_issue_cmd - SEV ioctl parameters | ||
| 128 | * | ||
| 129 | * @cmd: SEV commands to execute | ||
| 130 | * @opaque: pointer to the command structure | ||
| 131 | * @error: SEV FW return code on failure | ||
| 132 | */ | ||
| 133 | struct sev_issue_cmd { | ||
| 134 | __u32 cmd; /* In */ | ||
| 135 | __u64 data; /* In */ | ||
| 136 | __u32 error; /* Out */ | ||
| 137 | } __packed; | ||
| 138 | |||
| 139 | #define SEV_IOC_TYPE 'S' | ||
| 140 | #define SEV_ISSUE_CMD _IOWR(SEV_IOC_TYPE, 0x0, struct sev_issue_cmd) | ||
| 141 | |||
| 142 | #endif /* __PSP_USER_SEV_H */ | ||
| @@ -66,6 +66,12 @@ struct ptrace_peeksiginfo_args { · 65 unmodified lines | |||
| 66 | #define PTRACE_SETSIGMASK 0x420b | 66 | #define PTRACE_SETSIGMASK 0x420b |
| 67 | 67 | ||
| 68 | #define PTRACE_SECCOMP_GET_FILTER 0x420c | 68 | #define PTRACE_SECCOMP_GET_FILTER 0x420c |
| 69 | #define PTRACE_SECCOMP_GET_METADATA 0x420d | ||
| 70 | |||
| 71 | struct seccomp_metadata { | ||
| 72 | unsigned long filter_off; /* Input: which filter */ | ||
| 73 | unsigned int flags; /* Output: filter's flags */ | ||
| 74 | }; | ||
| 69 | 75 | ||
| 70 | /* Read signals from a shared (process wide) queue */ | 76 | /* Read signals from a shared (process wide) queue */ |
| 71 | #define PTRACE_PEEKSIGINFO_SHARED (1 << 0) | 77 | #define PTRACE_PEEKSIGINFO_SHARED (1 << 0) |
| @@ -541,9 +541,19 @@ struct tcmsg { · 540 unmodified lines | |||
| 541 | int tcm_ifindex; | 541 | int tcm_ifindex; |
| 542 | __u32 tcm_handle; | 542 | __u32 tcm_handle; |
| 543 | __u32 tcm_parent; | 543 | __u32 tcm_parent; |
| 544 | /* tcm_block_index is used instead of tcm_parent | ||
| 545 | * in case tcm_ifindex == TCM_IFINDEX_MAGIC_BLOCK | ||
| 546 | */ | ||
| 547 | #define tcm_block_index tcm_parent | ||
| 544 | __u32 tcm_info; | 548 | __u32 tcm_info; |
| 545 | }; | 549 | }; |
| 546 | 550 | ||
| 551 | /* For manipulation of filters in shared block, tcm_ifindex is set to | ||
| 552 | * TCM_IFINDEX_MAGIC_BLOCK, and tcm_parent is aliased to tcm_block_index | ||
| 553 | * which is the block index. | ||
| 554 | */ | ||
| 555 | #define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU) | ||
| 556 | |||
| 547 | enum { | 557 | enum { |
| 548 | TCA_UNSPEC, | 558 | TCA_UNSPEC, |
| 549 | TCA_KIND, | 559 | TCA_KIND, |
| @@ -558,6 +568,8 @@ enum { · 8 unmodified lines | |||
| 558 | TCA_DUMP_INVISIBLE, | 568 | TCA_DUMP_INVISIBLE, |
| 559 | TCA_CHAIN, | 569 | TCA_CHAIN, |
| 560 | TCA_HW_OFFLOAD, | 570 | TCA_HW_OFFLOAD, |
| 571 | TCA_INGRESS_BLOCK, | ||
| 572 | TCA_EGRESS_BLOCK, | ||
| 561 | __TCA_MAX | 573 | __TCA_MAX |
| 562 | }; | 574 | }; |
| 563 | 575 | ||
| @@ -125,6 +125,7 @@ typedef __s32 sctp_assoc_t; · 124 unmodified lines | |||
| 125 | #define SCTP_SOCKOPT_PEELOFF_FLAGS 122 | 125 | #define SCTP_SOCKOPT_PEELOFF_FLAGS 122 |
| 126 | #define SCTP_STREAM_SCHEDULER 123 | 126 | #define SCTP_STREAM_SCHEDULER 123 |
| 127 | #define SCTP_STREAM_SCHEDULER_VALUE 124 | 127 | #define SCTP_STREAM_SCHEDULER_VALUE 124 |
| 128 | #define SCTP_INTERLEAVING_SUPPORTED 125 | ||
| 128 | 129 | ||
| 129 | /* PR-SCTP policies */ | 130 | /* PR-SCTP policies */ |
| 130 | #define SCTP_PR_SCTP_NONE 0x0000 | 131 | #define SCTP_PR_SCTP_NONE 0x0000 |
| @@ -459,6 +460,8 @@ struct sctp_pdapi_event { · 328 unmodified lines | |||
| 459 | __u32 pdapi_length; | 460 | __u32 pdapi_length; |
| 460 | __u32 pdapi_indication; | 461 | __u32 pdapi_indication; |
| 461 | sctp_assoc_t pdapi_assoc_id; | 462 | sctp_assoc_t pdapi_assoc_id; |
| 463 | __u32 pdapi_stream; | ||
| 464 | __u32 pdapi_seq; | ||
| 462 | }; | 465 | }; |
| 463 | 466 | ||
| 464 | enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, }; | 467 | enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, }; |
| @@ -88,7 +88,8 @@ struct switchtec_ioctl_event_summary { · 87 unmodified lines | |||
| 88 | #define SWITCHTEC_IOCTL_EVENT_FORCE_SPEED 26 | 88 | #define SWITCHTEC_IOCTL_EVENT_FORCE_SPEED 26 |
| 89 | #define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT 27 | 89 | #define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT 27 |
| 90 | #define SWITCHTEC_IOCTL_EVENT_LINK_STATE 28 | 90 | #define SWITCHTEC_IOCTL_EVENT_LINK_STATE 28 |
| 91 | #define SWITCHTEC_IOCTL_MAX_EVENTS 29 | 91 | #define SWITCHTEC_IOCTL_EVENT_GFMS 29 |
| 92 | #define SWITCHTEC_IOCTL_MAX_EVENTS 30 | ||
| 92 | 93 | ||
| 93 | #define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1 | 94 | #define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1 |
| 94 | #define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2 | 95 | #define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2 |
| @@ -50,6 +50,7 @@ · 49 unmodified lines | |||
| 50 | 50 | ||
| 51 | #define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */ | 51 | #define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */ |
| 52 | #define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */ | 52 | #define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */ |
| 53 | #define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */ | ||
| 53 | 54 | ||
| 54 | /* | 55 | /* |
| 55 | * TEE Implementation ID | 56 | * TEE Implementation ID |
| @@ -154,6 +155,13 @@ struct tee_ioctl_buf_data { · 98 unmodified lines | |||
| 154 | */ | 155 | */ |
| 155 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MASK 0xff | 156 | #define TEE_IOCTL_PARAM_ATTR_TYPE_MASK 0xff |
| 156 | 157 | ||
| 158 | /* Meta parameter carrying extra information about the message. */ | ||
| 159 | #define TEE_IOCTL_PARAM_ATTR_META 0x100 | ||
| 160 | |||
| 161 | /* Mask of all known attr bits */ | ||
| 162 | #define TEE_IOCTL_PARAM_ATTR_MASK \ | ||
| 163 | (TEE_IOCTL_PARAM_ATTR_TYPE_MASK | TEE_IOCTL_PARAM_ATTR_META) | ||
| 164 | |||
| 157 | /* | 165 | /* |
| 158 | * Matches TEEC_LOGIN_* in GP TEE Client API | 166 | * Matches TEEC_LOGIN_* in GP TEE Client API |
| 159 | * Are only defined for GP compliant TEEs | 167 | * Are only defined for GP compliant TEEs |
| @@ -332,6 +340,35 @@ struct tee_iocl_supp_send_arg { · 172 unmodified lines | |||
| 332 | #define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \ | 340 | #define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \ |
| 333 | struct tee_ioctl_buf_data) | 341 | struct tee_ioctl_buf_data) |
| 334 | 342 | ||
| 343 | /** | ||
| 344 | * struct tee_ioctl_shm_register_data - Shared memory register argument | ||
| 345 | * @addr: [in] Start address of shared memory to register | ||
| 346 | * @length: [in/out] Length of shared memory to register | ||
| 347 | * @flags: [in/out] Flags to/from registration. | ||
| 348 | * @id: [out] Identifier of the shared memory | ||
| 349 | * | ||
| 350 | * The flags field should currently be zero as input. Updated by the call | ||
| 351 | * with actual flags as defined by TEE_IOCTL_SHM_* above. | ||
| 352 | * This structure is used as argument for TEE_IOC_SHM_REGISTER below. | ||
| 353 | */ | ||
| 354 | struct tee_ioctl_shm_register_data { | ||
| 355 | __u64 addr; | ||
| 356 | __u64 length; | ||
| 357 | __u32 flags; | ||
| 358 | __s32 id; | ||
| 359 | }; | ||
| 360 | |||
| 361 | /** | ||
| 362 | * TEE_IOC_SHM_REGISTER - Register shared memory argument | ||
| 363 | * | ||
| 364 | * Registers shared memory between the user space process and secure OS. | ||
| 365 | * | ||
| 366 | * Returns a file descriptor on success or < 0 on failure | ||
| 367 | * | ||
| 368 | * The shared memory is unregisterred when the descriptor is closed. | ||
| 369 | */ | ||
| 370 | #define TEE_IOC_SHM_REGISTER _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \ | ||
| 371 | struct tee_ioctl_shm_register_data) | ||
| 335 | /* | 372 | /* |
| 336 | * Five syscalls are used when communicating with the TEE driver. | 373 | * Five syscalls are used when communicating with the TEE driver. |
| 337 | * open(): opens the device associated with the driver | 374 | * open(): opens the device associated with the driver |
| @@ -117,10 +117,9 @@ static inline unsigned int tipc_node(__u32 addr) · 116 unmodified lines | |||
| 117 | /* | 117 | /* |
| 118 | * Publication scopes when binding port names and port name sequences | 118 | * Publication scopes when binding port names and port name sequences |
| 119 | */ | 119 | */ |
| 120 | 120 | #define TIPC_ZONE_SCOPE 1 | |
| 121 | #define TIPC_ZONE_SCOPE 1 | 121 | #define TIPC_CLUSTER_SCOPE 2 |
| 122 | #define TIPC_CLUSTER_SCOPE 2 | 122 | #define TIPC_NODE_SCOPE 3 |
| 123 | #define TIPC_NODE_SCOPE 3 | ||
| 124 | 123 | ||
| 125 | /* | 124 | /* |
| 126 | * Limiting values for messages | 125 | * Limiting values for messages |
| @@ -49,5 +49,11 @@ typedef __u32 __bitwise __wsum; · 48 unmodified lines | |||
| 49 | #define __aligned_be64 __be64 __attribute__((aligned(8))) | 49 | #define __aligned_be64 __be64 __attribute__((aligned(8))) |
| 50 | #define __aligned_le64 __le64 __attribute__((aligned(8))) | 50 | #define __aligned_le64 __le64 __attribute__((aligned(8))) |
| 51 | 51 | ||
| 52 | #ifdef __CHECK_POLL | ||
| 53 | typedef unsigned __bitwise __poll_t; | ||
| 54 | #else | ||
| 55 | typedef unsigned __poll_t; | ||
| 56 | #endif | ||
| 57 | |||
| 52 | #endif /* __ASSEMBLY__ */ | 58 | #endif /* __ASSEMBLY__ */ |
| 53 | #endif /* _UAPI_LINUX_TYPES_H */ | 59 | #endif /* _UAPI_LINUX_TYPES_H */ |
| @@ -1077,9 +1077,9 @@ struct usb_ptm_cap_descriptor { · 1076 unmodified lines | |||
| 1077 | #define USB_DT_USB_PTM_ID_SIZE 3 | 1077 | #define USB_DT_USB_PTM_ID_SIZE 3 |
| 1078 | /* | 1078 | /* |
| 1079 | * The size of the descriptor for the Sublink Speed Attribute Count | 1079 | * The size of the descriptor for the Sublink Speed Attribute Count |
| 1080 | * (SSAC) specified in bmAttributes[4:0]. | 1080 | * (SSAC) specified in bmAttributes[4:0]. SSAC is zero-based |
| 1081 | */ | 1081 | */ |
| 1082 | #define USB_DT_USB_SSP_CAP_SIZE(ssac) (16 + ssac * 4) | 1082 | #define USB_DT_USB_SSP_CAP_SIZE(ssac) (12 + (ssac + 1) * 4) |
| 1083 | 1083 | ||
| 1084 | /*-------------------------------------------------------------------------*/ | 1084 | /*-------------------------------------------------------------------------*/ |
| 1085 | 1085 | ||
| @@ -79,7 +79,7 @@ struct usbdevfs_connectinfo { · 78 unmodified lines | |||
| 79 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 | 79 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
| 80 | #define USBDEVFS_URB_ISO_ASAP 0x02 | 80 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
| 81 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 | 81 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 |
| 82 | #define USBDEVFS_URB_NO_FSBR 0x20 | 82 | #define USBDEVFS_URB_NO_FSBR 0x20 /* Not used */ |
| 83 | #define USBDEVFS_URB_ZERO_PACKET 0x40 | 83 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
| 84 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 | 84 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
| 85 | 85 | ||
| @@ -19,7 +19,6 @@ · 18 unmodified lines | |||
| 19 | #define _UAPI_LINUX_UUID_H_ | 19 | #define _UAPI_LINUX_UUID_H_ |
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <linux/string.h> | ||
| 23 | 22 | ||
| 24 | typedef struct { | 23 | typedef struct { |
| 25 | __u8 b[16]; | 24 | __u8 b[16]; |
| @@ -68,4 +68,30 @@ struct uvc_xu_control_query { · 67 unmodified lines | |||
| 68 | #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping) | 68 | #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping) |
| 69 | #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query) | 69 | #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query) |
| 70 | 70 | ||
| 71 | /* | ||
| 72 | * Metadata node | ||
| 73 | */ | ||
| 74 | |||
| 75 | /** | ||
| 76 | * struct uvc_meta_buf - metadata buffer building block | ||
| 77 | * @ns - system timestamp of the payload in nanoseconds | ||
| 78 | * @sof - USB Frame Number | ||
| 79 | * @length - length of the payload header | ||
| 80 | * @flags - payload header flags | ||
| 81 | * @buf - optional device-specific header data | ||
| 82 | * | ||
| 83 | * UVC metadata nodes fill buffers with possibly multiple instances of this | ||
| 84 | * struct. The first two fields are added by the driver, they can be used for | ||
| 85 | * clock synchronisation. The rest is an exact copy of a UVC payload header. | ||
| 86 | * Only complete objects with complete buffers are included. Therefore it's | ||
| 87 | * always sizeof(meta->ts) + sizeof(meta->sof) + meta->length bytes large. | ||
| 88 | */ | ||
| 89 | struct uvc_meta_buf { | ||
| 90 | __u64 ns; | ||
| 91 | __u16 sof; | ||
| 92 | __u8 length; | ||
| 93 | __u8 flags; | ||
| 94 | __u8 buf[]; | ||
| 95 | } __packed; | ||
| 96 | |||
| 71 | #endif | 97 | #endif |
| @@ -67,8 +67,8 @@ · 66 unmodified lines | |||
| 67 | /* User-class control IDs */ | 67 | /* User-class control IDs */ |
| 68 | 68 | ||
| 69 | #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) | 69 | #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) |
| 70 | #define V4L2_CID_USER_BASE V4L2_CID_BASE | 70 | #define V4L2_CID_USER_BASE V4L2_CID_BASE |
| 71 | #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) | 71 | #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) |
| 72 | #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) | 72 | #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) |
| 73 | #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) | 73 | #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) |
| 74 | #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) | 74 | #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) |
| @@ -102,7 +102,7 @@ enum v4l2_power_line_frequency { · 27 unmodified lines | |||
| 102 | #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) | 102 | #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) |
| 103 | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) | 103 | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) |
| 104 | #define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27) | 104 | #define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27) |
| 105 | #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28) | 105 | #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28) |
| 106 | #define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29) | 106 | #define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29) |
| 107 | #define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) | 107 | #define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) |
| 108 | #define V4L2_CID_COLORFX (V4L2_CID_BASE+31) | 108 | #define V4L2_CID_COLORFX (V4L2_CID_BASE+31) |
| @@ -194,11 +194,11 @@ enum v4l2_colorfx { · 85 unmodified lines | |||
| 194 | /* The MPEG controls are applicable to all codec controls | 194 | /* The MPEG controls are applicable to all codec controls |
| 195 | * and the 'MPEG' part of the define is historical */ | 195 | * and the 'MPEG' part of the define is historical */ |
| 196 | 196 | ||
| 197 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 197 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
| 198 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) | 198 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) |
| 199 | 199 | ||
| 200 | /* MPEG streams, specific to multiplexed streams */ | 200 | /* MPEG streams, specific to multiplexed streams */ |
| 201 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) | 201 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) |
| 202 | enum v4l2_mpeg_stream_type { | 202 | enum v4l2_mpeg_stream_type { |
| 203 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ | 203 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ |
| 204 | V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */ | 204 | V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */ |
| @@ -207,26 +207,26 @@ enum v4l2_mpeg_stream_type { · 2 unmodified lines | |||
| 207 | V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ | 207 | V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ |
| 208 | V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ | 208 | V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ |
| 209 | }; | 209 | }; |
| 210 | #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) | 210 | #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) |
| 211 | #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) | 211 | #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) |
| 212 | #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) | 212 | #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) |
| 213 | #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) | 213 | #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) |
| 214 | #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) | 214 | #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) |
| 215 | #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) | 215 | #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) |
| 216 | #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) | 216 | #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) |
| 217 | enum v4l2_mpeg_stream_vbi_fmt { | 217 | enum v4l2_mpeg_stream_vbi_fmt { |
| 218 | V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ | 218 | V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ |
| 219 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ | 219 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ |
| 220 | }; | 220 | }; |
| 221 | 221 | ||
| 222 | /* MPEG audio controls specific to multiplexed streams */ | 222 | /* MPEG audio controls specific to multiplexed streams */ |
| 223 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) | 223 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) |
| 224 | enum v4l2_mpeg_audio_sampling_freq { | 224 | enum v4l2_mpeg_audio_sampling_freq { |
| 225 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, | 225 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, |
| 226 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, | 226 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, |
| 227 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, | 227 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, |
| 228 | }; | 228 | }; |
| 229 | #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) | 229 | #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) |
| 230 | enum v4l2_mpeg_audio_encoding { | 230 | enum v4l2_mpeg_audio_encoding { |
| 231 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, | 231 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, |
| 232 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, | 232 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, |
| @@ -234,7 +234,7 @@ enum v4l2_mpeg_audio_encoding { · 1 unmodified line | |||
| 234 | V4L2_MPEG_AUDIO_ENCODING_AAC = 3, | 234 | V4L2_MPEG_AUDIO_ENCODING_AAC = 3, |
| 235 | V4L2_MPEG_AUDIO_ENCODING_AC3 = 4, | 235 | V4L2_MPEG_AUDIO_ENCODING_AC3 = 4, |
| 236 | }; | 236 | }; |
| 237 | #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) | 237 | #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) |
| 238 | enum v4l2_mpeg_audio_l1_bitrate { | 238 | enum v4l2_mpeg_audio_l1_bitrate { |
| 239 | V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, | 239 | V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, |
| 240 | V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, | 240 | V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, |
| @@ -251,7 +251,7 @@ enum v4l2_mpeg_audio_l1_bitrate { · 10 unmodified lines | |||
| 251 | V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12, | 251 | V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12, |
| 252 | V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13, | 252 | V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13, |
| 253 | }; | 253 | }; |
| 254 | #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) | 254 | #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) |
| 255 | enum v4l2_mpeg_audio_l2_bitrate { | 255 | enum v4l2_mpeg_audio_l2_bitrate { |
| 256 | V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0, | 256 | V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0, |
| 257 | V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1, | 257 | V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1, |
| @@ -268,7 +268,7 @@ enum v4l2_mpeg_audio_l2_bitrate { · 10 unmodified lines | |||
| 268 | V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, | 268 | V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, |
| 269 | V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, | 269 | V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, |
| 270 | }; | 270 | }; |
| 271 | #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) | 271 | #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) |
| 272 | enum v4l2_mpeg_audio_l3_bitrate { | 272 | enum v4l2_mpeg_audio_l3_bitrate { |
| 273 | V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, | 273 | V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, |
| 274 | V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, | 274 | V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, |
| @@ -285,32 +285,32 @@ enum v4l2_mpeg_audio_l3_bitrate { · 10 unmodified lines | |||
| 285 | V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, | 285 | V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, |
| 286 | V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, | 286 | V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, |
| 287 | }; | 287 | }; |
| 288 | #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) | 288 | #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) |
| 289 | enum v4l2_mpeg_audio_mode { | 289 | enum v4l2_mpeg_audio_mode { |
| 290 | V4L2_MPEG_AUDIO_MODE_STEREO = 0, | 290 | V4L2_MPEG_AUDIO_MODE_STEREO = 0, |
| 291 | V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, | 291 | V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, |
| 292 | V4L2_MPEG_AUDIO_MODE_DUAL = 2, | 292 | V4L2_MPEG_AUDIO_MODE_DUAL = 2, |
| 293 | V4L2_MPEG_AUDIO_MODE_MONO = 3, | 293 | V4L2_MPEG_AUDIO_MODE_MONO = 3, |
| 294 | }; | 294 | }; |
| 295 | #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) | 295 | #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) |
| 296 | enum v4l2_mpeg_audio_mode_extension { | 296 | enum v4l2_mpeg_audio_mode_extension { |
| 297 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, | 297 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, |
| 298 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, | 298 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, |
| 299 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, | 299 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, |
| 300 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, | 300 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, |
| 301 | }; | 301 | }; |
| 302 | #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) | 302 | #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) |
| 303 | enum v4l2_mpeg_audio_emphasis { | 303 | enum v4l2_mpeg_audio_emphasis { |
| 304 | V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, | 304 | V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, |
| 305 | V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, | 305 | V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, |
| 306 | V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, | 306 | V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, |
| 307 | }; | 307 | }; |
| 308 | #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) | 308 | #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) |
| 309 | enum v4l2_mpeg_audio_crc { | 309 | enum v4l2_mpeg_audio_crc { |
| 310 | V4L2_MPEG_AUDIO_CRC_NONE = 0, | 310 | V4L2_MPEG_AUDIO_CRC_NONE = 0, |
| 311 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, | 311 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, |
| 312 | }; | 312 | }; |
| 313 | #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) | 313 | #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) |
| 314 | #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110) | 314 | #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110) |
| 315 | #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111) | 315 | #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111) |
| 316 | enum v4l2_mpeg_audio_ac3_bitrate { | 316 | enum v4l2_mpeg_audio_ac3_bitrate { |
| @@ -346,33 +346,33 @@ enum v4l2_mpeg_audio_dec_playback { · 29 unmodified lines | |||
| 346 | #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113) | 346 | #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113) |
| 347 | 347 | ||
| 348 | /* MPEG video controls specific to multiplexed streams */ | 348 | /* MPEG video controls specific to multiplexed streams */ |
| 349 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 349 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
| 350 | enum v4l2_mpeg_video_encoding { | 350 | enum v4l2_mpeg_video_encoding { |
| 351 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, | 351 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, |
| 352 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, | 352 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, |
| 353 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2, | 353 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2, |
| 354 | }; | 354 | }; |
| 355 | #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) | 355 | #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) |
| 356 | enum v4l2_mpeg_video_aspect { | 356 | enum v4l2_mpeg_video_aspect { |
| 357 | V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, | 357 | V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, |
| 358 | V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, | 358 | V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, |
| 359 | V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, | 359 | V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, |
| 360 | V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, | 360 | V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, |
| 361 | }; | 361 | }; |
| 362 | #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) | 362 | #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) |
| 363 | #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) | 363 | #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) |
| 364 | #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) | 364 | #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) |
| 365 | #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) | 365 | #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) |
| 366 | #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) | 366 | #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) |
| 367 | enum v4l2_mpeg_video_bitrate_mode { | 367 | enum v4l2_mpeg_video_bitrate_mode { |
| 368 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, | 368 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, |
| 369 | V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, | 369 | V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, |
| 370 | }; | 370 | }; |
| 371 | #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) | 371 | #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) |
| 372 | #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) | 372 | #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) |
| 373 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) | 373 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) |
| 374 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) | 374 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) |
| 375 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) | 375 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) |
| 376 | #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) | 376 | #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) |
| 377 | #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213) | 377 | #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213) |
| 378 | #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214) | 378 | #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214) |
| @@ -590,14 +590,14 @@ enum v4l2_vp8_golden_frame_sel { · 211 unmodified lines | |||
| 590 | #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511) | 590 | #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511) |
| 591 | 591 | ||
| 592 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ | 592 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
| 593 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 593 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
| 594 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) | 594 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) |
| 595 | enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { | 595 | enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { |
| 596 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0, | 596 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0, |
| 597 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1, | 597 | V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1, |
| 598 | }; | 598 | }; |
| 599 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) | 599 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) |
| 600 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) | 600 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) |
| 601 | enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { | 601 | enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { |
| 602 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0, | 602 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0, |
| 603 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, | 603 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, |
| @@ -605,18 +605,18 @@ enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { · 1 unmodified line | |||
| 605 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3, | 605 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3, |
| 606 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4, | 606 | V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4, |
| 607 | }; | 607 | }; |
| 608 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) | 608 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) |
| 609 | enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { | 609 | enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { |
| 610 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0, | 610 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0, |
| 611 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, | 611 | V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, |
| 612 | }; | 612 | }; |
| 613 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) | 613 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) |
| 614 | enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { | 614 | enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { |
| 615 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0, | 615 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0, |
| 616 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1, | 616 | V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1, |
| 617 | }; | 617 | }; |
| 618 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) | 618 | #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) |
| 619 | #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) | 619 | #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) |
| 620 | enum v4l2_mpeg_cx2341x_video_median_filter_type { | 620 | enum v4l2_mpeg_cx2341x_video_median_filter_type { |
| 621 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0, | 621 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0, |
| 622 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1, | 622 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1, |
| @@ -624,11 +624,11 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type { · 1 unmodified line | |||
| 624 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3, | 624 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3, |
| 625 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4, | 625 | V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4, |
| 626 | }; | 626 | }; |
| 627 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) | 627 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) |
| 628 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) | 628 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) |
| 629 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) | 629 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) |
| 630 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) | 630 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) |
| 631 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) | 631 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) |
| 632 | 632 | ||
| 633 | /* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ | 633 | /* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ |
| 634 | #define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100) | 634 | #define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100) |
| @@ -660,8 +660,8 @@ enum v4l2_mpeg_mfc51_video_force_frame_type { · 25 unmodified lines | |||
| 660 | 660 | ||
| 661 | /* Camera class control IDs */ | 661 | /* Camera class control IDs */ |
| 662 | 662 | ||
| 663 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) | 663 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) |
| 664 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) | 664 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) |
| 665 | 665 | ||
| 666 | #define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1) | 666 | #define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1) |
| 667 | enum v4l2_exposure_auto_type { | 667 | enum v4l2_exposure_auto_type { |
| @@ -0,0 +1,151 @@ | |||
| 1 | /* SPDX-License-Identifier: MIT */ | ||
| 2 | /* Copyright (C) 2017 Oracle Corporation */ | ||
| 3 | |||
| 4 | #ifndef __UAPI_VBOX_ERR_H__ | ||
| 5 | #define __UAPI_VBOX_ERR_H__ | ||
| 6 | |||
| 7 | #define VINF_SUCCESS 0 | ||
| 8 | #define VERR_GENERAL_FAILURE (-1) | ||
| 9 | #define VERR_INVALID_PARAMETER (-2) | ||
| 10 | #define VERR_INVALID_MAGIC (-3) | ||
| 11 | #define VERR_INVALID_HANDLE (-4) | ||
| 12 | #define VERR_LOCK_FAILED (-5) | ||
| 13 | #define VERR_INVALID_POINTER (-6) | ||
| 14 | #define VERR_IDT_FAILED (-7) | ||
| 15 | #define VERR_NO_MEMORY (-8) | ||
| 16 | #define VERR_ALREADY_LOADED (-9) | ||
| 17 | #define VERR_PERMISSION_DENIED (-10) | ||
| 18 | #define VERR_VERSION_MISMATCH (-11) | ||
| 19 | #define VERR_NOT_IMPLEMENTED (-12) | ||
| 20 | #define VERR_INVALID_FLAGS (-13) | ||
| 21 | |||
| 22 | #define VERR_NOT_EQUAL (-18) | ||
| 23 | #define VERR_NOT_SYMLINK (-19) | ||
| 24 | #define VERR_NO_TMP_MEMORY (-20) | ||
| 25 | #define VERR_INVALID_FMODE (-21) | ||
| 26 | #define VERR_WRONG_ORDER (-22) | ||
| 27 | #define VERR_NO_TLS_FOR_SELF (-23) | ||
| 28 | #define VERR_FAILED_TO_SET_SELF_TLS (-24) | ||
| 29 | #define VERR_NO_CONT_MEMORY (-26) | ||
| 30 | #define VERR_NO_PAGE_MEMORY (-27) | ||
| 31 | #define VERR_THREAD_IS_DEAD (-29) | ||
| 32 | #define VERR_THREAD_NOT_WAITABLE (-30) | ||
| 33 | #define VERR_PAGE_TABLE_NOT_PRESENT (-31) | ||
| 34 | #define VERR_INVALID_CONTEXT (-32) | ||
| 35 | #define VERR_TIMER_BUSY (-33) | ||
| 36 | #define VERR_ADDRESS_CONFLICT (-34) | ||
| 37 | #define VERR_UNRESOLVED_ERROR (-35) | ||
| 38 | #define VERR_INVALID_FUNCTION (-36) | ||
| 39 | #define VERR_NOT_SUPPORTED (-37) | ||
| 40 | #define VERR_ACCESS_DENIED (-38) | ||
| 41 | #define VERR_INTERRUPTED (-39) | ||
| 42 | #define VERR_TIMEOUT (-40) | ||
| 43 | #define VERR_BUFFER_OVERFLOW (-41) | ||
| 44 | #define VERR_TOO_MUCH_DATA (-42) | ||
| 45 | #define VERR_MAX_THRDS_REACHED (-43) | ||
| 46 | #define VERR_MAX_PROCS_REACHED (-44) | ||
| 47 | #define VERR_SIGNAL_REFUSED (-45) | ||
| 48 | #define VERR_SIGNAL_PENDING (-46) | ||
| 49 | #define VERR_SIGNAL_INVALID (-47) | ||
| 50 | #define VERR_STATE_CHANGED (-48) | ||
| 51 | #define VERR_INVALID_UUID_FORMAT (-49) | ||
| 52 | #define VERR_PROCESS_NOT_FOUND (-50) | ||
| 53 | #define VERR_PROCESS_RUNNING (-51) | ||
| 54 | #define VERR_TRY_AGAIN (-52) | ||
| 55 | #define VERR_PARSE_ERROR (-53) | ||
| 56 | #define VERR_OUT_OF_RANGE (-54) | ||
| 57 | #define VERR_NUMBER_TOO_BIG (-55) | ||
| 58 | #define VERR_NO_DIGITS (-56) | ||
| 59 | #define VERR_NEGATIVE_UNSIGNED (-57) | ||
| 60 | #define VERR_NO_TRANSLATION (-58) | ||
| 61 | |||
| 62 | #define VERR_NOT_FOUND (-78) | ||
| 63 | #define VERR_INVALID_STATE (-79) | ||
| 64 | #define VERR_OUT_OF_RESOURCES (-80) | ||
| 65 | |||
| 66 | #define VERR_FILE_NOT_FOUND (-102) | ||
| 67 | #define VERR_PATH_NOT_FOUND (-103) | ||
| 68 | #define VERR_INVALID_NAME (-104) | ||
| 69 | #define VERR_ALREADY_EXISTS (-105) | ||
| 70 | #define VERR_TOO_MANY_OPEN_FILES (-106) | ||
| 71 | #define VERR_SEEK (-107) | ||
| 72 | #define VERR_NEGATIVE_SEEK (-108) | ||
| 73 | #define VERR_SEEK_ON_DEVICE (-109) | ||
| 74 | #define VERR_EOF (-110) | ||
| 75 | #define VERR_READ_ERROR (-111) | ||
| 76 | #define VERR_WRITE_ERROR (-112) | ||
| 77 | #define VERR_WRITE_PROTECT (-113) | ||
| 78 | #define VERR_SHARING_VIOLATION (-114) | ||
| 79 | #define VERR_FILE_LOCK_FAILED (-115) | ||
| 80 | #define VERR_FILE_LOCK_VIOLATION (-116) | ||
| 81 | #define VERR_CANT_CREATE (-117) | ||
| 82 | #define VERR_CANT_DELETE_DIRECTORY (-118) | ||
| 83 | #define VERR_NOT_SAME_DEVICE (-119) | ||
| 84 | #define VERR_FILENAME_TOO_LONG (-120) | ||
| 85 | #define VERR_MEDIA_NOT_PRESENT (-121) | ||
| 86 | #define VERR_MEDIA_NOT_RECOGNIZED (-122) | ||
| 87 | #define VERR_FILE_NOT_LOCKED (-123) | ||
| 88 | #define VERR_FILE_LOCK_LOST (-124) | ||
| 89 | #define VERR_DIR_NOT_EMPTY (-125) | ||
| 90 | #define VERR_NOT_A_DIRECTORY (-126) | ||
| 91 | #define VERR_IS_A_DIRECTORY (-127) | ||
| 92 | #define VERR_FILE_TOO_BIG (-128) | ||
| 93 | |||
| 94 | #define VERR_NET_IO_ERROR (-400) | ||
| 95 | #define VERR_NET_OUT_OF_RESOURCES (-401) | ||
| 96 | #define VERR_NET_HOST_NOT_FOUND (-402) | ||
| 97 | #define VERR_NET_PATH_NOT_FOUND (-403) | ||
| 98 | #define VERR_NET_PRINT_ERROR (-404) | ||
| 99 | #define VERR_NET_NO_NETWORK (-405) | ||
| 100 | #define VERR_NET_NOT_UNIQUE_NAME (-406) | ||
| 101 | |||
| 102 | #define VERR_NET_IN_PROGRESS (-436) | ||
| 103 | #define VERR_NET_ALREADY_IN_PROGRESS (-437) | ||
| 104 | #define VERR_NET_NOT_SOCKET (-438) | ||
| 105 | #define VERR_NET_DEST_ADDRESS_REQUIRED (-439) | ||
| 106 | #define VERR_NET_MSG_SIZE (-440) | ||
| 107 | #define VERR_NET_PROTOCOL_TYPE (-441) | ||
| 108 | #define VERR_NET_PROTOCOL_NOT_AVAILABLE (-442) | ||
| 109 | #define VERR_NET_PROTOCOL_NOT_SUPPORTED (-443) | ||
| 110 | #define VERR_NET_SOCKET_TYPE_NOT_SUPPORTED (-444) | ||
| 111 | #define VERR_NET_OPERATION_NOT_SUPPORTED (-445) | ||
| 112 | #define VERR_NET_PROTOCOL_FAMILY_NOT_SUPPORTED (-446) | ||
| 113 | #define VERR_NET_ADDRESS_FAMILY_NOT_SUPPORTED (-447) | ||
| 114 | #define VERR_NET_ADDRESS_IN_USE (-448) | ||
| 115 | #define VERR_NET_ADDRESS_NOT_AVAILABLE (-449) | ||
| 116 | #define VERR_NET_DOWN (-450) | ||
| 117 | #define VERR_NET_UNREACHABLE (-451) | ||
| 118 | #define VERR_NET_CONNECTION_RESET (-452) | ||
| 119 | #define VERR_NET_CONNECTION_ABORTED (-453) | ||
| 120 | #define VERR_NET_CONNECTION_RESET_BY_PEER (-454) | ||
| 121 | #define VERR_NET_NO_BUFFER_SPACE (-455) | ||
| 122 | #define VERR_NET_ALREADY_CONNECTED (-456) | ||
| 123 | #define VERR_NET_NOT_CONNECTED (-457) | ||
| 124 | #define VERR_NET_SHUTDOWN (-458) | ||
| 125 | #define VERR_NET_TOO_MANY_REFERENCES (-459) | ||
| 126 | #define VERR_NET_CONNECTION_TIMED_OUT (-460) | ||
| 127 | #define VERR_NET_CONNECTION_REFUSED (-461) | ||
| 128 | #define VERR_NET_HOST_DOWN (-464) | ||
| 129 | #define VERR_NET_HOST_UNREACHABLE (-465) | ||
| 130 | #define VERR_NET_PROTOCOL_ERROR (-466) | ||
| 131 | #define VERR_NET_INCOMPLETE_TX_PACKET (-467) | ||
| 132 | |||
| 133 | /* misc. unsorted codes */ | ||
| 134 | #define VERR_RESOURCE_BUSY (-138) | ||
| 135 | #define VERR_DISK_FULL (-152) | ||
| 136 | #define VERR_TOO_MANY_SYMLINKS (-156) | ||
| 137 | #define VERR_NO_MORE_FILES (-201) | ||
| 138 | #define VERR_INTERNAL_ERROR (-225) | ||
| 139 | #define VERR_INTERNAL_ERROR_2 (-226) | ||
| 140 | #define VERR_INTERNAL_ERROR_3 (-227) | ||
| 141 | #define VERR_INTERNAL_ERROR_4 (-228) | ||
| 142 | #define VERR_DEV_IO_ERROR (-250) | ||
| 143 | #define VERR_IO_BAD_LENGTH (-255) | ||
| 144 | #define VERR_BROKEN_PIPE (-301) | ||
| 145 | #define VERR_NO_DATA (-304) | ||
| 146 | #define VERR_SEM_DESTROYED (-363) | ||
| 147 | #define VERR_DEADLOCK (-365) | ||
| 148 | #define VERR_BAD_EXE_FORMAT (-608) | ||
| 149 | #define VINF_HGCM_ASYNC_EXECUTE (2903) | ||
| 150 | |||
| 151 | #endif | ||
| @@ -0,0 +1,226 @@ | |||
| 1 | /* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */ | ||
| 2 | /* | ||
| 3 | * Virtual Device for Guest <-> VMM/Host communication, type definitions | ||
| 4 | * which are also used for the vboxguest ioctl interface / by vboxsf | ||
| 5 | * | ||
| 6 | * Copyright (C) 2006-2016 Oracle Corporation | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __UAPI_VBOX_VMMDEV_TYPES_H__ | ||
| 10 | #define __UAPI_VBOX_VMMDEV_TYPES_H__ | ||
| 11 | |||
| 12 | #include <asm/bitsperlong.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * We cannot use linux' compiletime_assert here because it expects to be used | ||
| 17 | * inside a function only. Use a typedef to a char array with a negative size. | ||
| 18 | */ | ||
| 19 | #define VMMDEV_ASSERT_SIZE(type, size) \ | ||
| 20 | typedef char type ## _asrt_size[1 - 2*!!(sizeof(struct type) != (size))] | ||
| 21 | |||
| 22 | /** enum vmmdev_request_type - VMMDev request types. */ | ||
| 23 | enum vmmdev_request_type { | ||
| 24 | VMMDEVREQ_INVALID_REQUEST = 0, | ||
| 25 | VMMDEVREQ_GET_MOUSE_STATUS = 1, | ||
| 26 | VMMDEVREQ_SET_MOUSE_STATUS = 2, | ||
| 27 | VMMDEVREQ_SET_POINTER_SHAPE = 3, | ||
| 28 | VMMDEVREQ_GET_HOST_VERSION = 4, | ||
| 29 | VMMDEVREQ_IDLE = 5, | ||
| 30 | VMMDEVREQ_GET_HOST_TIME = 10, | ||
| 31 | VMMDEVREQ_GET_HYPERVISOR_INFO = 20, | ||
| 32 | VMMDEVREQ_SET_HYPERVISOR_INFO = 21, | ||
| 33 | VMMDEVREQ_REGISTER_PATCH_MEMORY = 22, /* since version 3.0.6 */ | ||
| 34 | VMMDEVREQ_DEREGISTER_PATCH_MEMORY = 23, /* since version 3.0.6 */ | ||
| 35 | VMMDEVREQ_SET_POWER_STATUS = 30, | ||
| 36 | VMMDEVREQ_ACKNOWLEDGE_EVENTS = 41, | ||
| 37 | VMMDEVREQ_CTL_GUEST_FILTER_MASK = 42, | ||
| 38 | VMMDEVREQ_REPORT_GUEST_INFO = 50, | ||
| 39 | VMMDEVREQ_REPORT_GUEST_INFO2 = 58, /* since version 3.2.0 */ | ||
| 40 | VMMDEVREQ_REPORT_GUEST_STATUS = 59, /* since version 3.2.8 */ | ||
| 41 | VMMDEVREQ_REPORT_GUEST_USER_STATE = 74, /* since version 4.3 */ | ||
| 42 | /* Retrieve a display resize request sent by the host, deprecated. */ | ||
| 43 | VMMDEVREQ_GET_DISPLAY_CHANGE_REQ = 51, | ||
| 44 | VMMDEVREQ_VIDEMODE_SUPPORTED = 52, | ||
| 45 | VMMDEVREQ_GET_HEIGHT_REDUCTION = 53, | ||
| 46 | /** | ||
| 47 | * @VMMDEVREQ_GET_DISPLAY_CHANGE_REQ2: | ||
| 48 | * Retrieve a display resize request sent by the host. | ||
| 49 | * | ||
| 50 | * Queries a display resize request sent from the host. If the | ||
| 51 | * event_ack member is sent to true and there is an unqueried request | ||
| 52 | * available for one of the virtual display then that request will | ||
| 53 | * be returned. If several displays have unqueried requests the lowest | ||
| 54 | * numbered display will be chosen first. Only the most recent unseen | ||
| 55 | * request for each display is remembered. | ||
| 56 | * If event_ack is set to false, the last host request queried with | ||
| 57 | * event_ack set is resent, or failing that the most recent received | ||
| 58 | * from the host. If no host request was ever received then all zeros | ||
| 59 | * are returned. | ||
| 60 | */ | ||
| 61 | VMMDEVREQ_GET_DISPLAY_CHANGE_REQ2 = 54, | ||
| 62 | VMMDEVREQ_REPORT_GUEST_CAPABILITIES = 55, | ||
| 63 | VMMDEVREQ_SET_GUEST_CAPABILITIES = 56, | ||
| 64 | VMMDEVREQ_VIDEMODE_SUPPORTED2 = 57, /* since version 3.2.0 */ | ||
| 65 | VMMDEVREQ_GET_DISPLAY_CHANGE_REQEX = 80, /* since version 4.2.4 */ | ||
| 66 | VMMDEVREQ_HGCM_CONNECT = 60, | ||
| 67 | VMMDEVREQ_HGCM_DISCONNECT = 61, | ||
| 68 | VMMDEVREQ_HGCM_CALL32 = 62, | ||
| 69 | VMMDEVREQ_HGCM_CALL64 = 63, | ||
| 70 | VMMDEVREQ_HGCM_CANCEL = 64, | ||
| 71 | VMMDEVREQ_HGCM_CANCEL2 = 65, | ||
| 72 | VMMDEVREQ_VIDEO_ACCEL_ENABLE = 70, | ||
| 73 | VMMDEVREQ_VIDEO_ACCEL_FLUSH = 71, | ||
| 74 | VMMDEVREQ_VIDEO_SET_VISIBLE_REGION = 72, | ||
| 75 | VMMDEVREQ_GET_SEAMLESS_CHANGE_REQ = 73, | ||
| 76 | VMMDEVREQ_QUERY_CREDENTIALS = 100, | ||
| 77 | VMMDEVREQ_REPORT_CREDENTIALS_JUDGEMENT = 101, | ||
| 78 | VMMDEVREQ_REPORT_GUEST_STATS = 110, | ||
| 79 | VMMDEVREQ_GET_MEMBALLOON_CHANGE_REQ = 111, | ||
| 80 | VMMDEVREQ_GET_STATISTICS_CHANGE_REQ = 112, | ||
| 81 | VMMDEVREQ_CHANGE_MEMBALLOON = 113, | ||
| 82 | VMMDEVREQ_GET_VRDPCHANGE_REQ = 150, | ||
| 83 | VMMDEVREQ_LOG_STRING = 200, | ||
| 84 | VMMDEVREQ_GET_CPU_HOTPLUG_REQ = 210, | ||
| 85 | VMMDEVREQ_SET_CPU_HOTPLUG_STATUS = 211, | ||
| 86 | VMMDEVREQ_REGISTER_SHARED_MODULE = 212, | ||
| 87 | VMMDEVREQ_UNREGISTER_SHARED_MODULE = 213, | ||
| 88 | VMMDEVREQ_CHECK_SHARED_MODULES = 214, | ||
| 89 | VMMDEVREQ_GET_PAGE_SHARING_STATUS = 215, | ||
| 90 | VMMDEVREQ_DEBUG_IS_PAGE_SHARED = 216, | ||
| 91 | VMMDEVREQ_GET_SESSION_ID = 217, /* since version 3.2.8 */ | ||
| 92 | VMMDEVREQ_WRITE_COREDUMP = 218, | ||
| 93 | VMMDEVREQ_GUEST_HEARTBEAT = 219, | ||
| 94 | VMMDEVREQ_HEARTBEAT_CONFIGURE = 220, | ||
| 95 | /* Ensure the enum is a 32 bit data-type */ | ||
| 96 | VMMDEVREQ_SIZEHACK = 0x7fffffff | ||
| 97 | }; | ||
| 98 | |||
| 99 | #if __BITS_PER_LONG == 64 | ||
| 100 | #define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL64 | ||
| 101 | #else | ||
| 102 | #define VMMDEVREQ_HGCM_CALL VMMDEVREQ_HGCM_CALL32 | ||
| 103 | #endif | ||
| 104 | |||
| 105 | /** HGCM service location types. */ | ||
| 106 | enum vmmdev_hgcm_service_location_type { | ||
| 107 | VMMDEV_HGCM_LOC_INVALID = 0, | ||
| 108 | VMMDEV_HGCM_LOC_LOCALHOST = 1, | ||
| 109 | VMMDEV_HGCM_LOC_LOCALHOST_EXISTING = 2, | ||
| 110 | /* Ensure the enum is a 32 bit data-type */ | ||
| 111 | VMMDEV_HGCM_LOC_SIZEHACK = 0x7fffffff | ||
| 112 | }; | ||
| 113 | |||
| 114 | /** HGCM host service location. */ | ||
| 115 | struct vmmdev_hgcm_service_location_localhost { | ||
| 116 | /** Service name */ | ||
| 117 | char service_name[128]; | ||
| 118 | }; | ||
| 119 | VMMDEV_ASSERT_SIZE(vmmdev_hgcm_service_location_localhost, 128); | ||
| 120 | |||
| 121 | /** HGCM service location. */ | ||
| 122 | struct vmmdev_hgcm_service_location { | ||
| 123 | /** Type of the location. */ | ||
| 124 | enum vmmdev_hgcm_service_location_type type; | ||
| 125 | |||
| 126 | union { | ||
| 127 | struct vmmdev_hgcm_service_location_localhost localhost; | ||
| 128 | } u; | ||
| 129 | }; | ||
| 130 | VMMDEV_ASSERT_SIZE(vmmdev_hgcm_service_location, 128 + 4); | ||
| 131 | |||
| 132 | /** HGCM function parameter type. */ | ||
| 133 | enum vmmdev_hgcm_function_parameter_type { | ||
| 134 | VMMDEV_HGCM_PARM_TYPE_INVALID = 0, | ||
| 135 | VMMDEV_HGCM_PARM_TYPE_32BIT = 1, | ||
| 136 | VMMDEV_HGCM_PARM_TYPE_64BIT = 2, | ||
| 137 | /** Deprecated Doesn't work, use PAGELIST. */ | ||
| 138 | VMMDEV_HGCM_PARM_TYPE_PHYSADDR = 3, | ||
| 139 | /** In and Out, user-memory */ | ||
| 140 | VMMDEV_HGCM_PARM_TYPE_LINADDR = 4, | ||
| 141 | /** In, user-memory (read; host<-guest) */ | ||
| 142 | VMMDEV_HGCM_PARM_TYPE_LINADDR_IN = 5, | ||
| 143 | /** Out, user-memory (write; host->guest) */ | ||
| 144 | VMMDEV_HGCM_PARM_TYPE_LINADDR_OUT = 6, | ||
| 145 | /** In and Out, kernel-memory */ | ||
| 146 | VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL = 7, | ||
| 147 | /** In, kernel-memory (read; host<-guest) */ | ||
| 148 | VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN = 8, | ||
| 149 | /** Out, kernel-memory (write; host->guest) */ | ||
| 150 | VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_OUT = 9, | ||
| 151 | /** Physical addresses of locked pages for a buffer. */ | ||
| 152 | VMMDEV_HGCM_PARM_TYPE_PAGELIST = 10, | ||
| 153 | /* Ensure the enum is a 32 bit data-type */ | ||
| 154 | VMMDEV_HGCM_PARM_TYPE_SIZEHACK = 0x7fffffff | ||
| 155 | }; | ||
| 156 | |||
| 157 | /** HGCM function parameter, 32-bit client. */ | ||
| 158 | struct vmmdev_hgcm_function_parameter32 { | ||
| 159 | enum vmmdev_hgcm_function_parameter_type type; | ||
| 160 | union { | ||
| 161 | __u32 value32; | ||
| 162 | __u64 value64; | ||
| 163 | struct { | ||
| 164 | __u32 size; | ||
| 165 | union { | ||
| 166 | __u32 phys_addr; | ||
| 167 | __u32 linear_addr; | ||
| 168 | } u; | ||
| 169 | } pointer; | ||
| 170 | struct { | ||
| 171 | /** Size of the buffer described by the page list. */ | ||
| 172 | __u32 size; | ||
| 173 | /** Relative to the request header. */ | ||
| 174 | __u32 offset; | ||
| 175 | } page_list; | ||
| 176 | } u; | ||
| 177 | } __packed; | ||
| 178 | VMMDEV_ASSERT_SIZE(vmmdev_hgcm_function_parameter32, 4 + 8); | ||
| 179 | |||
| 180 | /** HGCM function parameter, 64-bit client. */ | ||
| 181 | struct vmmdev_hgcm_function_parameter64 { | ||
| 182 | enum vmmdev_hgcm_function_parameter_type type; | ||
| 183 | union { | ||
| 184 | __u32 value32; | ||
| 185 | __u64 value64; | ||
| 186 | struct { | ||
| 187 | __u32 size; | ||
| 188 | union { | ||
| 189 | __u64 phys_addr; | ||
| 190 | __u64 linear_addr; | ||
| 191 | } u; | ||
| 192 | } __packed pointer; | ||
| 193 | struct { | ||
| 194 | /** Size of the buffer described by the page list. */ | ||
| 195 | __u32 size; | ||
| 196 | /** Relative to the request header. */ | ||
| 197 | __u32 offset; | ||
| 198 | } page_list; | ||
| 199 | } __packed u; | ||
| 200 | } __packed; | ||
| 201 | VMMDEV_ASSERT_SIZE(vmmdev_hgcm_function_parameter64, 4 + 12); | ||
| 202 | |||
| 203 | #if __BITS_PER_LONG == 64 | ||
| 204 | #define vmmdev_hgcm_function_parameter vmmdev_hgcm_function_parameter64 | ||
| 205 | #else | ||
| 206 | #define vmmdev_hgcm_function_parameter vmmdev_hgcm_function_parameter32 | ||
| 207 | #endif | ||
| 208 | |||
| 209 | #define VMMDEV_HGCM_F_PARM_DIRECTION_NONE 0x00000000U | ||
| 210 | #define VMMDEV_HGCM_F_PARM_DIRECTION_TO_HOST 0x00000001U | ||
| 211 | #define VMMDEV_HGCM_F_PARM_DIRECTION_FROM_HOST 0x00000002U | ||
| 212 | #define VMMDEV_HGCM_F_PARM_DIRECTION_BOTH 0x00000003U | ||
| 213 | |||
| 214 | /** | ||
| 215 | * struct vmmdev_hgcm_pagelist - VMMDEV_HGCM_PARM_TYPE_PAGELIST parameters | ||
| 216 | * point to this structure to actually describe the buffer. | ||
| 217 | */ | ||
| 218 | struct vmmdev_hgcm_pagelist { | ||
| 219 | __u32 flags; /** VMMDEV_HGCM_F_PARM_*. */ | ||
| 220 | __u16 offset_first_page; /** Data offset in the first page. */ | ||
| 221 | __u16 page_count; /** Number of pages. */ | ||
| 222 | __u64 pages[1]; /** Page addresses. */ | ||
| 223 | }; | ||
| 224 | VMMDEV_ASSERT_SIZE(vmmdev_hgcm_pagelist, 4 + 2 + 2 + 8); | ||
| 225 | |||
| 226 | #endif | ||
| @@ -0,0 +1,330 @@ | |||
| 1 | /* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */ | ||
| 2 | /* | ||
| 3 | * VBoxGuest - VirtualBox Guest Additions Driver Interface. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2006-2016 Oracle Corporation | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __UAPI_VBOXGUEST_H__ | ||
| 9 | #define __UAPI_VBOXGUEST_H__ | ||
| 10 | |||
| 11 | #include <asm/bitsperlong.h> | ||
| 12 | #include <linux/ioctl.h> | ||
| 13 | #include <linux/vbox_err.h> | ||
| 14 | #include <linux/vbox_vmmdev_types.h> | ||
| 15 | |||
| 16 | /* Version of vbg_ioctl_hdr structure. */ | ||
| 17 | #define VBG_IOCTL_HDR_VERSION 0x10001 | ||
| 18 | /* Default request type. Use this for non-VMMDev requests. */ | ||
| 19 | #define VBG_IOCTL_HDR_TYPE_DEFAULT 0 | ||
| 20 | |||
| 21 | /** | ||
| 22 | * Common ioctl header. | ||
| 23 | * | ||
| 24 | * This is a mirror of vmmdev_request_header to prevent duplicating data and | ||
| 25 | * needing to verify things multiple times. | ||
| 26 | */ | ||
| 27 | struct vbg_ioctl_hdr { | ||
| 28 | /** IN: The request input size, and output size if size_out is zero. */ | ||
| 29 | __u32 size_in; | ||
| 30 | /** IN: Structure version (VBG_IOCTL_HDR_VERSION) */ | ||
| 31 | __u32 version; | ||
| 32 | /** IN: The VMMDev request type or VBG_IOCTL_HDR_TYPE_DEFAULT. */ | ||
| 33 | __u32 type; | ||
| 34 | /** | ||
| 35 | * OUT: The VBox status code of the operation, out direction only. | ||
| 36 | * This is a VINF_ or VERR_ value as defined in vbox_err.h. | ||
| 37 | */ | ||
| 38 | __s32 rc; | ||
| 39 | /** IN: Output size. Set to zero to use size_in as output size. */ | ||
| 40 | __u32 size_out; | ||
| 41 | /** Reserved, MBZ. */ | ||
| 42 | __u32 reserved; | ||
| 43 | }; | ||
| 44 | VMMDEV_ASSERT_SIZE(vbg_ioctl_hdr, 24); | ||
| 45 | |||
| 46 | |||
| 47 | /* | ||
| 48 | * The VBoxGuest I/O control version. | ||
| 49 | * | ||
| 50 | * As usual, the high word contains the major version and changes to it | ||
| 51 | * signifies incompatible changes. | ||
| 52 | * | ||
| 53 | * The lower word is the minor version number, it is increased when new | ||
| 54 | * functions are added or existing changed in a backwards compatible manner. | ||
| 55 | */ | ||
| 56 | #define VBG_IOC_VERSION 0x00010000u | ||
| 57 | |||
| 58 | /** | ||
| 59 | * VBG_IOCTL_DRIVER_VERSION_INFO data structure | ||
| 60 | * | ||
| 61 | * Note VBG_IOCTL_DRIVER_VERSION_INFO may switch the session to a backwards | ||
| 62 | * compatible interface version if uClientVersion indicates older client code. | ||
| 63 | */ | ||
| 64 | struct vbg_ioctl_driver_version_info { | ||
| 65 | /** The header. */ | ||
| 66 | struct vbg_ioctl_hdr hdr; | ||
| 67 | union { | ||
| 68 | struct { | ||
| 69 | /** Requested interface version (VBG_IOC_VERSION). */ | ||
| 70 | __u32 req_version; | ||
| 71 | /** | ||
| 72 | * Minimum interface version number (typically the | ||
| 73 | * major version part of VBG_IOC_VERSION). | ||
| 74 | */ | ||
| 75 | __u32 min_version; | ||
| 76 | /** Reserved, MBZ. */ | ||
| 77 | __u32 reserved1; | ||
| 78 | /** Reserved, MBZ. */ | ||
| 79 | __u32 reserved2; | ||
| 80 | } in; | ||
| 81 | struct { | ||
| 82 | /** Version for this session (typ. VBG_IOC_VERSION). */ | ||
| 83 | __u32 session_version; | ||
| 84 | /** Version of the IDC interface (VBG_IOC_VERSION). */ | ||
| 85 | __u32 driver_version; | ||
| 86 | /** The SVN revision of the driver, or 0. */ | ||
| 87 | __u32 driver_revision; | ||
| 88 | /** Reserved \#1 (zero until defined). */ | ||
| 89 | __u32 reserved1; | ||
| 90 | /** Reserved \#2 (zero until defined). */ | ||
| 91 | __u32 reserved2; | ||
| 92 | } out; | ||
| 93 | } u; | ||
| 94 | }; | ||
| 95 | VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20); | ||
| 96 | |||
| 97 | #define VBG_IOCTL_DRIVER_VERSION_INFO \ | ||
| 98 | _IOWR('V', 0, struct vbg_ioctl_driver_version_info) | ||
| 99 | |||
| 100 | |||
| 101 | /* IOCTL to perform a VMM Device request less than 1KB in size. */ | ||
| 102 | #define VBG_IOCTL_VMMDEV_REQUEST(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 2, s) | ||
| 103 | |||
| 104 | |||
| 105 | /* IOCTL to perform a VMM Device request larger then 1KB. */ | ||
| 106 | #define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0) | ||
| 107 | |||
| 108 | |||
| 109 | /** VBG_IOCTL_HGCM_CONNECT data structure. */ | ||
| 110 | struct vbg_ioctl_hgcm_connect { | ||
| 111 | struct vbg_ioctl_hdr hdr; | ||
| 112 | union { | ||
| 113 | struct { | ||
| 114 | struct vmmdev_hgcm_service_location loc; | ||
| 115 | } in; | ||
| 116 | struct { | ||
| 117 | __u32 client_id; | ||
| 118 | } out; | ||
| 119 | } u; | ||
| 120 | }; | ||
| 121 | VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_connect, 24 + 132); | ||
| 122 | |||
| 123 | #define VBG_IOCTL_HGCM_CONNECT \ | ||
| 124 | _IOWR('V', 4, struct vbg_ioctl_hgcm_connect) | ||
| 125 | |||
| 126 | |||
| 127 | /** VBG_IOCTL_HGCM_DISCONNECT data structure. */ | ||
| 128 | struct vbg_ioctl_hgcm_disconnect { | ||
| 129 | struct vbg_ioctl_hdr hdr; | ||
| 130 | union { | ||
| 131 | struct { | ||
| 132 | __u32 client_id; | ||
| 133 | } in; | ||
| 134 | } u; | ||
| 135 | }; | ||
| 136 | VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_disconnect, 24 + 4); | ||
| 137 | |||
| 138 | #define VBG_IOCTL_HGCM_DISCONNECT \ | ||
| 139 | _IOWR('V', 5, struct vbg_ioctl_hgcm_disconnect) | ||
| 140 | |||
| 141 | |||
| 142 | /** VBG_IOCTL_HGCM_CALL data structure. */ | ||
| 143 | struct vbg_ioctl_hgcm_call { | ||
| 144 | /** The header. */ | ||
| 145 | struct vbg_ioctl_hdr hdr; | ||
| 146 | /** Input: The id of the caller. */ | ||
| 147 | __u32 client_id; | ||
| 148 | /** Input: Function number. */ | ||
| 149 | __u32 function; | ||
| 150 | /** | ||
| 151 | * Input: How long to wait (milliseconds) for completion before | ||
| 152 | * cancelling the call. Set to -1 to wait indefinitely. | ||
| 153 | */ | ||
| 154 | __u32 timeout_ms; | ||
| 155 | /** Interruptable flag, ignored for userspace calls. */ | ||
| 156 | __u8 interruptible; | ||
| 157 | /** Explicit padding, MBZ. */ | ||
| 158 | __u8 reserved; | ||
| 159 | /** | ||
| 160 | * Input: How many parameters following this structure. | ||
| 161 | * | ||
| 162 | * The parameters are either HGCMFunctionParameter64 or 32, | ||
| 163 | * depending on whether we're receiving a 64-bit or 32-bit request. | ||
| 164 | * | ||
| 165 | * The current maximum is 61 parameters (given a 1KB max request size, | ||
| 166 | * and a 64-bit parameter size of 16 bytes). | ||
| 167 | */ | ||
| 168 | __u16 parm_count; | ||
| 169 | /* | ||
| 170 | * Parameters follow in form: | ||
| 171 | * struct hgcm_function_parameter<32|64> parms[parm_count] | ||
| 172 | */ | ||
| 173 | }; | ||
| 174 | VMMDEV_ASSERT_SIZE(vbg_ioctl_hgcm_call, 24 + 16); | ||
| 175 | |||
| 176 | #define VBG_IOCTL_HGCM_CALL_32(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 6, s) | ||
| 177 | #define VBG_IOCTL_HGCM_CALL_64(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 7, s) | ||
| 178 | #if __BITS_PER_LONG == 64 | ||
| 179 | #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_64(s) | ||
| 180 | #else | ||
| 181 | #define VBG_IOCTL_HGCM_CALL(s) VBG_IOCTL_HGCM_CALL_32(s) | ||
| 182 | #endif | ||
| 183 | |||
| 184 | |||
| 185 | /** VBG_IOCTL_LOG data structure. */ | ||
| 186 | struct vbg_ioctl_log { | ||
| 187 | /** The header. */ | ||
| 188 | struct vbg_ioctl_hdr hdr; | ||
| 189 | union { | ||
| 190 | struct { | ||
| 191 | /** | ||
| 192 | * The log message, this may be zero terminated. If it | ||
| 193 | * is not zero terminated then the length is determined | ||
| 194 | * from the input size. | ||
| 195 | */ | ||
| 196 | char msg[1]; | ||
| 197 | } in; | ||
| 198 | } u; | ||
| 199 | }; | ||
| 200 | |||
| 201 | #define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s) | ||
| 202 | |||
| 203 | |||
| 204 | /** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */ | ||
| 205 | struct vbg_ioctl_wait_for_events { | ||
| 206 | /** The header. */ | ||
| 207 | struct vbg_ioctl_hdr hdr; | ||
| 208 | union { | ||
| 209 | struct { | ||
| 210 | /** Timeout in milliseconds. */ | ||
| 211 | __u32 timeout_ms; | ||
| 212 | /** Events to wait for. */ | ||
| 213 | __u32 events; | ||
| 214 | } in; | ||
| 215 | struct { | ||
| 216 | /** Events that occurred. */ | ||
| 217 | __u32 events; | ||
| 218 | } out; | ||
| 219 | } u; | ||
| 220 | }; | ||
| 221 | VMMDEV_ASSERT_SIZE(vbg_ioctl_wait_for_events, 24 + 8); | ||
| 222 | |||
| 223 | #define VBG_IOCTL_WAIT_FOR_EVENTS \ | ||
| 224 | _IOWR('V', 10, struct vbg_ioctl_wait_for_events) | ||
| 225 | |||
| 226 | |||
| 227 | /* | ||
| 228 | * IOCTL to VBoxGuest to interrupt (cancel) any pending | ||
| 229 | * VBG_IOCTL_WAIT_FOR_EVENTS and return. | ||
| 230 | * | ||
| 231 | * Handled inside the vboxguest driver and not seen by the host at all. | ||
| 232 | * After calling this, VBG_IOCTL_WAIT_FOR_EVENTS should no longer be called in | ||
| 233 | * the same session. Any VBOXGUEST_IOCTL_WAITEVENT calls in the same session | ||
| 234 | * done after calling this will directly exit with -EINTR. | ||
| 235 | */ | ||
| 236 | #define VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS \ | ||
| 237 | _IOWR('V', 11, struct vbg_ioctl_hdr) | ||
| 238 | |||
| 239 | |||
| 240 | /** VBG_IOCTL_CHANGE_FILTER_MASK data structure. */ | ||
| 241 | struct vbg_ioctl_change_filter { | ||
| 242 | /** The header. */ | ||
| 243 | struct vbg_ioctl_hdr hdr; | ||
| 244 | union { | ||
| 245 | struct { | ||
| 246 | /** Flags to set. */ | ||
| 247 | __u32 or_mask; | ||
| 248 | /** Flags to remove. */ | ||
| 249 | __u32 not_mask; | ||
| 250 | } in; | ||
| 251 | } u; | ||
| 252 | }; | ||
| 253 | VMMDEV_ASSERT_SIZE(vbg_ioctl_change_filter, 24 + 8); | ||
| 254 | |||
| 255 | /* IOCTL to VBoxGuest to control the event filter mask. */ | ||
| 256 | #define VBG_IOCTL_CHANGE_FILTER_MASK \ | ||
| 257 | _IOWR('V', 12, struct vbg_ioctl_change_filter) | ||
| 258 | |||
| 259 | |||
| 260 | /** VBG_IOCTL_CHANGE_GUEST_CAPABILITIES data structure. */ | ||
| 261 | struct vbg_ioctl_set_guest_caps { | ||
| 262 | /** The header. */ | ||
| 263 | struct vbg_ioctl_hdr hdr; | ||
| 264 | union { | ||
| 265 | struct { | ||
| 266 | /** Capabilities to set (VMMDEV_GUEST_SUPPORTS_XXX). */ | ||
| 267 | __u32 or_mask; | ||
| 268 | /** Capabilities to drop (VMMDEV_GUEST_SUPPORTS_XXX). */ | ||
| 269 | __u32 not_mask; | ||
| 270 | } in; | ||
| 271 | struct { | ||
| 272 | /** Capabilities held by the session after the call. */ | ||
| 273 | __u32 session_caps; | ||
| 274 | /** Capabilities for all the sessions after the call. */ | ||
| 275 | __u32 global_caps; | ||
| 276 | } out; | ||
| 277 | } u; | ||
| 278 | }; | ||
| 279 | VMMDEV_ASSERT_SIZE(vbg_ioctl_set_guest_caps, 24 + 8); | ||
| 280 | |||
| 281 | #define VBG_IOCTL_CHANGE_GUEST_CAPABILITIES \ | ||
| 282 | _IOWR('V', 14, struct vbg_ioctl_set_guest_caps) | ||
| 283 | |||
| 284 | |||
| 285 | /** VBG_IOCTL_CHECK_BALLOON data structure. */ | ||
| 286 | struct vbg_ioctl_check_balloon { | ||
| 287 | /** The header. */ | ||
| 288 | struct vbg_ioctl_hdr hdr; | ||
| 289 | union { | ||
| 290 | struct { | ||
| 291 | /** The size of the balloon in chunks of 1MB. */ | ||
| 292 | __u32 balloon_chunks; | ||
| 293 | /** | ||
| 294 | * false = handled in R0, no further action required. | ||
| 295 | * true = allocate balloon memory in R3. | ||
| 296 | */ | ||
| 297 | __u8 handle_in_r3; | ||
| 298 | /** Explicit padding, MBZ. */ | ||
| 299 | __u8 padding[3]; | ||
| 300 | } out; | ||
| 301 | } u; | ||
| 302 | }; | ||
| 303 | VMMDEV_ASSERT_SIZE(vbg_ioctl_check_balloon, 24 + 8); | ||
| 304 | |||
| 305 | /* | ||
| 306 | * IOCTL to check memory ballooning. | ||
| 307 | * | ||
| 308 | * The guest kernel module will ask the host for the current size of the | ||
| 309 | * balloon and adjust the size. Or it will set handle_in_r3 = true and R3 is | ||
| 310 | * responsible for allocating memory and calling VBG_IOCTL_CHANGE_BALLOON. | ||
| 311 | */ | ||
| 312 | #define VBG_IOCTL_CHECK_BALLOON \ | ||
| 313 | _IOWR('V', 17, struct vbg_ioctl_check_balloon) | ||
| 314 | |||
| 315 | |||
| 316 | /** VBG_IOCTL_WRITE_CORE_DUMP data structure. */ | ||
| 317 | struct vbg_ioctl_write_coredump { | ||
| 318 | struct vbg_ioctl_hdr hdr; | ||
| 319 | union { | ||
| 320 | struct { | ||
| 321 | __u32 flags; /** Flags (reserved, MBZ). */ | ||
| 322 | } in; | ||
| 323 | } u; | ||
| 324 | }; | ||
| 325 | VMMDEV_ASSERT_SIZE(vbg_ioctl_write_coredump, 24 + 4); | ||
| 326 | |||
| 327 | #define VBG_IOCTL_WRITE_CORE_DUMP \ | ||
| 328 | _IOWR('V', 19, struct vbg_ioctl_write_coredump) | ||
| 329 | |||
| 330 | #endif | ||
| @@ -301,6 +301,16 @@ struct vfio_region_info_cap_type { · 300 unmodified lines | |||
| 301 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2) | 301 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2) |
| 302 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) | 302 | #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) |
| 303 | 303 | ||
| 304 | /* | ||
| 305 | * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped | ||
| 306 | * which allows direct access to non-MSIX registers which happened to be within | ||
| 307 | * the same system page. | ||
| 308 | * | ||
| 309 | * Even though the userspace gets direct access to the MSIX data, the existing | ||
| 310 | * VFIO_DEVICE_SET_IRQS interface must still be used for MSIX configuration. | ||
| 311 | */ | ||
| 312 | #define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3 | ||
| 313 | |||
| 304 | /** | 314 | /** |
| 305 | * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9, | 315 | * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9, |
| 306 | * struct vfio_irq_info) | 316 | * struct vfio_irq_info) |
| @@ -503,6 +513,68 @@ struct vfio_pci_hot_reset { · 196 unmodified lines | |||
| 503 | 513 | ||
| 504 | #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) | 514 | #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) |
| 505 | 515 | ||
| 516 | /** | ||
| 517 | * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, | ||
| 518 | * struct vfio_device_query_gfx_plane) | ||
| 519 | * | ||
| 520 | * Set the drm_plane_type and flags, then retrieve the gfx plane info. | ||
| 521 | * | ||
| 522 | * flags supported: | ||
| 523 | * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set | ||
| 524 | * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no | ||
| 525 | * support for dma-buf. | ||
| 526 | * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set | ||
| 527 | * to ask if the mdev supports region. 0 on support, -EINVAL on no | ||
| 528 | * support for region. | ||
| 529 | * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set | ||
| 530 | * with each call to query the plane info. | ||
| 531 | * - Others are invalid and return -EINVAL. | ||
| 532 | * | ||
| 533 | * Note: | ||
| 534 | * 1. Plane could be disabled by guest. In that case, success will be | ||
| 535 | * returned with zero-initialized drm_format, size, width and height | ||
| 536 | * fields. | ||
| 537 | * 2. x_hot/y_hot is set to 0xFFFFFFFF if no hotspot information available | ||
| 538 | * | ||
| 539 | * Return: 0 on success, -errno on other failure. | ||
| 540 | */ | ||
| 541 | struct vfio_device_gfx_plane_info { | ||
| 542 | __u32 argsz; | ||
| 543 | __u32 flags; | ||
| 544 | #define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0) | ||
| 545 | #define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1) | ||
| 546 | #define VFIO_GFX_PLANE_TYPE_REGION (1 << 2) | ||
| 547 | /* in */ | ||
| 548 | __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */ | ||
| 549 | /* out */ | ||
| 550 | __u32 drm_format; /* drm format of plane */ | ||
| 551 | __u64 drm_format_mod; /* tiled mode */ | ||
| 552 | __u32 width; /* width of plane */ | ||
| 553 | __u32 height; /* height of plane */ | ||
| 554 | __u32 stride; /* stride of plane */ | ||
| 555 | __u32 size; /* size of plane in bytes, align on page*/ | ||
| 556 | __u32 x_pos; /* horizontal position of cursor plane */ | ||
| 557 | __u32 y_pos; /* vertical position of cursor plane*/ | ||
| 558 | __u32 x_hot; /* horizontal position of cursor hotspot */ | ||
| 559 | __u32 y_hot; /* vertical position of cursor hotspot */ | ||
| 560 | union { | ||
| 561 | __u32 region_index; /* region index */ | ||
| 562 | __u32 dmabuf_id; /* dma-buf id */ | ||
| 563 | }; | ||
| 564 | }; | ||
| 565 | |||
| 566 | #define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14) | ||
| 567 | |||
| 568 | /** | ||
| 569 | * VFIO_DEVICE_GET_GFX_DMABUF - _IOW(VFIO_TYPE, VFIO_BASE + 15, __u32) | ||
| 570 | * | ||
| 571 | * Return a new dma-buf file descriptor for an exposed guest framebuffer | ||
| 572 | * described by the provided dmabuf_id. The dmabuf_id is returned from VFIO_ | ||
| 573 | * DEVICE_QUERY_GFX_PLANE as a token of the exposed guest framebuffer. | ||
| 574 | */ | ||
| 575 | |||
| 576 | #define VFIO_DEVICE_GET_GFX_DMABUF _IO(VFIO_TYPE, VFIO_BASE + 15) | ||
| 577 | |||
| 506 | /* -------- API for Type1 VFIO IOMMU -------- */ | 578 | /* -------- API for Type1 VFIO IOMMU -------- */ |
| 507 | 579 | ||
| 508 | /** | 580 | /** |
| @@ -107,14 +107,14 @@ enum v4l2_field { · 106 unmodified lines | |||
| 107 | transmitted first */ | 107 | transmitted first */ |
| 108 | }; | 108 | }; |
| 109 | #define V4L2_FIELD_HAS_TOP(field) \ | 109 | #define V4L2_FIELD_HAS_TOP(field) \ |
| 110 | ((field) == V4L2_FIELD_TOP ||\ | 110 | ((field) == V4L2_FIELD_TOP ||\ |
| 111 | (field) == V4L2_FIELD_INTERLACED ||\ | 111 | (field) == V4L2_FIELD_INTERLACED ||\ |
| 112 | (field) == V4L2_FIELD_INTERLACED_TB ||\ | 112 | (field) == V4L2_FIELD_INTERLACED_TB ||\ |
| 113 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | 113 | (field) == V4L2_FIELD_INTERLACED_BT ||\ |
| 114 | (field) == V4L2_FIELD_SEQ_TB ||\ | 114 | (field) == V4L2_FIELD_SEQ_TB ||\ |
| 115 | (field) == V4L2_FIELD_SEQ_BT) | 115 | (field) == V4L2_FIELD_SEQ_BT) |
| 116 | #define V4L2_FIELD_HAS_BOTTOM(field) \ | 116 | #define V4L2_FIELD_HAS_BOTTOM(field) \ |
| 117 | ((field) == V4L2_FIELD_BOTTOM ||\ | 117 | ((field) == V4L2_FIELD_BOTTOM ||\ |
| 118 | (field) == V4L2_FIELD_INTERLACED ||\ | 118 | (field) == V4L2_FIELD_INTERLACED ||\ |
| 119 | (field) == V4L2_FIELD_INTERLACED_TB ||\ | 119 | (field) == V4L2_FIELD_INTERLACED_TB ||\ |
| 120 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | 120 | (field) == V4L2_FIELD_INTERLACED_BT ||\ |
| @@ -467,12 +467,12 @@ struct v4l2_capability { · 346 unmodified lines | |||
| 467 | * V I D E O I M A G E F O R M A T | 467 | * V I D E O I M A G E F O R M A T |
| 468 | */ | 468 | */ |
| 469 | struct v4l2_pix_format { | 469 | struct v4l2_pix_format { |
| 470 | __u32 width; | 470 | __u32 width; |
| 471 | __u32 height; | 471 | __u32 height; |
| 472 | __u32 pixelformat; | 472 | __u32 pixelformat; |
| 473 | __u32 field; /* enum v4l2_field */ | 473 | __u32 field; /* enum v4l2_field */ |
| 474 | __u32 bytesperline; /* for padding, zero if unused */ | 474 | __u32 bytesperline; /* for padding, zero if unused */ |
| 475 | __u32 sizeimage; | 475 | __u32 sizeimage; |
| 476 | __u32 colorspace; /* enum v4l2_colorspace */ | 476 | __u32 colorspace; /* enum v4l2_colorspace */ |
| 477 | __u32 priv; /* private data, depends on pixelformat */ | 477 | __u32 priv; /* private data, depends on pixelformat */ |
| 478 | __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ | 478 | __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ |
| @@ -669,6 +669,12 @@ struct v4l2_pix_format { · 190 unmodified lines | |||
| 669 | #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ | 669 | #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ |
| 670 | #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ | 670 | #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ |
| 671 | 671 | ||
| 672 | /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ | ||
| 673 | #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ | ||
| 674 | #define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */ | ||
| 675 | #define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */ | ||
| 676 | #define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */ | ||
| 677 | |||
| 672 | /* SDR formats - used only for Software Defined Radio devices */ | 678 | /* SDR formats - used only for Software Defined Radio devices */ |
| 673 | #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ | 679 | #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ |
| 674 | #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ | 680 | #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ |
| @@ -688,6 +694,7 @@ struct v4l2_pix_format { · 13 unmodified lines | |||
| 688 | /* Meta-data formats */ | 694 | /* Meta-data formats */ |
| 689 | #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ | 695 | #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ |
| 690 | #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ | 696 | #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ |
| 697 | #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ | ||
| 691 | 698 | ||
| 692 | /* priv field value to indicates that subsequent fields are valid. */ | 699 | /* priv field value to indicates that subsequent fields are valid. */ |
| 693 | #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe | 700 | #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe |
| @@ -1166,7 +1173,7 @@ typedef __u64 v4l2_std_id; · 472 unmodified lines | |||
| 1166 | V4L2_STD_NTSC_M_JP |\ | 1173 | V4L2_STD_NTSC_M_JP |\ |
| 1167 | V4L2_STD_NTSC_M_KR) | 1174 | V4L2_STD_NTSC_M_KR) |
| 1168 | /* Secam macros */ | 1175 | /* Secam macros */ |
| 1169 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ | 1176 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ |
| 1170 | V4L2_STD_SECAM_K |\ | 1177 | V4L2_STD_SECAM_K |\ |
| 1171 | V4L2_STD_SECAM_K1) | 1178 | V4L2_STD_SECAM_K1) |
| 1172 | /* All Secam Standards */ | 1179 | /* All Secam Standards */ |
| @@ -1247,7 +1254,7 @@ struct v4l2_standard { · 74 unmodified lines | |||
| 1247 | }; | 1254 | }; |
| 1248 | 1255 | ||
| 1249 | /* | 1256 | /* |
| 1250 | * D V B T T I M I N G S | 1257 | * D V B T T I M I N G S |
| 1251 | */ | 1258 | */ |
| 1252 | 1259 | ||
| 1253 | /** struct v4l2_bt_timings - BT.656/BT.1120 timing data | 1260 | /** struct v4l2_bt_timings - BT.656/BT.1120 timing data |
| @@ -1588,7 +1595,7 @@ struct v4l2_ext_controls { · 334 unmodified lines | |||
| 1588 | struct v4l2_ext_control *controls; | 1595 | struct v4l2_ext_control *controls; |
| 1589 | }; | 1596 | }; |
| 1590 | 1597 | ||
| 1591 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1598 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
| 1592 | #ifndef __KERNEL__ | 1599 | #ifndef __KERNEL__ |
| 1593 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1600 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
| 1594 | #endif | 1601 | #endif |
| @@ -1660,11 +1667,11 @@ struct v4l2_querymenu { · 65 unmodified lines | |||
| 1660 | /* Control flags */ | 1667 | /* Control flags */ |
| 1661 | #define V4L2_CTRL_FLAG_DISABLED 0x0001 | 1668 | #define V4L2_CTRL_FLAG_DISABLED 0x0001 |
| 1662 | #define V4L2_CTRL_FLAG_GRABBED 0x0002 | 1669 | #define V4L2_CTRL_FLAG_GRABBED 0x0002 |
| 1663 | #define V4L2_CTRL_FLAG_READ_ONLY 0x0004 | 1670 | #define V4L2_CTRL_FLAG_READ_ONLY 0x0004 |
| 1664 | #define V4L2_CTRL_FLAG_UPDATE 0x0008 | 1671 | #define V4L2_CTRL_FLAG_UPDATE 0x0008 |
| 1665 | #define V4L2_CTRL_FLAG_INACTIVE 0x0010 | 1672 | #define V4L2_CTRL_FLAG_INACTIVE 0x0010 |
| 1666 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 | 1673 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 |
| 1667 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 | 1674 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 |
| 1668 | #define V4L2_CTRL_FLAG_VOLATILE 0x0080 | 1675 | #define V4L2_CTRL_FLAG_VOLATILE 0x0080 |
| 1669 | #define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100 | 1676 | #define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100 |
| 1670 | #define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200 | 1677 | #define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200 |
| @@ -1778,21 +1785,21 @@ struct v4l2_hw_freq_seek { · 107 unmodified lines | |||
| 1778 | */ | 1785 | */ |
| 1779 | 1786 | ||
| 1780 | struct v4l2_rds_data { | 1787 | struct v4l2_rds_data { |
| 1781 | __u8 lsb; | 1788 | __u8 lsb; |
| 1782 | __u8 msb; | 1789 | __u8 msb; |
| 1783 | __u8 block; | 1790 | __u8 block; |
| 1784 | } __attribute__ ((packed)); | 1791 | } __attribute__ ((packed)); |
| 1785 | 1792 | ||
| 1786 | #define V4L2_RDS_BLOCK_MSK 0x7 | 1793 | #define V4L2_RDS_BLOCK_MSK 0x7 |
| 1787 | #define V4L2_RDS_BLOCK_A 0 | 1794 | #define V4L2_RDS_BLOCK_A 0 |
| 1788 | #define V4L2_RDS_BLOCK_B 1 | 1795 | #define V4L2_RDS_BLOCK_B 1 |
| 1789 | #define V4L2_RDS_BLOCK_C 2 | 1796 | #define V4L2_RDS_BLOCK_C 2 |
| 1790 | #define V4L2_RDS_BLOCK_D 3 | 1797 | #define V4L2_RDS_BLOCK_D 3 |
| 1791 | #define V4L2_RDS_BLOCK_C_ALT 4 | 1798 | #define V4L2_RDS_BLOCK_C_ALT 4 |
| 1792 | #define V4L2_RDS_BLOCK_INVALID 7 | 1799 | #define V4L2_RDS_BLOCK_INVALID 7 |
| 1793 | 1800 | ||
| 1794 | #define V4L2_RDS_BLOCK_CORRECTED 0x40 | 1801 | #define V4L2_RDS_BLOCK_CORRECTED 0x40 |
| 1795 | #define V4L2_RDS_BLOCK_ERROR 0x80 | 1802 | #define V4L2_RDS_BLOCK_ERROR 0x80 |
| 1796 | 1803 | ||
| 1797 | /* | 1804 | /* |
| 1798 | * A U D I O | 1805 | * A U D I O |
| @@ -2348,8 +2355,8 @@ struct v4l2_create_buffers { · 549 unmodified lines | |||
| 2348 | #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) | 2355 | #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) |
| 2349 | #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression) | 2356 | #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression) |
| 2350 | #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression) | 2357 | #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression) |
| 2351 | #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id) | 2358 | #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id) |
| 2352 | #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) | 2359 | #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) |
| 2353 | #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) | 2360 | #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) |
| 2354 | #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) | 2361 | #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) |
| 2355 | #define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */ | 2362 | #define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */ |
| @@ -2370,8 +2377,8 @@ struct v4l2_create_buffers { · 14 unmodified lines | |||
| 2370 | * Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. | 2377 | * Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. |
| 2371 | * You must be root to use these ioctls. Never use these in applications! | 2378 | * You must be root to use these ioctls. Never use these in applications! |
| 2372 | */ | 2379 | */ |
| 2373 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) | 2380 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) |
| 2374 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) | 2381 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) |
| 2375 | 2382 | ||
| 2376 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) | 2383 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
| 2377 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) | 2384 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) |
| @@ -52,7 +52,8 @@ struct virtio_balloon_config { · 51 unmodified lines | |||
| 52 | #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ | 52 | #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ |
| 53 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ | 53 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ |
| 54 | #define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */ | 54 | #define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */ |
| 55 | #define VIRTIO_BALLOON_S_NR 7 | 55 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ |
| 56 | #define VIRTIO_BALLOON_S_NR 8 | ||
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| 58 | * Memory statistics structure. | 59 | * Memory statistics structure. |
| @@ -57,6 +57,8 @@ · 56 unmodified lines | |||
| 57 | * Steering */ | 57 | * Steering */ |
| 58 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ | 58 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ |
| 59 | 59 | ||
| 60 | #define VIRTIO_NET_F_SPEED_DUPLEX 63 /* Device set linkspeed and duplex */ | ||
| 61 | |||
| 60 | #ifndef VIRTIO_NET_NO_LEGACY | 62 | #ifndef VIRTIO_NET_NO_LEGACY |
| 61 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ | 63 | #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ |
| 62 | #endif /* VIRTIO_NET_NO_LEGACY */ | 64 | #endif /* VIRTIO_NET_NO_LEGACY */ |
| @@ -76,6 +78,17 @@ struct virtio_net_config { · 13 unmodified lines | |||
| 76 | __u16 max_virtqueue_pairs; | 78 | __u16 max_virtqueue_pairs; |
| 77 | /* Default maximum transmit unit advice */ | 79 | /* Default maximum transmit unit advice */ |
| 78 | __u16 mtu; | 80 | __u16 mtu; |
| 81 | /* | ||
| 82 | * speed, in units of 1Mb. All values 0 to INT_MAX are legal. | ||
| 83 | * Any other value stands for unknown. | ||
| 84 | */ | ||
| 85 | __u32 speed; | ||
| 86 | /* | ||
| 87 | * 0x00 - half duplex | ||
| 88 | * 0x01 - full duplex | ||
| 89 | * Any other value stands for unknown. | ||
| 90 | */ | ||
| 91 | __u8 duplex; | ||
| 79 | } __attribute__((packed)); | 92 | } __attribute__((packed)); |
| 80 | 93 | ||
| 81 | /* | 94 | /* |