Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
0004  *
0005  * This program is free software; you can redistribute it and/or modify it
0006  * under the terms of the GNU General Public License as published by the
0007  * Free Software Foundation; either version 2 of the License, or (at your
0008  * option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0012  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0013  * for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software Foundation,
0017  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0018  */
0019 
0020 #ifndef _UAPI__SOUND_USB_STREAM_H
0021 #define _UAPI__SOUND_USB_STREAM_H
0022 
0023 #define USB_STREAM_INTERFACE_VERSION 2
0024 
0025 #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \
0026     _IOW('H', 0x90, struct usb_stream_config)
0027 
0028 struct usb_stream_packet {
0029     unsigned offset;
0030     unsigned length;
0031 };
0032 
0033 
0034 struct usb_stream_config {
0035     unsigned version;
0036     unsigned sample_rate;
0037     unsigned period_frames;
0038     unsigned frame_size;
0039 };
0040 
0041 struct usb_stream {
0042     struct usb_stream_config cfg;
0043     unsigned read_size;
0044     unsigned write_size;
0045 
0046     int period_size;
0047 
0048     unsigned state;
0049 
0050     int idle_insize;
0051     int idle_outsize;
0052     int sync_packet;
0053     unsigned insize_done;
0054     unsigned periods_done;
0055     unsigned periods_polled;
0056 
0057     struct usb_stream_packet outpacket[2];
0058     unsigned         inpackets;
0059     unsigned         inpacket_head;
0060     unsigned         inpacket_split;
0061     unsigned         inpacket_split_at;
0062     unsigned         next_inpacket_split;
0063     unsigned         next_inpacket_split_at;
0064     struct usb_stream_packet inpacket[];
0065 };
0066 
0067 enum usb_stream_state {
0068     usb_stream_invalid,
0069     usb_stream_stopped,
0070     usb_stream_sync0,
0071     usb_stream_sync1,
0072     usb_stream_ready,
0073     usb_stream_running,
0074     usb_stream_xrun,
0075 };
0076 
0077 #endif /* _UAPI__SOUND_USB_STREAM_H */