usb_qdss.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright (c) 2012, 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 __LINUX_USB_QDSS_H
  13. #define __LINUX_USB_QDSS_H
  14. #include <linux/kernel.h>
  15. struct qdss_request {
  16. char *buf;
  17. int length;
  18. int actual;
  19. int status;
  20. void *context;
  21. };
  22. struct usb_qdss_ch {
  23. const char *name;
  24. struct list_head list;
  25. void (*notify)(void *priv, unsigned event, struct qdss_request *d_req,
  26. struct usb_qdss_ch *);
  27. void *priv;
  28. void *priv_usb;
  29. int app_conn;
  30. };
  31. enum qdss_state {
  32. USB_QDSS_CONNECT,
  33. USB_QDSS_DISCONNECT,
  34. USB_QDSS_CTRL_READ_DONE,
  35. USB_QDSS_DATA_WRITE_DONE,
  36. USB_QDSS_CTRL_WRITE_DONE,
  37. };
  38. struct usb_qdss_ch *usb_qdss_open(const char *name, void *priv,
  39. void (*notify)(void *, unsigned, struct qdss_request *,
  40. struct usb_qdss_ch *));
  41. void usb_qdss_close(struct usb_qdss_ch *ch);
  42. int usb_qdss_alloc_req(struct usb_qdss_ch *ch, int n_write, int n_read);
  43. void usb_qdss_free_req(struct usb_qdss_ch *ch);
  44. int usb_qdss_read(struct usb_qdss_ch *ch, struct qdss_request *d_req);
  45. int usb_qdss_write(struct usb_qdss_ch *ch, struct qdss_request *d_req);
  46. int usb_qdss_ctrl_write(struct usb_qdss_ch *ch, struct qdss_request *d_req);
  47. int usb_qdss_ctrl_read(struct usb_qdss_ch *ch, struct qdss_request *d_req);
  48. #endif