usb_stream.h 1.1 KB

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