1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de> 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify it 6*4882a593Smuzhiyun * under the terms of the GNU General Public License as published by the 7*4882a593Smuzhiyun * Free Software Foundation; either version 2 of the License, or (at your 8*4882a593Smuzhiyun * option) any later version. 9*4882a593Smuzhiyun * 10*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful, but 11*4882a593Smuzhiyun * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12*4882a593Smuzhiyun * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13*4882a593Smuzhiyun * for more details. 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * You should have received a copy of the GNU General Public License 16*4882a593Smuzhiyun * along with this program; if not, write to the Free Software Foundation, 17*4882a593Smuzhiyun * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18*4882a593Smuzhiyun */ 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun #ifndef _UAPI__SOUND_USB_STREAM_H 21*4882a593Smuzhiyun #define _UAPI__SOUND_USB_STREAM_H 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun #define USB_STREAM_INTERFACE_VERSION 2 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \ 26*4882a593Smuzhiyun _IOW('H', 0x90, struct usb_stream_config) 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun struct usb_stream_packet { 29*4882a593Smuzhiyun unsigned offset; 30*4882a593Smuzhiyun unsigned length; 31*4882a593Smuzhiyun }; 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun struct usb_stream_config { 35*4882a593Smuzhiyun unsigned version; 36*4882a593Smuzhiyun unsigned sample_rate; 37*4882a593Smuzhiyun unsigned period_frames; 38*4882a593Smuzhiyun unsigned frame_size; 39*4882a593Smuzhiyun }; 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun struct usb_stream { 42*4882a593Smuzhiyun struct usb_stream_config cfg; 43*4882a593Smuzhiyun unsigned read_size; 44*4882a593Smuzhiyun unsigned write_size; 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun int period_size; 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun unsigned state; 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun int idle_insize; 51*4882a593Smuzhiyun int idle_outsize; 52*4882a593Smuzhiyun int sync_packet; 53*4882a593Smuzhiyun unsigned insize_done; 54*4882a593Smuzhiyun unsigned periods_done; 55*4882a593Smuzhiyun unsigned periods_polled; 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun struct usb_stream_packet outpacket[2]; 58*4882a593Smuzhiyun unsigned inpackets; 59*4882a593Smuzhiyun unsigned inpacket_head; 60*4882a593Smuzhiyun unsigned inpacket_split; 61*4882a593Smuzhiyun unsigned inpacket_split_at; 62*4882a593Smuzhiyun unsigned next_inpacket_split; 63*4882a593Smuzhiyun unsigned next_inpacket_split_at; 64*4882a593Smuzhiyun struct usb_stream_packet inpacket[0]; 65*4882a593Smuzhiyun }; 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun enum usb_stream_state { 68*4882a593Smuzhiyun usb_stream_invalid, 69*4882a593Smuzhiyun usb_stream_stopped, 70*4882a593Smuzhiyun usb_stream_sync0, 71*4882a593Smuzhiyun usb_stream_sync1, 72*4882a593Smuzhiyun usb_stream_ready, 73*4882a593Smuzhiyun usb_stream_running, 74*4882a593Smuzhiyun usb_stream_xrun, 75*4882a593Smuzhiyun }; 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun #endif /* _UAPI__SOUND_USB_STREAM_H */ 78