^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __USB_STREAM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __USB_STREAM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <uapi/sound/usb_stream.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define USB_STREAM_NURBS 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define USB_STREAM_URBDEPTH 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct usb_stream_kernel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct usb_stream *s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) void *write_page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) unsigned n_o_ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct urb *inurb[USB_STREAM_NURBS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct urb *idle_inurb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct urb *completed_inurb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct urb *outurb[USB_STREAM_NURBS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct urb *idle_outurb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct urb *completed_outurb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct urb *i_urb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int iso_frame_balance;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) wait_queue_head_t sleep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) unsigned out_phase;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned out_phase_peeked;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned freqn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct usb_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned in_endpoint, unsigned out_endpoint,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned sample_rate, unsigned use_packsize,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned period_frames, unsigned frame_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void usb_stream_free(struct usb_stream_kernel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) int usb_stream_start(struct usb_stream_kernel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void usb_stream_stop(struct usb_stream_kernel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #endif /* __USB_STREAM_H */