diagfwd.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (c) 2008-2014, 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_H
  13. #define DIAGFWD_H
  14. #define NO_PROCESS 0
  15. #define NON_APPS_PROC -1
  16. #define RESET_AND_NO_QUEUE 0
  17. #define RESET_AND_QUEUE 1
  18. #define CHK_OVERFLOW(bufStart, start, end, length) \
  19. ((((bufStart) <= (start)) && ((end) - (start) >= (length)) && ((length) > 0)) ? 1 : 0)
  20. void diagfwd_init(void);
  21. void diagfwd_exit(void);
  22. void diag_process_hdlc(void *data, unsigned len);
  23. void diag_smd_send_req(struct diag_smd_info *smd_info);
  24. void diag_usb_legacy_notifier(void *, unsigned, struct diag_request *);
  25. long diagchar_ioctl(struct file *, unsigned int, unsigned long);
  26. int diag_device_write(void *, int, struct diag_request *);
  27. int mask_request_validate(unsigned char mask_buf[]);
  28. void diag_clear_reg(int);
  29. int chk_config_get_id(void);
  30. int chk_apps_only(void);
  31. int chk_apps_master(void);
  32. int chk_polling_response(void);
  33. void diag_update_userspace_clients(unsigned int type);
  34. void diag_update_sleeping_process(int process_id, int data_type);
  35. void encode_rsp_and_send(int buf_length);
  36. void diag_smd_notify(void *ctxt, unsigned event);
  37. int diag_smd_constructor(struct diag_smd_info *smd_info, int peripheral,
  38. int type);
  39. void diag_smd_destructor(struct diag_smd_info *smd_info);
  40. int diag_switch_logging(unsigned long);
  41. int diag_command_reg(unsigned long);
  42. void diag_cmp_logging_modes_sdio_pipe(int old_mode, int new_mode);
  43. void diag_cmp_logging_modes_diagfwd_bridge(int old_mode, int new_mode);
  44. int diag_process_apps_pkt(unsigned char *buf, int len);
  45. void diag_reset_smd_data(int queue);
  46. int diag_apps_responds(void);
  47. void diag_update_pkt_buffer(unsigned char *buf, int type);
  48. int diag_process_stm_cmd(unsigned char *buf, unsigned char *dest_buf);
  49. void diag_ws_on_notify(void);
  50. void diag_ws_on_read(int pkt_len);
  51. void diag_ws_on_copy(void);
  52. void diag_ws_on_copy_complete(void);
  53. void diag_ws_reset(void);
  54. void diag_smd_queue_read(struct diag_smd_info *smd_info);
  55. /* State for diag forwarding */
  56. #ifdef CONFIG_DIAG_OVER_USB
  57. int diagfwd_connect(void);
  58. int diagfwd_disconnect(void);
  59. #endif
  60. extern int diag_debug_buf_idx;
  61. extern unsigned char diag_debug_buf[1024];
  62. extern struct platform_driver msm_diag_dci_driver;
  63. #endif