usb_stream.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
  4. */
  5. #ifndef __SOUND_USB_STREAM_H
  6. #define __SOUND_USB_STREAM_H
  7. #define USB_STREAM_INTERFACE_VERSION 2
  8. #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \
  9. _IOW('H', 0x90, struct usb_stream_config)
  10. struct usb_stream_packet {
  11. unsigned offset;
  12. unsigned length;
  13. };
  14. struct usb_stream_config {
  15. unsigned version;
  16. unsigned sample_rate;
  17. unsigned period_frames;
  18. unsigned frame_size;
  19. };
  20. struct usb_stream {
  21. struct usb_stream_config cfg;
  22. unsigned read_size;
  23. unsigned write_size;
  24. int period_size;
  25. unsigned state;
  26. int idle_insize;
  27. int idle_outsize;
  28. int sync_packet;
  29. unsigned insize_done;
  30. unsigned periods_done;
  31. unsigned periods_polled;
  32. struct usb_stream_packet outpacket[2];
  33. unsigned inpackets;
  34. unsigned inpacket_head;
  35. unsigned inpacket_split;
  36. unsigned inpacket_split_at;
  37. unsigned next_inpacket_split;
  38. unsigned next_inpacket_split_at;
  39. struct usb_stream_packet inpacket[];
  40. };
  41. enum usb_stream_state {
  42. usb_stream_invalid,
  43. usb_stream_stopped,
  44. usb_stream_sync0,
  45. usb_stream_sync1,
  46. usb_stream_ready,
  47. usb_stream_running,
  48. usb_stream_xrun,
  49. };
  50. #endif /* __SOUND_USB_STREAM_H */