diagfwd_bridge.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (c) 2012-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 DIAGFWD_BRIDGE_H
  13. #define DIAGFWD_BRIDGE_H
  14. #include "diagfwd.h"
  15. #define MAX_BRIDGES 5
  16. #define HSIC 0
  17. #define HSIC_2 1
  18. #define SMUX 4
  19. int diagfwd_connect_bridge(int);
  20. void connect_bridge(int, uint8_t);
  21. int diagfwd_disconnect_bridge(int);
  22. void diagfwd_bridge_init(int index);
  23. void diagfwd_bridge_exit(void);
  24. int diagfwd_read_complete_bridge(struct diag_request *diag_read_ptr);
  25. /* Diag-Bridge structure, n bridges can be used at same time
  26. * for instance SMUX, HSIC working at same time
  27. */
  28. struct diag_bridge_dev {
  29. int id;
  30. char name[20];
  31. int enabled;
  32. struct mutex bridge_mutex;
  33. int usb_connected;
  34. int read_len;
  35. int write_len;
  36. unsigned char *usb_buf_out;
  37. struct usb_diag_ch *ch;
  38. struct workqueue_struct *wq;
  39. struct work_struct diag_read_work;
  40. struct diag_request *usb_read_ptr;
  41. struct work_struct usb_read_complete_work;
  42. };
  43. #endif