1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2020 The FreeBSD Foundation 5 * 6 * This software was developed by Ka Ho Ng 7 * under sponsorship from the FreeBSD Foundation. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31 #ifndef _SYS_SNDSTAT_H_ 32 #define _SYS_SNDSTAT_H_ 33 34 #include <sys/types.h> 35 #ifndef _IOWR 36 #include <sys/ioccom.h> 37 #endif /* !_IOWR */ 38 39 struct sndstioc_nv_arg { 40 size_t nbytes; /* [IN/OUT] buffer size/number of bytes filled */ 41 void *buf; /* [OUT] buffer holding a packed nvlist */ 42 }; 43 44 /* 45 * Common name/value pair names 46 */ 47 #define SNDST_DSPS "dsps" 48 #define SNDST_DSPS_FROM_USER "from_user" 49 #define SNDST_DSPS_PCHAN "pchan" 50 #define SNDST_DSPS_RCHAN "rchan" 51 #define SNDST_DSPS_NAMEUNIT "nameunit" 52 #define SNDST_DSPS_DEVNODE "devnode" 53 #define SNDST_DSPS_DESC "desc" 54 #define SNDST_DSPS_PROVIDER "provider" 55 #define SNDST_DSPS_PROVIDER_INFO "provider_info" 56 57 /* 58 * Common name/value pair names for play/rec info 59 */ 60 #define SNDST_DSPS_INFO_PLAY "info_play" 61 #define SNDST_DSPS_INFO_REC "info_rec" 62 #define SNDST_DSPS_INFO_MIN_RATE "min_rate" 63 #define SNDST_DSPS_INFO_MAX_RATE "max_rate" 64 #define SNDST_DSPS_INFO_FORMATS "formats" 65 #define SNDST_DSPS_INFO_MIN_CHN "min_chn" 66 #define SNDST_DSPS_INFO_MAX_CHN "max_chn" 67 68 /* 69 * sound(4)-specific name/value pair names 70 */ 71 #define SNDST_DSPS_SOUND4_PROVIDER "sound(4)" 72 #define SNDST_DSPS_SOUND4_UNIT "unit" 73 #define SNDST_DSPS_SOUND4_STATUS "status" 74 #define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" 75 #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" 76 #define SNDST_DSPS_SOUND4_PVCHANRATE "pvchanrate" 77 #define SNDST_DSPS_SOUND4_PVCHANFORMAT "pvchanformat" 78 #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" 79 #define SNDST_DSPS_SOUND4_RVCHANRATE "rvchanrate" 80 #define SNDST_DSPS_SOUND4_RVCHANFORMAT "rvchanformat" 81 #define SNDST_DSPS_SOUND4_CHAN_INFO "channel_info" 82 #define SNDST_DSPS_SOUND4_CHAN_NAME "name" 83 #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" 84 #define SNDST_DSPS_SOUND4_CHAN_UNIT "unit" 85 #define SNDST_DSPS_SOUND4_CHAN_CAPS "caps" 86 #define SNDST_DSPS_SOUND4_CHAN_LATENCY "latency" 87 #define SNDST_DSPS_SOUND4_CHAN_RATE "rate" 88 #define SNDST_DSPS_SOUND4_CHAN_FORMAT "format" 89 #define SNDST_DSPS_SOUND4_CHAN_PID "pid" 90 #define SNDST_DSPS_SOUND4_CHAN_COMM "comm" 91 #define SNDST_DSPS_SOUND4_CHAN_INTR "interrupts" 92 #define SNDST_DSPS_SOUND4_CHAN_FEEDCNT "feedcount" 93 #define SNDST_DSPS_SOUND4_CHAN_XRUNS "xruns" 94 #define SNDST_DSPS_SOUND4_CHAN_LEFTVOL "left_volume" 95 #define SNDST_DSPS_SOUND4_CHAN_RIGHTVOL "right_volume" 96 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_FORMAT "hwbuf_format" 97 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_SIZE "hwbuf_size" 98 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_BLKSZ "hwbuf_blksz" 99 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_BLKCNT "hwbuf_blkcnt" 100 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_FREE "hwbuf_free" 101 #define SNDST_DSPS_SOUND4_CHAN_HWBUF_READY "hwbuf_ready" 102 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_FORMAT "swbuf_format" 103 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_SIZE "swbuf_size" 104 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_BLKSZ "swbuf_blksz" 105 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_BLKCNT "swbuf_blkcnt" 106 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_FREE "swbuf_free" 107 #define SNDST_DSPS_SOUND4_CHAN_SWBUF_READY "swbuf_ready" 108 #define SNDST_DSPS_SOUND4_CHAN_FEEDERCHAIN "feederchain" 109 110 /* 111 * Maximum user-specified nvlist buffer size 112 */ 113 #define SNDST_UNVLBUF_MAX 65536 114 115 #define SNDSTIOC_REFRESH_DEVS \ 116 _IO('D', 100) 117 #define SNDSTIOC_GET_DEVS \ 118 _IOWR('D', 101, struct sndstioc_nv_arg) 119 #define SNDSTIOC_ADD_USER_DEVS \ 120 _IOWR('D', 102, struct sndstioc_nv_arg) 121 #define SNDSTIOC_FLUSH_USER_DEVS \ 122 _IO('D', 103) 123 124 #ifdef _KERNEL 125 #ifdef COMPAT_FREEBSD32 126 127 struct sndstioc_nv_arg32 { 128 uint32_t nbytes; 129 uint32_t buf; 130 }; 131 132 #define SNDSTIOC_GET_DEVS32 \ 133 _IOC_NEWTYPE(SNDSTIOC_GET_DEVS, struct sndstioc_nv_arg32) 134 #define SNDSTIOC_ADD_USER_DEVS32 \ 135 _IOC_NEWTYPE(SNDSTIOC_ADD_USER_DEVS, struct sndstioc_nv_arg32) 136 137 #endif 138 #endif 139 140 #endif /* !_SYS_SNDSTAT_H_ */ 141