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