diff options
| author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-11 10:28:19 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-11 10:28:19 -0500 |
| commit | 734d1ece37fbf3d2ddfc71bc6c69e0fe35f02542 (patch) | |
| tree | c4805dd7e746b1feb9e09e9849f3245d0b2c0c6b /include/uapi | |
| parent | 216c82c6aba63eeb49d7654b448e0d47bea255bb (diff) | |
| parent | 9931faca02c604c22335f5a935a501bb2ace6e20 (diff) | |
Merge tag 'v3.8-rc3' into v4l_for_linus
Linux 3.8-rc3
* tag 'v3.8-rc3': (11110 commits)
Linux 3.8-rc3
mm: reinstante dropped pmd_trans_splitting() check
cred: Remove tgcred pointer from struct cred
drm/ttm: fix fence locking in ttm_buffer_object_transfer
ARM: clps711x: Fix bad merge of clockevents setup
ARM: highbank: save and restore L2 cache and GIC on suspend
ARM: highbank: add a power request clear
ARM: highbank: fix secondary boot and hotplug
ARM: highbank: fix typos with hignbank in power request functions
ARM: dts: fix highbank cpu mpidr values
ARM: dts: add device_type prop to cpu nodes on Calxeda platforms
drm/prime: drop reference on imported dma-buf come from gem
xen/netfront: improve truesize tracking
ARM: mx5: Fix MX53 flexcan2 clock
ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array
sctp: fix Kconfig bug in default cookie hmac selection
EDAC: Cleanup device deregistering path
EDAC: Fix EDAC Kconfig menu
EDAC: Fix kernel panic on module unloading
ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
...
Diffstat (limited to 'include/uapi')
67 files changed, 5862 insertions, 71 deletions
diff --git a/include/uapi/asm-generic/ioctls.h b/include/uapi/asm-generic/ioctls.h index 199975fac395..143dacbb7d9a 100644 --- a/include/uapi/asm-generic/ioctls.h +++ b/include/uapi/asm-generic/ioctls.h | |||
| @@ -74,6 +74,9 @@ | |||
| 74 | #define TCSETXW 0x5435 | 74 | #define TCSETXW 0x5435 |
| 75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ | 75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ |
| 76 | #define TIOCVHANGUP 0x5437 | 76 | #define TIOCVHANGUP 0x5437 |
| 77 | #define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */ | ||
| 78 | #define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */ | ||
| 79 | #define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */ | ||
| 77 | 80 | ||
| 78 | #define FIONCLEX 0x5450 | 81 | #define FIONCLEX 0x5450 |
| 79 | #define FIOCLEX 0x5451 | 82 | #define FIOCLEX 0x5451 |
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index d030d2c2647a..4164529a94f9 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h | |||
| @@ -55,4 +55,15 @@ | |||
| 55 | /* compatibility flags */ | 55 | /* compatibility flags */ |
| 56 | #define MAP_FILE 0 | 56 | #define MAP_FILE 0 |
| 57 | 57 | ||
| 58 | /* | ||
| 59 | * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. | ||
| 60 | * This gives us 6 bits, which is enough until someone invents 128 bit address | ||
| 61 | * spaces. | ||
| 62 | * | ||
| 63 | * Assume these are all power of twos. | ||
| 64 | * When 0 use the default page size. | ||
| 65 | */ | ||
| 66 | #define MAP_HUGE_SHIFT 26 | ||
| 67 | #define MAP_HUGE_MASK 0x3f | ||
| 68 | |||
| 58 | #endif /* __ASM_GENERIC_MMAN_COMMON_H */ | 69 | #endif /* __ASM_GENERIC_MMAN_COMMON_H */ |
diff --git a/include/uapi/asm-generic/mman.h b/include/uapi/asm-generic/mman.h index 32c8bd6a196d..e9fe6fd2a074 100644 --- a/include/uapi/asm-generic/mman.h +++ b/include/uapi/asm-generic/mman.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | 13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ |
| 14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | 14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ |
| 15 | 15 | ||
| 16 | /* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */ | ||
| 17 | |||
| 16 | #define MCL_CURRENT 1 /* lock all current mappings */ | 18 | #define MCL_CURRENT 1 /* lock all current mappings */ |
| 17 | #define MCL_FUTURE 2 /* lock all future mappings */ | 19 | #define MCL_FUTURE 2 /* lock all future mappings */ |
| 18 | 20 | ||
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h index 0a78028984de..6fae30fd16ab 100644 --- a/include/uapi/asm-generic/signal.h +++ b/include/uapi/asm-generic/signal.h | |||
| @@ -80,12 +80,6 @@ | |||
| 80 | * SA_RESTORER 0x04000000 | 80 | * SA_RESTORER 0x04000000 |
| 81 | */ | 81 | */ |
| 82 | 82 | ||
| 83 | /* | ||
| 84 | * sigaltstack controls | ||
| 85 | */ | ||
| 86 | #define SS_ONSTACK 1 | ||
| 87 | #define SS_DISABLE 2 | ||
| 88 | |||
| 89 | #define MINSIGSTKSZ 2048 | 83 | #define MINSIGSTKSZ 2048 |
| 90 | #define SIGSTKSZ 8192 | 84 | #define SIGSTKSZ 8192 |
| 91 | 85 | ||
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index b1bea03274d5..2d32d073a6f9 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | /* Socket filtering */ | 43 | /* Socket filtering */ |
| 44 | #define SO_ATTACH_FILTER 26 | 44 | #define SO_ATTACH_FILTER 26 |
| 45 | #define SO_DETACH_FILTER 27 | 45 | #define SO_DETACH_FILTER 27 |
| 46 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
| 46 | 47 | ||
| 47 | #define SO_PEERNAME 28 | 48 | #define SO_PEERNAME 28 |
| 48 | #define SO_TIMESTAMP 29 | 49 | #define SO_TIMESTAMP 29 |
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 6e595ba545f4..2c531f478410 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h | |||
| @@ -690,9 +690,11 @@ __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \ | |||
| 690 | compat_sys_process_vm_writev) | 690 | compat_sys_process_vm_writev) |
| 691 | #define __NR_kcmp 272 | 691 | #define __NR_kcmp 272 |
| 692 | __SYSCALL(__NR_kcmp, sys_kcmp) | 692 | __SYSCALL(__NR_kcmp, sys_kcmp) |
| 693 | #define __NR_finit_module 273 | ||
| 694 | __SYSCALL(__NR_finit_module, sys_finit_module) | ||
| 693 | 695 | ||
| 694 | #undef __NR_syscalls | 696 | #undef __NR_syscalls |
| 695 | #define __NR_syscalls 273 | 697 | #define __NR_syscalls 274 |
| 696 | 698 | ||
| 697 | /* | 699 | /* |
| 698 | * All syscalls below here should go away really, | 700 | * All syscalls below here should go away really, |
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 1e3481edf062..8d1e2bbee83a 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h | |||
| @@ -778,6 +778,7 @@ struct drm_event_vblank { | |||
| 778 | #define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 | 778 | #define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 |
| 779 | #define DRM_CAP_DUMB_PREFER_SHADOW 0x4 | 779 | #define DRM_CAP_DUMB_PREFER_SHADOW 0x4 |
| 780 | #define DRM_CAP_PRIME 0x5 | 780 | #define DRM_CAP_PRIME 0x5 |
| 781 | #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 | ||
| 781 | 782 | ||
| 782 | #define DRM_PRIME_CAP_IMPORT 0x1 | 783 | #define DRM_PRIME_CAP_IMPORT 0x1 |
| 783 | #define DRM_PRIME_CAP_EXPORT 0x2 | 784 | #define DRM_PRIME_CAP_EXPORT 0x2 |
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h index c0494d586e23..d5844122ff32 100644 --- a/include/uapi/drm/exynos_drm.h +++ b/include/uapi/drm/exynos_drm.h | |||
| @@ -6,24 +6,10 @@ | |||
| 6 | * Joonyoung Shim <jy0922.shim@samsung.com> | 6 | * Joonyoung Shim <jy0922.shim@samsung.com> |
| 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> | 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> |
| 8 | * | 8 | * |
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a | 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * copy of this software and associated documentation files (the "Software"), | 10 | * under the terms of the GNU General Public License as published by the |
| 11 | * to deal in the Software without restriction, including without limitation | 11 | * Free Software Foundation; either version 2 of the License, or (at your |
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 12 | * option) any later version. |
| 13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 14 | * Software is furnished to do so, subject to the following conditions: | ||
| 15 | * | ||
| 16 | * The above copyright notice and this permission notice (including the next | ||
| 17 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 18 | * Software. | ||
| 19 | * | ||
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 23 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 26 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 27 | */ | 13 | */ |
| 28 | 14 | ||
| 29 | #ifndef _UAPI_EXYNOS_DRM_H_ | 15 | #ifndef _UAPI_EXYNOS_DRM_H_ |
| @@ -133,17 +119,26 @@ struct drm_exynos_g2d_cmd { | |||
| 133 | __u32 data; | 119 | __u32 data; |
| 134 | }; | 120 | }; |
| 135 | 121 | ||
| 122 | enum drm_exynos_g2d_buf_type { | ||
| 123 | G2D_BUF_USERPTR = 1 << 31, | ||
| 124 | }; | ||
| 125 | |||
| 136 | enum drm_exynos_g2d_event_type { | 126 | enum drm_exynos_g2d_event_type { |
| 137 | G2D_EVENT_NOT, | 127 | G2D_EVENT_NOT, |
| 138 | G2D_EVENT_NONSTOP, | 128 | G2D_EVENT_NONSTOP, |
| 139 | G2D_EVENT_STOP, /* not yet */ | 129 | G2D_EVENT_STOP, /* not yet */ |
| 140 | }; | 130 | }; |
| 141 | 131 | ||
| 132 | struct drm_exynos_g2d_userptr { | ||
| 133 | unsigned long userptr; | ||
| 134 | unsigned long size; | ||
| 135 | }; | ||
| 136 | |||
| 142 | struct drm_exynos_g2d_set_cmdlist { | 137 | struct drm_exynos_g2d_set_cmdlist { |
| 143 | __u64 cmd; | 138 | __u64 cmd; |
| 144 | __u64 cmd_gem; | 139 | __u64 cmd_buf; |
| 145 | __u32 cmd_nr; | 140 | __u32 cmd_nr; |
| 146 | __u32 cmd_gem_nr; | 141 | __u32 cmd_buf_nr; |
| 147 | 142 | ||
| 148 | /* for g2d event */ | 143 | /* for g2d event */ |
| 149 | __u64 event_type; | 144 | __u64 event_type; |
| @@ -154,6 +149,172 @@ struct drm_exynos_g2d_exec { | |||
| 154 | __u64 async; | 149 | __u64 async; |
| 155 | }; | 150 | }; |
| 156 | 151 | ||
| 152 | enum drm_exynos_ops_id { | ||
| 153 | EXYNOS_DRM_OPS_SRC, | ||
| 154 | EXYNOS_DRM_OPS_DST, | ||
| 155 | EXYNOS_DRM_OPS_MAX, | ||
| 156 | }; | ||
| 157 | |||
| 158 | struct drm_exynos_sz { | ||
| 159 | __u32 hsize; | ||
| 160 | __u32 vsize; | ||
| 161 | }; | ||
| 162 | |||
| 163 | struct drm_exynos_pos { | ||
| 164 | __u32 x; | ||
| 165 | __u32 y; | ||
| 166 | __u32 w; | ||
| 167 | __u32 h; | ||
| 168 | }; | ||
| 169 | |||
| 170 | enum drm_exynos_flip { | ||
| 171 | EXYNOS_DRM_FLIP_NONE = (0 << 0), | ||
| 172 | EXYNOS_DRM_FLIP_VERTICAL = (1 << 0), | ||
| 173 | EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1), | ||
| 174 | EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | | ||
| 175 | EXYNOS_DRM_FLIP_HORIZONTAL, | ||
| 176 | }; | ||
| 177 | |||
| 178 | enum drm_exynos_degree { | ||
| 179 | EXYNOS_DRM_DEGREE_0, | ||
| 180 | EXYNOS_DRM_DEGREE_90, | ||
| 181 | EXYNOS_DRM_DEGREE_180, | ||
| 182 | EXYNOS_DRM_DEGREE_270, | ||
| 183 | }; | ||
| 184 | |||
| 185 | enum drm_exynos_planer { | ||
| 186 | EXYNOS_DRM_PLANAR_Y, | ||
| 187 | EXYNOS_DRM_PLANAR_CB, | ||
| 188 | EXYNOS_DRM_PLANAR_CR, | ||
| 189 | EXYNOS_DRM_PLANAR_MAX, | ||
| 190 | }; | ||
| 191 | |||
| 192 | /** | ||
| 193 | * A structure for ipp supported property list. | ||
| 194 | * | ||
| 195 | * @version: version of this structure. | ||
| 196 | * @ipp_id: id of ipp driver. | ||
| 197 | * @count: count of ipp driver. | ||
| 198 | * @writeback: flag of writeback supporting. | ||
| 199 | * @flip: flag of flip supporting. | ||
| 200 | * @degree: flag of degree information. | ||
| 201 | * @csc: flag of csc supporting. | ||
| 202 | * @crop: flag of crop supporting. | ||
| 203 | * @scale: flag of scale supporting. | ||
| 204 | * @refresh_min: min hz of refresh. | ||
| 205 | * @refresh_max: max hz of refresh. | ||
| 206 | * @crop_min: crop min resolution. | ||
| 207 | * @crop_max: crop max resolution. | ||
| 208 | * @scale_min: scale min resolution. | ||
| 209 | * @scale_max: scale max resolution. | ||
| 210 | */ | ||
| 211 | struct drm_exynos_ipp_prop_list { | ||
| 212 | __u32 version; | ||
| 213 | __u32 ipp_id; | ||
| 214 | __u32 count; | ||
| 215 | __u32 writeback; | ||
| 216 | __u32 flip; | ||
| 217 | __u32 degree; | ||
| 218 | __u32 csc; | ||
| 219 | __u32 crop; | ||
| 220 | __u32 scale; | ||
| 221 | __u32 refresh_min; | ||
| 222 | __u32 refresh_max; | ||
| 223 | __u32 reserved; | ||
| 224 | struct drm_exynos_sz crop_min; | ||
| 225 | struct drm_exynos_sz crop_max; | ||
| 226 | struct drm_exynos_sz scale_min; | ||
| 227 | struct drm_exynos_sz scale_max; | ||
| 228 | }; | ||
| 229 | |||
| 230 | /** | ||
| 231 | * A structure for ipp config. | ||
| 232 | * | ||
| 233 | * @ops_id: property of operation directions. | ||
| 234 | * @flip: property of mirror, flip. | ||
| 235 | * @degree: property of rotation degree. | ||
| 236 | * @fmt: property of image format. | ||
| 237 | * @sz: property of image size. | ||
| 238 | * @pos: property of image position(src-cropped,dst-scaler). | ||
| 239 | */ | ||
| 240 | struct drm_exynos_ipp_config { | ||
| 241 | enum drm_exynos_ops_id ops_id; | ||
| 242 | enum drm_exynos_flip flip; | ||
| 243 | enum drm_exynos_degree degree; | ||
| 244 | __u32 fmt; | ||
| 245 | struct drm_exynos_sz sz; | ||
| 246 | struct drm_exynos_pos pos; | ||
| 247 | }; | ||
| 248 | |||
| 249 | enum drm_exynos_ipp_cmd { | ||
| 250 | IPP_CMD_NONE, | ||
| 251 | IPP_CMD_M2M, | ||
| 252 | IPP_CMD_WB, | ||
| 253 | IPP_CMD_OUTPUT, | ||
| 254 | IPP_CMD_MAX, | ||
| 255 | }; | ||
| 256 | |||
| 257 | /** | ||
| 258 | * A structure for ipp property. | ||
| 259 | * | ||
| 260 | * @config: source, destination config. | ||
| 261 | * @cmd: definition of command. | ||
| 262 | * @ipp_id: id of ipp driver. | ||
| 263 | * @prop_id: id of property. | ||
| 264 | * @refresh_rate: refresh rate. | ||
| 265 | */ | ||
| 266 | struct drm_exynos_ipp_property { | ||
| 267 | struct drm_exynos_ipp_config config[EXYNOS_DRM_OPS_MAX]; | ||
| 268 | enum drm_exynos_ipp_cmd cmd; | ||
| 269 | __u32 ipp_id; | ||
| 270 | __u32 prop_id; | ||
| 271 | __u32 refresh_rate; | ||
| 272 | }; | ||
| 273 | |||
| 274 | enum drm_exynos_ipp_buf_type { | ||
| 275 | IPP_BUF_ENQUEUE, | ||
| 276 | IPP_BUF_DEQUEUE, | ||
| 277 | }; | ||
| 278 | |||
| 279 | /** | ||
| 280 | * A structure for ipp buffer operations. | ||
| 281 | * | ||
| 282 | * @ops_id: operation directions. | ||
| 283 | * @buf_type: definition of buffer. | ||
| 284 | * @prop_id: id of property. | ||
| 285 | * @buf_id: id of buffer. | ||
| 286 | * @handle: Y, Cb, Cr each planar handle. | ||
| 287 | * @user_data: user data. | ||
| 288 | */ | ||
| 289 | struct drm_exynos_ipp_queue_buf { | ||
| 290 | enum drm_exynos_ops_id ops_id; | ||
| 291 | enum drm_exynos_ipp_buf_type buf_type; | ||
| 292 | __u32 prop_id; | ||
| 293 | __u32 buf_id; | ||
| 294 | __u32 handle[EXYNOS_DRM_PLANAR_MAX]; | ||
| 295 | __u32 reserved; | ||
| 296 | __u64 user_data; | ||
| 297 | }; | ||
| 298 | |||
| 299 | enum drm_exynos_ipp_ctrl { | ||
| 300 | IPP_CTRL_PLAY, | ||
| 301 | IPP_CTRL_STOP, | ||
| 302 | IPP_CTRL_PAUSE, | ||
| 303 | IPP_CTRL_RESUME, | ||
| 304 | IPP_CTRL_MAX, | ||
| 305 | }; | ||
| 306 | |||
| 307 | /** | ||
| 308 | * A structure for ipp start/stop operations. | ||
| 309 | * | ||
| 310 | * @prop_id: id of property. | ||
| 311 | * @ctrl: definition of control. | ||
| 312 | */ | ||
| 313 | struct drm_exynos_ipp_cmd_ctrl { | ||
| 314 | __u32 prop_id; | ||
| 315 | enum drm_exynos_ipp_ctrl ctrl; | ||
| 316 | }; | ||
| 317 | |||
| 157 | #define DRM_EXYNOS_GEM_CREATE 0x00 | 318 | #define DRM_EXYNOS_GEM_CREATE 0x00 |
| 158 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 | 319 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 |
| 159 | #define DRM_EXYNOS_GEM_MMAP 0x02 | 320 | #define DRM_EXYNOS_GEM_MMAP 0x02 |
| @@ -166,6 +327,12 @@ struct drm_exynos_g2d_exec { | |||
| 166 | #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 | 327 | #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 |
| 167 | #define DRM_EXYNOS_G2D_EXEC 0x22 | 328 | #define DRM_EXYNOS_G2D_EXEC 0x22 |
| 168 | 329 | ||
| 330 | /* IPP - Image Post Processing */ | ||
| 331 | #define DRM_EXYNOS_IPP_GET_PROPERTY 0x30 | ||
| 332 | #define DRM_EXYNOS_IPP_SET_PROPERTY 0x31 | ||
| 333 | #define DRM_EXYNOS_IPP_QUEUE_BUF 0x32 | ||
| 334 | #define DRM_EXYNOS_IPP_CMD_CTRL 0x33 | ||
| 335 | |||
| 169 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | 336 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ |
| 170 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) | 337 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) |
| 171 | 338 | ||
| @@ -188,8 +355,18 @@ struct drm_exynos_g2d_exec { | |||
| 188 | #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ | 355 | #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ |
| 189 | DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) | 356 | DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) |
| 190 | 357 | ||
| 358 | #define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 359 | DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list) | ||
| 360 | #define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 361 | DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property) | ||
| 362 | #define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 363 | DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf) | ||
| 364 | #define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \ | ||
| 365 | DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl) | ||
| 366 | |||
| 191 | /* EXYNOS specific events */ | 367 | /* EXYNOS specific events */ |
| 192 | #define DRM_EXYNOS_G2D_EVENT 0x80000000 | 368 | #define DRM_EXYNOS_G2D_EVENT 0x80000000 |
| 369 | #define DRM_EXYNOS_IPP_EVENT 0x80000001 | ||
| 193 | 370 | ||
| 194 | struct drm_exynos_g2d_event { | 371 | struct drm_exynos_g2d_event { |
| 195 | struct drm_event base; | 372 | struct drm_event base; |
| @@ -200,4 +377,14 @@ struct drm_exynos_g2d_event { | |||
| 200 | __u32 reserved; | 377 | __u32 reserved; |
| 201 | }; | 378 | }; |
| 202 | 379 | ||
| 380 | struct drm_exynos_ipp_event { | ||
| 381 | struct drm_event base; | ||
| 382 | __u64 user_data; | ||
| 383 | __u32 tv_sec; | ||
| 384 | __u32 tv_usec; | ||
| 385 | __u32 prop_id; | ||
| 386 | __u32 reserved; | ||
| 387 | __u32 buf_id[EXYNOS_DRM_OPS_MAX]; | ||
| 388 | }; | ||
| 389 | |||
| 203 | #endif /* _UAPI_EXYNOS_DRM_H_ */ | 390 | #endif /* _UAPI_EXYNOS_DRM_H_ */ |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 4322b1e7d2ed..c4d2e9c74002 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
| @@ -306,6 +306,8 @@ typedef struct drm_i915_irq_wait { | |||
| 306 | #define I915_PARAM_HAS_SEMAPHORES 20 | 306 | #define I915_PARAM_HAS_SEMAPHORES 20 |
| 307 | #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 | 307 | #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 |
| 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 | 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 |
| 309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 | ||
| 310 | #define I915_PARAM_HAS_PINNED_BATCHES 24 | ||
| 309 | 311 | ||
| 310 | typedef struct drm_i915_getparam { | 312 | typedef struct drm_i915_getparam { |
| 311 | int param; | 313 | int param; |
| @@ -671,6 +673,20 @@ struct drm_i915_gem_execbuffer2 { | |||
| 671 | /** Resets the SO write offset registers for transform feedback on gen7. */ | 673 | /** Resets the SO write offset registers for transform feedback on gen7. */ |
| 672 | #define I915_EXEC_GEN7_SOL_RESET (1<<8) | 674 | #define I915_EXEC_GEN7_SOL_RESET (1<<8) |
| 673 | 675 | ||
| 676 | /** Request a privileged ("secure") batch buffer. Note only available for | ||
| 677 | * DRM_ROOT_ONLY | DRM_MASTER processes. | ||
| 678 | */ | ||
| 679 | #define I915_EXEC_SECURE (1<<9) | ||
| 680 | |||
| 681 | /** Inform the kernel that the batch is and will always be pinned. This | ||
| 682 | * negates the requirement for a workaround to be performed to avoid | ||
| 683 | * an incoherent CS (such as can be found on 830/845). If this flag is | ||
| 684 | * not passed, the kernel will endeavour to make sure the batch is | ||
| 685 | * coherent with the CS before execution. If this flag is passed, | ||
| 686 | * userspace assumes the responsibility for ensuring the same. | ||
| 687 | */ | ||
| 688 | #define I915_EXEC_IS_PINNED (1<<10) | ||
| 689 | |||
| 674 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | 690 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
| 675 | #define i915_execbuffer2_set_context_id(eb2, context) \ | 691 | #define i915_execbuffer2_set_context_id(eb2, context) \ |
| 676 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK | 692 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK |
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index 4766c0f6a838..eeda91774c8a 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h | |||
| @@ -913,9 +913,11 @@ struct drm_radeon_gem_va { | |||
| 913 | /* The first dword of RADEON_CHUNK_ID_FLAGS is a uint32 of these flags: */ | 913 | /* The first dword of RADEON_CHUNK_ID_FLAGS is a uint32 of these flags: */ |
| 914 | #define RADEON_CS_KEEP_TILING_FLAGS 0x01 | 914 | #define RADEON_CS_KEEP_TILING_FLAGS 0x01 |
| 915 | #define RADEON_CS_USE_VM 0x02 | 915 | #define RADEON_CS_USE_VM 0x02 |
| 916 | #define RADEON_CS_END_OF_FRAME 0x04 /* a hint from userspace which CS is the last one */ | ||
| 916 | /* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */ | 917 | /* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */ |
| 917 | #define RADEON_CS_RING_GFX 0 | 918 | #define RADEON_CS_RING_GFX 0 |
| 918 | #define RADEON_CS_RING_COMPUTE 1 | 919 | #define RADEON_CS_RING_COMPUTE 1 |
| 920 | #define RADEON_CS_RING_DMA 2 | ||
| 919 | /* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */ | 921 | /* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */ |
| 920 | /* 0 = normal, + = higher priority, - = lower priority */ | 922 | /* 0 = normal, + = higher priority, - = lower priority */ |
| 921 | 923 | ||
| @@ -966,6 +968,10 @@ struct drm_radeon_cs { | |||
| 966 | #define RADEON_INFO_MAX_PIPES 0x10 | 968 | #define RADEON_INFO_MAX_PIPES 0x10 |
| 967 | /* timestamp for GL_ARB_timer_query (OpenGL), returns the current GPU clock */ | 969 | /* timestamp for GL_ARB_timer_query (OpenGL), returns the current GPU clock */ |
| 968 | #define RADEON_INFO_TIMESTAMP 0x11 | 970 | #define RADEON_INFO_TIMESTAMP 0x11 |
| 971 | /* max shader engines (SE) - needed for geometry shaders, etc. */ | ||
| 972 | #define RADEON_INFO_MAX_SE 0x12 | ||
| 973 | /* max SH per SE */ | ||
| 974 | #define RADEON_INFO_MAX_SH_PER_SE 0x13 | ||
| 969 | 975 | ||
| 970 | struct drm_radeon_info { | 976 | struct drm_radeon_info { |
| 971 | uint32_t request; | 977 | uint32_t request; |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 19e765fbfef7..4e67194fd2c3 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
| @@ -258,6 +258,7 @@ header-y += neighbour.h | |||
| 258 | header-y += net.h | 258 | header-y += net.h |
| 259 | header-y += net_dropmon.h | 259 | header-y += net_dropmon.h |
| 260 | header-y += net_tstamp.h | 260 | header-y += net_tstamp.h |
| 261 | header-y += netconf.h | ||
| 261 | header-y += netdevice.h | 262 | header-y += netdevice.h |
| 262 | header-y += netfilter.h | 263 | header-y += netfilter.h |
| 263 | header-y += netfilter_arp.h | 264 | header-y += netfilter_arp.h |
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h index 91e3a360f611..539b179b349c 100644 --- a/include/uapi/linux/dm-ioctl.h +++ b/include/uapi/linux/dm-ioctl.h | |||
| @@ -268,8 +268,8 @@ enum { | |||
| 268 | 268 | ||
| 269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
| 270 | #define DM_VERSION_MINOR 23 | 270 | #define DM_VERSION_MINOR 23 |
| 271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 1 |
| 272 | #define DM_VERSION_EXTRA "-ioctl (2012-07-25)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2012-12-18)" |
| 273 | 273 | ||
| 274 | /* Status bits */ | 274 | /* Status bits */ |
| 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index d3eaaaf1009e..0c9b44871df0 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h | |||
| @@ -500,13 +500,26 @@ union ethtool_flow_union { | |||
| 500 | struct ethtool_ah_espip4_spec esp_ip4_spec; | 500 | struct ethtool_ah_espip4_spec esp_ip4_spec; |
| 501 | struct ethtool_usrip4_spec usr_ip4_spec; | 501 | struct ethtool_usrip4_spec usr_ip4_spec; |
| 502 | struct ethhdr ether_spec; | 502 | struct ethhdr ether_spec; |
| 503 | __u8 hdata[60]; | 503 | __u8 hdata[52]; |
| 504 | }; | 504 | }; |
| 505 | 505 | ||
| 506 | /** | ||
| 507 | * struct ethtool_flow_ext - additional RX flow fields | ||
| 508 | * @h_dest: destination MAC address | ||
| 509 | * @vlan_etype: VLAN EtherType | ||
| 510 | * @vlan_tci: VLAN tag control information | ||
| 511 | * @data: user defined data | ||
| 512 | * | ||
| 513 | * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT | ||
| 514 | * is set in &struct ethtool_rx_flow_spec @flow_type. | ||
| 515 | * @h_dest is valid if %FLOW_MAC_EXT is set. | ||
| 516 | */ | ||
| 506 | struct ethtool_flow_ext { | 517 | struct ethtool_flow_ext { |
| 507 | __be16 vlan_etype; | 518 | __u8 padding[2]; |
| 508 | __be16 vlan_tci; | 519 | unsigned char h_dest[ETH_ALEN]; |
| 509 | __be32 data[2]; | 520 | __be16 vlan_etype; |
| 521 | __be16 vlan_tci; | ||
| 522 | __be32 data[2]; | ||
| 510 | }; | 523 | }; |
| 511 | 524 | ||
| 512 | /** | 525 | /** |
| @@ -517,7 +530,8 @@ struct ethtool_flow_ext { | |||
| 517 | * @m_u: Masks for flow field bits to be matched | 530 | * @m_u: Masks for flow field bits to be matched |
| 518 | * @m_ext: Masks for additional field bits to be matched | 531 | * @m_ext: Masks for additional field bits to be matched |
| 519 | * Note, all additional fields must be ignored unless @flow_type | 532 | * Note, all additional fields must be ignored unless @flow_type |
| 520 | * includes the %FLOW_EXT flag. | 533 | * includes the %FLOW_EXT or %FLOW_MAC_EXT flag |
| 534 | * (see &struct ethtool_flow_ext description). | ||
| 521 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC | 535 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC |
| 522 | * if packets should be discarded | 536 | * if packets should be discarded |
| 523 | * @location: Location of rule in the table. Locations must be | 537 | * @location: Location of rule in the table. Locations must be |
| @@ -1027,6 +1041,7 @@ enum ethtool_sfeatures_retval_bits { | |||
| 1027 | #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ | 1041 | #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ |
| 1028 | /* Flag to enable additional fields in struct ethtool_rx_flow_spec */ | 1042 | /* Flag to enable additional fields in struct ethtool_rx_flow_spec */ |
| 1029 | #define FLOW_EXT 0x80000000 | 1043 | #define FLOW_EXT 0x80000000 |
| 1044 | #define FLOW_MAC_EXT 0x40000000 | ||
| 1030 | 1045 | ||
| 1031 | /* L3-L4 network traffic flow hash options */ | 1046 | /* L3-L4 network traffic flow hash options */ |
| 1032 | #define RXH_L2DA (1 << 1) | 1047 | #define RXH_L2DA (1 << 1) |
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h index 3d7922433aba..9cfde6941099 100644 --- a/include/uapi/linux/filter.h +++ b/include/uapi/linux/filter.h | |||
| @@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
| 127 | #define SKF_AD_RXHASH 32 | 127 | #define SKF_AD_RXHASH 32 |
| 128 | #define SKF_AD_CPU 36 | 128 | #define SKF_AD_CPU 36 |
| 129 | #define SKF_AD_ALU_XOR_X 40 | 129 | #define SKF_AD_ALU_XOR_X 40 |
| 130 | #define SKF_AD_MAX 44 | 130 | #define SKF_AD_VLAN_TAG 44 |
| 131 | #define SKF_AD_VLAN_TAG_PRESENT 48 | ||
| 132 | #define SKF_AD_MAX 52 | ||
| 131 | #define SKF_NET_OFF (-0x100000) | 133 | #define SKF_NET_OFF (-0x100000) |
| 132 | #define SKF_LL_OFF (-0x200000) | 134 | #define SKF_LL_OFF (-0x200000) |
| 133 | 135 | ||
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild index aafaa5aa54d4..8c1d2cb75e33 100644 --- a/include/uapi/linux/hdlc/Kbuild +++ b/include/uapi/linux/hdlc/Kbuild | |||
| @@ -1 +1,2 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += ioctl.h | ||
diff --git a/include/uapi/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h new file mode 100644 index 000000000000..04bc0274a189 --- /dev/null +++ b/include/uapi/linux/hdlc/ioctl.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | #ifndef __HDLC_IOCTL_H__ | ||
| 2 | #define __HDLC_IOCTL_H__ | ||
| 3 | |||
| 4 | |||
| 5 | #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ | ||
| 6 | |||
| 7 | #define CLOCK_DEFAULT 0 /* Default setting */ | ||
| 8 | #define CLOCK_EXT 1 /* External TX and RX clock - DTE */ | ||
| 9 | #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ | ||
| 10 | #define CLOCK_TXINT 3 /* Internal TX and external RX clock */ | ||
| 11 | #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ | ||
| 12 | |||
| 13 | |||
| 14 | #define ENCODING_DEFAULT 0 /* Default setting */ | ||
| 15 | #define ENCODING_NRZ 1 | ||
| 16 | #define ENCODING_NRZI 2 | ||
| 17 | #define ENCODING_FM_MARK 3 | ||
| 18 | #define ENCODING_FM_SPACE 4 | ||
| 19 | #define ENCODING_MANCHESTER 5 | ||
| 20 | |||
| 21 | |||
| 22 | #define PARITY_DEFAULT 0 /* Default setting */ | ||
| 23 | #define PARITY_NONE 1 /* No parity */ | ||
| 24 | #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ | ||
| 25 | #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ | ||
| 26 | #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ | ||
| 27 | #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ | ||
| 28 | #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ | ||
| 29 | #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ | ||
| 30 | |||
| 31 | #define LMI_DEFAULT 0 /* Default setting */ | ||
| 32 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | ||
| 33 | #define LMI_ANSI 2 /* ANSI Annex D */ | ||
| 34 | #define LMI_CCITT 3 /* ITU-T Annex A */ | ||
| 35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
| 36 | |||
| 37 | #ifndef __ASSEMBLY__ | ||
| 38 | |||
| 39 | typedef struct { | ||
| 40 | unsigned int clock_rate; /* bits per second */ | ||
| 41 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | ||
| 42 | unsigned short loopback; | ||
| 43 | } sync_serial_settings; /* V.35, V.24, X.21 */ | ||
| 44 | |||
| 45 | typedef struct { | ||
| 46 | unsigned int clock_rate; /* bits per second */ | ||
| 47 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | ||
| 48 | unsigned short loopback; | ||
| 49 | unsigned int slot_map; | ||
| 50 | } te1_settings; /* T1, E1 */ | ||
| 51 | |||
| 52 | typedef struct { | ||
| 53 | unsigned short encoding; | ||
| 54 | unsigned short parity; | ||
| 55 | } raw_hdlc_proto; | ||
| 56 | |||
| 57 | typedef struct { | ||
| 58 | unsigned int t391; | ||
| 59 | unsigned int t392; | ||
| 60 | unsigned int n391; | ||
| 61 | unsigned int n392; | ||
| 62 | unsigned int n393; | ||
| 63 | unsigned short lmi; | ||
| 64 | unsigned short dce; /* 1 for DCE (network side) operation */ | ||
| 65 | } fr_proto; | ||
| 66 | |||
| 67 | typedef struct { | ||
| 68 | unsigned int dlci; | ||
| 69 | } fr_proto_pvc; /* for creating/deleting FR PVCs */ | ||
| 70 | |||
| 71 | typedef struct { | ||
| 72 | unsigned int dlci; | ||
| 73 | char master[IFNAMSIZ]; /* Name of master FRAD device */ | ||
| 74 | }fr_proto_pvc_info; /* for returning PVC information only */ | ||
| 75 | |||
| 76 | typedef struct { | ||
| 77 | unsigned int interval; | ||
| 78 | unsigned int timeout; | ||
| 79 | } cisco_proto; | ||
| 80 | |||
| 81 | /* PPP doesn't need any info now - supply length = 0 to ioctl */ | ||
| 82 | |||
| 83 | #endif /* __ASSEMBLY__ */ | ||
| 84 | #endif /* __HDLC_IOCTL_H__ */ | ||
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index a8fe9549ddbc..5db297514aec 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
| @@ -97,5 +97,89 @@ struct __fdb_entry { | |||
| 97 | __u16 unused; | 97 | __u16 unused; |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | /* Bridge Flags */ | ||
| 101 | #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */ | ||
| 102 | #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */ | ||
| 103 | |||
| 104 | #define BRIDGE_MODE_VEB 0 /* Default loopback mode */ | ||
| 105 | #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */ | ||
| 106 | |||
| 107 | /* Bridge management nested attributes | ||
| 108 | * [IFLA_AF_SPEC] = { | ||
| 109 | * [IFLA_BRIDGE_FLAGS] | ||
| 110 | * [IFLA_BRIDGE_MODE] | ||
| 111 | * } | ||
| 112 | */ | ||
| 113 | enum { | ||
| 114 | IFLA_BRIDGE_FLAGS, | ||
| 115 | IFLA_BRIDGE_MODE, | ||
| 116 | __IFLA_BRIDGE_MAX, | ||
| 117 | }; | ||
| 118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | ||
| 119 | |||
| 120 | /* Bridge multicast database attributes | ||
| 121 | * [MDBA_MDB] = { | ||
| 122 | * [MDBA_MDB_ENTRY] = { | ||
| 123 | * [MDBA_MDB_ENTRY_INFO] | ||
| 124 | * } | ||
| 125 | * } | ||
| 126 | * [MDBA_ROUTER] = { | ||
| 127 | * [MDBA_ROUTER_PORT] | ||
| 128 | * } | ||
| 129 | */ | ||
| 130 | enum { | ||
| 131 | MDBA_UNSPEC, | ||
| 132 | MDBA_MDB, | ||
| 133 | MDBA_ROUTER, | ||
| 134 | __MDBA_MAX, | ||
| 135 | }; | ||
| 136 | #define MDBA_MAX (__MDBA_MAX - 1) | ||
| 137 | |||
| 138 | enum { | ||
| 139 | MDBA_MDB_UNSPEC, | ||
| 140 | MDBA_MDB_ENTRY, | ||
| 141 | __MDBA_MDB_MAX, | ||
| 142 | }; | ||
| 143 | #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1) | ||
| 144 | |||
| 145 | enum { | ||
| 146 | MDBA_MDB_ENTRY_UNSPEC, | ||
| 147 | MDBA_MDB_ENTRY_INFO, | ||
| 148 | __MDBA_MDB_ENTRY_MAX, | ||
| 149 | }; | ||
| 150 | #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1) | ||
| 151 | |||
| 152 | enum { | ||
| 153 | MDBA_ROUTER_UNSPEC, | ||
| 154 | MDBA_ROUTER_PORT, | ||
| 155 | __MDBA_ROUTER_MAX, | ||
| 156 | }; | ||
| 157 | #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1) | ||
| 158 | |||
| 159 | struct br_port_msg { | ||
| 160 | __u8 family; | ||
| 161 | __u32 ifindex; | ||
| 162 | }; | ||
| 163 | |||
| 164 | struct br_mdb_entry { | ||
| 165 | __u32 ifindex; | ||
| 166 | #define MDB_TEMPORARY 0 | ||
| 167 | #define MDB_PERMANENT 1 | ||
| 168 | __u8 state; | ||
| 169 | struct { | ||
| 170 | union { | ||
| 171 | __be32 ip4; | ||
| 172 | struct in6_addr ip6; | ||
| 173 | } u; | ||
| 174 | __be16 proto; | ||
| 175 | } addr; | ||
| 176 | }; | ||
| 177 | |||
| 178 | enum { | ||
| 179 | MDBA_SET_ENTRY_UNSPEC, | ||
| 180 | MDBA_SET_ENTRY, | ||
| 181 | __MDBA_SET_ENTRY_MAX, | ||
| 182 | }; | ||
| 183 | #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1) | ||
| 100 | 184 | ||
| 101 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ | 185 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 0343e1f0582c..67fb87ca1094 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | 48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ | 49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ |
| 50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ | 50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ |
| 51 | #define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
| 51 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ | 52 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ |
| 52 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ | 53 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ |
| 53 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ | 54 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 5c80cb11518b..60f3b6b90602 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -205,6 +205,24 @@ enum { | |||
| 205 | 205 | ||
| 206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | 206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
| 207 | 207 | ||
| 208 | enum { | ||
| 209 | BRIDGE_MODE_UNSPEC, | ||
| 210 | BRIDGE_MODE_HAIRPIN, | ||
| 211 | }; | ||
| 212 | |||
| 213 | enum { | ||
| 214 | IFLA_BRPORT_UNSPEC, | ||
| 215 | IFLA_BRPORT_STATE, /* Spanning tree state */ | ||
| 216 | IFLA_BRPORT_PRIORITY, /* " priority */ | ||
| 217 | IFLA_BRPORT_COST, /* " cost */ | ||
| 218 | IFLA_BRPORT_MODE, /* mode (hairpin) */ | ||
| 219 | IFLA_BRPORT_GUARD, /* bpdu guard */ | ||
| 220 | IFLA_BRPORT_PROTECT, /* root port protection */ | ||
| 221 | IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */ | ||
| 222 | __IFLA_BRPORT_MAX | ||
| 223 | }; | ||
| 224 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) | ||
| 225 | |||
| 208 | struct ifla_cacheinfo { | 226 | struct ifla_cacheinfo { |
| 209 | __u32 max_reasm_len; | 227 | __u32 max_reasm_len; |
| 210 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | 228 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ |
| @@ -285,6 +303,10 @@ enum { | |||
| 285 | IFLA_VXLAN_AGEING, | 303 | IFLA_VXLAN_AGEING, |
| 286 | IFLA_VXLAN_LIMIT, | 304 | IFLA_VXLAN_LIMIT, |
| 287 | IFLA_VXLAN_PORT_RANGE, | 305 | IFLA_VXLAN_PORT_RANGE, |
| 306 | IFLA_VXLAN_PROXY, | ||
| 307 | IFLA_VXLAN_RSC, | ||
| 308 | IFLA_VXLAN_L2MISS, | ||
| 309 | IFLA_VXLAN_L3MISS, | ||
| 288 | __IFLA_VXLAN_MAX | 310 | __IFLA_VXLAN_MAX |
| 289 | }; | 311 | }; |
| 290 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 312 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index f3799295d231..f9a60375f0d0 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h | |||
| @@ -50,6 +50,7 @@ struct sockaddr_ll { | |||
| 50 | #define PACKET_TX_TIMESTAMP 16 | 50 | #define PACKET_TX_TIMESTAMP 16 |
| 51 | #define PACKET_TIMESTAMP 17 | 51 | #define PACKET_TIMESTAMP 17 |
| 52 | #define PACKET_FANOUT 18 | 52 | #define PACKET_FANOUT 18 |
| 53 | #define PACKET_TX_HAS_OFF 19 | ||
| 53 | 54 | ||
| 54 | #define PACKET_FANOUT_HASH 0 | 55 | #define PACKET_FANOUT_HASH 0 |
| 55 | #define PACKET_FANOUT_LB 1 | 56 | #define PACKET_FANOUT_LB 1 |
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index 25a585ce23e6..2835b85fd46d 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h | |||
| @@ -31,9 +31,11 @@ | |||
| 31 | #define TUN_FASYNC 0x0010 | 31 | #define TUN_FASYNC 0x0010 |
| 32 | #define TUN_NOCHECKSUM 0x0020 | 32 | #define TUN_NOCHECKSUM 0x0020 |
| 33 | #define TUN_NO_PI 0x0040 | 33 | #define TUN_NO_PI 0x0040 |
| 34 | /* This flag has no real effect */ | ||
| 34 | #define TUN_ONE_QUEUE 0x0080 | 35 | #define TUN_ONE_QUEUE 0x0080 |
| 35 | #define TUN_PERSIST 0x0100 | 36 | #define TUN_PERSIST 0x0100 |
| 36 | #define TUN_VNET_HDR 0x0200 | 37 | #define TUN_VNET_HDR 0x0200 |
| 38 | #define TUN_TAP_MQ 0x0400 | ||
| 37 | 39 | ||
| 38 | /* Ioctl defines */ | 40 | /* Ioctl defines */ |
| 39 | #define TUNSETNOCSUM _IOW('T', 200, int) | 41 | #define TUNSETNOCSUM _IOW('T', 200, int) |
| @@ -53,14 +55,19 @@ | |||
| 53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | 55 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) |
| 54 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) | 56 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) |
| 55 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) | 57 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) |
| 58 | #define TUNSETQUEUE _IOW('T', 217, int) | ||
| 56 | 59 | ||
| 57 | /* TUNSETIFF ifr flags */ | 60 | /* TUNSETIFF ifr flags */ |
| 58 | #define IFF_TUN 0x0001 | 61 | #define IFF_TUN 0x0001 |
| 59 | #define IFF_TAP 0x0002 | 62 | #define IFF_TAP 0x0002 |
| 60 | #define IFF_NO_PI 0x1000 | 63 | #define IFF_NO_PI 0x1000 |
| 64 | /* This flag has no real effect */ | ||
| 61 | #define IFF_ONE_QUEUE 0x2000 | 65 | #define IFF_ONE_QUEUE 0x2000 |
| 62 | #define IFF_VNET_HDR 0x4000 | 66 | #define IFF_VNET_HDR 0x4000 |
| 63 | #define IFF_TUN_EXCL 0x8000 | 67 | #define IFF_TUN_EXCL 0x8000 |
| 68 | #define IFF_MULTI_QUEUE 0x0100 | ||
| 69 | #define IFF_ATTACH_QUEUE 0x0200 | ||
| 70 | #define IFF_DETACH_QUEUE 0x0400 | ||
| 64 | 71 | ||
| 65 | /* Features for GSO (TUNSETOFFLOAD). */ | 72 | /* Features for GSO (TUNSETOFFLOAD). */ |
| 66 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ | 73 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ |
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h index 5db5942575fe..aee73d0611fb 100644 --- a/include/uapi/linux/if_tunnel.h +++ b/include/uapi/linux/if_tunnel.h | |||
| @@ -37,6 +37,26 @@ struct ip_tunnel_parm { | |||
| 37 | struct iphdr iph; | 37 | struct iphdr iph; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | enum { | ||
| 41 | IFLA_IPTUN_UNSPEC, | ||
| 42 | IFLA_IPTUN_LINK, | ||
| 43 | IFLA_IPTUN_LOCAL, | ||
| 44 | IFLA_IPTUN_REMOTE, | ||
| 45 | IFLA_IPTUN_TTL, | ||
| 46 | IFLA_IPTUN_TOS, | ||
| 47 | IFLA_IPTUN_ENCAP_LIMIT, | ||
| 48 | IFLA_IPTUN_FLOWINFO, | ||
| 49 | IFLA_IPTUN_FLAGS, | ||
| 50 | IFLA_IPTUN_PROTO, | ||
| 51 | IFLA_IPTUN_PMTUDISC, | ||
| 52 | IFLA_IPTUN_6RD_PREFIX, | ||
| 53 | IFLA_IPTUN_6RD_RELAY_PREFIX, | ||
| 54 | IFLA_IPTUN_6RD_PREFIXLEN, | ||
| 55 | IFLA_IPTUN_6RD_RELAY_PREFIXLEN, | ||
| 56 | __IFLA_IPTUN_MAX, | ||
| 57 | }; | ||
| 58 | #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) | ||
| 59 | |||
| 40 | /* SIT-mode i_flags */ | 60 | /* SIT-mode i_flags */ |
| 41 | #define SIT_ISATAP 0x0001 | 61 | #define SIT_ISATAP 0x0001 |
| 42 | 62 | ||
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 1e3159989958..f79c3721da6e 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
| @@ -240,6 +240,7 @@ struct in6_flowlabel_req { | |||
| 240 | * | 240 | * |
| 241 | * IP6T_SO_GET_REVISION_MATCH 68 | 241 | * IP6T_SO_GET_REVISION_MATCH 68 |
| 242 | * IP6T_SO_GET_REVISION_TARGET 69 | 242 | * IP6T_SO_GET_REVISION_TARGET 69 |
| 243 | * IP6T_SO_ORIGINAL_DST 80 | ||
| 243 | */ | 244 | */ |
| 244 | 245 | ||
| 245 | /* RFC5014: Source address selection */ | 246 | /* RFC5014: Source address selection */ |
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index 8c469af939aa..bbde90fa5838 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h | |||
| @@ -109,9 +109,10 @@ enum { | |||
| 109 | INET_DIAG_TOS, | 109 | INET_DIAG_TOS, |
| 110 | INET_DIAG_TCLASS, | 110 | INET_DIAG_TCLASS, |
| 111 | INET_DIAG_SKMEMINFO, | 111 | INET_DIAG_SKMEMINFO, |
| 112 | INET_DIAG_SHUTDOWN, | ||
| 112 | }; | 113 | }; |
| 113 | 114 | ||
| 114 | #define INET_DIAG_MAX INET_DIAG_SKMEMINFO | 115 | #define INET_DIAG_MAX INET_DIAG_SHUTDOWN |
| 115 | 116 | ||
| 116 | 117 | ||
| 117 | /* INET_DIAG_MEM */ | 118 | /* INET_DIAG_MEM */ |
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index 558828590a69..935119c698ac 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
| @@ -851,6 +851,7 @@ struct input_keymap_entry { | |||
| 851 | #define MSC_GESTURE 0x02 | 851 | #define MSC_GESTURE 0x02 |
| 852 | #define MSC_RAW 0x03 | 852 | #define MSC_RAW 0x03 |
| 853 | #define MSC_SCAN 0x04 | 853 | #define MSC_SCAN 0x04 |
| 854 | #define MSC_TIMESTAMP 0x05 | ||
| 854 | #define MSC_MAX 0x07 | 855 | #define MSC_MAX 0x07 |
| 855 | #define MSC_CNT (MSC_MAX+1) | 856 | #define MSC_CNT (MSC_MAX+1) |
| 856 | 857 | ||
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index a6d7d1c536c3..5a2991cf0251 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
| @@ -157,6 +157,7 @@ enum { | |||
| 157 | DEVCONF_DISABLE_IPV6, | 157 | DEVCONF_DISABLE_IPV6, |
| 158 | DEVCONF_ACCEPT_DAD, | 158 | DEVCONF_ACCEPT_DAD, |
| 159 | DEVCONF_FORCE_TLLAO, | 159 | DEVCONF_FORCE_TLLAO, |
| 160 | DEVCONF_NDISC_NOTIFY, | ||
| 160 | DEVCONF_MAX | 161 | DEVCONF_MAX |
| 161 | }; | 162 | }; |
| 162 | 163 | ||
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h index 0459664c2636..2be7bd174751 100644 --- a/include/uapi/linux/ipv6_route.h +++ b/include/uapi/linux/ipv6_route.h | |||
| @@ -55,4 +55,7 @@ struct in6_rtmsg { | |||
| 55 | #define RTMSG_NEWROUTE 0x21 | 55 | #define RTMSG_NEWROUTE 0x21 |
| 56 | #define RTMSG_DELROUTE 0x22 | 56 | #define RTMSG_DELROUTE 0x22 |
| 57 | 57 | ||
| 58 | #define IP6_RT_PRIO_USER 1024 | ||
| 59 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
| 60 | |||
| 58 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ | 61 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 0a6d6ba44c85..e6e5d4b13708 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
| @@ -167,10 +167,15 @@ struct kvm_pit_config { | |||
| 167 | #define KVM_EXIT_OSI 18 | 167 | #define KVM_EXIT_OSI 18 |
| 168 | #define KVM_EXIT_PAPR_HCALL 19 | 168 | #define KVM_EXIT_PAPR_HCALL 19 |
| 169 | #define KVM_EXIT_S390_UCONTROL 20 | 169 | #define KVM_EXIT_S390_UCONTROL 20 |
| 170 | #define KVM_EXIT_WATCHDOG 21 | ||
| 170 | 171 | ||
| 171 | /* For KVM_EXIT_INTERNAL_ERROR */ | 172 | /* For KVM_EXIT_INTERNAL_ERROR */ |
| 172 | #define KVM_INTERNAL_ERROR_EMULATION 1 | 173 | /* Emulate instruction failed. */ |
| 173 | #define KVM_INTERNAL_ERROR_SIMUL_EX 2 | 174 | #define KVM_INTERNAL_ERROR_EMULATION 1 |
| 175 | /* Encounter unexpected simultaneous exceptions. */ | ||
| 176 | #define KVM_INTERNAL_ERROR_SIMUL_EX 2 | ||
| 177 | /* Encounter unexpected vm-exit due to delivery event. */ | ||
| 178 | #define KVM_INTERNAL_ERROR_DELIVERY_EV 3 | ||
| 174 | 179 | ||
| 175 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 180 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
| 176 | struct kvm_run { | 181 | struct kvm_run { |
| @@ -477,6 +482,8 @@ struct kvm_ppc_smmu_info { | |||
| 477 | struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; | 482 | struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; |
| 478 | }; | 483 | }; |
| 479 | 484 | ||
| 485 | #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) | ||
| 486 | |||
| 480 | #define KVMIO 0xAE | 487 | #define KVMIO 0xAE |
| 481 | 488 | ||
| 482 | /* machine type bits, to be used as argument to KVM_CREATE_VM */ | 489 | /* machine type bits, to be used as argument to KVM_CREATE_VM */ |
| @@ -626,6 +633,8 @@ struct kvm_ppc_smmu_info { | |||
| 626 | #define KVM_CAP_READONLY_MEM 81 | 633 | #define KVM_CAP_READONLY_MEM 81 |
| 627 | #endif | 634 | #endif |
| 628 | #define KVM_CAP_IRQFD_RESAMPLE 82 | 635 | #define KVM_CAP_IRQFD_RESAMPLE 82 |
| 636 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 | ||
| 637 | #define KVM_CAP_PPC_HTAB_FD 84 | ||
| 629 | 638 | ||
| 630 | #ifdef KVM_CAP_IRQ_ROUTING | 639 | #ifdef KVM_CAP_IRQ_ROUTING |
| 631 | 640 | ||
| @@ -848,6 +857,11 @@ struct kvm_s390_ucas_mapping { | |||
| 848 | #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) | 857 | #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) |
| 849 | /* Available with KVM_CAP_PPC_ALLOC_HTAB */ | 858 | /* Available with KVM_CAP_PPC_ALLOC_HTAB */ |
| 850 | #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) | 859 | #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) |
| 860 | #define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce) | ||
| 861 | /* Available with KVM_CAP_RMA */ | ||
| 862 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) | ||
| 863 | /* Available with KVM_CAP_PPC_HTAB_FD */ | ||
| 864 | #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd) | ||
| 851 | 865 | ||
| 852 | /* | 866 | /* |
| 853 | * ioctls for vcpu fds | 867 | * ioctls for vcpu fds |
| @@ -911,9 +925,6 @@ struct kvm_s390_ucas_mapping { | |||
| 911 | /* Available with KVM_CAP_XCRS */ | 925 | /* Available with KVM_CAP_XCRS */ |
| 912 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) | 926 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) |
| 913 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) | 927 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) |
| 914 | #define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce) | ||
| 915 | /* Available with KVM_CAP_RMA */ | ||
| 916 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) | ||
| 917 | /* Available with KVM_CAP_SW_TLB */ | 928 | /* Available with KVM_CAP_SW_TLB */ |
| 918 | #define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb) | 929 | #define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb) |
| 919 | /* Available with KVM_CAP_ONE_REG */ | 930 | /* Available with KVM_CAP_ONE_REG */ |
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h index e15192cb9cf4..873e086ce3a1 100644 --- a/include/uapi/linux/magic.h +++ b/include/uapi/linux/magic.h | |||
| @@ -23,10 +23,12 @@ | |||
| 23 | #define EXT4_SUPER_MAGIC 0xEF53 | 23 | #define EXT4_SUPER_MAGIC 0xEF53 |
| 24 | #define BTRFS_SUPER_MAGIC 0x9123683E | 24 | #define BTRFS_SUPER_MAGIC 0x9123683E |
| 25 | #define NILFS_SUPER_MAGIC 0x3434 | 25 | #define NILFS_SUPER_MAGIC 0x3434 |
| 26 | #define F2FS_SUPER_MAGIC 0xF2F52010 | ||
| 26 | #define HPFS_SUPER_MAGIC 0xf995e849 | 27 | #define HPFS_SUPER_MAGIC 0xf995e849 |
| 27 | #define ISOFS_SUPER_MAGIC 0x9660 | 28 | #define ISOFS_SUPER_MAGIC 0x9660 |
| 28 | #define JFFS2_SUPER_MAGIC 0x72b6 | 29 | #define JFFS2_SUPER_MAGIC 0x72b6 |
| 29 | #define PSTOREFS_MAGIC 0x6165676C | 30 | #define PSTOREFS_MAGIC 0x6165676C |
| 31 | #define EFIVARFS_MAGIC 0xde5e81e4 | ||
| 30 | 32 | ||
| 31 | #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ | 33 | #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ |
| 32 | #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ | 34 | #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ |
diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h index 23e62e0537e2..0d11c3dcd3a1 100644 --- a/include/uapi/linux/mempolicy.h +++ b/include/uapi/linux/mempolicy.h | |||
| @@ -20,6 +20,7 @@ enum { | |||
| 20 | MPOL_PREFERRED, | 20 | MPOL_PREFERRED, |
| 21 | MPOL_BIND, | 21 | MPOL_BIND, |
| 22 | MPOL_INTERLEAVE, | 22 | MPOL_INTERLEAVE, |
| 23 | MPOL_LOCAL, | ||
| 23 | MPOL_MAX, /* always last member of enum */ | 24 | MPOL_MAX, /* always last member of enum */ |
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| @@ -47,9 +48,15 @@ enum mpol_rebind_step { | |||
| 47 | 48 | ||
| 48 | /* Flags for mbind */ | 49 | /* Flags for mbind */ |
| 49 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ | 50 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ |
| 50 | #define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */ | 51 | #define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform |
| 51 | #define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */ | 52 | to policy */ |
| 52 | #define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */ | 53 | #define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to policy */ |
| 54 | #define MPOL_MF_LAZY (1<<3) /* Modifies '_MOVE: lazy migrate on fault */ | ||
| 55 | #define MPOL_MF_INTERNAL (1<<4) /* Internal flags start here */ | ||
| 56 | |||
| 57 | #define MPOL_MF_VALID (MPOL_MF_STRICT | \ | ||
| 58 | MPOL_MF_MOVE | \ | ||
| 59 | MPOL_MF_MOVE_ALL) | ||
| 53 | 60 | ||
| 54 | /* | 61 | /* |
| 55 | * Internal flags that share the struct mempolicy flags word with | 62 | * Internal flags that share the struct mempolicy flags word with |
| @@ -59,6 +66,8 @@ enum mpol_rebind_step { | |||
| 59 | #define MPOL_F_SHARED (1 << 0) /* identify shared policies */ | 66 | #define MPOL_F_SHARED (1 << 0) /* identify shared policies */ |
| 60 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ | 67 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ |
| 61 | #define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */ | 68 | #define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */ |
| 69 | #define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */ | ||
| 70 | #define MPOL_F_MORON (1 << 4) /* Migrate On pte_numa Reference On Node */ | ||
| 62 | 71 | ||
| 63 | 72 | ||
| 64 | #endif /* _UAPI_LINUX_MEMPOLICY_H */ | 73 | #endif /* _UAPI_LINUX_MEMPOLICY_H */ |
diff --git a/include/uapi/linux/module.h b/include/uapi/linux/module.h new file mode 100644 index 000000000000..38da4258b12f --- /dev/null +++ b/include/uapi/linux/module.h | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef _UAPI_LINUX_MODULE_H | ||
| 2 | #define _UAPI_LINUX_MODULE_H | ||
| 3 | |||
| 4 | /* Flags for sys_finit_module: */ | ||
| 5 | #define MODULE_INIT_IGNORE_MODVERSIONS 1 | ||
| 6 | #define MODULE_INIT_IGNORE_VERMAGIC 2 | ||
| 7 | |||
| 8 | #endif /* _UAPI_LINUX_MODULE_H */ | ||
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h index 78dbd2f996a3..22d95c6854e0 100644 --- a/include/uapi/linux/msg.h +++ b/include/uapi/linux/msg.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | /* msgrcv options */ | 10 | /* msgrcv options */ |
| 11 | #define MSG_NOERROR 010000 /* no error if message is too big */ | 11 | #define MSG_NOERROR 010000 /* no error if message is too big */ |
| 12 | #define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/ | 12 | #define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/ |
| 13 | #define MSG_COPY 040000 /* copy (not remove) all queue messages */ | ||
| 13 | 14 | ||
| 14 | /* Obsolete, used only for backwards compatibility and libc5 compiles */ | 15 | /* Obsolete, used only for backwards compatibility and libc5 compiles */ |
| 15 | struct msqid_ds { | 16 | struct msqid_ds { |
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h new file mode 100644 index 000000000000..64804a798b0c --- /dev/null +++ b/include/uapi/linux/netconf.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #ifndef _UAPI_LINUX_NETCONF_H_ | ||
| 2 | #define _UAPI_LINUX_NETCONF_H_ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/netlink.h> | ||
| 6 | |||
| 7 | struct netconfmsg { | ||
| 8 | __u8 ncm_family; | ||
| 9 | }; | ||
| 10 | |||
| 11 | enum { | ||
| 12 | NETCONFA_UNSPEC, | ||
| 13 | NETCONFA_IFINDEX, | ||
| 14 | NETCONFA_FORWARDING, | ||
| 15 | NETCONFA_RP_FILTER, | ||
| 16 | NETCONFA_MC_FORWARDING, | ||
| 17 | __NETCONFA_MAX | ||
| 18 | }; | ||
| 19 | #define NETCONFA_MAX (__NETCONFA_MAX - 1) | ||
| 20 | |||
| 21 | #define NETCONFA_IFINDEX_ALL -1 | ||
| 22 | #define NETCONFA_IFINDEX_DEFAULT -2 | ||
| 23 | |||
| 24 | #endif /* _UAPI_LINUX_NETCONF_H_ */ | ||
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h index 43bfe3e1685b..86e930cf3dfb 100644 --- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h +++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -9,6 +9,8 @@ enum cntl_msg_types { | |||
| 9 | IPCTNL_MSG_CT_GET_CTRZERO, | 9 | IPCTNL_MSG_CT_GET_CTRZERO, |
| 10 | IPCTNL_MSG_CT_GET_STATS_CPU, | 10 | IPCTNL_MSG_CT_GET_STATS_CPU, |
| 11 | IPCTNL_MSG_CT_GET_STATS, | 11 | IPCTNL_MSG_CT_GET_STATS, |
| 12 | IPCTNL_MSG_CT_GET_DYING, | ||
| 13 | IPCTNL_MSG_CT_GET_UNCONFIRMED, | ||
| 12 | 14 | ||
| 13 | IPCTNL_MSG_MAX | 15 | IPCTNL_MSG_MAX |
| 14 | }; | 16 | }; |
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h index bf1ef65cc582..649c68062dca 100644 --- a/include/uapi/linux/netfilter_ipv6/ip6_tables.h +++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -178,6 +178,9 @@ struct ip6t_error { | |||
| 178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) | 178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) |
| 179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET | 179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET |
| 180 | 180 | ||
| 181 | /* obtain original address if REDIRECT'd connection */ | ||
| 182 | #define IP6T_SO_ORIGINAL_DST 80 | ||
| 183 | |||
| 181 | /* ICMP matching stuff */ | 184 | /* ICMP matching stuff */ |
| 182 | struct ip6t_icmp { | 185 | struct ip6t_icmp { |
| 183 | __u8 type; /* type to match */ | 186 | __u8 type; /* type to match */ |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index d908d17da56d..0e63cee8d810 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
| @@ -60,6 +60,13 @@ | |||
| 60 | * target mode. | 60 | * target mode. |
| 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated |
| 62 | * from target mode. | 62 | * from target mode. |
| 63 | * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device | ||
| 64 | * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for | ||
| 65 | * a device. LTO must be set before the link is up otherwise -EINPROGRESS | ||
| 66 | * is returned. RW and MIUX can be set at anytime and will be passed in | ||
| 67 | * subsequent CONNECT and CC messages. | ||
| 68 | * If one of the passed parameters is wrong none is set and -EINVAL is | ||
| 69 | * returned. | ||
| 63 | */ | 70 | */ |
| 64 | enum nfc_commands { | 71 | enum nfc_commands { |
| 65 | NFC_CMD_UNSPEC, | 72 | NFC_CMD_UNSPEC, |
| @@ -77,6 +84,8 @@ enum nfc_commands { | |||
| 77 | NFC_EVENT_TARGET_LOST, | 84 | NFC_EVENT_TARGET_LOST, |
| 78 | NFC_EVENT_TM_ACTIVATED, | 85 | NFC_EVENT_TM_ACTIVATED, |
| 79 | NFC_EVENT_TM_DEACTIVATED, | 86 | NFC_EVENT_TM_DEACTIVATED, |
| 87 | NFC_CMD_LLC_GET_PARAMS, | ||
| 88 | NFC_CMD_LLC_SET_PARAMS, | ||
| 80 | /* private: internal use only */ | 89 | /* private: internal use only */ |
| 81 | __NFC_CMD_AFTER_LAST | 90 | __NFC_CMD_AFTER_LAST |
| 82 | }; | 91 | }; |
| @@ -102,6 +111,9 @@ enum nfc_commands { | |||
| 102 | * @NFC_ATTR_RF_MODE: Initiator or target | 111 | * @NFC_ATTR_RF_MODE: Initiator or target |
| 103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | 112 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for |
| 104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | 113 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for |
| 114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | ||
| 115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | ||
| 116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | ||
| 105 | */ | 117 | */ |
| 106 | enum nfc_attrs { | 118 | enum nfc_attrs { |
| 107 | NFC_ATTR_UNSPEC, | 119 | NFC_ATTR_UNSPEC, |
| @@ -119,6 +131,9 @@ enum nfc_attrs { | |||
| 119 | NFC_ATTR_DEVICE_POWERED, | 131 | NFC_ATTR_DEVICE_POWERED, |
| 120 | NFC_ATTR_IM_PROTOCOLS, | 132 | NFC_ATTR_IM_PROTOCOLS, |
| 121 | NFC_ATTR_TM_PROTOCOLS, | 133 | NFC_ATTR_TM_PROTOCOLS, |
| 134 | NFC_ATTR_LLC_PARAM_LTO, | ||
| 135 | NFC_ATTR_LLC_PARAM_RW, | ||
| 136 | NFC_ATTR_LLC_PARAM_MIUX, | ||
| 122 | /* private: internal use only */ | 137 | /* private: internal use only */ |
| 123 | __NFC_ATTR_AFTER_LAST | 138 | __NFC_ATTR_AFTER_LAST |
| 124 | }; | 139 | }; |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 7df9b500c804..e3e19f8b16f2 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
| @@ -118,8 +118,9 @@ | |||
| 118 | * to get a list of all present wiphys. | 118 | * to get a list of all present wiphys. |
| 119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or | 119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
| 120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, | 120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
| 121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, | 121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the |
| 122 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, | 122 | * attributes determining the channel width; this is used for setting |
| 123 | * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, | ||
| 123 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | 124 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, |
| 124 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | 125 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. |
| 125 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL | 126 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL |
| @@ -171,7 +172,7 @@ | |||
| 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 172 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
| 172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 173 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
| 173 | * The channel to use can be set on the interface or be given using the | 174 | * The channel to use can be set on the interface or be given using the |
| 174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | 175 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. |
| 175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 176 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
| 176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 177 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
| 177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 178 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
| @@ -401,8 +402,7 @@ | |||
| 401 | * a response while being associated to an AP on another channel. | 402 | * a response while being associated to an AP on another channel. |
| 402 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus | 403 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus |
| 403 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | 404 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the |
| 404 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | 405 | * frequency for the operation. |
| 405 | * optionally used to specify additional channel parameters. | ||
| 406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | 406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds |
| 407 | * to remain on the channel. This command is also used as an event to | 407 | * to remain on the channel. This command is also used as an event to |
| 408 | * notify when the requested duration starts (it may take a while for the | 408 | * notify when the requested duration starts (it may take a while for the |
| @@ -440,12 +440,11 @@ | |||
| 440 | * as an event indicating reception of a frame that was not processed in | 440 | * as an event indicating reception of a frame that was not processed in |
| 441 | * kernel code, but is for us (i.e., which may need to be processed in a | 441 | * kernel code, but is for us (i.e., which may need to be processed in a |
| 442 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 442 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
| 443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used |
| 444 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 444 | * to indicate on which channel the frame is to be transmitted or was |
| 445 | * which channel the frame is to be transmitted or was received. If this | 445 | * received. If this channel is not the current channel (remain-on-channel |
| 446 | * channel is not the current channel (remain-on-channel or the | 446 | * or the operational channel) the device will switch to the given channel |
| 447 | * operational channel) the device will switch to the given channel and | 447 | * and transmit the frame, optionally waiting for a response for the time |
| 448 | * transmit the frame, optionally waiting for a response for the time | ||
| 449 | * specified using %NL80211_ATTR_DURATION. When called, this operation | 448 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
| 450 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | 449 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the |
| 451 | * TX status event pertaining to the TX request. | 450 | * TX status event pertaining to the TX request. |
| @@ -473,8 +472,8 @@ | |||
| 473 | * command is used as an event to indicate the that a trigger level was | 472 | * command is used as an event to indicate the that a trigger level was |
| 474 | * reached. | 473 | * reached. |
| 475 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ | 474 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ |
| 476 | * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed | 475 | * and the attributes determining channel width) the given interface |
| 477 | * by %NL80211_ATTR_IFINDEX) shall operate on. | 476 | * (identifed by %NL80211_ATTR_IFINDEX) shall operate on. |
| 478 | * In case multiple channels are supported by the device, the mechanism | 477 | * In case multiple channels are supported by the device, the mechanism |
| 479 | * with which it switches channels is implementation-defined. | 478 | * with which it switches channels is implementation-defined. |
| 480 | * When a monitor interface is given, it can only switch channel while | 479 | * When a monitor interface is given, it can only switch channel while |
| @@ -526,6 +525,12 @@ | |||
| 526 | * of PMKSA caching dandidates. | 525 | * of PMKSA caching dandidates. |
| 527 | * | 526 | * |
| 528 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). | 527 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). |
| 528 | * In addition, this can be used as an event to request userspace to take | ||
| 529 | * actions on TDLS links (set up a new link or tear down an existing one). | ||
| 530 | * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested | ||
| 531 | * operation, %NL80211_ATTR_MAC contains the peer MAC address, and | ||
| 532 | * %NL80211_ATTR_REASON_CODE the reason code to be used (only with | ||
| 533 | * %NL80211_TDLS_TEARDOWN). | ||
| 529 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. | 534 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. |
| 530 | * | 535 | * |
| 531 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP | 536 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP |
| @@ -562,8 +567,8 @@ | |||
| 562 | * | 567 | * |
| 563 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels | 568 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels |
| 564 | * independently of the userspace SME, send this event indicating | 569 | * independently of the userspace SME, send this event indicating |
| 565 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with | 570 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the |
| 566 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. | 571 | * attributes determining channel width. |
| 567 | * | 572 | * |
| 568 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by | 573 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by |
| 569 | * its %NL80211_ATTR_WDEV identifier. It must have been created with | 574 | * its %NL80211_ATTR_WDEV identifier. It must have been created with |
| @@ -578,6 +583,9 @@ | |||
| 578 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON | 583 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON |
| 579 | * is used for this. | 584 | * is used for this. |
| 580 | * | 585 | * |
| 586 | * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames | ||
| 587 | * for IBSS or MESH vif. | ||
| 588 | * | ||
| 581 | * @NL80211_CMD_MAX: highest used command number | 589 | * @NL80211_CMD_MAX: highest used command number |
| 582 | * @__NL80211_CMD_AFTER_LAST: internal use | 590 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 583 | */ | 591 | */ |
| @@ -726,6 +734,8 @@ enum nl80211_commands { | |||
| 726 | 734 | ||
| 727 | NL80211_CMD_CONN_FAILED, | 735 | NL80211_CMD_CONN_FAILED, |
| 728 | 736 | ||
| 737 | NL80211_CMD_SET_MCAST_RATE, | ||
| 738 | |||
| 729 | /* add new commands above here */ | 739 | /* add new commands above here */ |
| 730 | 740 | ||
| 731 | /* used to define NL80211_CMD_MAX below */ | 741 | /* used to define NL80211_CMD_MAX below */ |
| @@ -762,14 +772,26 @@ enum nl80211_commands { | |||
| 762 | * /sys/class/ieee80211/<phyname>/index | 772 | * /sys/class/ieee80211/<phyname>/index |
| 763 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) | 773 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) |
| 764 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters | 774 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters |
| 765 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz | 775 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz, |
| 776 | * defines the channel together with the (deprecated) | ||
| 777 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes | ||
| 778 | * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 | ||
| 779 | * and %NL80211_ATTR_CENTER_FREQ2 | ||
| 780 | * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values | ||
| 781 | * of &enum nl80211_chan_width, describing the channel width. See the | ||
| 782 | * documentation of the enum for more information. | ||
| 783 | * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the | ||
| 784 | * channel, used for anything but 20 MHz bandwidth | ||
| 785 | * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the | ||
| 786 | * channel, used only for 80+80 MHz bandwidth | ||
| 766 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ | 787 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ |
| 767 | * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): | 788 | * if HT20 or HT40 are to be used (i.e., HT disabled if not included): |
| 768 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including | 789 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including |
| 769 | * this attribute) | 790 | * this attribute) |
| 770 | * NL80211_CHAN_HT20 = HT20 only | 791 | * NL80211_CHAN_HT20 = HT20 only |
| 771 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel | 792 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel |
| 772 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel | 793 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel |
| 794 | * This attribute is now deprecated. | ||
| 773 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is | 795 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is |
| 774 | * less than or equal to the RTS threshold; allowed range: 1..255; | 796 | * less than or equal to the RTS threshold; allowed range: 1..255; |
| 775 | * dot11ShortRetryLimit; u8 | 797 | * dot11ShortRetryLimit; u8 |
| @@ -1273,6 +1295,21 @@ enum nl80211_commands { | |||
| 1273 | * the connection request from a station. nl80211_connect_failed_reason | 1295 | * the connection request from a station. nl80211_connect_failed_reason |
| 1274 | * enum has different reasons of connection failure. | 1296 | * enum has different reasons of connection failure. |
| 1275 | * | 1297 | * |
| 1298 | * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts | ||
| 1299 | * with the Authentication transaction sequence number field. | ||
| 1300 | * | ||
| 1301 | * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from | ||
| 1302 | * association request when used with NL80211_CMD_NEW_STATION) | ||
| 1303 | * | ||
| 1304 | * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32) | ||
| 1305 | * | ||
| 1306 | * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with | ||
| 1307 | * the START_AP and SET_BSS commands | ||
| 1308 | * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the | ||
| 1309 | * START_AP and SET_BSS commands. This can have the values 0 or 1; | ||
| 1310 | * if not given in START_AP 0 is assumed, if not given in SET_BSS | ||
| 1311 | * no change is made. | ||
| 1312 | * | ||
| 1276 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1313 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1277 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1314 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1278 | */ | 1315 | */ |
| @@ -1530,6 +1567,19 @@ enum nl80211_attrs { | |||
| 1530 | 1567 | ||
| 1531 | NL80211_ATTR_CONN_FAILED_REASON, | 1568 | NL80211_ATTR_CONN_FAILED_REASON, |
| 1532 | 1569 | ||
| 1570 | NL80211_ATTR_SAE_DATA, | ||
| 1571 | |||
| 1572 | NL80211_ATTR_VHT_CAPABILITY, | ||
| 1573 | |||
| 1574 | NL80211_ATTR_SCAN_FLAGS, | ||
| 1575 | |||
| 1576 | NL80211_ATTR_CHANNEL_WIDTH, | ||
| 1577 | NL80211_ATTR_CENTER_FREQ1, | ||
| 1578 | NL80211_ATTR_CENTER_FREQ2, | ||
| 1579 | |||
| 1580 | NL80211_ATTR_P2P_CTWINDOW, | ||
| 1581 | NL80211_ATTR_P2P_OPPPS, | ||
| 1582 | |||
| 1533 | /* add attributes here, update the policy in nl80211.c */ | 1583 | /* add attributes here, update the policy in nl80211.c */ |
| 1534 | 1584 | ||
| 1535 | __NL80211_ATTR_AFTER_LAST, | 1585 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1573,6 +1623,7 @@ enum nl80211_attrs { | |||
| 1573 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 1623 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
| 1574 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 1624 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
| 1575 | #define NL80211_HT_CAPABILITY_LEN 26 | 1625 | #define NL80211_HT_CAPABILITY_LEN 26 |
| 1626 | #define NL80211_VHT_CAPABILITY_LEN 12 | ||
| 1576 | 1627 | ||
| 1577 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1628 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
| 1578 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1629 | #define NL80211_MAX_NR_AKM_SUITES 2 |
| @@ -1693,10 +1744,15 @@ struct nl80211_sta_flag_update { | |||
| 1693 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | 1744 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved |
| 1694 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | 1745 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) |
| 1695 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | 1746 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) |
| 1696 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | 1747 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate |
| 1697 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | 1748 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval |
| 1698 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) | 1749 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) |
| 1699 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined | 1750 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined |
| 1751 | * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) | ||
| 1752 | * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) | ||
| 1753 | * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate | ||
| 1754 | * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate | ||
| 1755 | * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate | ||
| 1700 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 1756 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
| 1701 | */ | 1757 | */ |
| 1702 | enum nl80211_rate_info { | 1758 | enum nl80211_rate_info { |
| @@ -1706,6 +1762,11 @@ enum nl80211_rate_info { | |||
| 1706 | NL80211_RATE_INFO_40_MHZ_WIDTH, | 1762 | NL80211_RATE_INFO_40_MHZ_WIDTH, |
| 1707 | NL80211_RATE_INFO_SHORT_GI, | 1763 | NL80211_RATE_INFO_SHORT_GI, |
| 1708 | NL80211_RATE_INFO_BITRATE32, | 1764 | NL80211_RATE_INFO_BITRATE32, |
| 1765 | NL80211_RATE_INFO_VHT_MCS, | ||
| 1766 | NL80211_RATE_INFO_VHT_NSS, | ||
| 1767 | NL80211_RATE_INFO_80_MHZ_WIDTH, | ||
| 1768 | NL80211_RATE_INFO_80P80_MHZ_WIDTH, | ||
| 1769 | NL80211_RATE_INFO_160_MHZ_WIDTH, | ||
| 1709 | 1770 | ||
| 1710 | /* keep last */ | 1771 | /* keep last */ |
| 1711 | __NL80211_RATE_INFO_AFTER_LAST, | 1772 | __NL80211_RATE_INFO_AFTER_LAST, |
| @@ -2414,6 +2475,15 @@ enum nl80211_ac { | |||
| 2414 | #define NL80211_TXQ_Q_BE NL80211_AC_BE | 2475 | #define NL80211_TXQ_Q_BE NL80211_AC_BE |
| 2415 | #define NL80211_TXQ_Q_BK NL80211_AC_BK | 2476 | #define NL80211_TXQ_Q_BK NL80211_AC_BK |
| 2416 | 2477 | ||
| 2478 | /** | ||
| 2479 | * enum nl80211_channel_type - channel type | ||
| 2480 | * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel | ||
| 2481 | * @NL80211_CHAN_HT20: 20 MHz HT channel | ||
| 2482 | * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel | ||
| 2483 | * below the control channel | ||
| 2484 | * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel | ||
| 2485 | * above the control channel | ||
| 2486 | */ | ||
| 2417 | enum nl80211_channel_type { | 2487 | enum nl80211_channel_type { |
| 2418 | NL80211_CHAN_NO_HT, | 2488 | NL80211_CHAN_NO_HT, |
| 2419 | NL80211_CHAN_HT20, | 2489 | NL80211_CHAN_HT20, |
| @@ -2422,6 +2492,32 @@ enum nl80211_channel_type { | |||
| 2422 | }; | 2492 | }; |
| 2423 | 2493 | ||
| 2424 | /** | 2494 | /** |
| 2495 | * enum nl80211_chan_width - channel width definitions | ||
| 2496 | * | ||
| 2497 | * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH | ||
| 2498 | * attribute. | ||
| 2499 | * | ||
| 2500 | * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel | ||
| 2501 | * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel | ||
| 2502 | * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
| 2503 | * attribute must be provided as well | ||
| 2504 | * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
| 2505 | * attribute must be provided as well | ||
| 2506 | * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
| 2507 | * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well | ||
| 2508 | * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
| 2509 | * attribute must be provided as well | ||
| 2510 | */ | ||
| 2511 | enum nl80211_chan_width { | ||
| 2512 | NL80211_CHAN_WIDTH_20_NOHT, | ||
| 2513 | NL80211_CHAN_WIDTH_20, | ||
| 2514 | NL80211_CHAN_WIDTH_40, | ||
| 2515 | NL80211_CHAN_WIDTH_80, | ||
| 2516 | NL80211_CHAN_WIDTH_80P80, | ||
| 2517 | NL80211_CHAN_WIDTH_160, | ||
| 2518 | }; | ||
| 2519 | |||
| 2520 | /** | ||
| 2425 | * enum nl80211_bss - netlink attributes for a BSS | 2521 | * enum nl80211_bss - netlink attributes for a BSS |
| 2426 | * | 2522 | * |
| 2427 | * @__NL80211_BSS_INVALID: invalid | 2523 | * @__NL80211_BSS_INVALID: invalid |
| @@ -2489,6 +2585,7 @@ enum nl80211_bss_status { | |||
| 2489 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) | 2585 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) |
| 2490 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) | 2586 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) |
| 2491 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) | 2587 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) |
| 2588 | * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals | ||
| 2492 | * @__NL80211_AUTHTYPE_NUM: internal | 2589 | * @__NL80211_AUTHTYPE_NUM: internal |
| 2493 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm | 2590 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm |
| 2494 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by | 2591 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by |
| @@ -2500,6 +2597,7 @@ enum nl80211_auth_type { | |||
| 2500 | NL80211_AUTHTYPE_SHARED_KEY, | 2597 | NL80211_AUTHTYPE_SHARED_KEY, |
| 2501 | NL80211_AUTHTYPE_FT, | 2598 | NL80211_AUTHTYPE_FT, |
| 2502 | NL80211_AUTHTYPE_NETWORK_EAP, | 2599 | NL80211_AUTHTYPE_NETWORK_EAP, |
| 2600 | NL80211_AUTHTYPE_SAE, | ||
| 2503 | 2601 | ||
| 2504 | /* keep last */ | 2602 | /* keep last */ |
| 2505 | __NL80211_AUTHTYPE_NUM, | 2603 | __NL80211_AUTHTYPE_NUM, |
| @@ -3028,6 +3126,20 @@ enum nl80211_ap_sme_features { | |||
| 3028 | * in the interface combinations, even when it's only used for scan | 3126 | * in the interface combinations, even when it's only used for scan |
| 3029 | * and remain-on-channel. This could be due to, for example, the | 3127 | * and remain-on-channel. This could be due to, for example, the |
| 3030 | * remain-on-channel implementation requiring a channel context. | 3128 | * remain-on-channel implementation requiring a channel context. |
| 3129 | * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of | ||
| 3130 | * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station | ||
| 3131 | * mode | ||
| 3132 | * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan | ||
| 3133 | * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported | ||
| 3134 | * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif | ||
| 3135 | * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting | ||
| 3136 | * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform | ||
| 3137 | * OBSS scans and generate 20/40 BSS coex reports. This flag is used only | ||
| 3138 | * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied. | ||
| 3139 | * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window | ||
| 3140 | * setting | ||
| 3141 | * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic | ||
| 3142 | * powersave | ||
| 3031 | */ | 3143 | */ |
| 3032 | enum nl80211_feature_flags { | 3144 | enum nl80211_feature_flags { |
| 3033 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3145 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
| @@ -3035,6 +3147,14 @@ enum nl80211_feature_flags { | |||
| 3035 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, | 3147 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, |
| 3036 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, | 3148 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, |
| 3037 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, | 3149 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, |
| 3150 | NL80211_FEATURE_SAE = 1 << 5, | ||
| 3151 | NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, | ||
| 3152 | NL80211_FEATURE_SCAN_FLUSH = 1 << 7, | ||
| 3153 | NL80211_FEATURE_AP_SCAN = 1 << 8, | ||
| 3154 | NL80211_FEATURE_VIF_TXPOWER = 1 << 9, | ||
| 3155 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, | ||
| 3156 | NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, | ||
| 3157 | NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, | ||
| 3038 | }; | 3158 | }; |
| 3039 | 3159 | ||
| 3040 | /** | 3160 | /** |
| @@ -3069,4 +3189,25 @@ enum nl80211_connect_failed_reason { | |||
| 3069 | NL80211_CONN_FAIL_BLOCKED_CLIENT, | 3189 | NL80211_CONN_FAIL_BLOCKED_CLIENT, |
| 3070 | }; | 3190 | }; |
| 3071 | 3191 | ||
| 3192 | /** | ||
| 3193 | * enum nl80211_scan_flags - scan request control flags | ||
| 3194 | * | ||
| 3195 | * Scan request control flags are used to control the handling | ||
| 3196 | * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN | ||
| 3197 | * requests. | ||
| 3198 | * | ||
| 3199 | * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority | ||
| 3200 | * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning | ||
| 3201 | * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured | ||
| 3202 | * as AP and the beaconing has already been configured. This attribute is | ||
| 3203 | * dangerous because will destroy stations performance as a lot of frames | ||
| 3204 | * will be lost while scanning off-channel, therefore it must be used only | ||
| 3205 | * when really needed | ||
| 3206 | */ | ||
| 3207 | enum nl80211_scan_flags { | ||
| 3208 | NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, | ||
| 3209 | NL80211_SCAN_FLAG_FLUSH = 1<<1, | ||
| 3210 | NL80211_SCAN_FLAG_AP = 1<<2, | ||
| 3211 | }; | ||
| 3212 | |||
| 3072 | #endif /* __LINUX_NL80211_H */ | 3213 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 20ae747ddf34..ebfadc56d1b4 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
| @@ -349,7 +349,7 @@ | |||
| 349 | #define PCI_AF_STATUS_TP 0x01 | 349 | #define PCI_AF_STATUS_TP 0x01 |
| 350 | #define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */ | 350 | #define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */ |
| 351 | 351 | ||
| 352 | /* PCI-X registers */ | 352 | /* PCI-X registers (Type 0 (non-bridge) devices) */ |
| 353 | 353 | ||
| 354 | #define PCI_X_CMD 2 /* Modes & Features */ | 354 | #define PCI_X_CMD 2 /* Modes & Features */ |
| 355 | #define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ | 355 | #define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ |
| @@ -389,6 +389,19 @@ | |||
| 389 | #define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */ | 389 | #define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */ |
| 390 | #define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */ | 390 | #define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */ |
| 391 | 391 | ||
| 392 | /* PCI-X registers (Type 1 (bridge) devices) */ | ||
| 393 | |||
| 394 | #define PCI_X_BRIDGE_SSTATUS 2 /* Secondary Status */ | ||
| 395 | #define PCI_X_SSTATUS_64BIT 0x0001 /* Secondary AD interface is 64 bits */ | ||
| 396 | #define PCI_X_SSTATUS_133MHZ 0x0002 /* 133 MHz capable */ | ||
| 397 | #define PCI_X_SSTATUS_FREQ 0x03c0 /* Secondary Bus Mode and Frequency */ | ||
| 398 | #define PCI_X_SSTATUS_VERS 0x3000 /* PCI-X Capability Version */ | ||
| 399 | #define PCI_X_SSTATUS_V1 0x1000 /* Mode 2, not Mode 1 */ | ||
| 400 | #define PCI_X_SSTATUS_V2 0x2000 /* Mode 1 or Modes 1 and 2 */ | ||
| 401 | #define PCI_X_SSTATUS_266MHZ 0x4000 /* 266 MHz capable */ | ||
| 402 | #define PCI_X_SSTATUS_533MHZ 0x8000 /* 533 MHz capable */ | ||
| 403 | #define PCI_X_BRIDGE_STATUS 4 /* Bridge Status */ | ||
| 404 | |||
| 392 | /* PCI Bridge Subsystem ID registers */ | 405 | /* PCI Bridge Subsystem ID registers */ |
| 393 | 406 | ||
| 394 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | 407 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ |
| @@ -445,6 +458,8 @@ | |||
| 445 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ | 458 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ |
| 446 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ | 459 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ |
| 447 | #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ | 460 | #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ |
| 461 | #define PCI_EXP_LNKCAP_SLS_2_5GB 0x1 /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */ | ||
| 462 | #define PCI_EXP_LNKCAP_SLS_5_0GB 0x2 /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */ | ||
| 448 | #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ | 463 | #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ |
| 449 | #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ | 464 | #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ |
| 450 | #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ | 465 | #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ |
| @@ -456,6 +471,8 @@ | |||
| 456 | #define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ | 471 | #define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ |
| 457 | #define PCI_EXP_LNKCTL 16 /* Link Control */ | 472 | #define PCI_EXP_LNKCTL 16 /* Link Control */ |
| 458 | #define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ | 473 | #define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ |
| 474 | #define PCI_EXP_LNKCTL_ASPM_L0S 0x01 /* L0s Enable */ | ||
| 475 | #define PCI_EXP_LNKCTL_ASPM_L1 0x02 /* L1 Enable */ | ||
| 459 | #define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ | 476 | #define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ |
| 460 | #define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ | 477 | #define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ |
| 461 | #define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ | 478 | #define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ |
| @@ -544,9 +561,9 @@ | |||
| 544 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ | 561 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ |
| 545 | #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ | 562 | #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ |
| 546 | #define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ | 563 | #define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ |
| 547 | #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */ | 564 | #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ |
| 548 | #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */ | 565 | #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ |
| 549 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ | 566 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ |
| 550 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ | 567 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ |
| 551 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 568 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
| 552 | #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ | 569 | #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ |
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 94e981f810a2..b65c834f83e9 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h | |||
| @@ -67,12 +67,26 @@ struct ptp_perout_request { | |||
| 67 | unsigned int rsv[4]; /* Reserved for future use. */ | 67 | unsigned int rsv[4]; /* Reserved for future use. */ |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | #define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */ | ||
| 71 | |||
| 72 | struct ptp_sys_offset { | ||
| 73 | unsigned int n_samples; /* Desired number of measurements. */ | ||
| 74 | unsigned int rsv[3]; /* Reserved for future use. */ | ||
| 75 | /* | ||
| 76 | * Array of interleaved system/phc time stamps. The kernel | ||
| 77 | * will provide 2*n_samples + 1 time stamps, with the last | ||
| 78 | * one as a system time stamp. | ||
| 79 | */ | ||
| 80 | struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; | ||
| 81 | }; | ||
| 82 | |||
| 70 | #define PTP_CLK_MAGIC '=' | 83 | #define PTP_CLK_MAGIC '=' |
| 71 | 84 | ||
| 72 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) | 85 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) |
| 73 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) | 86 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) |
| 74 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) | 87 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) |
| 75 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) | 88 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) |
| 89 | #define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset) | ||
| 76 | 90 | ||
| 77 | struct ptp_extts_event { | 91 | struct ptp_extts_event { |
| 78 | struct ptp_clock_time t; /* Time event occured. */ | 92 | struct ptp_clock_time t; /* Time event occured. */ |
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h index 1ef6c056a9e4..022ab186a812 100644 --- a/include/uapi/linux/ptrace.h +++ b/include/uapi/linux/ptrace.h | |||
| @@ -73,7 +73,10 @@ | |||
| 73 | #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) | 73 | #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) |
| 74 | #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) | 74 | #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) |
| 75 | 75 | ||
| 76 | #define PTRACE_O_MASK 0x000000ff | 76 | /* eventless options */ |
| 77 | #define PTRACE_O_EXITKILL (1 << 20) | ||
| 78 | |||
| 79 | #define PTRACE_O_MASK (0x000000ff | PTRACE_O_EXITKILL) | ||
| 77 | 80 | ||
| 78 | #include <asm/ptrace.h> | 81 | #include <asm/ptrace.h> |
| 79 | 82 | ||
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index fcd768b09f6e..7a5eb196ade9 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
| @@ -120,6 +120,18 @@ enum { | |||
| 120 | RTM_SETDCB, | 120 | RTM_SETDCB, |
| 121 | #define RTM_SETDCB RTM_SETDCB | 121 | #define RTM_SETDCB RTM_SETDCB |
| 122 | 122 | ||
| 123 | RTM_NEWNETCONF = 80, | ||
| 124 | #define RTM_NEWNETCONF RTM_NEWNETCONF | ||
| 125 | RTM_GETNETCONF = 82, | ||
| 126 | #define RTM_GETNETCONF RTM_GETNETCONF | ||
| 127 | |||
| 128 | RTM_NEWMDB = 84, | ||
| 129 | #define RTM_NEWMDB RTM_NEWMDB | ||
| 130 | RTM_DELMDB = 85, | ||
| 131 | #define RTM_DELMDB RTM_DELMDB | ||
| 132 | RTM_GETMDB = 86, | ||
| 133 | #define RTM_GETMDB RTM_GETMDB | ||
| 134 | |||
| 123 | __RTM_MAX, | 135 | __RTM_MAX, |
| 124 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 136 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
| 125 | }; | 137 | }; |
| @@ -222,6 +234,7 @@ enum { | |||
| 222 | #define RTPROT_XORP 14 /* XORP */ | 234 | #define RTPROT_XORP 14 /* XORP */ |
| 223 | #define RTPROT_NTK 15 /* Netsukuku */ | 235 | #define RTPROT_NTK 15 /* Netsukuku */ |
| 224 | #define RTPROT_DHCP 16 /* DHCP client */ | 236 | #define RTPROT_DHCP 16 /* DHCP client */ |
| 237 | #define RTPROT_MROUTED 17 /* Multicast daemon */ | ||
| 225 | 238 | ||
| 226 | /* rtm_scope | 239 | /* rtm_scope |
| 227 | 240 | ||
| @@ -283,6 +296,7 @@ enum rtattr_type_t { | |||
| 283 | RTA_MP_ALGO, /* no longer used */ | 296 | RTA_MP_ALGO, /* no longer used */ |
| 284 | RTA_TABLE, | 297 | RTA_TABLE, |
| 285 | RTA_MARK, | 298 | RTA_MARK, |
| 299 | RTA_MFC_STATS, | ||
| 286 | __RTA_MAX | 300 | __RTA_MAX |
| 287 | }; | 301 | }; |
| 288 | 302 | ||
| @@ -403,6 +417,12 @@ struct rta_session { | |||
| 403 | } u; | 417 | } u; |
| 404 | }; | 418 | }; |
| 405 | 419 | ||
| 420 | struct rta_mfc_stats { | ||
| 421 | __u64 mfcs_packets; | ||
| 422 | __u64 mfcs_bytes; | ||
| 423 | __u64 mfcs_wrong_if; | ||
| 424 | }; | ||
| 425 | |||
| 406 | /**** | 426 | /**** |
| 407 | * General form of address family dependent message. | 427 | * General form of address family dependent message. |
| 408 | ****/ | 428 | ****/ |
| @@ -587,6 +607,12 @@ enum rtnetlink_groups { | |||
| 587 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | 607 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
| 588 | RTNLGRP_DCB, | 608 | RTNLGRP_DCB, |
| 589 | #define RTNLGRP_DCB RTNLGRP_DCB | 609 | #define RTNLGRP_DCB RTNLGRP_DCB |
| 610 | RTNLGRP_IPV4_NETCONF, | ||
| 611 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF | ||
| 612 | RTNLGRP_IPV6_NETCONF, | ||
| 613 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF | ||
| 614 | RTNLGRP_MDB, | ||
| 615 | #define RTNLGRP_MDB RTNLGRP_MDB | ||
| 590 | __RTNLGRP_MAX | 616 | __RTNLGRP_MAX |
| 591 | }; | 617 | }; |
| 592 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 618 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 7e1ab20adc03..78f99d97475b 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
| @@ -49,7 +49,8 @@ | |||
| 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ | 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ |
| 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ | 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ |
| 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
| 52 | #define PORT_MAX_8250 23 /* max port ID */ | 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ |
| 53 | #define PORT_MAX_8250 24 /* max port ID */ | ||
| 53 | 54 | ||
| 54 | /* | 55 | /* |
| 55 | * ARM specific type numbers. These are not currently guaranteed | 56 | * ARM specific type numbers. These are not currently guaranteed |
| @@ -215,5 +216,7 @@ | |||
| 215 | /* Energy Micro efm32 SoC */ | 216 | /* Energy Micro efm32 SoC */ |
| 216 | #define PORT_EFMUART 100 | 217 | #define PORT_EFMUART 100 |
| 217 | 218 | ||
| 219 | /* ARC (Synopsys) on-chip UART */ | ||
| 220 | #define PORT_ARC 101 | ||
| 218 | 221 | ||
| 219 | #endif /* _UAPILINUX_SERIAL_CORE_H */ | 222 | #endif /* _UAPILINUX_SERIAL_CORE_H */ |
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 5ed325e88a81..e6322605b138 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h | |||
| @@ -367,5 +367,23 @@ | |||
| 367 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ | 367 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ |
| 368 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ | 368 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ |
| 369 | 369 | ||
| 370 | /* | ||
| 371 | * These are definitions for the Exar XR17V35X and XR17(C|D)15X | ||
| 372 | */ | ||
| 373 | #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */ | ||
| 374 | #define UART_EXAR_SLEEP 0x8b /* Sleep mode */ | ||
| 375 | #define UART_EXAR_DVID 0x8d /* Device identification */ | ||
| 376 | |||
| 377 | #define UART_EXAR_FCTR 0x08 /* Feature Control Register */ | ||
| 378 | #define UART_FCTR_EXAR_IRDA 0x08 /* IrDa data encode select */ | ||
| 379 | #define UART_FCTR_EXAR_485 0x10 /* Auto 485 half duplex dir ctl */ | ||
| 380 | #define UART_FCTR_EXAR_TRGA 0x00 /* FIFO trigger table A */ | ||
| 381 | #define UART_FCTR_EXAR_TRGB 0x60 /* FIFO trigger table B */ | ||
| 382 | #define UART_FCTR_EXAR_TRGC 0x80 /* FIFO trigger table C */ | ||
| 383 | #define UART_FCTR_EXAR_TRGD 0xc0 /* FIFO trigger table D programmable */ | ||
| 384 | |||
| 385 | #define UART_EXAR_TXTRG 0x0a /* Tx FIFO trigger level write-only */ | ||
| 386 | #define UART_EXAR_RXTRG 0x0b /* Rx FIFO trigger level write-only */ | ||
| 387 | |||
| 370 | #endif /* _LINUX_SERIAL_REG_H */ | 388 | #endif /* _LINUX_SERIAL_REG_H */ |
| 371 | 389 | ||
diff --git a/include/uapi/linux/signal.h b/include/uapi/linux/signal.h index dff452ed6d00..e1bd50c29ded 100644 --- a/include/uapi/linux/signal.h +++ b/include/uapi/linux/signal.h | |||
| @@ -4,5 +4,7 @@ | |||
| 4 | #include <asm/signal.h> | 4 | #include <asm/signal.h> |
| 5 | #include <asm/siginfo.h> | 5 | #include <asm/siginfo.h> |
| 6 | 6 | ||
| 7 | #define SS_ONSTACK 1 | ||
| 8 | #define SS_DISABLE 2 | ||
| 7 | 9 | ||
| 8 | #endif /* _UAPI_LINUX_SIGNAL_H */ | 10 | #endif /* _UAPI_LINUX_SIGNAL_H */ |
diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h index e811474724c2..0e011eb91b5d 100644 --- a/include/uapi/linux/swab.h +++ b/include/uapi/linux/swab.h | |||
| @@ -45,7 +45,9 @@ | |||
| 45 | 45 | ||
| 46 | static inline __attribute_const__ __u16 __fswab16(__u16 val) | 46 | static inline __attribute_const__ __u16 __fswab16(__u16 val) |
| 47 | { | 47 | { |
| 48 | #ifdef __arch_swab16 | 48 | #ifdef __HAVE_BUILTIN_BSWAP16__ |
| 49 | return __builtin_bswap16(val); | ||
| 50 | #elif defined (__arch_swab16) | ||
| 49 | return __arch_swab16(val); | 51 | return __arch_swab16(val); |
| 50 | #else | 52 | #else |
| 51 | return ___constant_swab16(val); | 53 | return ___constant_swab16(val); |
| @@ -54,7 +56,9 @@ static inline __attribute_const__ __u16 __fswab16(__u16 val) | |||
| 54 | 56 | ||
| 55 | static inline __attribute_const__ __u32 __fswab32(__u32 val) | 57 | static inline __attribute_const__ __u32 __fswab32(__u32 val) |
| 56 | { | 58 | { |
| 57 | #ifdef __arch_swab32 | 59 | #ifdef __HAVE_BUILTIN_BSWAP32__ |
| 60 | return __builtin_bswap32(val); | ||
| 61 | #elif defined(__arch_swab32) | ||
| 58 | return __arch_swab32(val); | 62 | return __arch_swab32(val); |
| 59 | #else | 63 | #else |
| 60 | return ___constant_swab32(val); | 64 | return ___constant_swab32(val); |
| @@ -63,7 +67,9 @@ static inline __attribute_const__ __u32 __fswab32(__u32 val) | |||
| 63 | 67 | ||
| 64 | static inline __attribute_const__ __u64 __fswab64(__u64 val) | 68 | static inline __attribute_const__ __u64 __fswab64(__u64 val) |
| 65 | { | 69 | { |
| 66 | #ifdef __arch_swab64 | 70 | #ifdef __HAVE_BUILTIN_BSWAP64__ |
| 71 | return __builtin_bswap64(val); | ||
| 72 | #elif defined (__arch_swab64) | ||
| 67 | return __arch_swab64(val); | 73 | return __arch_swab64(val); |
| 68 | #elif defined(__SWAB_64_THRU_32__) | 74 | #elif defined(__SWAB_64_THRU_32__) |
| 69 | __u32 h = val >> 32; | 75 | __u32 h = val >> 32; |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b1d2bf16b33c..b8a24941db21 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
| @@ -37,6 +37,7 @@ enum { | |||
| 37 | UNIX_DIAG_ICONS, | 37 | UNIX_DIAG_ICONS, |
| 38 | UNIX_DIAG_RQLEN, | 38 | UNIX_DIAG_RQLEN, |
| 39 | UNIX_DIAG_MEMINFO, | 39 | UNIX_DIAG_MEMINFO, |
| 40 | UNIX_DIAG_SHUTDOWN, | ||
| 40 | 41 | ||
| 41 | UNIX_DIAG_MAX, | 42 | UNIX_DIAG_MAX, |
| 42 | }; | 43 | }; |
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h index 81a927930bfd..f35aa0a338c7 100644 --- a/include/uapi/linux/usb/cdc.h +++ b/include/uapi/linux/usb/cdc.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b | 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
| 20 | #define USB_CDC_SUBCLASS_EEM 0x0c | 20 | #define USB_CDC_SUBCLASS_EEM 0x0c |
| 21 | #define USB_CDC_SUBCLASS_NCM 0x0d | 21 | #define USB_CDC_SUBCLASS_NCM 0x0d |
| 22 | #define USB_CDC_SUBCLASS_MBIM 0x0e | ||
| 22 | 23 | ||
| 23 | #define USB_CDC_PROTO_NONE 0 | 24 | #define USB_CDC_PROTO_NONE 0 |
| 24 | 25 | ||
| @@ -33,6 +34,7 @@ | |||
| 33 | #define USB_CDC_PROTO_EEM 7 | 34 | #define USB_CDC_PROTO_EEM 7 |
| 34 | 35 | ||
| 35 | #define USB_CDC_NCM_PROTO_NTB 1 | 36 | #define USB_CDC_NCM_PROTO_NTB 1 |
| 37 | #define USB_CDC_MBIM_PROTO_NTB 2 | ||
| 36 | 38 | ||
| 37 | /*-------------------------------------------------------------------------*/ | 39 | /*-------------------------------------------------------------------------*/ |
| 38 | 40 | ||
| @@ -53,6 +55,7 @@ | |||
| 53 | #define USB_CDC_DMM_TYPE 0x14 | 55 | #define USB_CDC_DMM_TYPE 0x14 |
| 54 | #define USB_CDC_OBEX_TYPE 0x15 | 56 | #define USB_CDC_OBEX_TYPE 0x15 |
| 55 | #define USB_CDC_NCM_TYPE 0x1a | 57 | #define USB_CDC_NCM_TYPE 0x1a |
| 58 | #define USB_CDC_MBIM_TYPE 0x1b | ||
| 56 | 59 | ||
| 57 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ | 60 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ |
| 58 | struct usb_cdc_header_desc { | 61 | struct usb_cdc_header_desc { |
| @@ -187,6 +190,21 @@ struct usb_cdc_ncm_desc { | |||
| 187 | __le16 bcdNcmVersion; | 190 | __le16 bcdNcmVersion; |
| 188 | __u8 bmNetworkCapabilities; | 191 | __u8 bmNetworkCapabilities; |
| 189 | } __attribute__ ((packed)); | 192 | } __attribute__ ((packed)); |
| 193 | |||
| 194 | /* "MBIM Control Model Functional Descriptor" */ | ||
| 195 | struct usb_cdc_mbim_desc { | ||
| 196 | __u8 bLength; | ||
| 197 | __u8 bDescriptorType; | ||
| 198 | __u8 bDescriptorSubType; | ||
| 199 | |||
| 200 | __le16 bcdMBIMVersion; | ||
| 201 | __le16 wMaxControlMessage; | ||
| 202 | __u8 bNumberFilters; | ||
| 203 | __u8 bMaxFilterSize; | ||
| 204 | __le16 wMaxSegmentSize; | ||
| 205 | __u8 bmNetworkCapabilities; | ||
| 206 | } __attribute__ ((packed)); | ||
| 207 | |||
| 190 | /*-------------------------------------------------------------------------*/ | 208 | /*-------------------------------------------------------------------------*/ |
| 191 | 209 | ||
| 192 | /* | 210 | /* |
| @@ -332,6 +350,11 @@ struct usb_cdc_ncm_nth32 { | |||
| 332 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ | 350 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ |
| 333 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ | 351 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ |
| 334 | 352 | ||
| 353 | #define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 /* IPS<sessionID> : IPS0 for now */ | ||
| 354 | #define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 /* ips<sessionID> : ips0 for now */ | ||
| 355 | #define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 /* DSS<sessionID> */ | ||
| 356 | #define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 /* dss<sessionID> */ | ||
| 357 | |||
| 335 | /* 16-bit NCM Datagram Pointer Entry */ | 358 | /* 16-bit NCM Datagram Pointer Entry */ |
| 336 | struct usb_cdc_ncm_dpe16 { | 359 | struct usb_cdc_ncm_dpe16 { |
| 337 | __le16 wDatagramIndex; | 360 | __le16 wDatagramIndex; |
diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h index 270fb22c5811..a7630d04029f 100644 --- a/include/uapi/linux/virtio_ids.h +++ b/include/uapi/linux/virtio_ids.h | |||
| @@ -37,5 +37,6 @@ | |||
| 37 | #define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */ | 37 | #define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */ |
| 38 | #define VIRTIO_ID_SCSI 8 /* virtio scsi */ | 38 | #define VIRTIO_ID_SCSI 8 /* virtio scsi */ |
| 39 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ | 39 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ |
| 40 | #define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */ | ||
| 40 | 41 | ||
| 41 | #endif /* _LINUX_VIRTIO_IDS_H */ | 42 | #endif /* _LINUX_VIRTIO_IDS_H */ |
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 2470f541af50..848e3584d7c8 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h | |||
| @@ -51,6 +51,8 @@ | |||
| 51 | #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ | 51 | #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ |
| 52 | #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the | 52 | #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the |
| 53 | * network */ | 53 | * network */ |
| 54 | #define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow | ||
| 55 | * Steering */ | ||
| 54 | 56 | ||
| 55 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 57 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
| 56 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ | 58 | #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ |
| @@ -60,6 +62,11 @@ struct virtio_net_config { | |||
| 60 | __u8 mac[6]; | 62 | __u8 mac[6]; |
| 61 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ | 63 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ |
| 62 | __u16 status; | 64 | __u16 status; |
| 65 | /* Maximum number of each of transmit and receive queues; | ||
| 66 | * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ. | ||
| 67 | * Legal values are between 1 and 0x8000 | ||
| 68 | */ | ||
| 69 | __u16 max_virtqueue_pairs; | ||
| 63 | } __attribute__((packed)); | 70 | } __attribute__((packed)); |
| 64 | 71 | ||
| 65 | /* This is the first element of the scatter-gather list. If you don't | 72 | /* This is the first element of the scatter-gather list. If you don't |
| @@ -166,4 +173,24 @@ struct virtio_net_ctrl_mac { | |||
| 166 | #define VIRTIO_NET_CTRL_ANNOUNCE 3 | 173 | #define VIRTIO_NET_CTRL_ANNOUNCE 3 |
| 167 | #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0 | 174 | #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0 |
| 168 | 175 | ||
| 176 | /* | ||
| 177 | * Control Receive Flow Steering | ||
| 178 | * | ||
| 179 | * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET | ||
| 180 | * enables Receive Flow Steering, specifying the number of the transmit and | ||
| 181 | * receive queues that will be used. After the command is consumed and acked by | ||
| 182 | * the device, the device will not steer new packets on receive virtqueues | ||
| 183 | * other than specified nor read from transmit virtqueues other than specified. | ||
| 184 | * Accordingly, driver should not transmit new packets on virtqueues other than | ||
| 185 | * specified. | ||
| 186 | */ | ||
| 187 | struct virtio_net_ctrl_mq { | ||
| 188 | u16 virtqueue_pairs; | ||
| 189 | }; | ||
| 190 | |||
| 191 | #define VIRTIO_NET_CTRL_MQ 4 | ||
| 192 | #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0 | ||
| 193 | #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1 | ||
| 194 | #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000 | ||
| 195 | |||
| 169 | #endif /* _LINUX_VIRTIO_NET_H */ | 196 | #endif /* _LINUX_VIRTIO_NET_H */ |
diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild index aafaa5aa54d4..687ae332200f 100644 --- a/include/uapi/rdma/Kbuild +++ b/include/uapi/rdma/Kbuild | |||
| @@ -1 +1,7 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += ib_user_cm.h | ||
| 3 | header-y += ib_user_mad.h | ||
| 4 | header-y += ib_user_sa.h | ||
| 5 | header-y += ib_user_verbs.h | ||
| 6 | header-y += rdma_netlink.h | ||
| 7 | header-y += rdma_user_cm.h | ||
diff --git a/include/uapi/rdma/ib_user_cm.h b/include/uapi/rdma/ib_user_cm.h new file mode 100644 index 000000000000..f79014aa28f9 --- /dev/null +++ b/include/uapi/rdma/ib_user_cm.h | |||
| @@ -0,0 +1,325 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | ||
| 3 | * Copyright (c) 2005 Intel Corporation. All rights reserved. | ||
| 4 | * | ||
| 5 | * This software is available to you under a choice of one of two | ||
| 6 | * licenses. You may choose to be licensed under the terms of the GNU | ||
| 7 | * General Public License (GPL) Version 2, available from the file | ||
| 8 | * COPYING in the main directory of this source tree, or the | ||
| 9 | * OpenIB.org BSD license below: | ||
| 10 | * | ||
| 11 | * Redistribution and use in source and binary forms, with or | ||
| 12 | * without modification, are permitted provided that the following | ||
| 13 | * conditions are met: | ||
| 14 | * | ||
| 15 | * - Redistributions of source code must retain the above | ||
| 16 | * copyright notice, this list of conditions and the following | ||
| 17 | * disclaimer. | ||
| 18 | * | ||
| 19 | * - Redistributions in binary form must reproduce the above | ||
| 20 | * copyright notice, this list of conditions and the following | ||
| 21 | * disclaimer in the documentation and/or other materials | ||
| 22 | * provided with the distribution. | ||
| 23 | * | ||
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 31 | * SOFTWARE. | ||
| 32 | */ | ||
| 33 | |||
| 34 | #ifndef IB_USER_CM_H | ||
| 35 | #define IB_USER_CM_H | ||
| 36 | |||
| 37 | #include <linux/types.h> | ||
| 38 | #include <rdma/ib_user_sa.h> | ||
| 39 | |||
| 40 | #define IB_USER_CM_ABI_VERSION 5 | ||
| 41 | |||
| 42 | enum { | ||
| 43 | IB_USER_CM_CMD_CREATE_ID, | ||
| 44 | IB_USER_CM_CMD_DESTROY_ID, | ||
| 45 | IB_USER_CM_CMD_ATTR_ID, | ||
| 46 | |||
| 47 | IB_USER_CM_CMD_LISTEN, | ||
| 48 | IB_USER_CM_CMD_NOTIFY, | ||
| 49 | |||
| 50 | IB_USER_CM_CMD_SEND_REQ, | ||
| 51 | IB_USER_CM_CMD_SEND_REP, | ||
| 52 | IB_USER_CM_CMD_SEND_RTU, | ||
| 53 | IB_USER_CM_CMD_SEND_DREQ, | ||
| 54 | IB_USER_CM_CMD_SEND_DREP, | ||
| 55 | IB_USER_CM_CMD_SEND_REJ, | ||
| 56 | IB_USER_CM_CMD_SEND_MRA, | ||
| 57 | IB_USER_CM_CMD_SEND_LAP, | ||
| 58 | IB_USER_CM_CMD_SEND_APR, | ||
| 59 | IB_USER_CM_CMD_SEND_SIDR_REQ, | ||
| 60 | IB_USER_CM_CMD_SEND_SIDR_REP, | ||
| 61 | |||
| 62 | IB_USER_CM_CMD_EVENT, | ||
| 63 | IB_USER_CM_CMD_INIT_QP_ATTR, | ||
| 64 | }; | ||
| 65 | /* | ||
| 66 | * command ABI structures. | ||
| 67 | */ | ||
| 68 | struct ib_ucm_cmd_hdr { | ||
| 69 | __u32 cmd; | ||
| 70 | __u16 in; | ||
| 71 | __u16 out; | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct ib_ucm_create_id { | ||
| 75 | __u64 uid; | ||
| 76 | __u64 response; | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct ib_ucm_create_id_resp { | ||
| 80 | __u32 id; | ||
| 81 | }; | ||
| 82 | |||
| 83 | struct ib_ucm_destroy_id { | ||
| 84 | __u64 response; | ||
| 85 | __u32 id; | ||
| 86 | __u32 reserved; | ||
| 87 | }; | ||
| 88 | |||
| 89 | struct ib_ucm_destroy_id_resp { | ||
| 90 | __u32 events_reported; | ||
| 91 | }; | ||
| 92 | |||
| 93 | struct ib_ucm_attr_id { | ||
| 94 | __u64 response; | ||
| 95 | __u32 id; | ||
| 96 | __u32 reserved; | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct ib_ucm_attr_id_resp { | ||
| 100 | __be64 service_id; | ||
| 101 | __be64 service_mask; | ||
| 102 | __be32 local_id; | ||
| 103 | __be32 remote_id; | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct ib_ucm_init_qp_attr { | ||
| 107 | __u64 response; | ||
| 108 | __u32 id; | ||
| 109 | __u32 qp_state; | ||
| 110 | }; | ||
| 111 | |||
| 112 | struct ib_ucm_listen { | ||
| 113 | __be64 service_id; | ||
| 114 | __be64 service_mask; | ||
| 115 | __u32 id; | ||
| 116 | __u32 reserved; | ||
| 117 | }; | ||
| 118 | |||
| 119 | struct ib_ucm_notify { | ||
| 120 | __u32 id; | ||
| 121 | __u32 event; | ||
| 122 | }; | ||
| 123 | |||
| 124 | struct ib_ucm_private_data { | ||
| 125 | __u64 data; | ||
| 126 | __u32 id; | ||
| 127 | __u8 len; | ||
| 128 | __u8 reserved[3]; | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct ib_ucm_req { | ||
| 132 | __u32 id; | ||
| 133 | __u32 qpn; | ||
| 134 | __u32 qp_type; | ||
| 135 | __u32 psn; | ||
| 136 | __be64 sid; | ||
| 137 | __u64 data; | ||
| 138 | __u64 primary_path; | ||
| 139 | __u64 alternate_path; | ||
| 140 | __u8 len; | ||
| 141 | __u8 peer_to_peer; | ||
| 142 | __u8 responder_resources; | ||
| 143 | __u8 initiator_depth; | ||
| 144 | __u8 remote_cm_response_timeout; | ||
| 145 | __u8 flow_control; | ||
| 146 | __u8 local_cm_response_timeout; | ||
| 147 | __u8 retry_count; | ||
| 148 | __u8 rnr_retry_count; | ||
| 149 | __u8 max_cm_retries; | ||
| 150 | __u8 srq; | ||
| 151 | __u8 reserved[5]; | ||
| 152 | }; | ||
| 153 | |||
| 154 | struct ib_ucm_rep { | ||
| 155 | __u64 uid; | ||
| 156 | __u64 data; | ||
| 157 | __u32 id; | ||
| 158 | __u32 qpn; | ||
| 159 | __u32 psn; | ||
| 160 | __u8 len; | ||
| 161 | __u8 responder_resources; | ||
| 162 | __u8 initiator_depth; | ||
| 163 | __u8 target_ack_delay; | ||
| 164 | __u8 failover_accepted; | ||
| 165 | __u8 flow_control; | ||
| 166 | __u8 rnr_retry_count; | ||
| 167 | __u8 srq; | ||
| 168 | __u8 reserved[4]; | ||
| 169 | }; | ||
| 170 | |||
| 171 | struct ib_ucm_info { | ||
| 172 | __u32 id; | ||
| 173 | __u32 status; | ||
| 174 | __u64 info; | ||
| 175 | __u64 data; | ||
| 176 | __u8 info_len; | ||
| 177 | __u8 data_len; | ||
| 178 | __u8 reserved[6]; | ||
| 179 | }; | ||
| 180 | |||
| 181 | struct ib_ucm_mra { | ||
| 182 | __u64 data; | ||
| 183 | __u32 id; | ||
| 184 | __u8 len; | ||
| 185 | __u8 timeout; | ||
| 186 | __u8 reserved[2]; | ||
| 187 | }; | ||
| 188 | |||
| 189 | struct ib_ucm_lap { | ||
| 190 | __u64 path; | ||
| 191 | __u64 data; | ||
| 192 | __u32 id; | ||
| 193 | __u8 len; | ||
| 194 | __u8 reserved[3]; | ||
| 195 | }; | ||
| 196 | |||
| 197 | struct ib_ucm_sidr_req { | ||
| 198 | __u32 id; | ||
| 199 | __u32 timeout; | ||
| 200 | __be64 sid; | ||
| 201 | __u64 data; | ||
| 202 | __u64 path; | ||
| 203 | __u16 reserved_pkey; | ||
| 204 | __u8 len; | ||
| 205 | __u8 max_cm_retries; | ||
| 206 | __u8 reserved[4]; | ||
| 207 | }; | ||
| 208 | |||
| 209 | struct ib_ucm_sidr_rep { | ||
| 210 | __u32 id; | ||
| 211 | __u32 qpn; | ||
| 212 | __u32 qkey; | ||
| 213 | __u32 status; | ||
| 214 | __u64 info; | ||
| 215 | __u64 data; | ||
| 216 | __u8 info_len; | ||
| 217 | __u8 data_len; | ||
| 218 | __u8 reserved[6]; | ||
| 219 | }; | ||
| 220 | /* | ||
| 221 | * event notification ABI structures. | ||
| 222 | */ | ||
| 223 | struct ib_ucm_event_get { | ||
| 224 | __u64 response; | ||
| 225 | __u64 data; | ||
| 226 | __u64 info; | ||
| 227 | __u8 data_len; | ||
| 228 | __u8 info_len; | ||
| 229 | __u8 reserved[6]; | ||
| 230 | }; | ||
| 231 | |||
| 232 | struct ib_ucm_req_event_resp { | ||
| 233 | struct ib_user_path_rec primary_path; | ||
| 234 | struct ib_user_path_rec alternate_path; | ||
| 235 | __be64 remote_ca_guid; | ||
| 236 | __u32 remote_qkey; | ||
| 237 | __u32 remote_qpn; | ||
| 238 | __u32 qp_type; | ||
| 239 | __u32 starting_psn; | ||
| 240 | __u8 responder_resources; | ||
| 241 | __u8 initiator_depth; | ||
| 242 | __u8 local_cm_response_timeout; | ||
| 243 | __u8 flow_control; | ||
| 244 | __u8 remote_cm_response_timeout; | ||
| 245 | __u8 retry_count; | ||
| 246 | __u8 rnr_retry_count; | ||
| 247 | __u8 srq; | ||
| 248 | __u8 port; | ||
| 249 | __u8 reserved[7]; | ||
| 250 | }; | ||
| 251 | |||
| 252 | struct ib_ucm_rep_event_resp { | ||
| 253 | __be64 remote_ca_guid; | ||
| 254 | __u32 remote_qkey; | ||
| 255 | __u32 remote_qpn; | ||
| 256 | __u32 starting_psn; | ||
| 257 | __u8 responder_resources; | ||
| 258 | __u8 initiator_depth; | ||
| 259 | __u8 target_ack_delay; | ||
| 260 | __u8 failover_accepted; | ||
| 261 | __u8 flow_control; | ||
| 262 | __u8 rnr_retry_count; | ||
| 263 | __u8 srq; | ||
| 264 | __u8 reserved[5]; | ||
| 265 | }; | ||
| 266 | |||
| 267 | struct ib_ucm_rej_event_resp { | ||
| 268 | __u32 reason; | ||
| 269 | /* ari in ib_ucm_event_get info field. */ | ||
| 270 | }; | ||
| 271 | |||
| 272 | struct ib_ucm_mra_event_resp { | ||
| 273 | __u8 timeout; | ||
| 274 | __u8 reserved[3]; | ||
| 275 | }; | ||
| 276 | |||
| 277 | struct ib_ucm_lap_event_resp { | ||
| 278 | struct ib_user_path_rec path; | ||
| 279 | }; | ||
| 280 | |||
| 281 | struct ib_ucm_apr_event_resp { | ||
| 282 | __u32 status; | ||
| 283 | /* apr info in ib_ucm_event_get info field. */ | ||
| 284 | }; | ||
| 285 | |||
| 286 | struct ib_ucm_sidr_req_event_resp { | ||
| 287 | __u16 pkey; | ||
| 288 | __u8 port; | ||
| 289 | __u8 reserved; | ||
| 290 | }; | ||
| 291 | |||
| 292 | struct ib_ucm_sidr_rep_event_resp { | ||
| 293 | __u32 status; | ||
| 294 | __u32 qkey; | ||
| 295 | __u32 qpn; | ||
| 296 | /* info in ib_ucm_event_get info field. */ | ||
| 297 | }; | ||
| 298 | |||
| 299 | #define IB_UCM_PRES_DATA 0x01 | ||
| 300 | #define IB_UCM_PRES_INFO 0x02 | ||
| 301 | #define IB_UCM_PRES_PRIMARY 0x04 | ||
| 302 | #define IB_UCM_PRES_ALTERNATE 0x08 | ||
| 303 | |||
| 304 | struct ib_ucm_event_resp { | ||
| 305 | __u64 uid; | ||
| 306 | __u32 id; | ||
| 307 | __u32 event; | ||
| 308 | __u32 present; | ||
| 309 | __u32 reserved; | ||
| 310 | union { | ||
| 311 | struct ib_ucm_req_event_resp req_resp; | ||
| 312 | struct ib_ucm_rep_event_resp rep_resp; | ||
| 313 | struct ib_ucm_rej_event_resp rej_resp; | ||
| 314 | struct ib_ucm_mra_event_resp mra_resp; | ||
| 315 | struct ib_ucm_lap_event_resp lap_resp; | ||
| 316 | struct ib_ucm_apr_event_resp apr_resp; | ||
| 317 | |||
| 318 | struct ib_ucm_sidr_req_event_resp sidr_req_resp; | ||
| 319 | struct ib_ucm_sidr_rep_event_resp sidr_rep_resp; | ||
| 320 | |||
| 321 | __u32 send_status; | ||
| 322 | } u; | ||
| 323 | }; | ||
| 324 | |||
| 325 | #endif /* IB_USER_CM_H */ | ||
diff --git a/include/uapi/rdma/ib_user_mad.h b/include/uapi/rdma/ib_user_mad.h new file mode 100644 index 000000000000..d6fce1cbdb90 --- /dev/null +++ b/include/uapi/rdma/ib_user_mad.h | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | ||
| 3 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. | ||
| 4 | * | ||
| 5 | * This software is available to you under a choice of one of two | ||
| 6 | * licenses. You may choose to be licensed under the terms of the GNU | ||
| 7 | * General Public License (GPL) Version 2, available from the file | ||
| 8 | * COPYING in the main directory of this source tree, or the | ||
| 9 | * OpenIB.org BSD license below: | ||
| 10 | * | ||
| 11 | * Redistribution and use in source and binary forms, with or | ||
| 12 | * without modification, are permitted provided that the following | ||
| 13 | * conditions are met: | ||
| 14 | * | ||
| 15 | * - Redistributions of source code must retain the above | ||
| 16 | * copyright notice, this list of conditions and the following | ||
| 17 | * disclaimer. | ||
| 18 | * | ||
| 19 | * - Redistributions in binary form must reproduce the above | ||
| 20 | * copyright notice, this list of conditions and the following | ||
| 21 | * disclaimer in the documentation and/or other materials | ||
| 22 | * provided with the distribution. | ||
| 23 | * | ||
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 31 | * SOFTWARE. | ||
| 32 | */ | ||
| 33 | |||
| 34 | #ifndef IB_USER_MAD_H | ||
| 35 | #define IB_USER_MAD_H | ||
| 36 | |||
| 37 | #include <linux/types.h> | ||
| 38 | #include <linux/ioctl.h> | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Increment this value if any changes that break userspace ABI | ||
| 42 | * compatibility are made. | ||
| 43 | */ | ||
| 44 | #define IB_USER_MAD_ABI_VERSION 5 | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Make sure that all structs defined in this file remain laid out so | ||
| 48 | * that they pack the same way on 32-bit and 64-bit architectures (to | ||
| 49 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). | ||
| 50 | */ | ||
| 51 | |||
| 52 | /** | ||
| 53 | * ib_user_mad_hdr_old - Old version of MAD packet header without pkey_index | ||
| 54 | * @id - ID of agent MAD received with/to be sent with | ||
| 55 | * @status - 0 on successful receive, ETIMEDOUT if no response | ||
| 56 | * received (transaction ID in data[] will be set to TID of original | ||
| 57 | * request) (ignored on send) | ||
| 58 | * @timeout_ms - Milliseconds to wait for response (unset on receive) | ||
| 59 | * @retries - Number of automatic retries to attempt | ||
| 60 | * @qpn - Remote QP number received from/to be sent to | ||
| 61 | * @qkey - Remote Q_Key to be sent with (unset on receive) | ||
| 62 | * @lid - Remote lid received from/to be sent to | ||
| 63 | * @sl - Service level received with/to be sent with | ||
| 64 | * @path_bits - Local path bits received with/to be sent with | ||
| 65 | * @grh_present - If set, GRH was received/should be sent | ||
| 66 | * @gid_index - Local GID index to send with (unset on receive) | ||
| 67 | * @hop_limit - Hop limit in GRH | ||
| 68 | * @traffic_class - Traffic class in GRH | ||
| 69 | * @gid - Remote GID in GRH | ||
| 70 | * @flow_label - Flow label in GRH | ||
| 71 | */ | ||
| 72 | struct ib_user_mad_hdr_old { | ||
| 73 | __u32 id; | ||
| 74 | __u32 status; | ||
| 75 | __u32 timeout_ms; | ||
| 76 | __u32 retries; | ||
| 77 | __u32 length; | ||
| 78 | __be32 qpn; | ||
| 79 | __be32 qkey; | ||
| 80 | __be16 lid; | ||
| 81 | __u8 sl; | ||
| 82 | __u8 path_bits; | ||
| 83 | __u8 grh_present; | ||
| 84 | __u8 gid_index; | ||
| 85 | __u8 hop_limit; | ||
| 86 | __u8 traffic_class; | ||
| 87 | __u8 gid[16]; | ||
| 88 | __be32 flow_label; | ||
| 89 | }; | ||
| 90 | |||
| 91 | /** | ||
| 92 | * ib_user_mad_hdr - MAD packet header | ||
| 93 | * This layout allows specifying/receiving the P_Key index. To use | ||
| 94 | * this capability, an application must call the | ||
| 95 | * IB_USER_MAD_ENABLE_PKEY ioctl on the user MAD file handle before | ||
| 96 | * any other actions with the file handle. | ||
| 97 | * @id - ID of agent MAD received with/to be sent with | ||
| 98 | * @status - 0 on successful receive, ETIMEDOUT if no response | ||
| 99 | * received (transaction ID in data[] will be set to TID of original | ||
| 100 | * request) (ignored on send) | ||
| 101 | * @timeout_ms - Milliseconds to wait for response (unset on receive) | ||
| 102 | * @retries - Number of automatic retries to attempt | ||
| 103 | * @qpn - Remote QP number received from/to be sent to | ||
| 104 | * @qkey - Remote Q_Key to be sent with (unset on receive) | ||
| 105 | * @lid - Remote lid received from/to be sent to | ||
| 106 | * @sl - Service level received with/to be sent with | ||
| 107 | * @path_bits - Local path bits received with/to be sent with | ||
| 108 | * @grh_present - If set, GRH was received/should be sent | ||
| 109 | * @gid_index - Local GID index to send with (unset on receive) | ||
| 110 | * @hop_limit - Hop limit in GRH | ||
| 111 | * @traffic_class - Traffic class in GRH | ||
| 112 | * @gid - Remote GID in GRH | ||
| 113 | * @flow_label - Flow label in GRH | ||
| 114 | * @pkey_index - P_Key index | ||
| 115 | */ | ||
| 116 | struct ib_user_mad_hdr { | ||
| 117 | __u32 id; | ||
| 118 | __u32 status; | ||
| 119 | __u32 timeout_ms; | ||
| 120 | __u32 retries; | ||
| 121 | __u32 length; | ||
| 122 | __be32 qpn; | ||
| 123 | __be32 qkey; | ||
| 124 | __be16 lid; | ||
| 125 | __u8 sl; | ||
| 126 | __u8 path_bits; | ||
| 127 | __u8 grh_present; | ||
| 128 | __u8 gid_index; | ||
| 129 | __u8 hop_limit; | ||
| 130 | __u8 traffic_class; | ||
| 131 | __u8 gid[16]; | ||
| 132 | __be32 flow_label; | ||
| 133 | __u16 pkey_index; | ||
| 134 | __u8 reserved[6]; | ||
| 135 | }; | ||
| 136 | |||
| 137 | /** | ||
| 138 | * ib_user_mad - MAD packet | ||
| 139 | * @hdr - MAD packet header | ||
| 140 | * @data - Contents of MAD | ||
| 141 | * | ||
| 142 | */ | ||
| 143 | struct ib_user_mad { | ||
| 144 | struct ib_user_mad_hdr hdr; | ||
| 145 | __u64 data[0]; | ||
| 146 | }; | ||
| 147 | |||
| 148 | /* | ||
| 149 | * Earlier versions of this interface definition declared the | ||
| 150 | * method_mask[] member as an array of __u32 but treated it as a | ||
| 151 | * bitmap made up of longs in the kernel. This ambiguity meant that | ||
| 152 | * 32-bit big-endian applications that can run on both 32-bit and | ||
| 153 | * 64-bit kernels had no consistent ABI to rely on, and 64-bit | ||
| 154 | * big-endian applications that treated method_mask as being made up | ||
| 155 | * of 32-bit words would have their bitmap misinterpreted. | ||
| 156 | * | ||
| 157 | * To clear up this confusion, we change the declaration of | ||
| 158 | * method_mask[] to use unsigned long and handle the conversion from | ||
| 159 | * 32-bit userspace to 64-bit kernel for big-endian systems in the | ||
| 160 | * compat_ioctl method. Unfortunately, to keep the structure layout | ||
| 161 | * the same, we need the method_mask[] array to be aligned only to 4 | ||
| 162 | * bytes even when long is 64 bits, which forces us into this ugly | ||
| 163 | * typedef. | ||
| 164 | */ | ||
| 165 | typedef unsigned long __attribute__((aligned(4))) packed_ulong; | ||
| 166 | #define IB_USER_MAD_LONGS_PER_METHOD_MASK (128 / (8 * sizeof (long))) | ||
| 167 | |||
| 168 | /** | ||
| 169 | * ib_user_mad_reg_req - MAD registration request | ||
| 170 | * @id - Set by the kernel; used to identify agent in future requests. | ||
| 171 | * @qpn - Queue pair number; must be 0 or 1. | ||
| 172 | * @method_mask - The caller will receive unsolicited MADs for any method | ||
| 173 | * where @method_mask = 1. | ||
| 174 | * @mgmt_class - Indicates which management class of MADs should be receive | ||
| 175 | * by the caller. This field is only required if the user wishes to | ||
| 176 | * receive unsolicited MADs, otherwise it should be 0. | ||
| 177 | * @mgmt_class_version - Indicates which version of MADs for the given | ||
| 178 | * management class to receive. | ||
| 179 | * @oui: Indicates IEEE OUI when mgmt_class is a vendor class | ||
| 180 | * in the range from 0x30 to 0x4f. Otherwise not used. | ||
| 181 | * @rmpp_version: If set, indicates the RMPP version used. | ||
| 182 | * | ||
| 183 | */ | ||
| 184 | struct ib_user_mad_reg_req { | ||
| 185 | __u32 id; | ||
| 186 | packed_ulong method_mask[IB_USER_MAD_LONGS_PER_METHOD_MASK]; | ||
| 187 | __u8 qpn; | ||
| 188 | __u8 mgmt_class; | ||
| 189 | __u8 mgmt_class_version; | ||
| 190 | __u8 oui[3]; | ||
| 191 | __u8 rmpp_version; | ||
| 192 | }; | ||
| 193 | |||
| 194 | #define IB_IOCTL_MAGIC 0x1b | ||
| 195 | |||
| 196 | #define IB_USER_MAD_REGISTER_AGENT _IOWR(IB_IOCTL_MAGIC, 1, \ | ||
| 197 | struct ib_user_mad_reg_req) | ||
| 198 | |||
| 199 | #define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32) | ||
| 200 | |||
| 201 | #define IB_USER_MAD_ENABLE_PKEY _IO(IB_IOCTL_MAGIC, 3) | ||
| 202 | |||
| 203 | #endif /* IB_USER_MAD_H */ | ||
diff --git a/include/uapi/rdma/ib_user_sa.h b/include/uapi/rdma/ib_user_sa.h new file mode 100644 index 000000000000..cfc7c9ba781e --- /dev/null +++ b/include/uapi/rdma/ib_user_sa.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Intel Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is available to you under a choice of one of two | ||
| 5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
| 6 | * General Public License (GPL) Version 2, available from the file | ||
| 7 | * COPYING in the main directory of this source tree, or the | ||
| 8 | * OpenIB.org BSD license below: | ||
| 9 | * | ||
| 10 | * Redistribution and use in source and binary forms, with or | ||
| 11 | * without modification, are permitted provided that the following | ||
| 12 | * conditions are met: | ||
| 13 | * | ||
| 14 | * - Redistributions of source code must retain the above | ||
| 15 | * copyright notice, this list of conditions and the following | ||
| 16 | * disclaimer. | ||
| 17 | * | ||
| 18 | * - Redistributions in binary form must reproduce the above | ||
| 19 | * copyright notice, this list of conditions and the following | ||
| 20 | * disclaimer in the documentation and/or other materials | ||
| 21 | * provided with the distribution. | ||
| 22 | * | ||
| 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 30 | * SOFTWARE. | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef IB_USER_SA_H | ||
| 34 | #define IB_USER_SA_H | ||
| 35 | |||
| 36 | #include <linux/types.h> | ||
| 37 | |||
| 38 | enum { | ||
| 39 | IB_PATH_GMP = 1, | ||
| 40 | IB_PATH_PRIMARY = (1<<1), | ||
| 41 | IB_PATH_ALTERNATE = (1<<2), | ||
| 42 | IB_PATH_OUTBOUND = (1<<3), | ||
| 43 | IB_PATH_INBOUND = (1<<4), | ||
| 44 | IB_PATH_INBOUND_REVERSE = (1<<5), | ||
| 45 | IB_PATH_BIDIRECTIONAL = IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct ib_path_rec_data { | ||
| 49 | __u32 flags; | ||
| 50 | __u32 reserved; | ||
| 51 | __u32 path_rec[16]; | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct ib_user_path_rec { | ||
| 55 | __u8 dgid[16]; | ||
| 56 | __u8 sgid[16]; | ||
| 57 | __be16 dlid; | ||
| 58 | __be16 slid; | ||
| 59 | __u32 raw_traffic; | ||
| 60 | __be32 flow_label; | ||
| 61 | __u32 reversible; | ||
| 62 | __u32 mtu; | ||
| 63 | __be16 pkey; | ||
| 64 | __u8 hop_limit; | ||
| 65 | __u8 traffic_class; | ||
| 66 | __u8 numb_path; | ||
| 67 | __u8 sl; | ||
| 68 | __u8 mtu_selector; | ||
| 69 | __u8 rate_selector; | ||
| 70 | __u8 rate; | ||
| 71 | __u8 packet_life_time_selector; | ||
| 72 | __u8 packet_life_time; | ||
| 73 | __u8 preference; | ||
| 74 | }; | ||
| 75 | |||
| 76 | #endif /* IB_USER_SA_H */ | ||
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h new file mode 100644 index 000000000000..81aba3a73aa3 --- /dev/null +++ b/include/uapi/rdma/ib_user_verbs.h | |||
| @@ -0,0 +1,734 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | ||
| 3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. | ||
| 4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. | ||
| 5 | * Copyright (c) 2006 Mellanox Technologies. All rights reserved. | ||
| 6 | * | ||
| 7 | * This software is available to you under a choice of one of two | ||
| 8 | * licenses. You may choose to be licensed under the terms of the GNU | ||
| 9 | * General Public License (GPL) Version 2, available from the file | ||
| 10 | * COPYING in the main directory of this source tree, or the | ||
| 11 | * OpenIB.org BSD license below: | ||
| 12 | * | ||
| 13 | * Redistribution and use in source and binary forms, with or | ||
| 14 | * without modification, are permitted provided that the following | ||
| 15 | * conditions are met: | ||
| 16 | * | ||
| 17 | * - Redistributions of source code must retain the above | ||
| 18 | * copyright notice, this list of conditions and the following | ||
| 19 | * disclaimer. | ||
| 20 | * | ||
| 21 | * - Redistributions in binary form must reproduce the above | ||
| 22 | * copyright notice, this list of conditions and the following | ||
| 23 | * disclaimer in the documentation and/or other materials | ||
| 24 | * provided with the distribution. | ||
| 25 | * | ||
| 26 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 27 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 29 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 30 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 31 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 32 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 33 | * SOFTWARE. | ||
| 34 | */ | ||
| 35 | |||
| 36 | #ifndef IB_USER_VERBS_H | ||
| 37 | #define IB_USER_VERBS_H | ||
| 38 | |||
| 39 | #include <linux/types.h> | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Increment this value if any changes that break userspace ABI | ||
| 43 | * compatibility are made. | ||
| 44 | */ | ||
| 45 | #define IB_USER_VERBS_ABI_VERSION 6 | ||
| 46 | |||
| 47 | enum { | ||
| 48 | IB_USER_VERBS_CMD_GET_CONTEXT, | ||
| 49 | IB_USER_VERBS_CMD_QUERY_DEVICE, | ||
| 50 | IB_USER_VERBS_CMD_QUERY_PORT, | ||
| 51 | IB_USER_VERBS_CMD_ALLOC_PD, | ||
| 52 | IB_USER_VERBS_CMD_DEALLOC_PD, | ||
| 53 | IB_USER_VERBS_CMD_CREATE_AH, | ||
| 54 | IB_USER_VERBS_CMD_MODIFY_AH, | ||
| 55 | IB_USER_VERBS_CMD_QUERY_AH, | ||
| 56 | IB_USER_VERBS_CMD_DESTROY_AH, | ||
| 57 | IB_USER_VERBS_CMD_REG_MR, | ||
| 58 | IB_USER_VERBS_CMD_REG_SMR, | ||
| 59 | IB_USER_VERBS_CMD_REREG_MR, | ||
| 60 | IB_USER_VERBS_CMD_QUERY_MR, | ||
| 61 | IB_USER_VERBS_CMD_DEREG_MR, | ||
| 62 | IB_USER_VERBS_CMD_ALLOC_MW, | ||
| 63 | IB_USER_VERBS_CMD_BIND_MW, | ||
| 64 | IB_USER_VERBS_CMD_DEALLOC_MW, | ||
| 65 | IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, | ||
| 66 | IB_USER_VERBS_CMD_CREATE_CQ, | ||
| 67 | IB_USER_VERBS_CMD_RESIZE_CQ, | ||
| 68 | IB_USER_VERBS_CMD_DESTROY_CQ, | ||
| 69 | IB_USER_VERBS_CMD_POLL_CQ, | ||
| 70 | IB_USER_VERBS_CMD_PEEK_CQ, | ||
| 71 | IB_USER_VERBS_CMD_REQ_NOTIFY_CQ, | ||
| 72 | IB_USER_VERBS_CMD_CREATE_QP, | ||
| 73 | IB_USER_VERBS_CMD_QUERY_QP, | ||
| 74 | IB_USER_VERBS_CMD_MODIFY_QP, | ||
| 75 | IB_USER_VERBS_CMD_DESTROY_QP, | ||
| 76 | IB_USER_VERBS_CMD_POST_SEND, | ||
| 77 | IB_USER_VERBS_CMD_POST_RECV, | ||
| 78 | IB_USER_VERBS_CMD_ATTACH_MCAST, | ||
| 79 | IB_USER_VERBS_CMD_DETACH_MCAST, | ||
| 80 | IB_USER_VERBS_CMD_CREATE_SRQ, | ||
| 81 | IB_USER_VERBS_CMD_MODIFY_SRQ, | ||
| 82 | IB_USER_VERBS_CMD_QUERY_SRQ, | ||
| 83 | IB_USER_VERBS_CMD_DESTROY_SRQ, | ||
| 84 | IB_USER_VERBS_CMD_POST_SRQ_RECV, | ||
| 85 | IB_USER_VERBS_CMD_OPEN_XRCD, | ||
| 86 | IB_USER_VERBS_CMD_CLOSE_XRCD, | ||
| 87 | IB_USER_VERBS_CMD_CREATE_XSRQ, | ||
| 88 | IB_USER_VERBS_CMD_OPEN_QP | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * Make sure that all structs defined in this file remain laid out so | ||
| 93 | * that they pack the same way on 32-bit and 64-bit architectures (to | ||
| 94 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). | ||
| 95 | * Specifically: | ||
| 96 | * - Do not use pointer types -- pass pointers in __u64 instead. | ||
| 97 | * - Make sure that any structure larger than 4 bytes is padded to a | ||
| 98 | * multiple of 8 bytes. Otherwise the structure size will be | ||
| 99 | * different between 32-bit and 64-bit architectures. | ||
| 100 | */ | ||
| 101 | |||
| 102 | struct ib_uverbs_async_event_desc { | ||
| 103 | __u64 element; | ||
| 104 | __u32 event_type; /* enum ib_event_type */ | ||
| 105 | __u32 reserved; | ||
| 106 | }; | ||
| 107 | |||
| 108 | struct ib_uverbs_comp_event_desc { | ||
| 109 | __u64 cq_handle; | ||
| 110 | }; | ||
| 111 | |||
| 112 | /* | ||
| 113 | * All commands from userspace should start with a __u32 command field | ||
| 114 | * followed by __u16 in_words and out_words fields (which give the | ||
| 115 | * length of the command block and response buffer if any in 32-bit | ||
| 116 | * words). The kernel driver will read these fields first and read | ||
| 117 | * the rest of the command struct based on these value. | ||
| 118 | */ | ||
| 119 | |||
| 120 | struct ib_uverbs_cmd_hdr { | ||
| 121 | __u32 command; | ||
| 122 | __u16 in_words; | ||
| 123 | __u16 out_words; | ||
| 124 | }; | ||
| 125 | |||
| 126 | struct ib_uverbs_get_context { | ||
| 127 | __u64 response; | ||
| 128 | __u64 driver_data[0]; | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct ib_uverbs_get_context_resp { | ||
| 132 | __u32 async_fd; | ||
| 133 | __u32 num_comp_vectors; | ||
| 134 | }; | ||
| 135 | |||
| 136 | struct ib_uverbs_query_device { | ||
| 137 | __u64 response; | ||
| 138 | __u64 driver_data[0]; | ||
| 139 | }; | ||
| 140 | |||
| 141 | struct ib_uverbs_query_device_resp { | ||
| 142 | __u64 fw_ver; | ||
| 143 | __be64 node_guid; | ||
| 144 | __be64 sys_image_guid; | ||
| 145 | __u64 max_mr_size; | ||
| 146 | __u64 page_size_cap; | ||
| 147 | __u32 vendor_id; | ||
| 148 | __u32 vendor_part_id; | ||
| 149 | __u32 hw_ver; | ||
| 150 | __u32 max_qp; | ||
| 151 | __u32 max_qp_wr; | ||
| 152 | __u32 device_cap_flags; | ||
| 153 | __u32 max_sge; | ||
| 154 | __u32 max_sge_rd; | ||
| 155 | __u32 max_cq; | ||
| 156 | __u32 max_cqe; | ||
| 157 | __u32 max_mr; | ||
| 158 | __u32 max_pd; | ||
| 159 | __u32 max_qp_rd_atom; | ||
| 160 | __u32 max_ee_rd_atom; | ||
| 161 | __u32 max_res_rd_atom; | ||
| 162 | __u32 max_qp_init_rd_atom; | ||
| 163 | __u32 max_ee_init_rd_atom; | ||
| 164 | __u32 atomic_cap; | ||
| 165 | __u32 max_ee; | ||
| 166 | __u32 max_rdd; | ||
| 167 | __u32 max_mw; | ||
| 168 | __u32 max_raw_ipv6_qp; | ||
| 169 | __u32 max_raw_ethy_qp; | ||
| 170 | __u32 max_mcast_grp; | ||
| 171 | __u32 max_mcast_qp_attach; | ||
| 172 | __u32 max_total_mcast_qp_attach; | ||
| 173 | __u32 max_ah; | ||
| 174 | __u32 max_fmr; | ||
| 175 | __u32 max_map_per_fmr; | ||
| 176 | __u32 max_srq; | ||
| 177 | __u32 max_srq_wr; | ||
| 178 | __u32 max_srq_sge; | ||
| 179 | __u16 max_pkeys; | ||
| 180 | __u8 local_ca_ack_delay; | ||
| 181 | __u8 phys_port_cnt; | ||
| 182 | __u8 reserved[4]; | ||
| 183 | }; | ||
| 184 | |||
| 185 | struct ib_uverbs_query_port { | ||
| 186 | __u64 response; | ||
| 187 | __u8 port_num; | ||
| 188 | __u8 reserved[7]; | ||
| 189 | __u64 driver_data[0]; | ||
| 190 | }; | ||
| 191 | |||
| 192 | struct ib_uverbs_query_port_resp { | ||
| 193 | __u32 port_cap_flags; | ||
| 194 | __u32 max_msg_sz; | ||
| 195 | __u32 bad_pkey_cntr; | ||
| 196 | __u32 qkey_viol_cntr; | ||
| 197 | __u32 gid_tbl_len; | ||
| 198 | __u16 pkey_tbl_len; | ||
| 199 | __u16 lid; | ||
| 200 | __u16 sm_lid; | ||
| 201 | __u8 state; | ||
| 202 | __u8 max_mtu; | ||
| 203 | __u8 active_mtu; | ||
| 204 | __u8 lmc; | ||
| 205 | __u8 max_vl_num; | ||
| 206 | __u8 sm_sl; | ||
| 207 | __u8 subnet_timeout; | ||
| 208 | __u8 init_type_reply; | ||
| 209 | __u8 active_width; | ||
| 210 | __u8 active_speed; | ||
| 211 | __u8 phys_state; | ||
| 212 | __u8 link_layer; | ||
| 213 | __u8 reserved[2]; | ||
| 214 | }; | ||
| 215 | |||
| 216 | struct ib_uverbs_alloc_pd { | ||
| 217 | __u64 response; | ||
| 218 | __u64 driver_data[0]; | ||
| 219 | }; | ||
| 220 | |||
| 221 | struct ib_uverbs_alloc_pd_resp { | ||
| 222 | __u32 pd_handle; | ||
| 223 | }; | ||
| 224 | |||
| 225 | struct ib_uverbs_dealloc_pd { | ||
| 226 | __u32 pd_handle; | ||
| 227 | }; | ||
| 228 | |||
| 229 | struct ib_uverbs_open_xrcd { | ||
| 230 | __u64 response; | ||
| 231 | __u32 fd; | ||
| 232 | __u32 oflags; | ||
| 233 | __u64 driver_data[0]; | ||
| 234 | }; | ||
| 235 | |||
| 236 | struct ib_uverbs_open_xrcd_resp { | ||
| 237 | __u32 xrcd_handle; | ||
| 238 | }; | ||
| 239 | |||
| 240 | struct ib_uverbs_close_xrcd { | ||
| 241 | __u32 xrcd_handle; | ||
| 242 | }; | ||
| 243 | |||
| 244 | struct ib_uverbs_reg_mr { | ||
| 245 | __u64 response; | ||
| 246 | __u64 start; | ||
| 247 | __u64 length; | ||
| 248 | __u64 hca_va; | ||
| 249 | __u32 pd_handle; | ||
| 250 | __u32 access_flags; | ||
| 251 | __u64 driver_data[0]; | ||
| 252 | }; | ||
| 253 | |||
| 254 | struct ib_uverbs_reg_mr_resp { | ||
| 255 | __u32 mr_handle; | ||
| 256 | __u32 lkey; | ||
| 257 | __u32 rkey; | ||
| 258 | }; | ||
| 259 | |||
| 260 | struct ib_uverbs_dereg_mr { | ||
| 261 | __u32 mr_handle; | ||
| 262 | }; | ||
| 263 | |||
| 264 | struct ib_uverbs_create_comp_channel { | ||
| 265 | __u64 response; | ||
| 266 | }; | ||
| 267 | |||
| 268 | struct ib_uverbs_create_comp_channel_resp { | ||
| 269 | __u32 fd; | ||
| 270 | }; | ||
| 271 | |||
| 272 | struct ib_uverbs_create_cq { | ||
| 273 | __u64 response; | ||
| 274 | __u64 user_handle; | ||
| 275 | __u32 cqe; | ||
| 276 | __u32 comp_vector; | ||
| 277 | __s32 comp_channel; | ||
| 278 | __u32 reserved; | ||
| 279 | __u64 driver_data[0]; | ||
| 280 | }; | ||
| 281 | |||
| 282 | struct ib_uverbs_create_cq_resp { | ||
| 283 | __u32 cq_handle; | ||
| 284 | __u32 cqe; | ||
| 285 | }; | ||
| 286 | |||
| 287 | struct ib_uverbs_resize_cq { | ||
| 288 | __u64 response; | ||
| 289 | __u32 cq_handle; | ||
| 290 | __u32 cqe; | ||
| 291 | __u64 driver_data[0]; | ||
| 292 | }; | ||
| 293 | |||
| 294 | struct ib_uverbs_resize_cq_resp { | ||
| 295 | __u32 cqe; | ||
| 296 | __u32 reserved; | ||
| 297 | __u64 driver_data[0]; | ||
| 298 | }; | ||
| 299 | |||
| 300 | struct ib_uverbs_poll_cq { | ||
| 301 | __u64 response; | ||
| 302 | __u32 cq_handle; | ||
| 303 | __u32 ne; | ||
| 304 | }; | ||
| 305 | |||
| 306 | struct ib_uverbs_wc { | ||
| 307 | __u64 wr_id; | ||
| 308 | __u32 status; | ||
| 309 | __u32 opcode; | ||
| 310 | __u32 vendor_err; | ||
| 311 | __u32 byte_len; | ||
| 312 | union { | ||
| 313 | __u32 imm_data; | ||
| 314 | __u32 invalidate_rkey; | ||
| 315 | } ex; | ||
| 316 | __u32 qp_num; | ||
| 317 | __u32 src_qp; | ||
| 318 | __u32 wc_flags; | ||
| 319 | __u16 pkey_index; | ||
| 320 | __u16 slid; | ||
| 321 | __u8 sl; | ||
| 322 | __u8 dlid_path_bits; | ||
| 323 | __u8 port_num; | ||
| 324 | __u8 reserved; | ||
| 325 | }; | ||
| 326 | |||
| 327 | struct ib_uverbs_poll_cq_resp { | ||
| 328 | __u32 count; | ||
| 329 | __u32 reserved; | ||
| 330 | struct ib_uverbs_wc wc[0]; | ||
| 331 | }; | ||
| 332 | |||
| 333 | struct ib_uverbs_req_notify_cq { | ||
| 334 | __u32 cq_handle; | ||
| 335 | __u32 solicited_only; | ||
| 336 | }; | ||
| 337 | |||
| 338 | struct ib_uverbs_destroy_cq { | ||
| 339 | __u64 response; | ||
| 340 | __u32 cq_handle; | ||
| 341 | __u32 reserved; | ||
| 342 | }; | ||
| 343 | |||
| 344 | struct ib_uverbs_destroy_cq_resp { | ||
| 345 | __u32 comp_events_reported; | ||
| 346 | __u32 async_events_reported; | ||
| 347 | }; | ||
| 348 | |||
| 349 | struct ib_uverbs_global_route { | ||
| 350 | __u8 dgid[16]; | ||
| 351 | __u32 flow_label; | ||
| 352 | __u8 sgid_index; | ||
| 353 | __u8 hop_limit; | ||
| 354 | __u8 traffic_class; | ||
| 355 | __u8 reserved; | ||
| 356 | }; | ||
| 357 | |||
| 358 | struct ib_uverbs_ah_attr { | ||
| 359 | struct ib_uverbs_global_route grh; | ||
| 360 | __u16 dlid; | ||
| 361 | __u8 sl; | ||
| 362 | __u8 src_path_bits; | ||
| 363 | __u8 static_rate; | ||
| 364 | __u8 is_global; | ||
| 365 | __u8 port_num; | ||
| 366 | __u8 reserved; | ||
| 367 | }; | ||
| 368 | |||
| 369 | struct ib_uverbs_qp_attr { | ||
| 370 | __u32 qp_attr_mask; | ||
| 371 | __u32 qp_state; | ||
| 372 | __u32 cur_qp_state; | ||
| 373 | __u32 path_mtu; | ||
| 374 | __u32 path_mig_state; | ||
| 375 | __u32 qkey; | ||
| 376 | __u32 rq_psn; | ||
| 377 | __u32 sq_psn; | ||
| 378 | __u32 dest_qp_num; | ||
| 379 | __u32 qp_access_flags; | ||
| 380 | |||
| 381 | struct ib_uverbs_ah_attr ah_attr; | ||
| 382 | struct ib_uverbs_ah_attr alt_ah_attr; | ||
| 383 | |||
| 384 | /* ib_qp_cap */ | ||
| 385 | __u32 max_send_wr; | ||
| 386 | __u32 max_recv_wr; | ||
| 387 | __u32 max_send_sge; | ||
| 388 | __u32 max_recv_sge; | ||
| 389 | __u32 max_inline_data; | ||
| 390 | |||
| 391 | __u16 pkey_index; | ||
| 392 | __u16 alt_pkey_index; | ||
| 393 | __u8 en_sqd_async_notify; | ||
| 394 | __u8 sq_draining; | ||
| 395 | __u8 max_rd_atomic; | ||
| 396 | __u8 max_dest_rd_atomic; | ||
| 397 | __u8 min_rnr_timer; | ||
| 398 | __u8 port_num; | ||
| 399 | __u8 timeout; | ||
| 400 | __u8 retry_cnt; | ||
| 401 | __u8 rnr_retry; | ||
| 402 | __u8 alt_port_num; | ||
| 403 | __u8 alt_timeout; | ||
| 404 | __u8 reserved[5]; | ||
| 405 | }; | ||
| 406 | |||
| 407 | struct ib_uverbs_create_qp { | ||
| 408 | __u64 response; | ||
| 409 | __u64 user_handle; | ||
| 410 | __u32 pd_handle; | ||
| 411 | __u32 send_cq_handle; | ||
| 412 | __u32 recv_cq_handle; | ||
| 413 | __u32 srq_handle; | ||
| 414 | __u32 max_send_wr; | ||
| 415 | __u32 max_recv_wr; | ||
| 416 | __u32 max_send_sge; | ||
| 417 | __u32 max_recv_sge; | ||
| 418 | __u32 max_inline_data; | ||
| 419 | __u8 sq_sig_all; | ||
| 420 | __u8 qp_type; | ||
| 421 | __u8 is_srq; | ||
| 422 | __u8 reserved; | ||
| 423 | __u64 driver_data[0]; | ||
| 424 | }; | ||
| 425 | |||
| 426 | struct ib_uverbs_open_qp { | ||
| 427 | __u64 response; | ||
| 428 | __u64 user_handle; | ||
| 429 | __u32 pd_handle; | ||
| 430 | __u32 qpn; | ||
| 431 | __u8 qp_type; | ||
| 432 | __u8 reserved[7]; | ||
| 433 | __u64 driver_data[0]; | ||
| 434 | }; | ||
| 435 | |||
| 436 | /* also used for open response */ | ||
| 437 | struct ib_uverbs_create_qp_resp { | ||
| 438 | __u32 qp_handle; | ||
| 439 | __u32 qpn; | ||
| 440 | __u32 max_send_wr; | ||
| 441 | __u32 max_recv_wr; | ||
| 442 | __u32 max_send_sge; | ||
| 443 | __u32 max_recv_sge; | ||
| 444 | __u32 max_inline_data; | ||
| 445 | __u32 reserved; | ||
| 446 | }; | ||
| 447 | |||
| 448 | /* | ||
| 449 | * This struct needs to remain a multiple of 8 bytes to keep the | ||
| 450 | * alignment of the modify QP parameters. | ||
| 451 | */ | ||
| 452 | struct ib_uverbs_qp_dest { | ||
| 453 | __u8 dgid[16]; | ||
| 454 | __u32 flow_label; | ||
| 455 | __u16 dlid; | ||
| 456 | __u16 reserved; | ||
| 457 | __u8 sgid_index; | ||
| 458 | __u8 hop_limit; | ||
| 459 | __u8 traffic_class; | ||
| 460 | __u8 sl; | ||
| 461 | __u8 src_path_bits; | ||
| 462 | __u8 static_rate; | ||
| 463 | __u8 is_global; | ||
| 464 | __u8 port_num; | ||
| 465 | }; | ||
| 466 | |||
| 467 | struct ib_uverbs_query_qp { | ||
| 468 | __u64 response; | ||
| 469 | __u32 qp_handle; | ||
| 470 | __u32 attr_mask; | ||
| 471 | __u64 driver_data[0]; | ||
| 472 | }; | ||
| 473 | |||
| 474 | struct ib_uverbs_query_qp_resp { | ||
| 475 | struct ib_uverbs_qp_dest dest; | ||
| 476 | struct ib_uverbs_qp_dest alt_dest; | ||
| 477 | __u32 max_send_wr; | ||
| 478 | __u32 max_recv_wr; | ||
| 479 | __u32 max_send_sge; | ||
| 480 | __u32 max_recv_sge; | ||
| 481 | __u32 max_inline_data; | ||
| 482 | __u32 qkey; | ||
| 483 | __u32 rq_psn; | ||
| 484 | __u32 sq_psn; | ||
| 485 | __u32 dest_qp_num; | ||
| 486 | __u32 qp_access_flags; | ||
| 487 | __u16 pkey_index; | ||
| 488 | __u16 alt_pkey_index; | ||
| 489 | __u8 qp_state; | ||
| 490 | __u8 cur_qp_state; | ||
| 491 | __u8 path_mtu; | ||
| 492 | __u8 path_mig_state; | ||
| 493 | __u8 sq_draining; | ||
| 494 | __u8 max_rd_atomic; | ||
| 495 | __u8 max_dest_rd_atomic; | ||
| 496 | __u8 min_rnr_timer; | ||
| 497 | __u8 port_num; | ||
| 498 | __u8 timeout; | ||
| 499 | __u8 retry_cnt; | ||
| 500 | __u8 rnr_retry; | ||
| 501 | __u8 alt_port_num; | ||
| 502 | __u8 alt_timeout; | ||
| 503 | __u8 sq_sig_all; | ||
| 504 | __u8 reserved[5]; | ||
| 505 | __u64 driver_data[0]; | ||
| 506 | }; | ||
| 507 | |||
| 508 | struct ib_uverbs_modify_qp { | ||
| 509 | struct ib_uverbs_qp_dest dest; | ||
| 510 | struct ib_uverbs_qp_dest alt_dest; | ||
| 511 | __u32 qp_handle; | ||
| 512 | __u32 attr_mask; | ||
| 513 | __u32 qkey; | ||
| 514 | __u32 rq_psn; | ||
| 515 | __u32 sq_psn; | ||
| 516 | __u32 dest_qp_num; | ||
| 517 | __u32 qp_access_flags; | ||
| 518 | __u16 pkey_index; | ||
| 519 | __u16 alt_pkey_index; | ||
| 520 | __u8 qp_state; | ||
| 521 | __u8 cur_qp_state; | ||
| 522 | __u8 path_mtu; | ||
| 523 | __u8 path_mig_state; | ||
| 524 | __u8 en_sqd_async_notify; | ||
| 525 | __u8 max_rd_atomic; | ||
| 526 | __u8 max_dest_rd_atomic; | ||
| 527 | __u8 min_rnr_timer; | ||
| 528 | __u8 port_num; | ||
| 529 | __u8 timeout; | ||
| 530 | __u8 retry_cnt; | ||
| 531 | __u8 rnr_retry; | ||
| 532 | __u8 alt_port_num; | ||
| 533 | __u8 alt_timeout; | ||
| 534 | __u8 reserved[2]; | ||
| 535 | __u64 driver_data[0]; | ||
| 536 | }; | ||
| 537 | |||
| 538 | struct ib_uverbs_modify_qp_resp { | ||
| 539 | }; | ||
| 540 | |||
| 541 | struct ib_uverbs_destroy_qp { | ||
| 542 | __u64 response; | ||
| 543 | __u32 qp_handle; | ||
| 544 | __u32 reserved; | ||
| 545 | }; | ||
| 546 | |||
| 547 | struct ib_uverbs_destroy_qp_resp { | ||
| 548 | __u32 events_reported; | ||
| 549 | }; | ||
| 550 | |||
| 551 | /* | ||
| 552 | * The ib_uverbs_sge structure isn't used anywhere, since we assume | ||
| 553 | * the ib_sge structure is packed the same way on 32-bit and 64-bit | ||
| 554 | * architectures in both kernel and user space. It's just here to | ||
| 555 | * document the ABI. | ||
| 556 | */ | ||
| 557 | struct ib_uverbs_sge { | ||
| 558 | __u64 addr; | ||
| 559 | __u32 length; | ||
| 560 | __u32 lkey; | ||
| 561 | }; | ||
| 562 | |||
| 563 | struct ib_uverbs_send_wr { | ||
| 564 | __u64 wr_id; | ||
| 565 | __u32 num_sge; | ||
| 566 | __u32 opcode; | ||
| 567 | __u32 send_flags; | ||
| 568 | union { | ||
| 569 | __u32 imm_data; | ||
| 570 | __u32 invalidate_rkey; | ||
| 571 | } ex; | ||
| 572 | union { | ||
| 573 | struct { | ||
| 574 | __u64 remote_addr; | ||
| 575 | __u32 rkey; | ||
| 576 | __u32 reserved; | ||
| 577 | } rdma; | ||
| 578 | struct { | ||
| 579 | __u64 remote_addr; | ||
| 580 | __u64 compare_add; | ||
| 581 | __u64 swap; | ||
| 582 | __u32 rkey; | ||
| 583 | __u32 reserved; | ||
| 584 | } atomic; | ||
| 585 | struct { | ||
| 586 | __u32 ah; | ||
| 587 | __u32 remote_qpn; | ||
| 588 | __u32 remote_qkey; | ||
| 589 | __u32 reserved; | ||
| 590 | } ud; | ||
| 591 | } wr; | ||
| 592 | }; | ||
| 593 | |||
| 594 | struct ib_uverbs_post_send { | ||
| 595 | __u64 response; | ||
| 596 | __u32 qp_handle; | ||
| 597 | __u32 wr_count; | ||
| 598 | __u32 sge_count; | ||
| 599 | __u32 wqe_size; | ||
| 600 | struct ib_uverbs_send_wr send_wr[0]; | ||
| 601 | }; | ||
| 602 | |||
| 603 | struct ib_uverbs_post_send_resp { | ||
| 604 | __u32 bad_wr; | ||
| 605 | }; | ||
| 606 | |||
| 607 | struct ib_uverbs_recv_wr { | ||
| 608 | __u64 wr_id; | ||
| 609 | __u32 num_sge; | ||
| 610 | __u32 reserved; | ||
| 611 | }; | ||
| 612 | |||
| 613 | struct ib_uverbs_post_recv { | ||
| 614 | __u64 response; | ||
| 615 | __u32 qp_handle; | ||
| 616 | __u32 wr_count; | ||
| 617 | __u32 sge_count; | ||
| 618 | __u32 wqe_size; | ||
| 619 | struct ib_uverbs_recv_wr recv_wr[0]; | ||
| 620 | }; | ||
| 621 | |||
| 622 | struct ib_uverbs_post_recv_resp { | ||
| 623 | __u32 bad_wr; | ||
| 624 | }; | ||
| 625 | |||
| 626 | struct ib_uverbs_post_srq_recv { | ||
| 627 | __u64 response; | ||
| 628 | __u32 srq_handle; | ||
| 629 | __u32 wr_count; | ||
| 630 | __u32 sge_count; | ||
| 631 | __u32 wqe_size; | ||
| 632 | struct ib_uverbs_recv_wr recv[0]; | ||
| 633 | }; | ||
| 634 | |||
| 635 | struct ib_uverbs_post_srq_recv_resp { | ||
| 636 | __u32 bad_wr; | ||
| 637 | }; | ||
| 638 | |||
| 639 | struct ib_uverbs_create_ah { | ||
| 640 | __u64 response; | ||
| 641 | __u64 user_handle; | ||
| 642 | __u32 pd_handle; | ||
| 643 | __u32 reserved; | ||
| 644 | struct ib_uverbs_ah_attr attr; | ||
| 645 | }; | ||
| 646 | |||
| 647 | struct ib_uverbs_create_ah_resp { | ||
| 648 | __u32 ah_handle; | ||
| 649 | }; | ||
| 650 | |||
| 651 | struct ib_uverbs_destroy_ah { | ||
| 652 | __u32 ah_handle; | ||
| 653 | }; | ||
| 654 | |||
| 655 | struct ib_uverbs_attach_mcast { | ||
| 656 | __u8 gid[16]; | ||
| 657 | __u32 qp_handle; | ||
| 658 | __u16 mlid; | ||
| 659 | __u16 reserved; | ||
| 660 | __u64 driver_data[0]; | ||
| 661 | }; | ||
| 662 | |||
| 663 | struct ib_uverbs_detach_mcast { | ||
| 664 | __u8 gid[16]; | ||
| 665 | __u32 qp_handle; | ||
| 666 | __u16 mlid; | ||
| 667 | __u16 reserved; | ||
| 668 | __u64 driver_data[0]; | ||
| 669 | }; | ||
| 670 | |||
| 671 | struct ib_uverbs_create_srq { | ||
| 672 | __u64 response; | ||
| 673 | __u64 user_handle; | ||
| 674 | __u32 pd_handle; | ||
| 675 | __u32 max_wr; | ||
| 676 | __u32 max_sge; | ||
| 677 | __u32 srq_limit; | ||
| 678 | __u64 driver_data[0]; | ||
| 679 | }; | ||
| 680 | |||
| 681 | struct ib_uverbs_create_xsrq { | ||
| 682 | __u64 response; | ||
| 683 | __u64 user_handle; | ||
| 684 | __u32 srq_type; | ||
| 685 | __u32 pd_handle; | ||
| 686 | __u32 max_wr; | ||
| 687 | __u32 max_sge; | ||
| 688 | __u32 srq_limit; | ||
| 689 | __u32 reserved; | ||
| 690 | __u32 xrcd_handle; | ||
| 691 | __u32 cq_handle; | ||
| 692 | __u64 driver_data[0]; | ||
| 693 | }; | ||
| 694 | |||
| 695 | struct ib_uverbs_create_srq_resp { | ||
| 696 | __u32 srq_handle; | ||
| 697 | __u32 max_wr; | ||
| 698 | __u32 max_sge; | ||
| 699 | __u32 srqn; | ||
| 700 | }; | ||
| 701 | |||
| 702 | struct ib_uverbs_modify_srq { | ||
| 703 | __u32 srq_handle; | ||
| 704 | __u32 attr_mask; | ||
| 705 | __u32 max_wr; | ||
| 706 | __u32 srq_limit; | ||
| 707 | __u64 driver_data[0]; | ||
| 708 | }; | ||
| 709 | |||
| 710 | struct ib_uverbs_query_srq { | ||
| 711 | __u64 response; | ||
| 712 | __u32 srq_handle; | ||
| 713 | __u32 reserved; | ||
| 714 | __u64 driver_data[0]; | ||
| 715 | }; | ||
| 716 | |||
| 717 | struct ib_uverbs_query_srq_resp { | ||
| 718 | __u32 max_wr; | ||
| 719 | __u32 max_sge; | ||
| 720 | __u32 srq_limit; | ||
| 721 | __u32 reserved; | ||
| 722 | }; | ||
| 723 | |||
| 724 | struct ib_uverbs_destroy_srq { | ||
| 725 | __u64 response; | ||
| 726 | __u32 srq_handle; | ||
| 727 | __u32 reserved; | ||
| 728 | }; | ||
| 729 | |||
| 730 | struct ib_uverbs_destroy_srq_resp { | ||
| 731 | __u32 events_reported; | ||
| 732 | }; | ||
| 733 | |||
| 734 | #endif /* IB_USER_VERBS_H */ | ||
diff --git a/include/uapi/rdma/rdma_netlink.h b/include/uapi/rdma/rdma_netlink.h new file mode 100644 index 000000000000..8297285b6288 --- /dev/null +++ b/include/uapi/rdma/rdma_netlink.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #ifndef _UAPI_RDMA_NETLINK_H | ||
| 2 | #define _UAPI_RDMA_NETLINK_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | enum { | ||
| 7 | RDMA_NL_RDMA_CM = 1 | ||
| 8 | }; | ||
| 9 | |||
| 10 | #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10) | ||
| 11 | #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) | ||
| 12 | #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) | ||
| 13 | |||
| 14 | enum { | ||
| 15 | RDMA_NL_RDMA_CM_ID_STATS = 0, | ||
| 16 | RDMA_NL_RDMA_CM_NUM_OPS | ||
| 17 | }; | ||
| 18 | |||
| 19 | enum { | ||
| 20 | RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, | ||
| 21 | RDMA_NL_RDMA_CM_ATTR_DST_ADDR, | ||
| 22 | RDMA_NL_RDMA_CM_NUM_ATTR, | ||
| 23 | }; | ||
| 24 | |||
| 25 | struct rdma_cm_id_stats { | ||
| 26 | __u32 qp_num; | ||
| 27 | __u32 bound_dev_if; | ||
| 28 | __u32 port_space; | ||
| 29 | __s32 pid; | ||
| 30 | __u8 cm_state; | ||
| 31 | __u8 node_type; | ||
| 32 | __u8 port_num; | ||
| 33 | __u8 qp_type; | ||
| 34 | }; | ||
| 35 | |||
| 36 | |||
| 37 | #endif /* _UAPI_RDMA_NETLINK_H */ | ||
diff --git a/include/uapi/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h new file mode 100644 index 000000000000..1ee9239ff8c2 --- /dev/null +++ b/include/uapi/rdma/rdma_user_cm.h | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is available to you under a choice of one of two | ||
| 5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
| 6 | * General Public License (GPL) Version 2, available from the file | ||
| 7 | * COPYING in the main directory of this source tree, or the | ||
| 8 | * OpenIB.org BSD license below: | ||
| 9 | * | ||
| 10 | * Redistribution and use in source and binary forms, with or | ||
| 11 | * without modification, are permitted provided that the following | ||
| 12 | * conditions are met: | ||
| 13 | * | ||
| 14 | * - Redistributions of source code must retain the above | ||
| 15 | * copyright notice, this list of conditions and the following | ||
| 16 | * disclaimer. | ||
| 17 | * | ||
| 18 | * - Redistributions in binary form must reproduce the above | ||
| 19 | * copyright notice, this list of conditions and the following | ||
| 20 | * disclaimer in the documentation and/or other materials | ||
| 21 | * provided with the distribution. | ||
| 22 | * | ||
| 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
| 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
| 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 30 | * SOFTWARE. | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef RDMA_USER_CM_H | ||
| 34 | #define RDMA_USER_CM_H | ||
| 35 | |||
| 36 | #include <linux/types.h> | ||
| 37 | #include <linux/in6.h> | ||
| 38 | #include <rdma/ib_user_verbs.h> | ||
| 39 | #include <rdma/ib_user_sa.h> | ||
| 40 | |||
| 41 | #define RDMA_USER_CM_ABI_VERSION 4 | ||
| 42 | |||
| 43 | #define RDMA_MAX_PRIVATE_DATA 256 | ||
| 44 | |||
| 45 | enum { | ||
| 46 | RDMA_USER_CM_CMD_CREATE_ID, | ||
| 47 | RDMA_USER_CM_CMD_DESTROY_ID, | ||
| 48 | RDMA_USER_CM_CMD_BIND_ADDR, | ||
| 49 | RDMA_USER_CM_CMD_RESOLVE_ADDR, | ||
| 50 | RDMA_USER_CM_CMD_RESOLVE_ROUTE, | ||
| 51 | RDMA_USER_CM_CMD_QUERY_ROUTE, | ||
| 52 | RDMA_USER_CM_CMD_CONNECT, | ||
| 53 | RDMA_USER_CM_CMD_LISTEN, | ||
| 54 | RDMA_USER_CM_CMD_ACCEPT, | ||
| 55 | RDMA_USER_CM_CMD_REJECT, | ||
| 56 | RDMA_USER_CM_CMD_DISCONNECT, | ||
| 57 | RDMA_USER_CM_CMD_INIT_QP_ATTR, | ||
| 58 | RDMA_USER_CM_CMD_GET_EVENT, | ||
| 59 | RDMA_USER_CM_CMD_GET_OPTION, | ||
| 60 | RDMA_USER_CM_CMD_SET_OPTION, | ||
| 61 | RDMA_USER_CM_CMD_NOTIFY, | ||
| 62 | RDMA_USER_CM_CMD_JOIN_MCAST, | ||
| 63 | RDMA_USER_CM_CMD_LEAVE_MCAST, | ||
| 64 | RDMA_USER_CM_CMD_MIGRATE_ID | ||
| 65 | }; | ||
| 66 | |||
| 67 | /* | ||
| 68 | * command ABI structures. | ||
| 69 | */ | ||
| 70 | struct rdma_ucm_cmd_hdr { | ||
| 71 | __u32 cmd; | ||
| 72 | __u16 in; | ||
| 73 | __u16 out; | ||
| 74 | }; | ||
| 75 | |||
| 76 | struct rdma_ucm_create_id { | ||
| 77 | __u64 uid; | ||
| 78 | __u64 response; | ||
| 79 | __u16 ps; | ||
| 80 | __u8 qp_type; | ||
| 81 | __u8 reserved[5]; | ||
| 82 | }; | ||
| 83 | |||
| 84 | struct rdma_ucm_create_id_resp { | ||
| 85 | __u32 id; | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct rdma_ucm_destroy_id { | ||
| 89 | __u64 response; | ||
| 90 | __u32 id; | ||
| 91 | __u32 reserved; | ||
| 92 | }; | ||
| 93 | |||
| 94 | struct rdma_ucm_destroy_id_resp { | ||
| 95 | __u32 events_reported; | ||
| 96 | }; | ||
| 97 | |||
| 98 | struct rdma_ucm_bind_addr { | ||
| 99 | __u64 response; | ||
| 100 | struct sockaddr_in6 addr; | ||
| 101 | __u32 id; | ||
| 102 | }; | ||
| 103 | |||
| 104 | struct rdma_ucm_resolve_addr { | ||
| 105 | struct sockaddr_in6 src_addr; | ||
| 106 | struct sockaddr_in6 dst_addr; | ||
| 107 | __u32 id; | ||
| 108 | __u32 timeout_ms; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct rdma_ucm_resolve_route { | ||
| 112 | __u32 id; | ||
| 113 | __u32 timeout_ms; | ||
| 114 | }; | ||
| 115 | |||
| 116 | struct rdma_ucm_query_route { | ||
| 117 | __u64 response; | ||
| 118 | __u32 id; | ||
| 119 | __u32 reserved; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct rdma_ucm_query_route_resp { | ||
| 123 | __u64 node_guid; | ||
| 124 | struct ib_user_path_rec ib_route[2]; | ||
| 125 | struct sockaddr_in6 src_addr; | ||
| 126 | struct sockaddr_in6 dst_addr; | ||
| 127 | __u32 num_paths; | ||
| 128 | __u8 port_num; | ||
| 129 | __u8 reserved[3]; | ||
| 130 | }; | ||
| 131 | |||
| 132 | struct rdma_ucm_conn_param { | ||
| 133 | __u32 qp_num; | ||
| 134 | __u32 reserved; | ||
| 135 | __u8 private_data[RDMA_MAX_PRIVATE_DATA]; | ||
| 136 | __u8 private_data_len; | ||
| 137 | __u8 srq; | ||
| 138 | __u8 responder_resources; | ||
| 139 | __u8 initiator_depth; | ||
| 140 | __u8 flow_control; | ||
| 141 | __u8 retry_count; | ||
| 142 | __u8 rnr_retry_count; | ||
| 143 | __u8 valid; | ||
| 144 | }; | ||
| 145 | |||
| 146 | struct rdma_ucm_ud_param { | ||
| 147 | __u32 qp_num; | ||
| 148 | __u32 qkey; | ||
| 149 | struct ib_uverbs_ah_attr ah_attr; | ||
| 150 | __u8 private_data[RDMA_MAX_PRIVATE_DATA]; | ||
| 151 | __u8 private_data_len; | ||
| 152 | __u8 reserved[7]; | ||
| 153 | }; | ||
| 154 | |||
| 155 | struct rdma_ucm_connect { | ||
| 156 | struct rdma_ucm_conn_param conn_param; | ||
| 157 | __u32 id; | ||
| 158 | __u32 reserved; | ||
| 159 | }; | ||
| 160 | |||
| 161 | struct rdma_ucm_listen { | ||
| 162 | __u32 id; | ||
| 163 | __u32 backlog; | ||
| 164 | }; | ||
| 165 | |||
| 166 | struct rdma_ucm_accept { | ||
| 167 | __u64 uid; | ||
| 168 | struct rdma_ucm_conn_param conn_param; | ||
| 169 | __u32 id; | ||
| 170 | __u32 reserved; | ||
| 171 | }; | ||
| 172 | |||
| 173 | struct rdma_ucm_reject { | ||
| 174 | __u32 id; | ||
| 175 | __u8 private_data_len; | ||
| 176 | __u8 reserved[3]; | ||
| 177 | __u8 private_data[RDMA_MAX_PRIVATE_DATA]; | ||
| 178 | }; | ||
| 179 | |||
| 180 | struct rdma_ucm_disconnect { | ||
| 181 | __u32 id; | ||
| 182 | }; | ||
| 183 | |||
| 184 | struct rdma_ucm_init_qp_attr { | ||
| 185 | __u64 response; | ||
| 186 | __u32 id; | ||
| 187 | __u32 qp_state; | ||
| 188 | }; | ||
| 189 | |||
| 190 | struct rdma_ucm_notify { | ||
| 191 | __u32 id; | ||
| 192 | __u32 event; | ||
| 193 | }; | ||
| 194 | |||
| 195 | struct rdma_ucm_join_mcast { | ||
| 196 | __u64 response; /* rdma_ucm_create_id_resp */ | ||
| 197 | __u64 uid; | ||
| 198 | struct sockaddr_in6 addr; | ||
| 199 | __u32 id; | ||
| 200 | }; | ||
| 201 | |||
| 202 | struct rdma_ucm_get_event { | ||
| 203 | __u64 response; | ||
| 204 | }; | ||
| 205 | |||
| 206 | struct rdma_ucm_event_resp { | ||
| 207 | __u64 uid; | ||
| 208 | __u32 id; | ||
| 209 | __u32 event; | ||
| 210 | __u32 status; | ||
| 211 | union { | ||
| 212 | struct rdma_ucm_conn_param conn; | ||
| 213 | struct rdma_ucm_ud_param ud; | ||
| 214 | } param; | ||
| 215 | }; | ||
| 216 | |||
| 217 | /* Option levels */ | ||
| 218 | enum { | ||
| 219 | RDMA_OPTION_ID = 0, | ||
| 220 | RDMA_OPTION_IB = 1 | ||
| 221 | }; | ||
| 222 | |||
| 223 | /* Option details */ | ||
| 224 | enum { | ||
| 225 | RDMA_OPTION_ID_TOS = 0, | ||
| 226 | RDMA_OPTION_ID_REUSEADDR = 1, | ||
| 227 | RDMA_OPTION_ID_AFONLY = 2, | ||
| 228 | RDMA_OPTION_IB_PATH = 1 | ||
| 229 | }; | ||
| 230 | |||
| 231 | struct rdma_ucm_set_option { | ||
| 232 | __u64 optval; | ||
| 233 | __u32 id; | ||
| 234 | __u32 level; | ||
| 235 | __u32 optname; | ||
| 236 | __u32 optlen; | ||
| 237 | }; | ||
| 238 | |||
| 239 | struct rdma_ucm_migrate_id { | ||
| 240 | __u64 response; | ||
| 241 | __u32 id; | ||
| 242 | __u32 fd; | ||
| 243 | }; | ||
| 244 | |||
| 245 | struct rdma_ucm_migrate_resp { | ||
| 246 | __u32 events_reported; | ||
| 247 | }; | ||
| 248 | |||
| 249 | #endif /* RDMA_USER_CM_H */ | ||
diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild index aafaa5aa54d4..0f7d279ebde3 100644 --- a/include/uapi/sound/Kbuild +++ b/include/uapi/sound/Kbuild | |||
| @@ -1 +1,11 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += asequencer.h | ||
| 3 | header-y += asound.h | ||
| 4 | header-y += asound_fm.h | ||
| 5 | header-y += compress_offload.h | ||
| 6 | header-y += compress_params.h | ||
| 7 | header-y += emu10k1.h | ||
| 8 | header-y += hdsp.h | ||
| 9 | header-y += hdspm.h | ||
| 10 | header-y += sb16_csp.h | ||
| 11 | header-y += sfnt_info.h | ||
diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h new file mode 100644 index 000000000000..09c8a00ea503 --- /dev/null +++ b/include/uapi/sound/asequencer.h | |||
| @@ -0,0 +1,614 @@ | |||
| 1 | /* | ||
| 2 | * Main header file for the ALSA sequencer | ||
| 3 | * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> | ||
| 4 | * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz> | ||
| 5 | * | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | #ifndef _UAPI__SOUND_ASEQUENCER_H | ||
| 23 | #define _UAPI__SOUND_ASEQUENCER_H | ||
| 24 | |||
| 25 | |||
| 26 | /** version of the sequencer */ | ||
| 27 | #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1) | ||
| 28 | |||
| 29 | /** | ||
| 30 | * definition of sequencer event types | ||
| 31 | */ | ||
| 32 | |||
| 33 | /** system messages | ||
| 34 | * event data type = #snd_seq_result | ||
| 35 | */ | ||
| 36 | #define SNDRV_SEQ_EVENT_SYSTEM 0 | ||
| 37 | #define SNDRV_SEQ_EVENT_RESULT 1 | ||
| 38 | |||
| 39 | /** note messages (channel specific) | ||
| 40 | * event data type = #snd_seq_ev_note | ||
| 41 | */ | ||
| 42 | #define SNDRV_SEQ_EVENT_NOTE 5 | ||
| 43 | #define SNDRV_SEQ_EVENT_NOTEON 6 | ||
| 44 | #define SNDRV_SEQ_EVENT_NOTEOFF 7 | ||
| 45 | #define SNDRV_SEQ_EVENT_KEYPRESS 8 | ||
| 46 | |||
| 47 | /** control messages (channel specific) | ||
| 48 | * event data type = #snd_seq_ev_ctrl | ||
| 49 | */ | ||
| 50 | #define SNDRV_SEQ_EVENT_CONTROLLER 10 | ||
| 51 | #define SNDRV_SEQ_EVENT_PGMCHANGE 11 | ||
| 52 | #define SNDRV_SEQ_EVENT_CHANPRESS 12 | ||
| 53 | #define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */ | ||
| 54 | #define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */ | ||
| 55 | #define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */ | ||
| 56 | #define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */ | ||
| 57 | |||
| 58 | /** synchronisation messages | ||
| 59 | * event data type = #snd_seq_ev_ctrl | ||
| 60 | */ | ||
| 61 | #define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */ | ||
| 62 | #define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */ | ||
| 63 | #define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */ | ||
| 64 | #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */ | ||
| 65 | #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */ | ||
| 66 | |||
| 67 | /** timer messages | ||
| 68 | * event data type = snd_seq_ev_queue_control | ||
| 69 | */ | ||
| 70 | #define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */ | ||
| 71 | #define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */ | ||
| 72 | #define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */ | ||
| 73 | #define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */ | ||
| 74 | #define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */ | ||
| 75 | #define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */ | ||
| 76 | #define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */ | ||
| 77 | #define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */ | ||
| 78 | #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */ | ||
| 79 | |||
| 80 | /** others | ||
| 81 | * event data type = none | ||
| 82 | */ | ||
| 83 | #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */ | ||
| 84 | #define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */ | ||
| 85 | #define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */ | ||
| 86 | |||
| 87 | /** echo back, kernel private messages | ||
| 88 | * event data type = any type | ||
| 89 | */ | ||
| 90 | #define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */ | ||
| 91 | #define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */ | ||
| 92 | |||
| 93 | /** system status messages (broadcast for subscribers) | ||
| 94 | * event data type = snd_seq_addr | ||
| 95 | */ | ||
| 96 | #define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */ | ||
| 97 | #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */ | ||
| 98 | #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */ | ||
| 99 | #define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */ | ||
| 100 | #define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */ | ||
| 101 | #define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */ | ||
| 102 | |||
| 103 | /** port connection changes | ||
| 104 | * event data type = snd_seq_connect | ||
| 105 | */ | ||
| 106 | #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ | ||
| 107 | #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ | ||
| 108 | |||
| 109 | /* 70-89: synthesizer events - obsoleted */ | ||
| 110 | |||
| 111 | /** user-defined events with fixed length | ||
| 112 | * event data type = any | ||
| 113 | */ | ||
| 114 | #define SNDRV_SEQ_EVENT_USR0 90 | ||
| 115 | #define SNDRV_SEQ_EVENT_USR1 91 | ||
| 116 | #define SNDRV_SEQ_EVENT_USR2 92 | ||
| 117 | #define SNDRV_SEQ_EVENT_USR3 93 | ||
| 118 | #define SNDRV_SEQ_EVENT_USR4 94 | ||
| 119 | #define SNDRV_SEQ_EVENT_USR5 95 | ||
| 120 | #define SNDRV_SEQ_EVENT_USR6 96 | ||
| 121 | #define SNDRV_SEQ_EVENT_USR7 97 | ||
| 122 | #define SNDRV_SEQ_EVENT_USR8 98 | ||
| 123 | #define SNDRV_SEQ_EVENT_USR9 99 | ||
| 124 | |||
| 125 | /* 100-118: instrument layer - obsoleted */ | ||
| 126 | /* 119-129: reserved */ | ||
| 127 | |||
| 128 | /* 130-139: variable length events | ||
| 129 | * event data type = snd_seq_ev_ext | ||
| 130 | * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set) | ||
| 131 | */ | ||
| 132 | #define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */ | ||
| 133 | #define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */ | ||
| 134 | /* 132-134: reserved */ | ||
| 135 | #define SNDRV_SEQ_EVENT_USR_VAR0 135 | ||
| 136 | #define SNDRV_SEQ_EVENT_USR_VAR1 136 | ||
| 137 | #define SNDRV_SEQ_EVENT_USR_VAR2 137 | ||
| 138 | #define SNDRV_SEQ_EVENT_USR_VAR3 138 | ||
| 139 | #define SNDRV_SEQ_EVENT_USR_VAR4 139 | ||
| 140 | |||
| 141 | /* 150-151: kernel events with quote - DO NOT use in user clients */ | ||
| 142 | #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150 | ||
| 143 | #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */ | ||
| 144 | |||
| 145 | /* 152-191: reserved */ | ||
| 146 | |||
| 147 | /* 192-254: hardware specific events */ | ||
| 148 | |||
| 149 | /* 255: special event */ | ||
| 150 | #define SNDRV_SEQ_EVENT_NONE 255 | ||
| 151 | |||
| 152 | |||
| 153 | typedef unsigned char snd_seq_event_type_t; | ||
| 154 | |||
| 155 | /** event address */ | ||
| 156 | struct snd_seq_addr { | ||
| 157 | unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */ | ||
| 158 | unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */ | ||
| 159 | }; | ||
| 160 | |||
| 161 | /** port connection */ | ||
| 162 | struct snd_seq_connect { | ||
| 163 | struct snd_seq_addr sender; | ||
| 164 | struct snd_seq_addr dest; | ||
| 165 | }; | ||
| 166 | |||
| 167 | |||
| 168 | #define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */ | ||
| 169 | #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */ | ||
| 170 | #define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */ | ||
| 171 | #define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */ | ||
| 172 | |||
| 173 | /* event mode flag - NOTE: only 8 bits available! */ | ||
| 174 | #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */ | ||
| 175 | #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */ | ||
| 176 | #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0) | ||
| 177 | |||
| 178 | #define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */ | ||
| 179 | #define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */ | ||
| 180 | #define SNDRV_SEQ_TIME_MODE_MASK (1<<1) | ||
| 181 | |||
| 182 | #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */ | ||
| 183 | #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */ | ||
| 184 | #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */ | ||
| 185 | #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2) | ||
| 186 | |||
| 187 | #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */ | ||
| 188 | #define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */ | ||
| 189 | #define SNDRV_SEQ_PRIORITY_MASK (1<<4) | ||
| 190 | |||
| 191 | |||
| 192 | /* note event */ | ||
| 193 | struct snd_seq_ev_note { | ||
| 194 | unsigned char channel; | ||
| 195 | unsigned char note; | ||
| 196 | unsigned char velocity; | ||
| 197 | unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */ | ||
| 198 | unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */ | ||
| 199 | }; | ||
| 200 | |||
| 201 | /* controller event */ | ||
| 202 | struct snd_seq_ev_ctrl { | ||
| 203 | unsigned char channel; | ||
| 204 | unsigned char unused1, unused2, unused3; /* pad */ | ||
| 205 | unsigned int param; | ||
| 206 | signed int value; | ||
| 207 | }; | ||
| 208 | |||
| 209 | /* generic set of bytes (12x8 bit) */ | ||
| 210 | struct snd_seq_ev_raw8 { | ||
| 211 | unsigned char d[12]; /* 8 bit value */ | ||
| 212 | }; | ||
| 213 | |||
| 214 | /* generic set of integers (3x32 bit) */ | ||
| 215 | struct snd_seq_ev_raw32 { | ||
| 216 | unsigned int d[3]; /* 32 bit value */ | ||
| 217 | }; | ||
| 218 | |||
| 219 | /* external stored data */ | ||
| 220 | struct snd_seq_ev_ext { | ||
| 221 | unsigned int len; /* length of data */ | ||
| 222 | void *ptr; /* pointer to data (note: maybe 64-bit) */ | ||
| 223 | } __attribute__((packed)); | ||
| 224 | |||
| 225 | struct snd_seq_result { | ||
| 226 | int event; /* processed event type */ | ||
| 227 | int result; | ||
| 228 | }; | ||
| 229 | |||
| 230 | |||
| 231 | struct snd_seq_real_time { | ||
| 232 | unsigned int tv_sec; /* seconds */ | ||
| 233 | unsigned int tv_nsec; /* nanoseconds */ | ||
| 234 | }; | ||
| 235 | |||
| 236 | typedef unsigned int snd_seq_tick_time_t; /* midi ticks */ | ||
| 237 | |||
| 238 | union snd_seq_timestamp { | ||
| 239 | snd_seq_tick_time_t tick; | ||
| 240 | struct snd_seq_real_time time; | ||
| 241 | }; | ||
| 242 | |||
| 243 | struct snd_seq_queue_skew { | ||
| 244 | unsigned int value; | ||
| 245 | unsigned int base; | ||
| 246 | }; | ||
| 247 | |||
| 248 | /* queue timer control */ | ||
| 249 | struct snd_seq_ev_queue_control { | ||
| 250 | unsigned char queue; /* affected queue */ | ||
| 251 | unsigned char pad[3]; /* reserved */ | ||
| 252 | union { | ||
| 253 | signed int value; /* affected value (e.g. tempo) */ | ||
| 254 | union snd_seq_timestamp time; /* time */ | ||
| 255 | unsigned int position; /* sync position */ | ||
| 256 | struct snd_seq_queue_skew skew; | ||
| 257 | unsigned int d32[2]; | ||
| 258 | unsigned char d8[8]; | ||
| 259 | } param; | ||
| 260 | }; | ||
| 261 | |||
| 262 | /* quoted event - inside the kernel only */ | ||
| 263 | struct snd_seq_ev_quote { | ||
| 264 | struct snd_seq_addr origin; /* original sender */ | ||
| 265 | unsigned short value; /* optional data */ | ||
| 266 | struct snd_seq_event *event; /* quoted event */ | ||
| 267 | } __attribute__((packed)); | ||
| 268 | |||
| 269 | |||
| 270 | /* sequencer event */ | ||
| 271 | struct snd_seq_event { | ||
| 272 | snd_seq_event_type_t type; /* event type */ | ||
| 273 | unsigned char flags; /* event flags */ | ||
| 274 | char tag; | ||
| 275 | |||
| 276 | unsigned char queue; /* schedule queue */ | ||
| 277 | union snd_seq_timestamp time; /* schedule time */ | ||
| 278 | |||
| 279 | |||
| 280 | struct snd_seq_addr source; /* source address */ | ||
| 281 | struct snd_seq_addr dest; /* destination address */ | ||
| 282 | |||
| 283 | union { /* event data... */ | ||
| 284 | struct snd_seq_ev_note note; | ||
| 285 | struct snd_seq_ev_ctrl control; | ||
| 286 | struct snd_seq_ev_raw8 raw8; | ||
| 287 | struct snd_seq_ev_raw32 raw32; | ||
| 288 | struct snd_seq_ev_ext ext; | ||
| 289 | struct snd_seq_ev_queue_control queue; | ||
| 290 | union snd_seq_timestamp time; | ||
| 291 | struct snd_seq_addr addr; | ||
| 292 | struct snd_seq_connect connect; | ||
| 293 | struct snd_seq_result result; | ||
| 294 | struct snd_seq_ev_quote quote; | ||
| 295 | } data; | ||
| 296 | }; | ||
| 297 | |||
| 298 | |||
| 299 | /* | ||
| 300 | * bounce event - stored as variable size data | ||
| 301 | */ | ||
| 302 | struct snd_seq_event_bounce { | ||
| 303 | int err; | ||
| 304 | struct snd_seq_event event; | ||
| 305 | /* external data follows here. */ | ||
| 306 | }; | ||
| 307 | |||
| 308 | |||
| 309 | /* system information */ | ||
| 310 | struct snd_seq_system_info { | ||
| 311 | int queues; /* maximum queues count */ | ||
| 312 | int clients; /* maximum clients count */ | ||
| 313 | int ports; /* maximum ports per client */ | ||
| 314 | int channels; /* maximum channels per port */ | ||
| 315 | int cur_clients; /* current clients */ | ||
| 316 | int cur_queues; /* current queues */ | ||
| 317 | char reserved[24]; | ||
| 318 | }; | ||
| 319 | |||
| 320 | |||
| 321 | /* system running information */ | ||
| 322 | struct snd_seq_running_info { | ||
| 323 | unsigned char client; /* client id */ | ||
| 324 | unsigned char big_endian; /* 1 = big-endian */ | ||
| 325 | unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ | ||
| 326 | unsigned char pad; /* reserved */ | ||
| 327 | unsigned char reserved[12]; | ||
| 328 | }; | ||
| 329 | |||
| 330 | |||
| 331 | /* known client numbers */ | ||
| 332 | #define SNDRV_SEQ_CLIENT_SYSTEM 0 | ||
| 333 | /* internal client numbers */ | ||
| 334 | #define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */ | ||
| 335 | #define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */ | ||
| 336 | |||
| 337 | |||
| 338 | /* client types */ | ||
| 339 | typedef int __bitwise snd_seq_client_type_t; | ||
| 340 | #define NO_CLIENT ((__force snd_seq_client_type_t) 0) | ||
| 341 | #define USER_CLIENT ((__force snd_seq_client_type_t) 1) | ||
| 342 | #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2) | ||
| 343 | |||
| 344 | /* event filter flags */ | ||
| 345 | #define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ | ||
| 346 | #define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */ | ||
| 347 | #define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */ | ||
| 348 | #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */ | ||
| 349 | |||
| 350 | struct snd_seq_client_info { | ||
| 351 | int client; /* client number to inquire */ | ||
| 352 | snd_seq_client_type_t type; /* client type */ | ||
| 353 | char name[64]; /* client name */ | ||
| 354 | unsigned int filter; /* filter flags */ | ||
| 355 | unsigned char multicast_filter[8]; /* multicast filter bitmap */ | ||
| 356 | unsigned char event_filter[32]; /* event filter bitmap */ | ||
| 357 | int num_ports; /* RO: number of ports */ | ||
| 358 | int event_lost; /* number of lost events */ | ||
| 359 | char reserved[64]; /* for future use */ | ||
| 360 | }; | ||
| 361 | |||
| 362 | |||
| 363 | /* client pool size */ | ||
| 364 | struct snd_seq_client_pool { | ||
| 365 | int client; /* client number to inquire */ | ||
| 366 | int output_pool; /* outgoing (write) pool size */ | ||
| 367 | int input_pool; /* incoming (read) pool size */ | ||
| 368 | int output_room; /* minimum free pool size for select/blocking mode */ | ||
| 369 | int output_free; /* unused size */ | ||
| 370 | int input_free; /* unused size */ | ||
| 371 | char reserved[64]; | ||
| 372 | }; | ||
| 373 | |||
| 374 | |||
| 375 | /* Remove events by specified criteria */ | ||
| 376 | |||
| 377 | #define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */ | ||
| 378 | #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */ | ||
| 379 | #define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */ | ||
| 380 | #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */ | ||
| 381 | #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */ | ||
| 382 | #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */ | ||
| 383 | #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */ | ||
| 384 | #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */ | ||
| 385 | #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */ | ||
| 386 | #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */ | ||
| 387 | |||
| 388 | struct snd_seq_remove_events { | ||
| 389 | unsigned int remove_mode; /* Flags that determine what gets removed */ | ||
| 390 | |||
| 391 | union snd_seq_timestamp time; | ||
| 392 | |||
| 393 | unsigned char queue; /* Queue for REMOVE_DEST */ | ||
| 394 | struct snd_seq_addr dest; /* Address for REMOVE_DEST */ | ||
| 395 | unsigned char channel; /* Channel for REMOVE_DEST */ | ||
| 396 | |||
| 397 | int type; /* For REMOVE_EVENT_TYPE */ | ||
| 398 | char tag; /* Tag for REMOVE_TAG */ | ||
| 399 | |||
| 400 | int reserved[10]; /* To allow for future binary compatibility */ | ||
| 401 | |||
| 402 | }; | ||
| 403 | |||
| 404 | |||
| 405 | /* known port numbers */ | ||
| 406 | #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0 | ||
| 407 | #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1 | ||
| 408 | |||
| 409 | /* port capabilities (32 bits) */ | ||
| 410 | #define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */ | ||
| 411 | #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */ | ||
| 412 | |||
| 413 | #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2) | ||
| 414 | #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3) | ||
| 415 | |||
| 416 | #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4) | ||
| 417 | |||
| 418 | #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */ | ||
| 419 | #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */ | ||
| 420 | #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */ | ||
| 421 | |||
| 422 | /* port type */ | ||
| 423 | #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */ | ||
| 424 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */ | ||
| 425 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */ | ||
| 426 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */ | ||
| 427 | #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */ | ||
| 428 | #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */ | ||
| 429 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */ | ||
| 430 | |||
| 431 | /* other standards...*/ | ||
| 432 | #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */ | ||
| 433 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ | ||
| 434 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ | ||
| 435 | /*...*/ | ||
| 436 | #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */ | ||
| 437 | #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */ | ||
| 438 | #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */ | ||
| 439 | #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */ | ||
| 440 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ | ||
| 441 | |||
| 442 | /* misc. conditioning flags */ | ||
| 443 | #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0) | ||
| 444 | #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1) | ||
| 445 | #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) | ||
| 446 | |||
| 447 | struct snd_seq_port_info { | ||
| 448 | struct snd_seq_addr addr; /* client/port numbers */ | ||
| 449 | char name[64]; /* port name */ | ||
| 450 | |||
| 451 | unsigned int capability; /* port capability bits */ | ||
| 452 | unsigned int type; /* port type bits */ | ||
| 453 | int midi_channels; /* channels per MIDI port */ | ||
| 454 | int midi_voices; /* voices per MIDI port */ | ||
| 455 | int synth_voices; /* voices per SYNTH port */ | ||
| 456 | |||
| 457 | int read_use; /* R/O: subscribers for output (from this port) */ | ||
| 458 | int write_use; /* R/O: subscribers for input (to this port) */ | ||
| 459 | |||
| 460 | void *kernel; /* reserved for kernel use (must be NULL) */ | ||
| 461 | unsigned int flags; /* misc. conditioning */ | ||
| 462 | unsigned char time_queue; /* queue # for timestamping */ | ||
| 463 | char reserved[59]; /* for future use */ | ||
| 464 | }; | ||
| 465 | |||
| 466 | |||
| 467 | /* queue flags */ | ||
| 468 | #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */ | ||
| 469 | |||
| 470 | /* queue information */ | ||
| 471 | struct snd_seq_queue_info { | ||
| 472 | int queue; /* queue id */ | ||
| 473 | |||
| 474 | /* | ||
| 475 | * security settings, only owner of this queue can start/stop timer | ||
| 476 | * etc. if the queue is locked for other clients | ||
| 477 | */ | ||
| 478 | int owner; /* client id for owner of the queue */ | ||
| 479 | unsigned locked:1; /* timing queue locked for other queues */ | ||
| 480 | char name[64]; /* name of this queue */ | ||
| 481 | unsigned int flags; /* flags */ | ||
| 482 | char reserved[60]; /* for future use */ | ||
| 483 | |||
| 484 | }; | ||
| 485 | |||
| 486 | /* queue info/status */ | ||
| 487 | struct snd_seq_queue_status { | ||
| 488 | int queue; /* queue id */ | ||
| 489 | int events; /* read-only - queue size */ | ||
| 490 | snd_seq_tick_time_t tick; /* current tick */ | ||
| 491 | struct snd_seq_real_time time; /* current time */ | ||
| 492 | int running; /* running state of queue */ | ||
| 493 | int flags; /* various flags */ | ||
| 494 | char reserved[64]; /* for the future */ | ||
| 495 | }; | ||
| 496 | |||
| 497 | |||
| 498 | /* queue tempo */ | ||
| 499 | struct snd_seq_queue_tempo { | ||
| 500 | int queue; /* sequencer queue */ | ||
| 501 | unsigned int tempo; /* current tempo, us/tick */ | ||
| 502 | int ppq; /* time resolution, ticks/quarter */ | ||
| 503 | unsigned int skew_value; /* queue skew */ | ||
| 504 | unsigned int skew_base; /* queue skew base */ | ||
| 505 | char reserved[24]; /* for the future */ | ||
| 506 | }; | ||
| 507 | |||
| 508 | |||
| 509 | /* sequencer timer sources */ | ||
| 510 | #define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */ | ||
| 511 | #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */ | ||
| 512 | #define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */ | ||
| 513 | |||
| 514 | /* queue timer info */ | ||
| 515 | struct snd_seq_queue_timer { | ||
| 516 | int queue; /* sequencer queue */ | ||
| 517 | int type; /* source timer type */ | ||
| 518 | union { | ||
| 519 | struct { | ||
| 520 | struct snd_timer_id id; /* ALSA's timer ID */ | ||
| 521 | unsigned int resolution; /* resolution in Hz */ | ||
| 522 | } alsa; | ||
| 523 | } u; | ||
| 524 | char reserved[64]; /* for the future use */ | ||
| 525 | }; | ||
| 526 | |||
| 527 | |||
| 528 | struct snd_seq_queue_client { | ||
| 529 | int queue; /* sequencer queue */ | ||
| 530 | int client; /* sequencer client */ | ||
| 531 | int used; /* queue is used with this client | ||
| 532 | (must be set for accepting events) */ | ||
| 533 | /* per client watermarks */ | ||
| 534 | char reserved[64]; /* for future use */ | ||
| 535 | }; | ||
| 536 | |||
| 537 | |||
| 538 | #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */ | ||
| 539 | #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1) | ||
| 540 | #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2) | ||
| 541 | |||
| 542 | struct snd_seq_port_subscribe { | ||
| 543 | struct snd_seq_addr sender; /* sender address */ | ||
| 544 | struct snd_seq_addr dest; /* destination address */ | ||
| 545 | unsigned int voices; /* number of voices to be allocated (0 = don't care) */ | ||
| 546 | unsigned int flags; /* modes */ | ||
| 547 | unsigned char queue; /* input time-stamp queue (optional) */ | ||
| 548 | unsigned char pad[3]; /* reserved */ | ||
| 549 | char reserved[64]; | ||
| 550 | }; | ||
| 551 | |||
| 552 | /* type of query subscription */ | ||
| 553 | #define SNDRV_SEQ_QUERY_SUBS_READ 0 | ||
| 554 | #define SNDRV_SEQ_QUERY_SUBS_WRITE 1 | ||
| 555 | |||
| 556 | struct snd_seq_query_subs { | ||
| 557 | struct snd_seq_addr root; /* client/port id to be searched */ | ||
| 558 | int type; /* READ or WRITE */ | ||
| 559 | int index; /* 0..N-1 */ | ||
| 560 | int num_subs; /* R/O: number of subscriptions on this port */ | ||
| 561 | struct snd_seq_addr addr; /* R/O: result */ | ||
| 562 | unsigned char queue; /* R/O: result */ | ||
| 563 | unsigned int flags; /* R/O: result */ | ||
| 564 | char reserved[64]; /* for future use */ | ||
| 565 | }; | ||
| 566 | |||
| 567 | |||
| 568 | /* | ||
| 569 | * IOCTL commands | ||
| 570 | */ | ||
| 571 | |||
| 572 | #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int) | ||
| 573 | #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) | ||
| 574 | #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info) | ||
| 575 | #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info) | ||
| 576 | |||
| 577 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info) | ||
| 578 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info) | ||
| 579 | |||
| 580 | #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info) | ||
| 581 | #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info) | ||
| 582 | #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info) | ||
| 583 | #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info) | ||
| 584 | |||
| 585 | #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe) | ||
| 586 | #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe) | ||
| 587 | |||
| 588 | #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info) | ||
| 589 | #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info) | ||
| 590 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info) | ||
| 591 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info) | ||
| 592 | #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info) | ||
| 593 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status) | ||
| 594 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo) | ||
| 595 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo) | ||
| 596 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner) | ||
| 597 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner) | ||
| 598 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer) | ||
| 599 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer) | ||
| 600 | /* XXX | ||
| 601 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync) | ||
| 602 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync) | ||
| 603 | */ | ||
| 604 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client) | ||
| 605 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client) | ||
| 606 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool) | ||
| 607 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool) | ||
| 608 | #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events) | ||
| 609 | #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs) | ||
| 610 | #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe) | ||
| 611 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info) | ||
| 612 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info) | ||
| 613 | |||
| 614 | #endif /* _UAPI__SOUND_ASEQUENCER_H */ | ||
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h new file mode 100644 index 000000000000..1774a5c3ef10 --- /dev/null +++ b/include/uapi/sound/asound.h | |||
| @@ -0,0 +1,971 @@ | |||
| 1 | /* | ||
| 2 | * Advanced Linux Sound Architecture - ALSA - Driver | ||
| 3 | * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>, | ||
| 4 | * Abramo Bagnara <abramo@alsa-project.org> | ||
| 5 | * | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _UAPI__SOUND_ASOUND_H | ||
| 24 | #define _UAPI__SOUND_ASOUND_H | ||
| 25 | |||
| 26 | #include <linux/types.h> | ||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * protocol version | ||
| 31 | */ | ||
| 32 | |||
| 33 | #define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor)) | ||
| 34 | #define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff) | ||
| 35 | #define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff) | ||
| 36 | #define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff) | ||
| 37 | #define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \ | ||
| 38 | (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \ | ||
| 39 | (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \ | ||
| 40 | SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion))) | ||
| 41 | |||
| 42 | /**************************************************************************** | ||
| 43 | * * | ||
| 44 | * Digital audio interface * | ||
| 45 | * * | ||
| 46 | ****************************************************************************/ | ||
| 47 | |||
| 48 | struct snd_aes_iec958 { | ||
| 49 | unsigned char status[24]; /* AES/IEC958 channel status bits */ | ||
| 50 | unsigned char subcode[147]; /* AES/IEC958 subcode bits */ | ||
| 51 | unsigned char pad; /* nothing */ | ||
| 52 | unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */ | ||
| 53 | }; | ||
| 54 | |||
| 55 | /**************************************************************************** | ||
| 56 | * * | ||
| 57 | * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort * | ||
| 58 | * * | ||
| 59 | ****************************************************************************/ | ||
| 60 | |||
| 61 | struct snd_cea_861_aud_if { | ||
| 62 | unsigned char db1_ct_cc; /* coding type and channel count */ | ||
| 63 | unsigned char db2_sf_ss; /* sample frequency and size */ | ||
| 64 | unsigned char db3; /* not used, all zeros */ | ||
| 65 | unsigned char db4_ca; /* channel allocation code */ | ||
| 66 | unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */ | ||
| 67 | }; | ||
| 68 | |||
| 69 | /**************************************************************************** | ||
| 70 | * * | ||
| 71 | * Section for driver hardware dependent interface - /dev/snd/hw? * | ||
| 72 | * * | ||
| 73 | ****************************************************************************/ | ||
| 74 | |||
| 75 | #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) | ||
| 76 | |||
| 77 | enum { | ||
| 78 | SNDRV_HWDEP_IFACE_OPL2 = 0, | ||
| 79 | SNDRV_HWDEP_IFACE_OPL3, | ||
| 80 | SNDRV_HWDEP_IFACE_OPL4, | ||
| 81 | SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */ | ||
| 82 | SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */ | ||
| 83 | SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */ | ||
| 84 | SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */ | ||
| 85 | SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */ | ||
| 86 | SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */ | ||
| 87 | SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */ | ||
| 88 | SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */ | ||
| 89 | SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */ | ||
| 90 | SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ | ||
| 91 | SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ | ||
| 92 | SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ | ||
| 93 | SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ | ||
| 94 | SNDRV_HWDEP_IFACE_HDA, /* HD-audio */ | ||
| 95 | SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */ | ||
| 96 | |||
| 97 | /* Don't forget to change the following: */ | ||
| 98 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM | ||
| 99 | }; | ||
| 100 | |||
| 101 | struct snd_hwdep_info { | ||
| 102 | unsigned int device; /* WR: device number */ | ||
| 103 | int card; /* R: card number */ | ||
| 104 | unsigned char id[64]; /* ID (user selectable) */ | ||
| 105 | unsigned char name[80]; /* hwdep name */ | ||
| 106 | int iface; /* hwdep interface */ | ||
| 107 | unsigned char reserved[64]; /* reserved for future */ | ||
| 108 | }; | ||
| 109 | |||
| 110 | /* generic DSP loader */ | ||
| 111 | struct snd_hwdep_dsp_status { | ||
| 112 | unsigned int version; /* R: driver-specific version */ | ||
| 113 | unsigned char id[32]; /* R: driver-specific ID string */ | ||
| 114 | unsigned int num_dsps; /* R: number of DSP images to transfer */ | ||
| 115 | unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */ | ||
| 116 | unsigned int chip_ready; /* R: 1 = initialization finished */ | ||
| 117 | unsigned char reserved[16]; /* reserved for future use */ | ||
| 118 | }; | ||
| 119 | |||
| 120 | struct snd_hwdep_dsp_image { | ||
| 121 | unsigned int index; /* W: DSP index */ | ||
| 122 | unsigned char name[64]; /* W: ID (e.g. file name) */ | ||
| 123 | unsigned char __user *image; /* W: binary image */ | ||
| 124 | size_t length; /* W: size of image in bytes */ | ||
| 125 | unsigned long driver_data; /* W: driver-specific data */ | ||
| 126 | }; | ||
| 127 | |||
| 128 | #define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int) | ||
| 129 | #define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info) | ||
| 130 | #define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status) | ||
| 131 | #define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image) | ||
| 132 | |||
| 133 | /***************************************************************************** | ||
| 134 | * * | ||
| 135 | * Digital Audio (PCM) interface - /dev/snd/pcm?? * | ||
| 136 | * * | ||
| 137 | *****************************************************************************/ | ||
| 138 | |||
| 139 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11) | ||
| 140 | |||
| 141 | typedef unsigned long snd_pcm_uframes_t; | ||
| 142 | typedef signed long snd_pcm_sframes_t; | ||
| 143 | |||
| 144 | enum { | ||
| 145 | SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ | ||
| 146 | SNDRV_PCM_CLASS_MULTI, /* multichannel device */ | ||
| 147 | SNDRV_PCM_CLASS_MODEM, /* software modem class */ | ||
| 148 | SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */ | ||
| 149 | /* Don't forget to change the following: */ | ||
| 150 | SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, | ||
| 151 | }; | ||
| 152 | |||
| 153 | enum { | ||
| 154 | SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ | ||
| 155 | SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ | ||
| 156 | /* Don't forget to change the following: */ | ||
| 157 | SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, | ||
| 158 | }; | ||
| 159 | |||
| 160 | enum { | ||
| 161 | SNDRV_PCM_STREAM_PLAYBACK = 0, | ||
| 162 | SNDRV_PCM_STREAM_CAPTURE, | ||
| 163 | SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, | ||
| 164 | }; | ||
| 165 | |||
| 166 | typedef int __bitwise snd_pcm_access_t; | ||
| 167 | #define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */ | ||
| 168 | #define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */ | ||
| 169 | #define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */ | ||
| 170 | #define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */ | ||
| 171 | #define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */ | ||
| 172 | #define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED | ||
| 173 | |||
| 174 | typedef int __bitwise snd_pcm_format_t; | ||
| 175 | #define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0) | ||
| 176 | #define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1) | ||
| 177 | #define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2) | ||
| 178 | #define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3) | ||
| 179 | #define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4) | ||
| 180 | #define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5) | ||
| 181 | #define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */ | ||
| 182 | #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */ | ||
| 183 | #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */ | ||
| 184 | #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */ | ||
| 185 | #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10) | ||
| 186 | #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11) | ||
| 187 | #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12) | ||
| 188 | #define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13) | ||
| 189 | #define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ | ||
| 190 | #define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ | ||
| 191 | #define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ | ||
| 192 | #define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ | ||
| 193 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */ | ||
| 194 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */ | ||
| 195 | #define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20) | ||
| 196 | #define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21) | ||
| 197 | #define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) | ||
| 198 | #define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) | ||
| 199 | #define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) | ||
| 200 | #define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) | ||
| 201 | #define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ | ||
| 202 | #define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */ | ||
| 203 | #define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */ | ||
| 204 | #define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */ | ||
| 205 | #define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */ | ||
| 206 | #define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */ | ||
| 207 | #define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */ | ||
| 208 | #define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */ | ||
| 209 | #define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */ | ||
| 210 | #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ | ||
| 211 | #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ | ||
| 212 | #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ | ||
| 213 | #define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ | ||
| 214 | #define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */ | ||
| 215 | #define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ | ||
| 216 | #define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */ | ||
| 217 | #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B | ||
| 218 | |||
| 219 | #ifdef SNDRV_LITTLE_ENDIAN | ||
| 220 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE | ||
| 221 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE | ||
| 222 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE | ||
| 223 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE | ||
| 224 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE | ||
| 225 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE | ||
| 226 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE | ||
| 227 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE | ||
| 228 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE | ||
| 229 | #endif | ||
| 230 | #ifdef SNDRV_BIG_ENDIAN | ||
| 231 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE | ||
| 232 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE | ||
| 233 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE | ||
| 234 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE | ||
| 235 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE | ||
| 236 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE | ||
| 237 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE | ||
| 238 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE | ||
| 239 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE | ||
| 240 | #endif | ||
| 241 | |||
| 242 | typedef int __bitwise snd_pcm_subformat_t; | ||
| 243 | #define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0) | ||
| 244 | #define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD | ||
| 245 | |||
| 246 | #define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ | ||
| 247 | #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ | ||
| 248 | #define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */ | ||
| 249 | #define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */ | ||
| 250 | #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */ | ||
| 251 | #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */ | ||
| 252 | #define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */ | ||
| 253 | #define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */ | ||
| 254 | #define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */ | ||
| 255 | #define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */ | ||
| 256 | #define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */ | ||
| 257 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | ||
| 258 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | ||
| 259 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | ||
| 260 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | ||
| 261 | #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ | ||
| 262 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | ||
| 263 | |||
| 264 | typedef int __bitwise snd_pcm_state_t; | ||
| 265 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ | ||
| 266 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ | ||
| 267 | #define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */ | ||
| 268 | #define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */ | ||
| 269 | #define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */ | ||
| 270 | #define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */ | ||
| 271 | #define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */ | ||
| 272 | #define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */ | ||
| 273 | #define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */ | ||
| 274 | #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED | ||
| 275 | |||
| 276 | enum { | ||
| 277 | SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, | ||
| 278 | SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000, | ||
| 279 | SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, | ||
| 280 | }; | ||
| 281 | |||
| 282 | union snd_pcm_sync_id { | ||
| 283 | unsigned char id[16]; | ||
| 284 | unsigned short id16[8]; | ||
| 285 | unsigned int id32[4]; | ||
| 286 | }; | ||
| 287 | |||
| 288 | struct snd_pcm_info { | ||
| 289 | unsigned int device; /* RO/WR (control): device number */ | ||
| 290 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | ||
| 291 | int stream; /* RO/WR (control): stream direction */ | ||
| 292 | int card; /* R: card number */ | ||
| 293 | unsigned char id[64]; /* ID (user selectable) */ | ||
| 294 | unsigned char name[80]; /* name of this device */ | ||
| 295 | unsigned char subname[32]; /* subdevice name */ | ||
| 296 | int dev_class; /* SNDRV_PCM_CLASS_* */ | ||
| 297 | int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ | ||
| 298 | unsigned int subdevices_count; | ||
| 299 | unsigned int subdevices_avail; | ||
| 300 | union snd_pcm_sync_id sync; /* hardware synchronization ID */ | ||
| 301 | unsigned char reserved[64]; /* reserved for future... */ | ||
| 302 | }; | ||
| 303 | |||
| 304 | typedef int snd_pcm_hw_param_t; | ||
| 305 | #define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */ | ||
| 306 | #define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */ | ||
| 307 | #define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */ | ||
| 308 | #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS | ||
| 309 | #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT | ||
| 310 | |||
| 311 | #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */ | ||
| 312 | #define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */ | ||
| 313 | #define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */ | ||
| 314 | #define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */ | ||
| 315 | #define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between | ||
| 316 | * interrupts in us | ||
| 317 | */ | ||
| 318 | #define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between | ||
| 319 | * interrupts | ||
| 320 | */ | ||
| 321 | #define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between | ||
| 322 | * interrupts | ||
| 323 | */ | ||
| 324 | #define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per | ||
| 325 | * buffer | ||
| 326 | */ | ||
| 327 | #define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer | ||
| 328 | * in us | ||
| 329 | */ | ||
| 330 | #define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */ | ||
| 331 | #define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */ | ||
| 332 | #define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */ | ||
| 333 | #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS | ||
| 334 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | ||
| 335 | |||
| 336 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | ||
| 337 | #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ | ||
| 338 | #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ | ||
| 339 | |||
| 340 | struct snd_interval { | ||
| 341 | unsigned int min, max; | ||
| 342 | unsigned int openmin:1, | ||
| 343 | openmax:1, | ||
| 344 | integer:1, | ||
| 345 | empty:1; | ||
| 346 | }; | ||
| 347 | |||
| 348 | #define SNDRV_MASK_MAX 256 | ||
| 349 | |||
| 350 | struct snd_mask { | ||
| 351 | __u32 bits[(SNDRV_MASK_MAX+31)/32]; | ||
| 352 | }; | ||
| 353 | |||
| 354 | struct snd_pcm_hw_params { | ||
| 355 | unsigned int flags; | ||
| 356 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - | ||
| 357 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; | ||
| 358 | struct snd_mask mres[5]; /* reserved masks */ | ||
| 359 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - | ||
| 360 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; | ||
| 361 | struct snd_interval ires[9]; /* reserved intervals */ | ||
| 362 | unsigned int rmask; /* W: requested masks */ | ||
| 363 | unsigned int cmask; /* R: changed masks */ | ||
| 364 | unsigned int info; /* R: Info flags for returned setup */ | ||
| 365 | unsigned int msbits; /* R: used most significant bits */ | ||
| 366 | unsigned int rate_num; /* R: rate numerator */ | ||
| 367 | unsigned int rate_den; /* R: rate denominator */ | ||
| 368 | snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ | ||
| 369 | unsigned char reserved[64]; /* reserved for future */ | ||
| 370 | }; | ||
| 371 | |||
| 372 | enum { | ||
| 373 | SNDRV_PCM_TSTAMP_NONE = 0, | ||
| 374 | SNDRV_PCM_TSTAMP_ENABLE, | ||
| 375 | SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE, | ||
| 376 | }; | ||
| 377 | |||
| 378 | struct snd_pcm_sw_params { | ||
| 379 | int tstamp_mode; /* timestamp mode */ | ||
| 380 | unsigned int period_step; | ||
| 381 | unsigned int sleep_min; /* min ticks to sleep */ | ||
| 382 | snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */ | ||
| 383 | snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */ | ||
| 384 | snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ | ||
| 385 | snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ | ||
| 386 | snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ | ||
| 387 | snd_pcm_uframes_t silence_size; /* silence block size */ | ||
| 388 | snd_pcm_uframes_t boundary; /* pointers wrap point */ | ||
| 389 | unsigned char reserved[64]; /* reserved for future */ | ||
| 390 | }; | ||
| 391 | |||
| 392 | struct snd_pcm_channel_info { | ||
| 393 | unsigned int channel; | ||
| 394 | __kernel_off_t offset; /* mmap offset */ | ||
| 395 | unsigned int first; /* offset to first sample in bits */ | ||
| 396 | unsigned int step; /* samples distance in bits */ | ||
| 397 | }; | ||
| 398 | |||
| 399 | struct snd_pcm_status { | ||
| 400 | snd_pcm_state_t state; /* stream state */ | ||
| 401 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ | ||
| 402 | struct timespec tstamp; /* reference timestamp */ | ||
| 403 | snd_pcm_uframes_t appl_ptr; /* appl ptr */ | ||
| 404 | snd_pcm_uframes_t hw_ptr; /* hw ptr */ | ||
| 405 | snd_pcm_sframes_t delay; /* current delay in frames */ | ||
| 406 | snd_pcm_uframes_t avail; /* number of frames available */ | ||
| 407 | snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ | ||
| 408 | snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ | ||
| 409 | snd_pcm_state_t suspended_state; /* suspended stream state */ | ||
| 410 | __u32 reserved_alignment; /* must be filled with zero */ | ||
| 411 | struct timespec audio_tstamp; /* from sample counter or wall clock */ | ||
| 412 | unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */ | ||
| 413 | }; | ||
| 414 | |||
| 415 | struct snd_pcm_mmap_status { | ||
| 416 | snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ | ||
| 417 | int pad1; /* Needed for 64 bit alignment */ | ||
| 418 | snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ | ||
| 419 | struct timespec tstamp; /* Timestamp */ | ||
| 420 | snd_pcm_state_t suspended_state; /* RO: suspended stream state */ | ||
| 421 | struct timespec audio_tstamp; /* from sample counter or wall clock */ | ||
| 422 | }; | ||
| 423 | |||
| 424 | struct snd_pcm_mmap_control { | ||
| 425 | snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ | ||
| 426 | snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ | ||
| 427 | }; | ||
| 428 | |||
| 429 | #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ | ||
| 430 | #define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ | ||
| 431 | #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ | ||
| 432 | |||
| 433 | struct snd_pcm_sync_ptr { | ||
| 434 | unsigned int flags; | ||
| 435 | union { | ||
| 436 | struct snd_pcm_mmap_status status; | ||
| 437 | unsigned char reserved[64]; | ||
| 438 | } s; | ||
| 439 | union { | ||
| 440 | struct snd_pcm_mmap_control control; | ||
| 441 | unsigned char reserved[64]; | ||
| 442 | } c; | ||
| 443 | }; | ||
| 444 | |||
| 445 | struct snd_xferi { | ||
| 446 | snd_pcm_sframes_t result; | ||
| 447 | void __user *buf; | ||
| 448 | snd_pcm_uframes_t frames; | ||
| 449 | }; | ||
| 450 | |||
| 451 | struct snd_xfern { | ||
| 452 | snd_pcm_sframes_t result; | ||
| 453 | void __user * __user *bufs; | ||
| 454 | snd_pcm_uframes_t frames; | ||
| 455 | }; | ||
| 456 | |||
| 457 | enum { | ||
| 458 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ | ||
| 459 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ | ||
| 460 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, | ||
| 461 | }; | ||
| 462 | |||
| 463 | /* channel positions */ | ||
| 464 | enum { | ||
| 465 | SNDRV_CHMAP_UNKNOWN = 0, | ||
| 466 | SNDRV_CHMAP_NA, /* N/A, silent */ | ||
| 467 | SNDRV_CHMAP_MONO, /* mono stream */ | ||
| 468 | /* this follows the alsa-lib mixer channel value + 3 */ | ||
| 469 | SNDRV_CHMAP_FL, /* front left */ | ||
| 470 | SNDRV_CHMAP_FR, /* front right */ | ||
| 471 | SNDRV_CHMAP_RL, /* rear left */ | ||
| 472 | SNDRV_CHMAP_RR, /* rear right */ | ||
| 473 | SNDRV_CHMAP_FC, /* front center */ | ||
| 474 | SNDRV_CHMAP_LFE, /* LFE */ | ||
| 475 | SNDRV_CHMAP_SL, /* side left */ | ||
| 476 | SNDRV_CHMAP_SR, /* side right */ | ||
| 477 | SNDRV_CHMAP_RC, /* rear center */ | ||
| 478 | /* new definitions */ | ||
| 479 | SNDRV_CHMAP_FLC, /* front left center */ | ||
| 480 | SNDRV_CHMAP_FRC, /* front right center */ | ||
| 481 | SNDRV_CHMAP_RLC, /* rear left center */ | ||
| 482 | SNDRV_CHMAP_RRC, /* rear right center */ | ||
| 483 | SNDRV_CHMAP_FLW, /* front left wide */ | ||
| 484 | SNDRV_CHMAP_FRW, /* front right wide */ | ||
| 485 | SNDRV_CHMAP_FLH, /* front left high */ | ||
| 486 | SNDRV_CHMAP_FCH, /* front center high */ | ||
| 487 | SNDRV_CHMAP_FRH, /* front right high */ | ||
| 488 | SNDRV_CHMAP_TC, /* top center */ | ||
| 489 | SNDRV_CHMAP_TFL, /* top front left */ | ||
| 490 | SNDRV_CHMAP_TFR, /* top front right */ | ||
| 491 | SNDRV_CHMAP_TFC, /* top front center */ | ||
| 492 | SNDRV_CHMAP_TRL, /* top rear left */ | ||
| 493 | SNDRV_CHMAP_TRR, /* top rear right */ | ||
| 494 | SNDRV_CHMAP_TRC, /* top rear center */ | ||
| 495 | /* new definitions for UAC2 */ | ||
| 496 | SNDRV_CHMAP_TFLC, /* top front left center */ | ||
| 497 | SNDRV_CHMAP_TFRC, /* top front right center */ | ||
| 498 | SNDRV_CHMAP_TSL, /* top side left */ | ||
| 499 | SNDRV_CHMAP_TSR, /* top side right */ | ||
| 500 | SNDRV_CHMAP_LLFE, /* left LFE */ | ||
| 501 | SNDRV_CHMAP_RLFE, /* right LFE */ | ||
| 502 | SNDRV_CHMAP_BC, /* bottom center */ | ||
| 503 | SNDRV_CHMAP_BLC, /* bottom left center */ | ||
| 504 | SNDRV_CHMAP_BRC, /* bottom right center */ | ||
| 505 | SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC, | ||
| 506 | }; | ||
| 507 | |||
| 508 | #define SNDRV_CHMAP_POSITION_MASK 0xffff | ||
| 509 | #define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16) | ||
| 510 | #define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16) | ||
| 511 | |||
| 512 | #define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int) | ||
| 513 | #define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info) | ||
| 514 | #define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int) | ||
| 515 | #define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int) | ||
| 516 | #define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params) | ||
| 517 | #define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params) | ||
| 518 | #define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12) | ||
| 519 | #define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params) | ||
| 520 | #define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status) | ||
| 521 | #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) | ||
| 522 | #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) | ||
| 523 | #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) | ||
| 524 | #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) | ||
| 525 | #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) | ||
| 526 | #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) | ||
| 527 | #define SNDRV_PCM_IOCTL_START _IO('A', 0x42) | ||
| 528 | #define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43) | ||
| 529 | #define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44) | ||
| 530 | #define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int) | ||
| 531 | #define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t) | ||
| 532 | #define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47) | ||
| 533 | #define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48) | ||
| 534 | #define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t) | ||
| 535 | #define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi) | ||
| 536 | #define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi) | ||
| 537 | #define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern) | ||
| 538 | #define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern) | ||
| 539 | #define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int) | ||
| 540 | #define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61) | ||
| 541 | |||
| 542 | /***************************************************************************** | ||
| 543 | * * | ||
| 544 | * MIDI v1.0 interface * | ||
| 545 | * * | ||
| 546 | *****************************************************************************/ | ||
| 547 | |||
| 548 | /* | ||
| 549 | * Raw MIDI section - /dev/snd/midi?? | ||
| 550 | */ | ||
| 551 | |||
| 552 | #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) | ||
| 553 | |||
| 554 | enum { | ||
| 555 | SNDRV_RAWMIDI_STREAM_OUTPUT = 0, | ||
| 556 | SNDRV_RAWMIDI_STREAM_INPUT, | ||
| 557 | SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, | ||
| 558 | }; | ||
| 559 | |||
| 560 | #define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001 | ||
| 561 | #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 | ||
| 562 | #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 | ||
| 563 | |||
| 564 | struct snd_rawmidi_info { | ||
| 565 | unsigned int device; /* RO/WR (control): device number */ | ||
| 566 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | ||
| 567 | int stream; /* WR: stream */ | ||
| 568 | int card; /* R: card number */ | ||
| 569 | unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ | ||
| 570 | unsigned char id[64]; /* ID (user selectable) */ | ||
| 571 | unsigned char name[80]; /* name of device */ | ||
| 572 | unsigned char subname[32]; /* name of active or selected subdevice */ | ||
| 573 | unsigned int subdevices_count; | ||
| 574 | unsigned int subdevices_avail; | ||
| 575 | unsigned char reserved[64]; /* reserved for future use */ | ||
| 576 | }; | ||
| 577 | |||
| 578 | struct snd_rawmidi_params { | ||
| 579 | int stream; | ||
| 580 | size_t buffer_size; /* queue size in bytes */ | ||
| 581 | size_t avail_min; /* minimum avail bytes for wakeup */ | ||
| 582 | unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ | ||
| 583 | unsigned char reserved[16]; /* reserved for future use */ | ||
| 584 | }; | ||
| 585 | |||
| 586 | struct snd_rawmidi_status { | ||
| 587 | int stream; | ||
| 588 | struct timespec tstamp; /* Timestamp */ | ||
| 589 | size_t avail; /* available bytes */ | ||
| 590 | size_t xruns; /* count of overruns since last status (in bytes) */ | ||
| 591 | unsigned char reserved[16]; /* reserved for future use */ | ||
| 592 | }; | ||
| 593 | |||
| 594 | #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) | ||
| 595 | #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) | ||
| 596 | #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params) | ||
| 597 | #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status) | ||
| 598 | #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int) | ||
| 599 | #define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int) | ||
| 600 | |||
| 601 | /* | ||
| 602 | * Timer section - /dev/snd/timer | ||
| 603 | */ | ||
| 604 | |||
| 605 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) | ||
| 606 | |||
| 607 | enum { | ||
| 608 | SNDRV_TIMER_CLASS_NONE = -1, | ||
| 609 | SNDRV_TIMER_CLASS_SLAVE = 0, | ||
| 610 | SNDRV_TIMER_CLASS_GLOBAL, | ||
| 611 | SNDRV_TIMER_CLASS_CARD, | ||
| 612 | SNDRV_TIMER_CLASS_PCM, | ||
| 613 | SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM, | ||
| 614 | }; | ||
| 615 | |||
| 616 | /* slave timer classes */ | ||
| 617 | enum { | ||
| 618 | SNDRV_TIMER_SCLASS_NONE = 0, | ||
| 619 | SNDRV_TIMER_SCLASS_APPLICATION, | ||
| 620 | SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ | ||
| 621 | SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */ | ||
| 622 | SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, | ||
| 623 | }; | ||
| 624 | |||
| 625 | /* global timers (device member) */ | ||
| 626 | #define SNDRV_TIMER_GLOBAL_SYSTEM 0 | ||
| 627 | #define SNDRV_TIMER_GLOBAL_RTC 1 | ||
| 628 | #define SNDRV_TIMER_GLOBAL_HPET 2 | ||
| 629 | #define SNDRV_TIMER_GLOBAL_HRTIMER 3 | ||
| 630 | |||
| 631 | /* info flags */ | ||
| 632 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ | ||
| 633 | |||
| 634 | struct snd_timer_id { | ||
| 635 | int dev_class; | ||
| 636 | int dev_sclass; | ||
| 637 | int card; | ||
| 638 | int device; | ||
| 639 | int subdevice; | ||
| 640 | }; | ||
| 641 | |||
| 642 | struct snd_timer_ginfo { | ||
| 643 | struct snd_timer_id tid; /* requested timer ID */ | ||
| 644 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | ||
| 645 | int card; /* card number */ | ||
| 646 | unsigned char id[64]; /* timer identification */ | ||
| 647 | unsigned char name[80]; /* timer name */ | ||
| 648 | unsigned long reserved0; /* reserved for future use */ | ||
| 649 | unsigned long resolution; /* average period resolution in ns */ | ||
| 650 | unsigned long resolution_min; /* minimal period resolution in ns */ | ||
| 651 | unsigned long resolution_max; /* maximal period resolution in ns */ | ||
| 652 | unsigned int clients; /* active timer clients */ | ||
| 653 | unsigned char reserved[32]; | ||
| 654 | }; | ||
| 655 | |||
| 656 | struct snd_timer_gparams { | ||
| 657 | struct snd_timer_id tid; /* requested timer ID */ | ||
| 658 | unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ | ||
| 659 | unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ | ||
| 660 | unsigned char reserved[32]; | ||
| 661 | }; | ||
| 662 | |||
| 663 | struct snd_timer_gstatus { | ||
| 664 | struct snd_timer_id tid; /* requested timer ID */ | ||
| 665 | unsigned long resolution; /* current period resolution in ns */ | ||
| 666 | unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ | ||
| 667 | unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ | ||
| 668 | unsigned char reserved[32]; | ||
| 669 | }; | ||
| 670 | |||
| 671 | struct snd_timer_select { | ||
| 672 | struct snd_timer_id id; /* bind to timer ID */ | ||
| 673 | unsigned char reserved[32]; /* reserved */ | ||
| 674 | }; | ||
| 675 | |||
| 676 | struct snd_timer_info { | ||
| 677 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | ||
| 678 | int card; /* card number */ | ||
| 679 | unsigned char id[64]; /* timer identificator */ | ||
| 680 | unsigned char name[80]; /* timer name */ | ||
| 681 | unsigned long reserved0; /* reserved for future use */ | ||
| 682 | unsigned long resolution; /* average period resolution in ns */ | ||
| 683 | unsigned char reserved[64]; /* reserved */ | ||
| 684 | }; | ||
| 685 | |||
| 686 | #define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */ | ||
| 687 | #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */ | ||
| 688 | #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */ | ||
| 689 | |||
| 690 | struct snd_timer_params { | ||
| 691 | unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ | ||
| 692 | unsigned int ticks; /* requested resolution in ticks */ | ||
| 693 | unsigned int queue_size; /* total size of queue (32-1024) */ | ||
| 694 | unsigned int reserved0; /* reserved, was: failure locations */ | ||
| 695 | unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */ | ||
| 696 | unsigned char reserved[60]; /* reserved */ | ||
| 697 | }; | ||
| 698 | |||
| 699 | struct snd_timer_status { | ||
| 700 | struct timespec tstamp; /* Timestamp - last update */ | ||
| 701 | unsigned int resolution; /* current period resolution in ns */ | ||
| 702 | unsigned int lost; /* counter of master tick lost */ | ||
| 703 | unsigned int overrun; /* count of read queue overruns */ | ||
| 704 | unsigned int queue; /* used queue size */ | ||
| 705 | unsigned char reserved[64]; /* reserved */ | ||
| 706 | }; | ||
| 707 | |||
| 708 | #define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int) | ||
| 709 | #define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id) | ||
| 710 | #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int) | ||
| 711 | #define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo) | ||
| 712 | #define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams) | ||
| 713 | #define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus) | ||
| 714 | #define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select) | ||
| 715 | #define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info) | ||
| 716 | #define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params) | ||
| 717 | #define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status) | ||
| 718 | /* The following four ioctls are changed since 1.0.9 due to confliction */ | ||
| 719 | #define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0) | ||
| 720 | #define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1) | ||
| 721 | #define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2) | ||
| 722 | #define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3) | ||
| 723 | |||
| 724 | struct snd_timer_read { | ||
| 725 | unsigned int resolution; | ||
| 726 | unsigned int ticks; | ||
| 727 | }; | ||
| 728 | |||
| 729 | enum { | ||
| 730 | SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ | ||
| 731 | SNDRV_TIMER_EVENT_TICK, /* val = ticks */ | ||
| 732 | SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ | ||
| 733 | SNDRV_TIMER_EVENT_STOP, /* val = 0 */ | ||
| 734 | SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ | ||
| 735 | SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */ | ||
| 736 | SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */ | ||
| 737 | SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */ | ||
| 738 | SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */ | ||
| 739 | /* master timer events for slave timer instances */ | ||
| 740 | SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10, | ||
| 741 | SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10, | ||
| 742 | SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10, | ||
| 743 | SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10, | ||
| 744 | SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10, | ||
| 745 | SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, | ||
| 746 | }; | ||
| 747 | |||
| 748 | struct snd_timer_tread { | ||
| 749 | int event; | ||
| 750 | struct timespec tstamp; | ||
| 751 | unsigned int val; | ||
| 752 | }; | ||
| 753 | |||
| 754 | /**************************************************************************** | ||
| 755 | * * | ||
| 756 | * Section for driver control interface - /dev/snd/control? * | ||
| 757 | * * | ||
| 758 | ****************************************************************************/ | ||
| 759 | |||
| 760 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) | ||
| 761 | |||
| 762 | struct snd_ctl_card_info { | ||
| 763 | int card; /* card number */ | ||
| 764 | int pad; /* reserved for future (was type) */ | ||
| 765 | unsigned char id[16]; /* ID of card (user selectable) */ | ||
| 766 | unsigned char driver[16]; /* Driver name */ | ||
| 767 | unsigned char name[32]; /* Short name of soundcard */ | ||
| 768 | unsigned char longname[80]; /* name + info text about soundcard */ | ||
| 769 | unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */ | ||
| 770 | unsigned char mixername[80]; /* visual mixer identification */ | ||
| 771 | unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */ | ||
| 772 | }; | ||
| 773 | |||
| 774 | typedef int __bitwise snd_ctl_elem_type_t; | ||
| 775 | #define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */ | ||
| 776 | #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */ | ||
| 777 | #define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */ | ||
| 778 | #define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */ | ||
| 779 | #define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */ | ||
| 780 | #define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */ | ||
| 781 | #define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */ | ||
| 782 | #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64 | ||
| 783 | |||
| 784 | typedef int __bitwise snd_ctl_elem_iface_t; | ||
| 785 | #define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */ | ||
| 786 | #define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */ | ||
| 787 | #define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */ | ||
| 788 | #define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */ | ||
| 789 | #define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */ | ||
| 790 | #define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */ | ||
| 791 | #define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */ | ||
| 792 | #define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER | ||
| 793 | |||
| 794 | #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) | ||
| 795 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) | ||
| 796 | #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE) | ||
| 797 | #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */ | ||
| 798 | #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */ | ||
| 799 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */ | ||
| 800 | #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */ | ||
| 801 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) | ||
| 802 | #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */ | ||
| 803 | #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */ | ||
| 804 | #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */ | ||
| 805 | #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ | ||
| 806 | #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */ | ||
| 807 | #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ | ||
| 808 | /* bits 30 and 31 are obsoleted (for indirect access) */ | ||
| 809 | |||
| 810 | /* for further details see the ACPI and PCI power management specification */ | ||
| 811 | #define SNDRV_CTL_POWER_D0 0x0000 /* full On */ | ||
| 812 | #define SNDRV_CTL_POWER_D1 0x0100 /* partial On */ | ||
| 813 | #define SNDRV_CTL_POWER_D2 0x0200 /* partial On */ | ||
| 814 | #define SNDRV_CTL_POWER_D3 0x0300 /* Off */ | ||
| 815 | #define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ | ||
| 816 | #define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ | ||
| 817 | |||
| 818 | struct snd_ctl_elem_id { | ||
| 819 | unsigned int numid; /* numeric identifier, zero = invalid */ | ||
| 820 | snd_ctl_elem_iface_t iface; /* interface identifier */ | ||
| 821 | unsigned int device; /* device/client number */ | ||
| 822 | unsigned int subdevice; /* subdevice (substream) number */ | ||
| 823 | unsigned char name[44]; /* ASCII name of item */ | ||
| 824 | unsigned int index; /* index of item */ | ||
| 825 | }; | ||
| 826 | |||
| 827 | struct snd_ctl_elem_list { | ||
| 828 | unsigned int offset; /* W: first element ID to get */ | ||
| 829 | unsigned int space; /* W: count of element IDs to get */ | ||
| 830 | unsigned int used; /* R: count of element IDs set */ | ||
| 831 | unsigned int count; /* R: count of all elements */ | ||
| 832 | struct snd_ctl_elem_id __user *pids; /* R: IDs */ | ||
| 833 | unsigned char reserved[50]; | ||
| 834 | }; | ||
| 835 | |||
| 836 | struct snd_ctl_elem_info { | ||
| 837 | struct snd_ctl_elem_id id; /* W: element ID */ | ||
| 838 | snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ | ||
| 839 | unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ | ||
| 840 | unsigned int count; /* count of values */ | ||
| 841 | __kernel_pid_t owner; /* owner's PID of this control */ | ||
| 842 | union { | ||
| 843 | struct { | ||
| 844 | long min; /* R: minimum value */ | ||
| 845 | long max; /* R: maximum value */ | ||
| 846 | long step; /* R: step (0 variable) */ | ||
| 847 | } integer; | ||
| 848 | struct { | ||
| 849 | long long min; /* R: minimum value */ | ||
| 850 | long long max; /* R: maximum value */ | ||
| 851 | long long step; /* R: step (0 variable) */ | ||
| 852 | } integer64; | ||
| 853 | struct { | ||
| 854 | unsigned int items; /* R: number of items */ | ||
| 855 | unsigned int item; /* W: item number */ | ||
| 856 | char name[64]; /* R: value name */ | ||
| 857 | __u64 names_ptr; /* W: names list (ELEM_ADD only) */ | ||
| 858 | unsigned int names_length; | ||
| 859 | } enumerated; | ||
| 860 | unsigned char reserved[128]; | ||
| 861 | } value; | ||
| 862 | union { | ||
| 863 | unsigned short d[4]; /* dimensions */ | ||
| 864 | unsigned short *d_ptr; /* indirect - obsoleted */ | ||
| 865 | } dimen; | ||
| 866 | unsigned char reserved[64-4*sizeof(unsigned short)]; | ||
| 867 | }; | ||
| 868 | |||
| 869 | struct snd_ctl_elem_value { | ||
| 870 | struct snd_ctl_elem_id id; /* W: element ID */ | ||
| 871 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ | ||
| 872 | union { | ||
| 873 | union { | ||
| 874 | long value[128]; | ||
| 875 | long *value_ptr; /* obsoleted */ | ||
| 876 | } integer; | ||
| 877 | union { | ||
| 878 | long long value[64]; | ||
| 879 | long long *value_ptr; /* obsoleted */ | ||
| 880 | } integer64; | ||
| 881 | union { | ||
| 882 | unsigned int item[128]; | ||
| 883 | unsigned int *item_ptr; /* obsoleted */ | ||
| 884 | } enumerated; | ||
| 885 | union { | ||
| 886 | unsigned char data[512]; | ||
| 887 | unsigned char *data_ptr; /* obsoleted */ | ||
| 888 | } bytes; | ||
| 889 | struct snd_aes_iec958 iec958; | ||
| 890 | } value; /* RO */ | ||
| 891 | struct timespec tstamp; | ||
| 892 | unsigned char reserved[128-sizeof(struct timespec)]; | ||
| 893 | }; | ||
| 894 | |||
| 895 | struct snd_ctl_tlv { | ||
| 896 | unsigned int numid; /* control element numeric identification */ | ||
| 897 | unsigned int length; /* in bytes aligned to 4 */ | ||
| 898 | unsigned int tlv[0]; /* first TLV */ | ||
| 899 | }; | ||
| 900 | |||
| 901 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) | ||
| 902 | #define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info) | ||
| 903 | #define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list) | ||
| 904 | #define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info) | ||
| 905 | #define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value) | ||
| 906 | #define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value) | ||
| 907 | #define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id) | ||
| 908 | #define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id) | ||
| 909 | #define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int) | ||
| 910 | #define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info) | ||
| 911 | #define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info) | ||
| 912 | #define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id) | ||
| 913 | #define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv) | ||
| 914 | #define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv) | ||
| 915 | #define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv) | ||
| 916 | #define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int) | ||
| 917 | #define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info) | ||
| 918 | #define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int) | ||
| 919 | #define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info) | ||
| 920 | #define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int) | ||
| 921 | #define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int) | ||
| 922 | #define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info) | ||
| 923 | #define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int) | ||
| 924 | #define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int) | ||
| 925 | #define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int) | ||
| 926 | |||
| 927 | /* | ||
| 928 | * Read interface. | ||
| 929 | */ | ||
| 930 | |||
| 931 | enum sndrv_ctl_event_type { | ||
| 932 | SNDRV_CTL_EVENT_ELEM = 0, | ||
| 933 | SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM, | ||
| 934 | }; | ||
| 935 | |||
| 936 | #define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */ | ||
| 937 | #define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */ | ||
| 938 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ | ||
| 939 | #define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */ | ||
| 940 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ | ||
| 941 | |||
| 942 | struct snd_ctl_event { | ||
| 943 | int type; /* event type - SNDRV_CTL_EVENT_* */ | ||
| 944 | union { | ||
| 945 | struct { | ||
| 946 | unsigned int mask; | ||
| 947 | struct snd_ctl_elem_id id; | ||
| 948 | } elem; | ||
| 949 | unsigned char data8[60]; | ||
| 950 | } data; | ||
| 951 | }; | ||
| 952 | |||
| 953 | /* | ||
| 954 | * Control names | ||
| 955 | */ | ||
| 956 | |||
| 957 | #define SNDRV_CTL_NAME_NONE "" | ||
| 958 | #define SNDRV_CTL_NAME_PLAYBACK "Playback " | ||
| 959 | #define SNDRV_CTL_NAME_CAPTURE "Capture " | ||
| 960 | |||
| 961 | #define SNDRV_CTL_NAME_IEC958_NONE "" | ||
| 962 | #define SNDRV_CTL_NAME_IEC958_SWITCH "Switch" | ||
| 963 | #define SNDRV_CTL_NAME_IEC958_VOLUME "Volume" | ||
| 964 | #define SNDRV_CTL_NAME_IEC958_DEFAULT "Default" | ||
| 965 | #define SNDRV_CTL_NAME_IEC958_MASK "Mask" | ||
| 966 | #define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask" | ||
| 967 | #define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask" | ||
| 968 | #define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream" | ||
| 969 | #define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what | ||
| 970 | |||
| 971 | #endif /* _UAPI__SOUND_ASOUND_H */ | ||
diff --git a/include/uapi/sound/asound_fm.h b/include/uapi/sound/asound_fm.h new file mode 100644 index 000000000000..c2a4b967d5be --- /dev/null +++ b/include/uapi/sound/asound_fm.h | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | #ifndef __SOUND_ASOUND_FM_H | ||
| 2 | #define __SOUND_ASOUND_FM_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Advanced Linux Sound Architecture - ALSA | ||
| 6 | * | ||
| 7 | * Interface file between ALSA driver & user space | ||
| 8 | * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>, | ||
| 9 | * 4Front Technologies | ||
| 10 | * | ||
| 11 | * Direct FM control | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License as published by | ||
| 15 | * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | * (at your option) any later version. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | * | ||
| 23 | * You should have received a copy of the GNU General Public License | ||
| 24 | * along with this program; if not, write to the Free Software | ||
| 25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 26 | * | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define SNDRV_DM_FM_MODE_OPL2 0x00 | ||
| 30 | #define SNDRV_DM_FM_MODE_OPL3 0x01 | ||
| 31 | |||
| 32 | struct snd_dm_fm_info { | ||
| 33 | unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ | ||
| 34 | unsigned char rhythm; /* percussion mode flag */ | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* | ||
| 38 | * Data structure composing an FM "note" or sound event. | ||
| 39 | */ | ||
| 40 | |||
| 41 | struct snd_dm_fm_voice { | ||
| 42 | unsigned char op; /* operator cell (0 or 1) */ | ||
| 43 | unsigned char voice; /* FM voice (0 to 17) */ | ||
| 44 | |||
| 45 | unsigned char am; /* amplitude modulation */ | ||
| 46 | unsigned char vibrato; /* vibrato effect */ | ||
| 47 | unsigned char do_sustain; /* sustain phase */ | ||
| 48 | unsigned char kbd_scale; /* keyboard scaling */ | ||
| 49 | unsigned char harmonic; /* 4 bits: harmonic and multiplier */ | ||
| 50 | unsigned char scale_level; /* 2 bits: decrease output freq rises */ | ||
| 51 | unsigned char volume; /* 6 bits: volume */ | ||
| 52 | |||
| 53 | unsigned char attack; /* 4 bits: attack rate */ | ||
| 54 | unsigned char decay; /* 4 bits: decay rate */ | ||
| 55 | unsigned char sustain; /* 4 bits: sustain level */ | ||
| 56 | unsigned char release; /* 4 bits: release rate */ | ||
| 57 | |||
| 58 | unsigned char feedback; /* 3 bits: feedback for op0 */ | ||
| 59 | unsigned char connection; /* 0 for serial, 1 for parallel */ | ||
| 60 | unsigned char left; /* stereo left */ | ||
| 61 | unsigned char right; /* stereo right */ | ||
| 62 | unsigned char waveform; /* 3 bits: waveform shape */ | ||
| 63 | }; | ||
| 64 | |||
| 65 | /* | ||
| 66 | * This describes an FM note by its voice, octave, frequency number (10bit) | ||
| 67 | * and key on/off. | ||
| 68 | */ | ||
| 69 | |||
| 70 | struct snd_dm_fm_note { | ||
| 71 | unsigned char voice; /* 0-17 voice channel */ | ||
| 72 | unsigned char octave; /* 3 bits: what octave to play */ | ||
| 73 | unsigned int fnum; /* 10 bits: frequency number */ | ||
| 74 | unsigned char key_on; /* set for active, clear for silent */ | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* | ||
| 78 | * FM parameters that apply globally to all voices, and thus are not "notes" | ||
| 79 | */ | ||
| 80 | |||
| 81 | struct snd_dm_fm_params { | ||
| 82 | unsigned char am_depth; /* amplitude modulation depth (1=hi) */ | ||
| 83 | unsigned char vib_depth; /* vibrato depth (1=hi) */ | ||
| 84 | unsigned char kbd_split; /* keyboard split */ | ||
| 85 | unsigned char rhythm; /* percussion mode select */ | ||
| 86 | |||
| 87 | /* This block is the percussion instrument data */ | ||
| 88 | unsigned char bass; | ||
| 89 | unsigned char snare; | ||
| 90 | unsigned char tomtom; | ||
| 91 | unsigned char cymbal; | ||
| 92 | unsigned char hihat; | ||
| 93 | }; | ||
| 94 | |||
| 95 | /* | ||
| 96 | * FM mode ioctl settings | ||
| 97 | */ | ||
| 98 | |||
| 99 | #define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info) | ||
| 100 | #define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21) | ||
| 101 | #define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note) | ||
| 102 | #define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice) | ||
| 103 | #define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params) | ||
| 104 | #define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) | ||
| 105 | /* for OPL3 only */ | ||
| 106 | #define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) | ||
| 107 | /* SBI patch management */ | ||
| 108 | #define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40) | ||
| 109 | |||
| 110 | #define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 | ||
| 111 | #define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 | ||
| 112 | #define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22 | ||
| 113 | #define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23 | ||
| 114 | #define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 | ||
| 115 | #define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 | ||
| 116 | |||
| 117 | /* | ||
| 118 | * Patch Record - fixed size for write | ||
| 119 | */ | ||
| 120 | |||
| 121 | #define FM_KEY_SBI "SBI\032" | ||
| 122 | #define FM_KEY_2OP "2OP\032" | ||
| 123 | #define FM_KEY_4OP "4OP\032" | ||
| 124 | |||
| 125 | struct sbi_patch { | ||
| 126 | unsigned char prog; | ||
| 127 | unsigned char bank; | ||
| 128 | char key[4]; | ||
| 129 | char name[25]; | ||
| 130 | char extension[7]; | ||
| 131 | unsigned char data[32]; | ||
| 132 | }; | ||
| 133 | |||
| 134 | #endif /* __SOUND_ASOUND_FM_H */ | ||
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h new file mode 100644 index 000000000000..05341a43fedf --- /dev/null +++ b/include/uapi/sound/compress_offload.h | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | /* | ||
| 2 | * compress_offload.h - compress offload header definations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Intel Corporation | ||
| 5 | * Authors: Vinod Koul <vinod.koul@linux.intel.com> | ||
| 6 | * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | ||
| 7 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; version 2 of the License. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License along | ||
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 20 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
| 21 | * | ||
| 22 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 23 | * | ||
| 24 | */ | ||
| 25 | #ifndef __COMPRESS_OFFLOAD_H | ||
| 26 | #define __COMPRESS_OFFLOAD_H | ||
| 27 | |||
| 28 | #include <linux/types.h> | ||
| 29 | #include <sound/asound.h> | ||
| 30 | #include <sound/compress_params.h> | ||
| 31 | |||
| 32 | |||
| 33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0) | ||
| 34 | /** | ||
| 35 | * struct snd_compressed_buffer: compressed buffer | ||
| 36 | * @fragment_size: size of buffer fragment in bytes | ||
| 37 | * @fragments: number of such fragments | ||
| 38 | */ | ||
| 39 | struct snd_compressed_buffer { | ||
| 40 | __u32 fragment_size; | ||
| 41 | __u32 fragments; | ||
| 42 | }; | ||
| 43 | |||
| 44 | /** | ||
| 45 | * struct snd_compr_params: compressed stream params | ||
| 46 | * @buffer: buffer description | ||
| 47 | * @codec: codec parameters | ||
| 48 | * @no_wake_mode: dont wake on fragment elapsed | ||
| 49 | */ | ||
| 50 | struct snd_compr_params { | ||
| 51 | struct snd_compressed_buffer buffer; | ||
| 52 | struct snd_codec codec; | ||
| 53 | __u8 no_wake_mode; | ||
| 54 | }; | ||
| 55 | |||
| 56 | /** | ||
| 57 | * struct snd_compr_tstamp: timestamp descriptor | ||
| 58 | * @byte_offset: Byte offset in ring buffer to DSP | ||
| 59 | * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP | ||
| 60 | * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by | ||
| 61 | * large steps and should only be used to monitor encoding/decoding | ||
| 62 | * progress. It shall not be used for timing estimates. | ||
| 63 | * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio | ||
| 64 | * output/input. This field should be used for A/V sync or time estimates. | ||
| 65 | * @sampling_rate: sampling rate of audio | ||
| 66 | */ | ||
| 67 | struct snd_compr_tstamp { | ||
| 68 | __u32 byte_offset; | ||
| 69 | __u32 copied_total; | ||
| 70 | snd_pcm_uframes_t pcm_frames; | ||
| 71 | snd_pcm_uframes_t pcm_io_frames; | ||
| 72 | __u32 sampling_rate; | ||
| 73 | }; | ||
| 74 | |||
| 75 | /** | ||
| 76 | * struct snd_compr_avail: avail descriptor | ||
| 77 | * @avail: Number of bytes available in ring buffer for writing/reading | ||
| 78 | * @tstamp: timestamp infomation | ||
| 79 | */ | ||
| 80 | struct snd_compr_avail { | ||
| 81 | __u64 avail; | ||
| 82 | struct snd_compr_tstamp tstamp; | ||
| 83 | }; | ||
| 84 | |||
| 85 | enum snd_compr_direction { | ||
| 86 | SND_COMPRESS_PLAYBACK = 0, | ||
| 87 | SND_COMPRESS_CAPTURE | ||
| 88 | }; | ||
| 89 | |||
| 90 | /** | ||
| 91 | * struct snd_compr_caps: caps descriptor | ||
| 92 | * @codecs: pointer to array of codecs | ||
| 93 | * @direction: direction supported. Of type snd_compr_direction | ||
| 94 | * @min_fragment_size: minimum fragment supported by DSP | ||
| 95 | * @max_fragment_size: maximum fragment supported by DSP | ||
| 96 | * @min_fragments: min fragments supported by DSP | ||
| 97 | * @max_fragments: max fragments supported by DSP | ||
| 98 | * @num_codecs: number of codecs supported | ||
| 99 | * @reserved: reserved field | ||
| 100 | */ | ||
| 101 | struct snd_compr_caps { | ||
| 102 | __u32 num_codecs; | ||
| 103 | __u32 direction; | ||
| 104 | __u32 min_fragment_size; | ||
| 105 | __u32 max_fragment_size; | ||
| 106 | __u32 min_fragments; | ||
| 107 | __u32 max_fragments; | ||
| 108 | __u32 codecs[MAX_NUM_CODECS]; | ||
| 109 | __u32 reserved[11]; | ||
| 110 | }; | ||
| 111 | |||
| 112 | /** | ||
| 113 | * struct snd_compr_codec_caps: query capability of codec | ||
| 114 | * @codec: codec for which capability is queried | ||
| 115 | * @num_descriptors: number of codec descriptors | ||
| 116 | * @descriptor: array of codec capability descriptor | ||
| 117 | */ | ||
| 118 | struct snd_compr_codec_caps { | ||
| 119 | __u32 codec; | ||
| 120 | __u32 num_descriptors; | ||
| 121 | struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; | ||
| 122 | }; | ||
| 123 | |||
| 124 | /** | ||
| 125 | * compress path ioctl definitions | ||
| 126 | * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP | ||
| 127 | * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec | ||
| 128 | * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters | ||
| 129 | * Note: only codec params can be changed runtime and stream params cant be | ||
| 130 | * SNDRV_COMPRESS_GET_PARAMS: Query codec params | ||
| 131 | * SNDRV_COMPRESS_TSTAMP: get the current timestamp value | ||
| 132 | * SNDRV_COMPRESS_AVAIL: get the current buffer avail value. | ||
| 133 | * This also queries the tstamp properties | ||
| 134 | * SNDRV_COMPRESS_PAUSE: Pause the running stream | ||
| 135 | * SNDRV_COMPRESS_RESUME: resume a paused stream | ||
| 136 | * SNDRV_COMPRESS_START: Start a stream | ||
| 137 | * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content | ||
| 138 | * and the buffers currently with DSP | ||
| 139 | * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that | ||
| 140 | * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version | ||
| 141 | */ | ||
| 142 | #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int) | ||
| 143 | #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps) | ||
| 144 | #define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\ | ||
| 145 | struct snd_compr_codec_caps) | ||
| 146 | #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) | ||
| 147 | #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) | ||
| 148 | #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) | ||
| 149 | #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) | ||
| 150 | #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) | ||
| 151 | #define SNDRV_COMPRESS_RESUME _IO('C', 0x31) | ||
| 152 | #define SNDRV_COMPRESS_START _IO('C', 0x32) | ||
| 153 | #define SNDRV_COMPRESS_STOP _IO('C', 0x33) | ||
| 154 | #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) | ||
| 155 | /* | ||
| 156 | * TODO | ||
| 157 | * 1. add mmap support | ||
| 158 | * | ||
| 159 | */ | ||
| 160 | #define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */ | ||
| 161 | #endif | ||
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h new file mode 100644 index 000000000000..602dc6c45d1a --- /dev/null +++ b/include/uapi/sound/compress_params.h | |||
| @@ -0,0 +1,400 @@ | |||
| 1 | /* | ||
| 2 | * compress_params.h - codec types and parameters for compressed data | ||
| 3 | * streaming interface | ||
| 4 | * | ||
| 5 | * Copyright (C) 2011 Intel Corporation | ||
| 6 | * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | ||
| 7 | * Vinod Koul <vinod.koul@linux.intel.com> | ||
| 8 | * | ||
| 9 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; version 2 of the License. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License along | ||
| 21 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
| 23 | * | ||
| 24 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 25 | * | ||
| 26 | * The definitions in this file are derived from the OpenMAX AL version 1.1 | ||
| 27 | * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below. | ||
| 28 | * | ||
| 29 | * Copyright (c) 2007-2010 The Khronos Group Inc. | ||
| 30 | * | ||
| 31 | * Permission is hereby granted, free of charge, to any person obtaining | ||
| 32 | * a copy of this software and/or associated documentation files (the | ||
| 33 | * "Materials "), to deal in the Materials without restriction, including | ||
| 34 | * without limitation the rights to use, copy, modify, merge, publish, | ||
| 35 | * distribute, sublicense, and/or sell copies of the Materials, and to | ||
| 36 | * permit persons to whom the Materials are furnished to do so, subject to | ||
| 37 | * the following conditions: | ||
| 38 | * | ||
| 39 | * The above copyright notice and this permission notice shall be included | ||
| 40 | * in all copies or substantial portions of the Materials. | ||
| 41 | * | ||
| 42 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 43 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 44 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| 45 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
| 46 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| 47 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| 48 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. | ||
| 49 | * | ||
| 50 | */ | ||
| 51 | #ifndef __SND_COMPRESS_PARAMS_H | ||
| 52 | #define __SND_COMPRESS_PARAMS_H | ||
| 53 | |||
| 54 | #include <linux/types.h> | ||
| 55 | |||
| 56 | /* AUDIO CODECS SUPPORTED */ | ||
| 57 | #define MAX_NUM_CODECS 32 | ||
| 58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 | ||
| 59 | #define MAX_NUM_BITRATES 32 | ||
| 60 | |||
| 61 | /* Codecs are listed linearly to allow for extensibility */ | ||
| 62 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) | ||
| 63 | #define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002) | ||
| 64 | #define SND_AUDIOCODEC_AMR ((__u32) 0x00000003) | ||
| 65 | #define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004) | ||
| 66 | #define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005) | ||
| 67 | #define SND_AUDIOCODEC_AAC ((__u32) 0x00000006) | ||
| 68 | #define SND_AUDIOCODEC_WMA ((__u32) 0x00000007) | ||
| 69 | #define SND_AUDIOCODEC_REAL ((__u32) 0x00000008) | ||
| 70 | #define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009) | ||
| 71 | #define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A) | ||
| 72 | #define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B) | ||
| 73 | #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C) | ||
| 74 | #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D) | ||
| 75 | #define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729 | ||
| 76 | |||
| 77 | /* | ||
| 78 | * Profile and modes are listed with bit masks. This allows for a | ||
| 79 | * more compact representation of fields that will not evolve | ||
| 80 | * (in contrast to the list of codecs) | ||
| 81 | */ | ||
| 82 | |||
| 83 | #define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001) | ||
| 84 | |||
| 85 | /* MP3 modes are only useful for encoders */ | ||
| 86 | #define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001) | ||
| 87 | #define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002) | ||
| 88 | #define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004) | ||
| 89 | #define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008) | ||
| 90 | |||
| 91 | #define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001) | ||
| 92 | |||
| 93 | /* AMR modes are only useful for encoders */ | ||
| 94 | #define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001) | ||
| 95 | #define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002) | ||
| 96 | #define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004) | ||
| 97 | |||
| 98 | #define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000) | ||
| 99 | #define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001) | ||
| 100 | #define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002) | ||
| 101 | #define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004) | ||
| 102 | #define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008) | ||
| 103 | #define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010) | ||
| 104 | #define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020) | ||
| 105 | |||
| 106 | #define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001) | ||
| 107 | |||
| 108 | /* AMRWB modes are only useful for encoders */ | ||
| 109 | #define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001) | ||
| 110 | #define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002) | ||
| 111 | #define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004) | ||
| 112 | |||
| 113 | #define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001) | ||
| 114 | |||
| 115 | #define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001) | ||
| 116 | |||
| 117 | /* AAC modes are required for encoders and decoders */ | ||
| 118 | #define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001) | ||
| 119 | #define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002) | ||
| 120 | #define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004) | ||
| 121 | #define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008) | ||
| 122 | #define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010) | ||
| 123 | #define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020) | ||
| 124 | #define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040) | ||
| 125 | #define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080) | ||
| 126 | #define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100) | ||
| 127 | #define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200) | ||
| 128 | |||
| 129 | /* AAC formats are required for encoders and decoders */ | ||
| 130 | #define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001) | ||
| 131 | #define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002) | ||
| 132 | #define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004) | ||
| 133 | #define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008) | ||
| 134 | #define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010) | ||
| 135 | #define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020) | ||
| 136 | #define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040) | ||
| 137 | |||
| 138 | #define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001) | ||
| 139 | #define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002) | ||
| 140 | #define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004) | ||
| 141 | #define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008) | ||
| 142 | |||
| 143 | #define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001) | ||
| 144 | #define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002) | ||
| 145 | #define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004) | ||
| 146 | #define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008) | ||
| 147 | #define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010) | ||
| 148 | #define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020) | ||
| 149 | #define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040) | ||
| 150 | #define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080) | ||
| 151 | |||
| 152 | #define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001) | ||
| 153 | /* | ||
| 154 | * Some implementations strip the ASF header and only send ASF packets | ||
| 155 | * to the DSP | ||
| 156 | */ | ||
| 157 | #define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002) | ||
| 158 | |||
| 159 | #define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001) | ||
| 160 | |||
| 161 | #define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001) | ||
| 162 | #define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002) | ||
| 163 | #define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004) | ||
| 164 | #define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008) | ||
| 165 | |||
| 166 | #define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001) | ||
| 167 | |||
| 168 | #define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001) | ||
| 169 | |||
| 170 | #define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001) | ||
| 171 | |||
| 172 | /* | ||
| 173 | * Define quality levels for FLAC encoders, from LEVEL0 (fast) | ||
| 174 | * to LEVEL8 (best) | ||
| 175 | */ | ||
| 176 | #define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001) | ||
| 177 | #define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002) | ||
| 178 | #define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004) | ||
| 179 | #define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008) | ||
| 180 | #define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010) | ||
| 181 | #define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020) | ||
| 182 | #define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040) | ||
| 183 | #define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080) | ||
| 184 | #define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100) | ||
| 185 | |||
| 186 | #define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001) | ||
| 187 | #define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002) | ||
| 188 | |||
| 189 | /* IEC61937 payloads without CUVP and preambles */ | ||
| 190 | #define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001) | ||
| 191 | /* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */ | ||
| 192 | #define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002) | ||
| 193 | |||
| 194 | /* | ||
| 195 | * IEC modes are mandatory for decoders. Format autodetection | ||
| 196 | * will only happen on the DSP side with mode 0. The PCM mode should | ||
| 197 | * not be used, the PCM codec should be used instead. | ||
| 198 | */ | ||
| 199 | #define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000) | ||
| 200 | #define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001) | ||
| 201 | #define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002) | ||
| 202 | #define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004) | ||
| 203 | #define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008) | ||
| 204 | #define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010) | ||
| 205 | #define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020) | ||
| 206 | #define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040) | ||
| 207 | #define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080) | ||
| 208 | #define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100) | ||
| 209 | #define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200) | ||
| 210 | #define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400) | ||
| 211 | #define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800) | ||
| 212 | #define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000) | ||
| 213 | #define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000) | ||
| 214 | #define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000) | ||
| 215 | #define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000) | ||
| 216 | #define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000) | ||
| 217 | #define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000) | ||
| 218 | |||
| 219 | #define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001) | ||
| 220 | |||
| 221 | #define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001) | ||
| 222 | #define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002) | ||
| 223 | #define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004) | ||
| 224 | |||
| 225 | #define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001) | ||
| 226 | |||
| 227 | #define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001) | ||
| 228 | #define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002) | ||
| 229 | |||
| 230 | /* <FIXME: multichannel encoders aren't supported for now. Would need | ||
| 231 | an additional definition of channel arrangement> */ | ||
| 232 | |||
| 233 | /* VBR/CBR definitions */ | ||
| 234 | #define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001) | ||
| 235 | #define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002) | ||
| 236 | |||
| 237 | /* Encoder options */ | ||
| 238 | |||
| 239 | struct snd_enc_wma { | ||
| 240 | __u32 super_block_align; /* WMA Type-specific data */ | ||
| 241 | }; | ||
| 242 | |||
| 243 | |||
| 244 | /** | ||
| 245 | * struct snd_enc_vorbis | ||
| 246 | * @quality: Sets encoding quality to n, between -1 (low) and 10 (high). | ||
| 247 | * In the default mode of operation, the quality level is 3. | ||
| 248 | * Normal quality range is 0 - 10. | ||
| 249 | * @managed: Boolean. Set bitrate management mode. This turns off the | ||
| 250 | * normal VBR encoding, but allows hard or soft bitrate constraints to be | ||
| 251 | * enforced by the encoder. This mode can be slower, and may also be | ||
| 252 | * lower quality. It is primarily useful for streaming. | ||
| 253 | * @max_bit_rate: Enabled only if managed is TRUE | ||
| 254 | * @min_bit_rate: Enabled only if managed is TRUE | ||
| 255 | * @downmix: Boolean. Downmix input from stereo to mono (has no effect on | ||
| 256 | * non-stereo streams). Useful for lower-bitrate encoding. | ||
| 257 | * | ||
| 258 | * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc | ||
| 259 | * properties | ||
| 260 | * | ||
| 261 | * For best quality users should specify VBR mode and set quality levels. | ||
| 262 | */ | ||
| 263 | |||
| 264 | struct snd_enc_vorbis { | ||
| 265 | __s32 quality; | ||
| 266 | __u32 managed; | ||
| 267 | __u32 max_bit_rate; | ||
| 268 | __u32 min_bit_rate; | ||
| 269 | __u32 downmix; | ||
| 270 | }; | ||
| 271 | |||
| 272 | |||
| 273 | /** | ||
| 274 | * struct snd_enc_real | ||
| 275 | * @quant_bits: number of coupling quantization bits in the stream | ||
| 276 | * @start_region: coupling start region in the stream | ||
| 277 | * @num_regions: number of regions value | ||
| 278 | * | ||
| 279 | * These options were extracted from the OpenMAX IL spec | ||
| 280 | */ | ||
| 281 | |||
| 282 | struct snd_enc_real { | ||
| 283 | __u32 quant_bits; | ||
| 284 | __u32 start_region; | ||
| 285 | __u32 num_regions; | ||
| 286 | }; | ||
| 287 | |||
| 288 | /** | ||
| 289 | * struct snd_enc_flac | ||
| 290 | * @num: serial number, valid only for OGG formats | ||
| 291 | * needs to be set by application | ||
| 292 | * @gain: Add replay gain tags | ||
| 293 | * | ||
| 294 | * These options were extracted from the FLAC online documentation | ||
| 295 | * at http://flac.sourceforge.net/documentation_tools_flac.html | ||
| 296 | * | ||
| 297 | * To make the API simpler, it is assumed that the user will select quality | ||
| 298 | * profiles. Additional options that affect encoding quality and speed can | ||
| 299 | * be added at a later stage if needed. | ||
| 300 | * | ||
| 301 | * By default the Subset format is used by encoders. | ||
| 302 | * | ||
| 303 | * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are | ||
| 304 | * not supported in this API. | ||
| 305 | */ | ||
| 306 | |||
| 307 | struct snd_enc_flac { | ||
| 308 | __u32 num; | ||
| 309 | __u32 gain; | ||
| 310 | }; | ||
| 311 | |||
| 312 | struct snd_enc_generic { | ||
| 313 | __u32 bw; /* encoder bandwidth */ | ||
| 314 | __s32 reserved[15]; | ||
| 315 | }; | ||
| 316 | |||
| 317 | union snd_codec_options { | ||
| 318 | struct snd_enc_wma wma; | ||
| 319 | struct snd_enc_vorbis vorbis; | ||
| 320 | struct snd_enc_real real; | ||
| 321 | struct snd_enc_flac flac; | ||
| 322 | struct snd_enc_generic generic; | ||
| 323 | }; | ||
| 324 | |||
| 325 | /** struct snd_codec_desc - description of codec capabilities | ||
| 326 | * @max_ch: Maximum number of audio channels | ||
| 327 | * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this | ||
| 328 | * @bit_rate: Indexed array containing supported bit rates | ||
| 329 | * @num_bitrates: Number of valid values in bit_rate array | ||
| 330 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. | ||
| 331 | * @profiles: Supported profiles. See SND_AUDIOPROFILE defines. | ||
| 332 | * @modes: Supported modes. See SND_AUDIOMODE defines | ||
| 333 | * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines | ||
| 334 | * @min_buffer: Minimum buffer size handled by codec implementation | ||
| 335 | * @reserved: reserved for future use | ||
| 336 | * | ||
| 337 | * This structure provides a scalar value for profiles, modes and stream | ||
| 338 | * format fields. | ||
| 339 | * If an implementation supports multiple combinations, they will be listed as | ||
| 340 | * codecs with different descriptors, for example there would be 2 descriptors | ||
| 341 | * for AAC-RAW and AAC-ADTS. | ||
| 342 | * This entails some redundancy but makes it easier to avoid invalid | ||
| 343 | * configurations. | ||
| 344 | * | ||
| 345 | */ | ||
| 346 | |||
| 347 | struct snd_codec_desc { | ||
| 348 | __u32 max_ch; | ||
| 349 | __u32 sample_rates; | ||
| 350 | __u32 bit_rate[MAX_NUM_BITRATES]; | ||
| 351 | __u32 num_bitrates; | ||
| 352 | __u32 rate_control; | ||
| 353 | __u32 profiles; | ||
| 354 | __u32 modes; | ||
| 355 | __u32 formats; | ||
| 356 | __u32 min_buffer; | ||
| 357 | __u32 reserved[15]; | ||
| 358 | }; | ||
| 359 | |||
| 360 | /** struct snd_codec | ||
| 361 | * @id: Identifies the supported audio encoder/decoder. | ||
| 362 | * See SND_AUDIOCODEC macros. | ||
| 363 | * @ch_in: Number of input audio channels | ||
| 364 | * @ch_out: Number of output channels. In case of contradiction between | ||
| 365 | * this field and the channelMode field, the channelMode field | ||
| 366 | * overrides. | ||
| 367 | * @sample_rate: Audio sample rate of input data | ||
| 368 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders | ||
| 369 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. | ||
| 370 | * Encoders may rely on profiles for quality levels. | ||
| 371 | * May be ignored by decoders. | ||
| 372 | * @profile: Mandatory for encoders, can be mandatory for specific | ||
| 373 | * decoders as well. See SND_AUDIOPROFILE defines. | ||
| 374 | * @level: Supported level (Only used by WMA at the moment) | ||
| 375 | * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines | ||
| 376 | * @format: Format of encoded bistream. Mandatory when defined. | ||
| 377 | * See SND_AUDIOSTREAMFORMAT defines. | ||
| 378 | * @align: Block alignment in bytes of an audio sample. | ||
| 379 | * Only required for PCM or IEC formats. | ||
| 380 | * @options: encoder-specific settings | ||
| 381 | * @reserved: reserved for future use | ||
| 382 | */ | ||
| 383 | |||
| 384 | struct snd_codec { | ||
| 385 | __u32 id; | ||
| 386 | __u32 ch_in; | ||
| 387 | __u32 ch_out; | ||
| 388 | __u32 sample_rate; | ||
| 389 | __u32 bit_rate; | ||
| 390 | __u32 rate_control; | ||
| 391 | __u32 profile; | ||
| 392 | __u32 level; | ||
| 393 | __u32 ch_mode; | ||
| 394 | __u32 format; | ||
| 395 | __u32 align; | ||
| 396 | union snd_codec_options options; | ||
| 397 | __u32 reserved[3]; | ||
| 398 | }; | ||
| 399 | |||
| 400 | #endif | ||
diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h new file mode 100644 index 000000000000..d1bbaf78457a --- /dev/null +++ b/include/uapi/sound/emu10k1.h | |||
| @@ -0,0 +1,373 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, | ||
| 3 | * Creative Labs, Inc. | ||
| 4 | * Definitions for EMU10K1 (SB Live!) chips | ||
| 5 | * | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | #ifndef _UAPI__SOUND_EMU10K1_H | ||
| 23 | #define _UAPI__SOUND_EMU10K1_H | ||
| 24 | |||
| 25 | #include <linux/types.h> | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * ---- FX8010 ---- | ||
| 31 | */ | ||
| 32 | |||
| 33 | #define EMU10K1_CARD_CREATIVE 0x00000000 | ||
| 34 | #define EMU10K1_CARD_EMUAPS 0x00000001 | ||
| 35 | |||
| 36 | #define EMU10K1_FX8010_PCM_COUNT 8 | ||
| 37 | |||
| 38 | /* instruction set */ | ||
| 39 | #define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */ | ||
| 40 | #define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ | ||
| 41 | #define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */ | ||
| 42 | #define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */ | ||
| 43 | #define iMACINT0 0x04 /* R = A + X * Y ; saturation */ | ||
| 44 | #define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */ | ||
| 45 | #define iACC3 0x06 /* R = A + X + Y ; saturation */ | ||
| 46 | #define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */ | ||
| 47 | #define iANDXOR 0x08 /* R = (A & X) ^ Y */ | ||
| 48 | #define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */ | ||
| 49 | #define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */ | ||
| 50 | #define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */ | ||
| 51 | #define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */ | ||
| 52 | #define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */ | ||
| 53 | #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ | ||
| 54 | #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ | ||
| 55 | |||
| 56 | /* GPRs */ | ||
| 57 | #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ | ||
| 58 | #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ | ||
| 59 | #define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */ | ||
| 60 | #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ | ||
| 61 | /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ | ||
| 62 | |||
| 63 | #define C_00000000 0x40 | ||
| 64 | #define C_00000001 0x41 | ||
| 65 | #define C_00000002 0x42 | ||
| 66 | #define C_00000003 0x43 | ||
| 67 | #define C_00000004 0x44 | ||
| 68 | #define C_00000008 0x45 | ||
| 69 | #define C_00000010 0x46 | ||
| 70 | #define C_00000020 0x47 | ||
| 71 | #define C_00000100 0x48 | ||
| 72 | #define C_00010000 0x49 | ||
| 73 | #define C_00080000 0x4a | ||
| 74 | #define C_10000000 0x4b | ||
| 75 | #define C_20000000 0x4c | ||
| 76 | #define C_40000000 0x4d | ||
| 77 | #define C_80000000 0x4e | ||
| 78 | #define C_7fffffff 0x4f | ||
| 79 | #define C_ffffffff 0x50 | ||
| 80 | #define C_fffffffe 0x51 | ||
| 81 | #define C_c0000000 0x52 | ||
| 82 | #define C_4f1bbcdc 0x53 | ||
| 83 | #define C_5a7ef9db 0x54 | ||
| 84 | #define C_00100000 0x55 /* ?? */ | ||
| 85 | #define GPR_ACCU 0x56 /* ACCUM, accumulator */ | ||
| 86 | #define GPR_COND 0x57 /* CCR, condition register */ | ||
| 87 | #define GPR_NOISE0 0x58 /* noise source */ | ||
| 88 | #define GPR_NOISE1 0x59 /* noise source */ | ||
| 89 | #define GPR_IRQ 0x5a /* IRQ register */ | ||
| 90 | #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ | ||
| 91 | #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ | ||
| 92 | #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | ||
| 93 | #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | ||
| 94 | #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | ||
| 95 | #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | ||
| 96 | |||
| 97 | #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
| 98 | #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
| 99 | #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
| 100 | #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
| 101 | #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
| 102 | #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
| 103 | |||
| 104 | #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ | ||
| 105 | #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ | ||
| 106 | #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ | ||
| 107 | #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ | ||
| 108 | #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ | ||
| 109 | #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ | ||
| 110 | #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ | ||
| 111 | #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */ | ||
| 112 | #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */ | ||
| 113 | #define A_GPR(x) (A_FXGPREGBASE + (x)) | ||
| 114 | |||
| 115 | /* cc_reg constants */ | ||
| 116 | #define CC_REG_NORMALIZED C_00000001 | ||
| 117 | #define CC_REG_BORROW C_00000002 | ||
| 118 | #define CC_REG_MINUS C_00000004 | ||
| 119 | #define CC_REG_ZERO C_00000008 | ||
| 120 | #define CC_REG_SATURATE C_00000010 | ||
| 121 | #define CC_REG_NONZERO C_00000100 | ||
| 122 | |||
| 123 | /* FX buses */ | ||
| 124 | #define FXBUS_PCM_LEFT 0x00 | ||
| 125 | #define FXBUS_PCM_RIGHT 0x01 | ||
| 126 | #define FXBUS_PCM_LEFT_REAR 0x02 | ||
| 127 | #define FXBUS_PCM_RIGHT_REAR 0x03 | ||
| 128 | #define FXBUS_MIDI_LEFT 0x04 | ||
| 129 | #define FXBUS_MIDI_RIGHT 0x05 | ||
| 130 | #define FXBUS_PCM_CENTER 0x06 | ||
| 131 | #define FXBUS_PCM_LFE 0x07 | ||
| 132 | #define FXBUS_PCM_LEFT_FRONT 0x08 | ||
| 133 | #define FXBUS_PCM_RIGHT_FRONT 0x09 | ||
| 134 | #define FXBUS_MIDI_REVERB 0x0c | ||
| 135 | #define FXBUS_MIDI_CHORUS 0x0d | ||
| 136 | #define FXBUS_PCM_LEFT_SIDE 0x0e | ||
| 137 | #define FXBUS_PCM_RIGHT_SIDE 0x0f | ||
| 138 | #define FXBUS_PT_LEFT 0x14 | ||
| 139 | #define FXBUS_PT_RIGHT 0x15 | ||
| 140 | |||
| 141 | /* Inputs */ | ||
| 142 | #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ | ||
| 143 | #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ | ||
| 144 | #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ | ||
| 145 | #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ | ||
| 146 | #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ | ||
| 147 | #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ | ||
| 148 | #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ | ||
| 149 | #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ | ||
| 150 | #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ | ||
| 151 | #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ | ||
| 152 | #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ | ||
| 153 | #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ | ||
| 154 | #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ | ||
| 155 | #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ | ||
| 156 | |||
| 157 | /* Outputs */ | ||
| 158 | #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ | ||
| 159 | #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ | ||
| 160 | #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ | ||
| 161 | #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ | ||
| 162 | #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ | ||
| 163 | #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ | ||
| 164 | #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ | ||
| 165 | #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ | ||
| 166 | #define EXTOUT_REAR_L 0x08 /* Rear channel - left */ | ||
| 167 | #define EXTOUT_REAR_R 0x09 /* Rear channel - right */ | ||
| 168 | #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ | ||
| 169 | #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ | ||
| 170 | #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ | ||
| 171 | #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ | ||
| 172 | #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ | ||
| 173 | #define EXTOUT_ACENTER 0x11 /* Analog Center */ | ||
| 174 | #define EXTOUT_ALFE 0x12 /* Analog LFE */ | ||
| 175 | |||
| 176 | /* Audigy Inputs */ | ||
| 177 | #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ | ||
| 178 | #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ | ||
| 179 | #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ | ||
| 180 | #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ | ||
| 181 | #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ | ||
| 182 | #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ | ||
| 183 | #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ | ||
| 184 | #define A_EXTIN_LINE2_R 0x09 /* right */ | ||
| 185 | #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */ | ||
| 186 | #define A_EXTIN_ADC_R 0x0b /* right */ | ||
| 187 | #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ | ||
| 188 | #define A_EXTIN_AUX2_R 0x0d /* - right */ | ||
| 189 | |||
| 190 | /* Audigiy Outputs */ | ||
| 191 | #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ | ||
| 192 | #define A_EXTOUT_FRONT_R 0x01 /* right */ | ||
| 193 | #define A_EXTOUT_CENTER 0x02 /* digital front center */ | ||
| 194 | #define A_EXTOUT_LFE 0x03 /* digital front lfe */ | ||
| 195 | #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ | ||
| 196 | #define A_EXTOUT_HEADPHONE_R 0x05 /* right */ | ||
| 197 | #define A_EXTOUT_REAR_L 0x06 /* digital rear left */ | ||
| 198 | #define A_EXTOUT_REAR_R 0x07 /* right */ | ||
| 199 | #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ | ||
| 200 | #define A_EXTOUT_AFRONT_R 0x09 /* right */ | ||
| 201 | #define A_EXTOUT_ACENTER 0x0a /* analog center */ | ||
| 202 | #define A_EXTOUT_ALFE 0x0b /* analog LFE */ | ||
| 203 | #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ | ||
| 204 | #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ | ||
| 205 | #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ | ||
| 206 | #define A_EXTOUT_AREAR_R 0x0f /* right */ | ||
| 207 | #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ | ||
| 208 | #define A_EXTOUT_AC97_R 0x11 /* right */ | ||
| 209 | #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ | ||
| 210 | #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ | ||
| 211 | #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ | ||
| 212 | |||
| 213 | /* Audigy constants */ | ||
| 214 | #define A_C_00000000 0xc0 | ||
| 215 | #define A_C_00000001 0xc1 | ||
| 216 | #define A_C_00000002 0xc2 | ||
| 217 | #define A_C_00000003 0xc3 | ||
| 218 | #define A_C_00000004 0xc4 | ||
| 219 | #define A_C_00000008 0xc5 | ||
| 220 | #define A_C_00000010 0xc6 | ||
| 221 | #define A_C_00000020 0xc7 | ||
| 222 | #define A_C_00000100 0xc8 | ||
| 223 | #define A_C_00010000 0xc9 | ||
| 224 | #define A_C_00000800 0xca | ||
| 225 | #define A_C_10000000 0xcb | ||
| 226 | #define A_C_20000000 0xcc | ||
| 227 | #define A_C_40000000 0xcd | ||
| 228 | #define A_C_80000000 0xce | ||
| 229 | #define A_C_7fffffff 0xcf | ||
| 230 | #define A_C_ffffffff 0xd0 | ||
| 231 | #define A_C_fffffffe 0xd1 | ||
| 232 | #define A_C_c0000000 0xd2 | ||
| 233 | #define A_C_4f1bbcdc 0xd3 | ||
| 234 | #define A_C_5a7ef9db 0xd4 | ||
| 235 | #define A_C_00100000 0xd5 | ||
| 236 | #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ | ||
| 237 | #define A_GPR_COND 0xd7 /* CCR, condition register */ | ||
| 238 | #define A_GPR_NOISE0 0xd8 /* noise source */ | ||
| 239 | #define A_GPR_NOISE1 0xd9 /* noise source */ | ||
| 240 | #define A_GPR_IRQ 0xda /* IRQ register */ | ||
| 241 | #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ | ||
| 242 | #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ | ||
| 243 | |||
| 244 | /* definitions for debug register */ | ||
| 245 | #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ | ||
| 246 | #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ | ||
| 247 | #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ | ||
| 248 | #define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */ | ||
| 249 | #define EMU10K1_DBG_STEP 0x00004000 /* start single step */ | ||
| 250 | #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ | ||
| 251 | #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ | ||
| 252 | |||
| 253 | /* tank memory address line */ | ||
| 254 | #ifndef __KERNEL__ | ||
| 255 | #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ | ||
| 256 | #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ | ||
| 257 | #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ | ||
| 258 | #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ | ||
| 259 | #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ | ||
| 260 | #endif | ||
| 261 | |||
| 262 | struct snd_emu10k1_fx8010_info { | ||
| 263 | unsigned int internal_tram_size; /* in samples */ | ||
| 264 | unsigned int external_tram_size; /* in samples */ | ||
| 265 | char fxbus_names[16][32]; /* names of FXBUSes */ | ||
| 266 | char extin_names[16][32]; /* names of external inputs */ | ||
| 267 | char extout_names[32][32]; /* names of external outputs */ | ||
| 268 | unsigned int gpr_controls; /* count of GPR controls */ | ||
| 269 | }; | ||
| 270 | |||
| 271 | #define EMU10K1_GPR_TRANSLATION_NONE 0 | ||
| 272 | #define EMU10K1_GPR_TRANSLATION_TABLE100 1 | ||
| 273 | #define EMU10K1_GPR_TRANSLATION_BASS 2 | ||
| 274 | #define EMU10K1_GPR_TRANSLATION_TREBLE 3 | ||
| 275 | #define EMU10K1_GPR_TRANSLATION_ONOFF 4 | ||
| 276 | |||
| 277 | struct snd_emu10k1_fx8010_control_gpr { | ||
| 278 | struct snd_ctl_elem_id id; /* full control ID definition */ | ||
| 279 | unsigned int vcount; /* visible count */ | ||
| 280 | unsigned int count; /* count of GPR (1..16) */ | ||
| 281 | unsigned short gpr[32]; /* GPR number(s) */ | ||
| 282 | unsigned int value[32]; /* initial values */ | ||
| 283 | unsigned int min; /* minimum range */ | ||
| 284 | unsigned int max; /* maximum range */ | ||
| 285 | unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ | ||
| 286 | const unsigned int *tlv; | ||
| 287 | }; | ||
| 288 | |||
| 289 | /* old ABI without TLV support */ | ||
| 290 | struct snd_emu10k1_fx8010_control_old_gpr { | ||
| 291 | struct snd_ctl_elem_id id; | ||
| 292 | unsigned int vcount; | ||
| 293 | unsigned int count; | ||
| 294 | unsigned short gpr[32]; | ||
| 295 | unsigned int value[32]; | ||
| 296 | unsigned int min; | ||
| 297 | unsigned int max; | ||
| 298 | unsigned int translation; | ||
| 299 | }; | ||
| 300 | |||
| 301 | struct snd_emu10k1_fx8010_code { | ||
| 302 | char name[128]; | ||
| 303 | |||
| 304 | DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ | ||
| 305 | __u32 __user *gpr_map; /* initializers */ | ||
| 306 | |||
| 307 | unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ | ||
| 308 | struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */ | ||
| 309 | |||
| 310 | unsigned int gpr_del_control_count; /* count of GPR controls to remove */ | ||
| 311 | struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */ | ||
| 312 | |||
| 313 | unsigned int gpr_list_control_count; /* count of GPR controls to list */ | ||
| 314 | unsigned int gpr_list_control_total; /* total count of GPR controls */ | ||
| 315 | struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */ | ||
| 316 | |||
| 317 | DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ | ||
| 318 | __u32 __user *tram_data_map; /* data initializers */ | ||
| 319 | __u32 __user *tram_addr_map; /* map initializers */ | ||
| 320 | |||
| 321 | DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ | ||
| 322 | __u32 __user *code; /* one instruction - 64 bits */ | ||
| 323 | }; | ||
| 324 | |||
| 325 | struct snd_emu10k1_fx8010_tram { | ||
| 326 | unsigned int address; /* 31.bit == 1 -> external TRAM */ | ||
| 327 | unsigned int size; /* size in samples (4 bytes) */ | ||
| 328 | unsigned int *samples; /* pointer to samples (20-bit) */ | ||
| 329 | /* NULL->clear memory */ | ||
| 330 | }; | ||
| 331 | |||
| 332 | struct snd_emu10k1_fx8010_pcm_rec { | ||
| 333 | unsigned int substream; /* substream number */ | ||
| 334 | unsigned int res1; /* reserved */ | ||
| 335 | unsigned int channels; /* 16-bit channels count, zero = remove this substream */ | ||
| 336 | unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ | ||
| 337 | unsigned int buffer_size; /* count of buffered samples */ | ||
| 338 | unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ | ||
| 339 | unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ | ||
| 340 | unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ | ||
| 341 | unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ | ||
| 342 | unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ | ||
| 343 | unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ | ||
| 344 | unsigned char pad; /* reserved */ | ||
| 345 | unsigned char etram[32]; /* external TRAM address & data (one per channel) */ | ||
| 346 | unsigned int res2; /* reserved */ | ||
| 347 | }; | ||
| 348 | |||
| 349 | #define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) | ||
| 350 | |||
| 351 | #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) | ||
| 352 | #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) | ||
| 353 | #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) | ||
| 354 | #define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) | ||
| 355 | #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram) | ||
| 356 | #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) | ||
| 357 | #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) | ||
| 358 | #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) | ||
| 359 | #define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int) | ||
| 360 | #define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) | ||
| 361 | #define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) | ||
| 362 | #define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) | ||
| 363 | #define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) | ||
| 364 | #define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) | ||
| 365 | |||
| 366 | /* typedefs for compatibility to user-space */ | ||
| 367 | typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t; | ||
| 368 | typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t; | ||
| 369 | typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t; | ||
| 370 | typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t; | ||
| 371 | typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t; | ||
| 372 | |||
| 373 | #endif /* _UAPI__SOUND_EMU10K1_H */ | ||
diff --git a/include/uapi/sound/hdsp.h b/include/uapi/sound/hdsp.h new file mode 100644 index 000000000000..0909a3843479 --- /dev/null +++ b/include/uapi/sound/hdsp.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | #ifndef __SOUND_HDSP_H | ||
| 2 | #define __SOUND_HDSP_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org) | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 24 | #define HDSP_MATRIX_MIXER_SIZE 2048 | ||
| 25 | |||
| 26 | enum HDSP_IO_Type { | ||
| 27 | Digiface, | ||
| 28 | Multiface, | ||
| 29 | H9652, | ||
| 30 | H9632, | ||
| 31 | RPM, | ||
| 32 | Undefined, | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct hdsp_peak_rms { | ||
| 36 | __u32 input_peaks[26]; | ||
| 37 | __u32 playback_peaks[26]; | ||
| 38 | __u32 output_peaks[28]; | ||
| 39 | __u64 input_rms[26]; | ||
| 40 | __u64 playback_rms[26]; | ||
| 41 | /* These are only used for H96xx cards */ | ||
| 42 | __u64 output_rms[26]; | ||
| 43 | }; | ||
| 44 | |||
| 45 | #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms) | ||
| 46 | |||
| 47 | struct hdsp_config_info { | ||
| 48 | unsigned char pref_sync_ref; | ||
| 49 | unsigned char wordclock_sync_check; | ||
| 50 | unsigned char spdif_sync_check; | ||
| 51 | unsigned char adatsync_sync_check; | ||
| 52 | unsigned char adat_sync_check[3]; | ||
| 53 | unsigned char spdif_in; | ||
| 54 | unsigned char spdif_out; | ||
| 55 | unsigned char spdif_professional; | ||
| 56 | unsigned char spdif_emphasis; | ||
| 57 | unsigned char spdif_nonaudio; | ||
| 58 | unsigned int spdif_sample_rate; | ||
| 59 | unsigned int system_sample_rate; | ||
| 60 | unsigned int autosync_sample_rate; | ||
| 61 | unsigned char system_clock_mode; | ||
| 62 | unsigned char clock_source; | ||
| 63 | unsigned char autosync_ref; | ||
| 64 | unsigned char line_out; | ||
| 65 | unsigned char passthru; | ||
| 66 | unsigned char da_gain; | ||
| 67 | unsigned char ad_gain; | ||
| 68 | unsigned char phone_gain; | ||
| 69 | unsigned char xlr_breakout_cable; | ||
| 70 | unsigned char analog_extension_board; | ||
| 71 | }; | ||
| 72 | |||
| 73 | #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info) | ||
| 74 | |||
| 75 | struct hdsp_firmware { | ||
| 76 | void __user *firmware_data; /* 24413 x 4 bytes */ | ||
| 77 | }; | ||
| 78 | |||
| 79 | #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware) | ||
| 80 | |||
| 81 | struct hdsp_version { | ||
| 82 | enum HDSP_IO_Type io_type; | ||
| 83 | unsigned short firmware_rev; | ||
| 84 | }; | ||
| 85 | |||
| 86 | #define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version) | ||
| 87 | |||
| 88 | struct hdsp_mixer { | ||
| 89 | unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; | ||
| 90 | }; | ||
| 91 | |||
| 92 | #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer) | ||
| 93 | |||
| 94 | struct hdsp_9632_aeb { | ||
| 95 | int aebi; | ||
| 96 | int aebo; | ||
| 97 | }; | ||
| 98 | |||
| 99 | #define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb) | ||
| 100 | |||
| 101 | /* typedefs for compatibility to user-space */ | ||
| 102 | typedef enum HDSP_IO_Type HDSP_IO_Type; | ||
| 103 | typedef struct hdsp_peak_rms hdsp_peak_rms_t; | ||
| 104 | typedef struct hdsp_config_info hdsp_config_info_t; | ||
| 105 | typedef struct hdsp_firmware hdsp_firmware_t; | ||
| 106 | typedef struct hdsp_version hdsp_version_t; | ||
| 107 | typedef struct hdsp_mixer hdsp_mixer_t; | ||
| 108 | typedef struct hdsp_9632_aeb hdsp_9632_aeb_t; | ||
| 109 | |||
| 110 | #endif /* __SOUND_HDSP_H */ | ||
diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h new file mode 100644 index 000000000000..1f59ea2a4a76 --- /dev/null +++ b/include/uapi/sound/hdspm.h | |||
| @@ -0,0 +1,229 @@ | |||
| 1 | #ifndef __SOUND_HDSPM_H | ||
| 2 | #define __SOUND_HDSPM_H | ||
| 3 | /* | ||
| 4 | * Copyright (C) 2003 Winfried Ritsch (IEM) | ||
| 5 | * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) | ||
| 6 | * | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 21 | */ | ||
| 22 | |||
| 23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ | ||
| 24 | #define HDSPM_MAX_CHANNELS 64 | ||
| 25 | |||
| 26 | enum hdspm_io_type { | ||
| 27 | MADI, | ||
| 28 | MADIface, | ||
| 29 | AIO, | ||
| 30 | AES32, | ||
| 31 | RayDAT | ||
| 32 | }; | ||
| 33 | |||
| 34 | enum hdspm_speed { | ||
| 35 | ss, | ||
| 36 | ds, | ||
| 37 | qs | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* -------------------- IOCTL Peak/RMS Meters -------------------- */ | ||
| 41 | |||
| 42 | struct hdspm_peak_rms { | ||
| 43 | uint32_t input_peaks[64]; | ||
| 44 | uint32_t playback_peaks[64]; | ||
| 45 | uint32_t output_peaks[64]; | ||
| 46 | |||
| 47 | uint64_t input_rms[64]; | ||
| 48 | uint64_t playback_rms[64]; | ||
| 49 | uint64_t output_rms[64]; | ||
| 50 | |||
| 51 | uint8_t speed; /* enum {ss, ds, qs} */ | ||
| 52 | int status2; | ||
| 53 | }; | ||
| 54 | |||
| 55 | #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ | ||
| 56 | _IOR('H', 0x42, struct hdspm_peak_rms) | ||
| 57 | |||
| 58 | /* ------------ CONFIG block IOCTL ---------------------- */ | ||
| 59 | |||
| 60 | struct hdspm_config { | ||
| 61 | unsigned char pref_sync_ref; | ||
| 62 | unsigned char wordclock_sync_check; | ||
| 63 | unsigned char madi_sync_check; | ||
| 64 | unsigned int system_sample_rate; | ||
| 65 | unsigned int autosync_sample_rate; | ||
| 66 | unsigned char system_clock_mode; | ||
| 67 | unsigned char clock_source; | ||
| 68 | unsigned char autosync_ref; | ||
| 69 | unsigned char line_out; | ||
| 70 | unsigned int passthru; | ||
| 71 | unsigned int analog_out; | ||
| 72 | }; | ||
| 73 | |||
| 74 | #define SNDRV_HDSPM_IOCTL_GET_CONFIG \ | ||
| 75 | _IOR('H', 0x41, struct hdspm_config) | ||
| 76 | |||
| 77 | /** | ||
| 78 | * If there's a TCO (TimeCode Option) board installed, | ||
| 79 | * there are further options and status data available. | ||
| 80 | * The hdspm_ltc structure contains the current SMPTE | ||
| 81 | * timecode and some status information and can be | ||
| 82 | * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the | ||
| 83 | * hdspm_status struct. | ||
| 84 | **/ | ||
| 85 | |||
| 86 | enum hdspm_ltc_format { | ||
| 87 | format_invalid, | ||
| 88 | fps_24, | ||
| 89 | fps_25, | ||
| 90 | fps_2997, | ||
| 91 | fps_30 | ||
| 92 | }; | ||
| 93 | |||
| 94 | enum hdspm_ltc_frame { | ||
| 95 | frame_invalid, | ||
| 96 | drop_frame, | ||
| 97 | full_frame | ||
| 98 | }; | ||
| 99 | |||
| 100 | enum hdspm_ltc_input_format { | ||
| 101 | ntsc, | ||
| 102 | pal, | ||
| 103 | no_video | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct hdspm_ltc { | ||
| 107 | unsigned int ltc; | ||
| 108 | |||
| 109 | enum hdspm_ltc_format format; | ||
| 110 | enum hdspm_ltc_frame frame; | ||
| 111 | enum hdspm_ltc_input_format input_format; | ||
| 112 | }; | ||
| 113 | |||
| 114 | #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl) | ||
| 115 | |||
| 116 | /** | ||
| 117 | * The status data reflects the device's current state | ||
| 118 | * as determined by the card's configuration and | ||
| 119 | * connection status. | ||
| 120 | **/ | ||
| 121 | |||
| 122 | enum hdspm_sync { | ||
| 123 | hdspm_sync_no_lock = 0, | ||
| 124 | hdspm_sync_lock = 1, | ||
| 125 | hdspm_sync_sync = 2 | ||
| 126 | }; | ||
| 127 | |||
| 128 | enum hdspm_madi_input { | ||
| 129 | hdspm_input_optical = 0, | ||
| 130 | hdspm_input_coax = 1 | ||
| 131 | }; | ||
| 132 | |||
| 133 | enum hdspm_madi_channel_format { | ||
| 134 | hdspm_format_ch_64 = 0, | ||
| 135 | hdspm_format_ch_56 = 1 | ||
| 136 | }; | ||
| 137 | |||
| 138 | enum hdspm_madi_frame_format { | ||
| 139 | hdspm_frame_48 = 0, | ||
| 140 | hdspm_frame_96 = 1 | ||
| 141 | }; | ||
| 142 | |||
| 143 | enum hdspm_syncsource { | ||
| 144 | syncsource_wc = 0, | ||
| 145 | syncsource_madi = 1, | ||
| 146 | syncsource_tco = 2, | ||
| 147 | syncsource_sync = 3, | ||
| 148 | syncsource_none = 4 | ||
| 149 | }; | ||
| 150 | |||
| 151 | struct hdspm_status { | ||
| 152 | uint8_t card_type; /* enum hdspm_io_type */ | ||
| 153 | enum hdspm_syncsource autosync_source; | ||
| 154 | |||
| 155 | uint64_t card_clock; | ||
| 156 | uint32_t master_period; | ||
| 157 | |||
| 158 | union { | ||
| 159 | struct { | ||
| 160 | uint8_t sync_wc; /* enum hdspm_sync */ | ||
| 161 | uint8_t sync_madi; /* enum hdspm_sync */ | ||
| 162 | uint8_t sync_tco; /* enum hdspm_sync */ | ||
| 163 | uint8_t sync_in; /* enum hdspm_sync */ | ||
| 164 | uint8_t madi_input; /* enum hdspm_madi_input */ | ||
| 165 | uint8_t channel_format; /* enum hdspm_madi_channel_format */ | ||
| 166 | uint8_t frame_format; /* enum hdspm_madi_frame_format */ | ||
| 167 | } madi; | ||
| 168 | } card_specific; | ||
| 169 | }; | ||
| 170 | |||
| 171 | #define SNDRV_HDSPM_IOCTL_GET_STATUS \ | ||
| 172 | _IOR('H', 0x47, struct hdspm_status) | ||
| 173 | |||
| 174 | /** | ||
| 175 | * Get information about the card and its add-ons. | ||
| 176 | **/ | ||
| 177 | |||
| 178 | #define HDSPM_ADDON_TCO 1 | ||
| 179 | |||
| 180 | struct hdspm_version { | ||
| 181 | uint8_t card_type; /* enum hdspm_io_type */ | ||
| 182 | char cardname[20]; | ||
| 183 | unsigned int serial; | ||
| 184 | unsigned short firmware_rev; | ||
| 185 | int addons; | ||
| 186 | }; | ||
| 187 | |||
| 188 | #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version) | ||
| 189 | |||
| 190 | /* ------------- get Matrix Mixer IOCTL --------------- */ | ||
| 191 | |||
| 192 | /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = | ||
| 193 | * 32768 Bytes | ||
| 194 | */ | ||
| 195 | |||
| 196 | /* organisation is 64 channelfader in a continuous memory block */ | ||
| 197 | /* equivalent to hardware definition, maybe for future feature of mmap of | ||
| 198 | * them | ||
| 199 | */ | ||
| 200 | /* each of 64 outputs has 64 infader and 64 outfader: | ||
| 201 | Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ | ||
| 202 | |||
| 203 | #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS | ||
| 204 | |||
| 205 | struct hdspm_channelfader { | ||
| 206 | unsigned int in[HDSPM_MIXER_CHANNELS]; | ||
| 207 | unsigned int pb[HDSPM_MIXER_CHANNELS]; | ||
| 208 | }; | ||
| 209 | |||
| 210 | struct hdspm_mixer { | ||
| 211 | struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS]; | ||
| 212 | }; | ||
| 213 | |||
| 214 | struct hdspm_mixer_ioctl { | ||
| 215 | struct hdspm_mixer *mixer; | ||
| 216 | }; | ||
| 217 | |||
| 218 | /* use indirect access due to the limit of ioctl bit size */ | ||
| 219 | #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl) | ||
| 220 | |||
| 221 | /* typedefs for compatibility to user-space */ | ||
| 222 | typedef struct hdspm_peak_rms hdspm_peak_rms_t; | ||
| 223 | typedef struct hdspm_config_info hdspm_config_info_t; | ||
| 224 | typedef struct hdspm_version hdspm_version_t; | ||
| 225 | typedef struct hdspm_channelfader snd_hdspm_channelfader_t; | ||
| 226 | typedef struct hdspm_mixer hdspm_mixer_t; | ||
| 227 | |||
| 228 | |||
| 229 | #endif | ||
diff --git a/include/uapi/sound/sb16_csp.h b/include/uapi/sound/sb16_csp.h new file mode 100644 index 000000000000..3b96907e2afb --- /dev/null +++ b/include/uapi/sound/sb16_csp.h | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> | ||
| 3 | * Takashi Iwai <tiwai@suse.de> | ||
| 4 | * | ||
| 5 | * SB16ASP/AWE32 CSP control | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | #ifndef _UAPI__SOUND_SB16_CSP_H | ||
| 23 | #define _UAPI__SOUND_SB16_CSP_H | ||
| 24 | |||
| 25 | |||
| 26 | /* CSP modes */ | ||
| 27 | #define SNDRV_SB_CSP_MODE_NONE 0x00 | ||
| 28 | #define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */ | ||
| 29 | #define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */ | ||
| 30 | #define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */ | ||
| 31 | |||
| 32 | /* CSP load flags */ | ||
| 33 | #define SNDRV_SB_CSP_LOAD_FROMUSER 0x01 | ||
| 34 | #define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02 | ||
| 35 | |||
| 36 | /* CSP sample width */ | ||
| 37 | #define SNDRV_SB_CSP_SAMPLE_8BIT 0x01 | ||
| 38 | #define SNDRV_SB_CSP_SAMPLE_16BIT 0x02 | ||
| 39 | |||
| 40 | /* CSP channels */ | ||
| 41 | #define SNDRV_SB_CSP_MONO 0x01 | ||
| 42 | #define SNDRV_SB_CSP_STEREO 0x02 | ||
| 43 | |||
| 44 | /* CSP rates */ | ||
| 45 | #define SNDRV_SB_CSP_RATE_8000 0x01 | ||
| 46 | #define SNDRV_SB_CSP_RATE_11025 0x02 | ||
| 47 | #define SNDRV_SB_CSP_RATE_22050 0x04 | ||
| 48 | #define SNDRV_SB_CSP_RATE_44100 0x08 | ||
| 49 | #define SNDRV_SB_CSP_RATE_ALL 0x0f | ||
| 50 | |||
| 51 | /* CSP running state */ | ||
| 52 | #define SNDRV_SB_CSP_ST_IDLE 0x00 | ||
| 53 | #define SNDRV_SB_CSP_ST_LOADED 0x01 | ||
| 54 | #define SNDRV_SB_CSP_ST_RUNNING 0x02 | ||
| 55 | #define SNDRV_SB_CSP_ST_PAUSED 0x04 | ||
| 56 | #define SNDRV_SB_CSP_ST_AUTO 0x08 | ||
| 57 | #define SNDRV_SB_CSP_ST_QSOUND 0x10 | ||
| 58 | |||
| 59 | /* maximum QSound value (180 degrees right) */ | ||
| 60 | #define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20 | ||
| 61 | |||
| 62 | /* maximum microcode RIFF file size */ | ||
| 63 | #define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 | ||
| 64 | |||
| 65 | /* microcode header */ | ||
| 66 | struct snd_sb_csp_mc_header { | ||
| 67 | char codec_name[16]; /* id name of codec */ | ||
| 68 | unsigned short func_req; /* requested function */ | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* microcode to be loaded */ | ||
| 72 | struct snd_sb_csp_microcode { | ||
| 73 | struct snd_sb_csp_mc_header info; | ||
| 74 | unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* start CSP with sample_width in mono/stereo */ | ||
| 78 | struct snd_sb_csp_start { | ||
| 79 | int sample_width; /* sample width, look above */ | ||
| 80 | int channels; /* channels, look above */ | ||
| 81 | }; | ||
| 82 | |||
| 83 | /* CSP information */ | ||
| 84 | struct snd_sb_csp_info { | ||
| 85 | char codec_name[16]; /* id name of codec */ | ||
| 86 | unsigned short func_nr; /* function number */ | ||
| 87 | unsigned int acc_format; /* accepted PCM formats */ | ||
| 88 | unsigned short acc_channels; /* accepted channels */ | ||
| 89 | unsigned short acc_width; /* accepted sample width */ | ||
| 90 | unsigned short acc_rates; /* accepted sample rates */ | ||
| 91 | unsigned short csp_mode; /* CSP mode, see above */ | ||
| 92 | unsigned short run_channels; /* current channels */ | ||
| 93 | unsigned short run_width; /* current sample width */ | ||
| 94 | unsigned short version; /* version id: 0x10 - 0x1f */ | ||
| 95 | unsigned short state; /* state bits */ | ||
| 96 | }; | ||
| 97 | |||
| 98 | /* HWDEP controls */ | ||
| 99 | /* get CSP information */ | ||
| 100 | #define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) | ||
| 101 | /* load microcode to CSP */ | ||
| 102 | /* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits) | ||
| 103 | * defined for some architectures like MIPS, and it leads to build errors. | ||
| 104 | * (x86 and co have 14-bit size, thus it's valid, though.) | ||
| 105 | * As a workaround for skipping the size-limit check, here we don't use the | ||
| 106 | * normal _IOW() macro but _IOC() with the manual argument. | ||
| 107 | */ | ||
| 108 | #define SNDRV_SB_CSP_IOCTL_LOAD_CODE \ | ||
| 109 | _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode)) | ||
| 110 | /* unload microcode from CSP */ | ||
| 111 | #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) | ||
| 112 | /* start CSP */ | ||
| 113 | #define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start) | ||
| 114 | /* stop CSP */ | ||
| 115 | #define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) | ||
| 116 | /* pause CSP and DMA transfer */ | ||
| 117 | #define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15) | ||
| 118 | /* restart CSP and DMA transfer */ | ||
| 119 | #define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) | ||
| 120 | |||
| 121 | |||
| 122 | #endif /* _UAPI__SOUND_SB16_CSP_H */ | ||
diff --git a/include/uapi/sound/sfnt_info.h b/include/uapi/sound/sfnt_info.h new file mode 100644 index 000000000000..1bce7fd1725f --- /dev/null +++ b/include/uapi/sound/sfnt_info.h | |||
| @@ -0,0 +1,212 @@ | |||
| 1 | #ifndef __SOUND_SFNT_INFO_H | ||
| 2 | #define __SOUND_SFNT_INFO_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Patch record compatible with AWE driver on OSS | ||
| 6 | * | ||
| 7 | * Copyright (C) 1999-2000 Takashi Iwai | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include <sound/asound.h> | ||
| 26 | |||
| 27 | /* | ||
| 28 | * patch information record | ||
| 29 | */ | ||
| 30 | |||
| 31 | #ifdef SNDRV_BIG_ENDIAN | ||
| 32 | #define SNDRV_OSS_PATCHKEY(id) (0xfd00|id) | ||
| 33 | #else | ||
| 34 | #define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd) | ||
| 35 | #endif | ||
| 36 | |||
| 37 | /* patch interface header: 16 bytes */ | ||
| 38 | struct soundfont_patch_info { | ||
| 39 | unsigned short key; /* use the key below */ | ||
| 40 | #define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) | ||
| 41 | |||
| 42 | short device_no; /* synthesizer number */ | ||
| 43 | unsigned short sf_id; /* file id (should be zero) */ | ||
| 44 | short optarg; /* optional argument */ | ||
| 45 | int len; /* data length (without this header) */ | ||
| 46 | |||
| 47 | short type; /* patch operation type */ | ||
| 48 | #define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */ | ||
| 49 | #define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */ | ||
| 50 | #define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */ | ||
| 51 | #define SNDRV_SFNT_CLOSE_PATCH 3 /* none */ | ||
| 52 | /* 4 is obsolete */ | ||
| 53 | #define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/ | ||
| 54 | #define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */ | ||
| 55 | /* 7 is not used */ | ||
| 56 | #define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */ | ||
| 57 | #define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */ | ||
| 58 | |||
| 59 | short reserved; /* word alignment data */ | ||
| 60 | |||
| 61 | /* the actual patch data begins after this */ | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | /* | ||
| 66 | * open patch | ||
| 67 | */ | ||
| 68 | |||
| 69 | #define SNDRV_SFNT_PATCH_NAME_LEN 32 | ||
| 70 | |||
| 71 | struct soundfont_open_parm { | ||
| 72 | unsigned short type; /* sample type */ | ||
| 73 | #define SNDRV_SFNT_PAT_TYPE_MISC 0 | ||
| 74 | #define SNDRV_SFNT_PAT_TYPE_GUS 6 | ||
| 75 | #define SNDRV_SFNT_PAT_TYPE_MAP 7 | ||
| 76 | #define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */ | ||
| 77 | #define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */ | ||
| 78 | |||
| 79 | short reserved; | ||
| 80 | char name[SNDRV_SFNT_PATCH_NAME_LEN]; | ||
| 81 | }; | ||
| 82 | |||
| 83 | |||
| 84 | /* | ||
| 85 | * raw voice information record | ||
| 86 | */ | ||
| 87 | |||
| 88 | /* wave table envelope & effect parameters to control EMU8000 */ | ||
| 89 | struct soundfont_voice_parm { | ||
| 90 | unsigned short moddelay; /* modulation delay (0x8000) */ | ||
| 91 | unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ | ||
| 92 | unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ | ||
| 93 | unsigned short modrelease; /* modulation release time (0x807f) */ | ||
| 94 | short modkeyhold, modkeydecay; /* envelope change per key (not used) */ | ||
| 95 | unsigned short voldelay; /* volume delay (0x8000) */ | ||
| 96 | unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */ | ||
| 97 | unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */ | ||
| 98 | unsigned short volrelease; /* volume release time (0x807f) */ | ||
| 99 | short volkeyhold, volkeydecay; /* envelope change per key (not used) */ | ||
| 100 | unsigned short lfo1delay; /* LFO1 delay (0x8000) */ | ||
| 101 | unsigned short lfo2delay; /* LFO2 delay (0x8000) */ | ||
| 102 | unsigned short pefe; /* modulation pitch & cutoff (0x0000) */ | ||
| 103 | unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */ | ||
| 104 | unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */ | ||
| 105 | unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */ | ||
| 106 | unsigned char cutoff; /* initial cutoff (0xff) */ | ||
| 107 | unsigned char filterQ; /* initial filter Q [0-15] (0x0) */ | ||
| 108 | unsigned char chorus; /* chorus send (0x00) */ | ||
| 109 | unsigned char reverb; /* reverb send (0x00) */ | ||
| 110 | unsigned short reserved[4]; /* not used */ | ||
| 111 | }; | ||
| 112 | |||
| 113 | |||
| 114 | /* wave table parameters: 92 bytes */ | ||
| 115 | struct soundfont_voice_info { | ||
| 116 | unsigned short sf_id; /* file id (should be zero) */ | ||
| 117 | unsigned short sample; /* sample id */ | ||
| 118 | int start, end; /* sample offset correction */ | ||
| 119 | int loopstart, loopend; /* loop offset correction */ | ||
| 120 | short rate_offset; /* sample rate pitch offset */ | ||
| 121 | unsigned short mode; /* sample mode */ | ||
| 122 | #define SNDRV_SFNT_MODE_ROMSOUND 0x8000 | ||
| 123 | #define SNDRV_SFNT_MODE_STEREO 1 | ||
| 124 | #define SNDRV_SFNT_MODE_LOOPING 2 | ||
| 125 | #define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */ | ||
| 126 | #define SNDRV_SFNT_MODE_INIT_PARM 8 | ||
| 127 | |||
| 128 | short root; /* midi root key */ | ||
| 129 | short tune; /* pitch tuning (in cents) */ | ||
| 130 | unsigned char low, high; /* key note range */ | ||
| 131 | unsigned char vellow, velhigh; /* velocity range */ | ||
| 132 | signed char fixkey, fixvel; /* fixed key, velocity */ | ||
| 133 | signed char pan, fixpan; /* panning, fixed panning */ | ||
| 134 | short exclusiveClass; /* exclusive class (0 = none) */ | ||
| 135 | unsigned char amplitude; /* sample volume (127 max) */ | ||
| 136 | unsigned char attenuation; /* attenuation (0.375dB) */ | ||
| 137 | short scaleTuning; /* pitch scale tuning(%), normally 100 */ | ||
| 138 | struct soundfont_voice_parm parm; /* voice envelope parameters */ | ||
| 139 | unsigned short sample_mode; /* sample mode_flag (set by driver) */ | ||
| 140 | }; | ||
| 141 | |||
| 142 | |||
| 143 | /* instrument info header: 4 bytes */ | ||
| 144 | struct soundfont_voice_rec_hdr { | ||
| 145 | unsigned char bank; /* midi bank number */ | ||
| 146 | unsigned char instr; /* midi preset number */ | ||
| 147 | char nvoices; /* number of voices */ | ||
| 148 | char write_mode; /* write mode; normally 0 */ | ||
| 149 | #define SNDRV_SFNT_WR_APPEND 0 /* append anyway */ | ||
| 150 | #define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ | ||
| 151 | #define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ | ||
| 152 | }; | ||
| 153 | |||
| 154 | |||
| 155 | /* | ||
| 156 | * sample wave information | ||
| 157 | */ | ||
| 158 | |||
| 159 | /* wave table sample header: 32 bytes */ | ||
| 160 | struct soundfont_sample_info { | ||
| 161 | unsigned short sf_id; /* file id (should be zero) */ | ||
| 162 | unsigned short sample; /* sample id */ | ||
| 163 | int start, end; /* start & end offset */ | ||
| 164 | int loopstart, loopend; /* loop start & end offset */ | ||
| 165 | int size; /* size (0 = ROM) */ | ||
| 166 | short dummy; /* not used */ | ||
| 167 | unsigned short mode_flags; /* mode flags */ | ||
| 168 | #define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */ | ||
| 169 | #define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */ | ||
| 170 | #define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */ | ||
| 171 | #define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */ | ||
| 172 | #define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */ | ||
| 173 | #define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */ | ||
| 174 | #define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ | ||
| 175 | #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ | ||
| 176 | unsigned int truesize; /* used memory size (set by driver) */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | |||
| 180 | /* | ||
| 181 | * voice preset mapping (aliasing) | ||
| 182 | */ | ||
| 183 | |||
| 184 | struct soundfont_voice_map { | ||
| 185 | int map_bank, map_instr, map_key; /* key = -1 means all keys */ | ||
| 186 | int src_bank, src_instr, src_key; | ||
| 187 | }; | ||
| 188 | |||
| 189 | |||
| 190 | /* | ||
| 191 | * ioctls for hwdep | ||
| 192 | */ | ||
| 193 | |||
| 194 | #define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable" | ||
| 195 | |||
| 196 | #define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ | ||
| 197 | |||
| 198 | struct snd_emux_misc_mode { | ||
| 199 | int port; /* -1 = all */ | ||
| 200 | int mode; | ||
| 201 | int value; | ||
| 202 | int value2; /* reserved */ | ||
| 203 | }; | ||
| 204 | |||
| 205 | #define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int) | ||
| 206 | #define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info) | ||
| 207 | #define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82) | ||
| 208 | #define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83) | ||
| 209 | #define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int) | ||
| 210 | #define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode) | ||
| 211 | |||
| 212 | #endif /* __SOUND_SFNT_INFO_H */ | ||
