u_bam_data.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __U_BAM_DATA_H
  13. #define __U_BAM_DATA_H
  14. #include <mach/usb_gadget_xport.h>
  15. enum function_type {
  16. USB_FUNC_ECM,
  17. USB_FUNC_MBIM,
  18. USB_FUNC_RNDIS,
  19. };
  20. struct data_port {
  21. struct usb_composite_dev *cdev;
  22. struct usb_function *func;
  23. struct usb_ep *in;
  24. struct usb_ep *out;
  25. };
  26. void bam_data_disconnect(struct data_port *gr, u8 port_num);
  27. int bam_data_connect(struct data_port *gr, u8 port_num,
  28. enum transport_type trans, u8 src_connection_idx,
  29. u8 dst_connection_idx, enum function_type func);
  30. int bam_data_setup(unsigned int no_bam2bam_port);
  31. int bam_data_destroy(unsigned int no_bam2bam_port);
  32. void bam_data_suspend(u8 port_num);
  33. void bam_data_resume(u8 port_num);
  34. #endif /* __U_BAM_DATA_H */