g_zero.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. struct usb_zero_options {
  12. unsigned pattern;
  13. unsigned isoc_interval;
  14. unsigned isoc_maxpacket;
  15. unsigned isoc_mult;
  16. unsigned isoc_maxburst;
  17. unsigned bulk_buflen;
  18. unsigned qlen;
  19. };
  20. struct f_ss_opts {
  21. struct usb_function_instance func_inst;
  22. unsigned pattern;
  23. unsigned isoc_interval;
  24. unsigned isoc_maxpacket;
  25. unsigned isoc_mult;
  26. unsigned isoc_maxburst;
  27. unsigned bulk_buflen;
  28. /*
  29. * Read/write access to configfs attributes is handled by configfs.
  30. *
  31. * This is to protect the data from concurrent access by read/write
  32. * and create symlink/remove symlink.
  33. */
  34. struct mutex lock;
  35. int refcnt;
  36. };
  37. struct f_lb_opts {
  38. struct usb_function_instance func_inst;
  39. unsigned bulk_buflen;
  40. unsigned qlen;
  41. /*
  42. * Read/write access to configfs attributes is handled by configfs.
  43. *
  44. * This is to protect the data from concurrent access by read/write
  45. * and create symlink/remove symlink.
  46. */
  47. struct mutex lock;
  48. int refcnt;
  49. };
  50. void lb_modexit(void);
  51. int lb_modinit(void);
  52. /* common utilities */
  53. void disable_endpoints(struct usb_composite_dev *cdev,
  54. struct usb_ep *in, struct usb_ep *out,
  55. struct usb_ep *iso_in, struct usb_ep *iso_out);
  56. #endif /* __G_ZERO_H */