bta_sys_int.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2003-2012 Broadcom Corporation
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at:
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. ******************************************************************************/
  18. /******************************************************************************
  19. *
  20. * This is the private interface file for the BTA system manager.
  21. *
  22. ******************************************************************************/
  23. #ifndef BTA_SYS_INT_H
  24. #define BTA_SYS_INT_H
  25. /*****************************************************************************
  26. ** Constants and data types
  27. *****************************************************************************/
  28. /*****************************************************************************
  29. ** state table
  30. *****************************************************************************/
  31. /* SYS HW state */
  32. enum {
  33. BTA_SYS_HW_OFF,
  34. BTA_SYS_HW_STARTING,
  35. BTA_SYS_HW_ON,
  36. BTA_SYS_HW_STOPPING
  37. };
  38. typedef UINT8 tBTA_SYS_HW_STATE;
  39. /* Collision callback */
  40. #define MAX_COLLISION_REG 5
  41. typedef struct {
  42. UINT8 id[MAX_COLLISION_REG];
  43. tBTA_SYS_CONN_CBACK *p_coll_cback[MAX_COLLISION_REG];
  44. } tBTA_SYS_COLLISION;
  45. /* system manager control block */
  46. typedef struct {
  47. tBTA_SYS_REG *reg[BTA_ID_MAX]; /* registration structures */
  48. BOOLEAN is_reg[BTA_ID_MAX]; /* registration structures */
  49. tBTA_SYS_HW_STATE state;
  50. tBTA_SYS_HW_CBACK *sys_hw_cback[BTA_SYS_MAX_HW_MODULES]; /* enable callback for each HW modules */
  51. UINT32 sys_hw_module_active; /* bitmask of all active modules */
  52. UINT16 sys_features; /* Bitmask of sys features */
  53. tBTA_SYS_CONN_CBACK *prm_cb; /* role management callback registered by DM */
  54. tBTA_SYS_CONN_CBACK *ppm_cb; /* low power management callback registered by DM */
  55. tBTA_SYS_CONN_CBACK *p_policy_cb; /* link policy change callback registered by DM */
  56. tBTA_SYS_CONN_CBACK *p_sco_cb; /* SCO connection change callback registered by AV */
  57. tBTA_SYS_CONN_CBACK *p_role_cb; /* role change callback registered by AV */
  58. tBTA_SYS_COLLISION colli_reg; /* collision handling module */
  59. #if (BTA_EIR_CANNED_UUID_LIST != TRUE)
  60. tBTA_SYS_EIR_CBACK *eir_cb; /* add/remove UUID into EIR */
  61. #endif
  62. #if (BTM_SSR_INCLUDED == TRUE)
  63. tBTA_SYS_SSR_CFG_CBACK *p_ssr_cb;
  64. #endif
  65. /* VS event handler */
  66. tBTA_SYS_VS_EVT_HDLR *p_vs_evt_hdlr;
  67. } tBTA_SYS_CB;
  68. /*****************************************************************************
  69. ** Global variables
  70. *****************************************************************************/
  71. /* system manager control block */
  72. #if BTA_DYNAMIC_MEMORY == FALSE
  73. extern tBTA_SYS_CB bta_sys_cb;
  74. #else
  75. extern tBTA_SYS_CB *bta_sys_cb_ptr;
  76. #define bta_sys_cb (*bta_sys_cb_ptr)
  77. #endif
  78. /* functions used for BTA SYS HW state machine */
  79. void bta_sys_hw_btm_cback( tBTM_DEV_STATUS status );
  80. void bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg);
  81. void bta_sys_hw_api_enable( tBTA_SYS_HW_MSG *p_sys_hw_msg );
  82. void bta_sys_hw_api_disable(tBTA_SYS_HW_MSG *p_sys_hw_msg);
  83. void bta_sys_hw_evt_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg);
  84. void bta_sys_hw_evt_disabled(tBTA_SYS_HW_MSG *p_sys_hw_msg);
  85. void bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg);
  86. BOOLEAN bta_sys_sm_execute(BT_HDR *p_msg);
  87. #endif /* BTA_SYS_INT_H */