0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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