g_zero.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This header declares the utility functions used by "Gadget Zero", plus
  3. * interfaces to its two single-configuration function drivers.
  4. */
  5. #ifndef __G_ZERO_H
  6. #define __G_ZERO_H
  7. #define GZERO_BULK_BUFLEN 4096
  8. #define GZERO_QLEN 32
  9. #define GZERO_ISOC_INTERVAL 4
  10. #define GZERO_ISOC_MAXPACKET 1024
  11. #define GZERO_SS_BULK_QLEN 1
  12. #define GZERO_SS_ISO_QLEN 8
  13. struct usb_zero_options {
  14. unsigned pattern;
  15. unsigned isoc_interval;
  16. unsigned isoc_maxpacket;
  17. unsigned isoc_mult;
  18. unsigned isoc_maxburst;
  19. unsigned bulk_buflen;
  20. unsigned qlen;
  21. unsigned ss_bulk_qlen;
  22. unsigned ss_iso_qlen;
  23. };
  24. struct f_ss_opts {
  25. struct usb_function_instance func_inst;
  26. unsigned pattern;
  27. unsigned isoc_interval;
  28. unsigned isoc_maxpacket;
  29. unsigned isoc_mult;
  30. unsigned isoc_maxburst;
  31. unsigned bulk_buflen;
  32. unsigned bulk_qlen;
  33. unsigned iso_qlen;
  34. /*
  35. * Read/write access to configfs attributes is handled by configfs.
  36. *
  37. * This is to protect the data from concurrent access by read/write
  38. * and create symlink/remove symlink.
  39. */
  40. struct mutex lock;
  41. int refcnt;
  42. };
  43. struct f_lb_opts {
  44. struct usb_function_instance func_inst;
  45. unsigned bulk_buflen;
  46. unsigned qlen;
  47. /*
  48. * Read/write access to configfs attributes is handled by configfs.
  49. *
  50. * This is to protect the data from concurrent access by read/write
  51. * and create symlink/remove symlink.
  52. */
  53. struct mutex lock;
  54. int refcnt;
  55. };
  56. void lb_modexit(void);
  57. int lb_modinit(void);
  58. /* common utilities */
  59. void disable_endpoints(struct usb_composite_dev *cdev,
  60. struct usb_ep *in, struct usb_ep *out,
  61. struct usb_ep *iso_in, struct usb_ep *iso_out);
  62. #endif /* __G_ZERO_H */