1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _UAPI__SOUND_USB_STREAM_H
21 #define _UAPI__SOUND_USB_STREAM_H
22
23 #define USB_STREAM_INTERFACE_VERSION 2
24
25 #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \
26 _IOW('H', 0x90, struct usb_stream_config)
27
28 struct usb_stream_packet {
29 unsigned offset;
30 unsigned length;
31 };
32
33
34 struct usb_stream_config {
35 unsigned version;
36 unsigned sample_rate;
37 unsigned period_frames;
38 unsigned frame_size;
39 };
40
41 struct usb_stream {
42 struct usb_stream_config cfg;
43 unsigned read_size;
44 unsigned write_size;
45
46 int period_size;
47
48 unsigned state;
49
50 int idle_insize;
51 int idle_outsize;
52 int sync_packet;
53 unsigned insize_done;
54 unsigned periods_done;
55 unsigned periods_polled;
56
57 struct usb_stream_packet outpacket[2];
58 unsigned inpackets;
59 unsigned inpacket_head;
60 unsigned inpacket_split;
61 unsigned inpacket_split_at;
62 unsigned next_inpacket_split;
63 unsigned next_inpacket_split_at;
64 struct usb_stream_packet inpacket[0];
65 };
66
67 enum usb_stream_state {
68 usb_stream_invalid,
69 usb_stream_stopped,
70 usb_stream_sync0,
71 usb_stream_sync1,
72 usb_stream_ready,
73 usb_stream_running,
74 usb_stream_xrun,
75 };
76
77 #endif