ccci_rpc.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*****************************************************************************
  2. *
  3. * Filename:
  4. * ---------
  5. * ccci_rpc.h
  6. *
  7. * Project:
  8. * --------
  9. * YuSu
  10. *
  11. * Description:
  12. * ------------
  13. *
  14. *
  15. * Author:
  16. * -------
  17. *
  18. *
  19. ****************************************************************************/
  20. #ifndef __CCCI_RPC_H__
  21. #define __CCCI_RPC_H__
  22. #define CCCI_SED_LEN_BYTES 16
  23. struct sed_t {
  24. unsigned char sed[CCCI_SED_LEN_BYTES];
  25. };
  26. #define SED_INITIALIZER { { [0 ... CCCI_SED_LEN_BYTES-1] = 0} }
  27. /*******************************************************************************
  28. * Define marco or constant.
  29. *******************************************************************************/
  30. #define IPC_RPC_EXCEPT_MAX_RETRY 7
  31. #define IPC_RPC_MAX_RETRY 0xFFFF
  32. #define IPC_RPC_MAX_ARG_NUM 6 /* parameter number */
  33. #define IPC_RPC_USE_DEFAULT_INDEX -1
  34. #define IPC_RPC_API_RESP_ID 0xFFFF0000
  35. #define IPC_RPC_INC_BUF_INDEX(x) (x = (x + 1) % IPC_RPC_REQ_BUFFER_NUM)
  36. /*******************************************************************************
  37. * Define data structure.
  38. *******************************************************************************/
  39. enum RPC_OP_ID {
  40. IPC_RPC_CPSVC_SECURE_ALGO_OP = 0x2001,
  41. IPC_RPC_GET_SECRO_OP = 0x2002,
  42. IPC_RPC_GET_TDD_EINT_NUM_OP = 0x4001,
  43. IPC_RPC_GET_TDD_GPIO_NUM_OP = 0x4002,
  44. IPC_RPC_GET_TDD_ADC_NUM_OP = 0x4003,
  45. IPC_RPC_GET_EMI_CLK_TYPE_OP = 0x4004,
  46. IPC_RPC_GET_EINT_ATTR_OP = 0x4005,
  47. IPC_RPC_GET_GPIO_VAL_OP = 0x4006,
  48. IPC_RPC_GET_ADC_VAL_OP = 0x4007,
  49. };
  50. struct RPC_PKT {
  51. unsigned int len;
  52. void *buf;
  53. };
  54. struct RPC_BUF {
  55. unsigned int op_id;
  56. unsigned char buf[0];
  57. };
  58. #define FS_NO_ERROR 0
  59. #define FS_NO_OP -1
  60. #define FS_PARAM_ERROR -2
  61. #define FS_NO_FEATURE -3
  62. #define FS_NO_MATCH -4
  63. #define FS_FUNC_FAIL -5
  64. #define FS_ERROR_RESERVED -6
  65. #define FS_MEM_OVERFLOW -7
  66. extern int ccci_rpc_init(int);
  67. extern void ccci_rpc_exit(int);
  68. extern void ccci_rpc_work_helper(int md_id, int *p_pkt_num, struct RPC_PKT pkt[],
  69. struct RPC_BUF *p_rpc_buf, unsigned int tmp_data[]);
  70. #endif /* __CCCI_RPC_H__ */