ozusbsvc.h 1002 B

123456789101112131415161718192021222324252627282930313233
  1. /* -----------------------------------------------------------------------------
  2. * Copyright (c) 2011 Ozmo Inc
  3. * Released under the GNU General Public License Version 2 (GPLv2).
  4. * -----------------------------------------------------------------------------
  5. */
  6. #ifndef _OZUSBSVC_H
  7. #define _OZUSBSVC_H
  8. /*------------------------------------------------------------------------------
  9. * Per PD context info stored in application context area of PD.
  10. * This object is reference counted to ensure it doesn't disappear while
  11. * still in use.
  12. */
  13. struct oz_usb_ctx {
  14. atomic_t ref_count;
  15. u8 tx_seq_num;
  16. u8 rx_seq_num;
  17. struct oz_pd *pd;
  18. void *hport;
  19. int stopped;
  20. };
  21. int oz_usb_init(void);
  22. void oz_usb_term(void);
  23. int oz_usb_start(struct oz_pd *pd, int resume);
  24. void oz_usb_stop(struct oz_pd *pd, int pause);
  25. void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt);
  26. int oz_usb_heartbeat(struct oz_pd *pd);
  27. void oz_usb_farewell(struct oz_pd *pd, u8 ep_num, u8 *data, u8 len);
  28. #endif /* _OZUSBSVC_H */