1 /******************************************************************************
3 * Copyright (C) 2000-2012 Broadcom Corporation
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:
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ******************************************************************************/
19 /******************************************************************************
21 * This module contains the routines that initialize the stack components.
22 * It must be called before the BTU task is started.
24 ******************************************************************************/
26 #include "bt_target.h"
30 #define BTA_INCLUDED FALSE
33 /* Include initialization functions definitions */
36 #if (defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE)
42 #if (defined(PAN_INCLUDED) && PAN_INCLUDED == TRUE)
48 #if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
52 #if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE)
56 #if (defined(MCA_INCLUDED) && MCA_INCLUDED == TRUE)
60 #if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE)
62 #if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
67 /***** BTA Modules ******/
68 #if BTA_INCLUDED == TRUE && BTA_DYNAMIC_MEMORY == TRUE
72 #include "bta_ag_int.h"
74 #if BTA_HS_INCLUDED == TRUE
75 #include "bta_hs_int.h"
78 #include "bta_dm_int.h"
80 #if BTA_AR_INCLUDED==TRUE
81 #include "bta_ar_int.h"
83 #if BTA_AV_INCLUDED==TRUE
84 #include "bta_av_int.h"
87 #if BTA_HH_INCLUDED==TRUE
88 #include "bta_hh_int.h"
91 #if BTA_JV_INCLUDED==TRUE
92 #include "bta_jv_int.h"
93 tBTA_JV_CB *bta_jv_cb_ptr = NULL;
96 #if BTA_HL_INCLUDED == TRUE
97 #include "bta_hl_int.h"
100 #if BTA_GATT_INCLUDED == TRUE
101 #include "bta_gattc_int.h"
102 #include "bta_gatts_int.h"
105 #if BTA_PAN_INCLUDED==TRUE
106 #include "bta_pan_int.h"
109 #include "bta_sys_int.h"
111 /* control block for patch ram downloading */
112 #include "bta_prm_int.h"
114 #endif /* BTA_INCLUDED */
116 /*****************************************************************************
117 ** F U N C T I O N S *
118 ******************************************************************************/
120 /*****************************************************************************
122 ** Function BTE_InitStack
124 ** Description Initialize control block memory for each component.
126 ** Note: The core stack components must be called
127 ** before creating the BTU Task. The rest of the
128 ** components can be initialized at a later time if desired
129 ** as long as the component's init function is called
130 ** before accessing any of its functions.
134 ******************************************************************************/
135 void BTE_InitStack(void)
137 /* Initialize the optional stack components */
140 /**************************
141 ** BNEP and its profiles **
142 ***************************/
143 #if (defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE)
146 #if (defined(PAN_INCLUDED) && PAN_INCLUDED == TRUE)
149 #endif /* BNEP Included */
152 /**************************
153 ** AVDT and its profiles **
154 ***************************/
155 #if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
168 #if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE)
172 #if (defined(MCA_INCLUDED) && MCA_INCLUDED == TRUE)
179 #if (BTA_INCLUDED == TRUE && BTA_DYNAMIC_MEMORY == TRUE)
180 memset((void*)bta_sys_cb_ptr, 0, sizeof(tBTA_SYS_CB));
181 memset((void*)bta_dm_cb_ptr, 0, sizeof(tBTA_DM_CB));
182 memset((void*)bta_dm_search_cb_ptr, 0, sizeof(tBTA_DM_SEARCH_CB));
183 memset((void*)bta_dm_di_cb_ptr, 0, sizeof(tBTA_DM_DI_CB));
184 memset((void*)bta_prm_cb_ptr, 0, sizeof(tBTA_PRM_CB));
185 memset((void*)bta_ag_cb_ptr, 0, sizeof(tBTA_AG_CB));
186 #if BTA_HS_INCLUDED == TRUE
187 memset((void*)bta_hs_cb_ptr, 0, sizeof(tBTA_HS_CB));
189 #if BTA_AR_INCLUDED==TRUE
190 memset((void *)bta_ar_cb_ptr, 0, sizeof(tBTA_AR_CB));
192 #if BTA_AV_INCLUDED==TRUE
193 memset((void *)bta_av_cb_ptr, 0, sizeof(tBTA_AV_CB));
195 #if BTA_HH_INCLUDED==TRUE
196 memset((void *)bta_hh_cb_ptr, 0, sizeof(tBTA_HH_CB));
198 #if BTA_HL_INCLUDED==TRUE
199 memset((void *)bta_hl_cb_ptr, 0, sizeof(tBTA_HL_CB));
201 #if BTA_GATT_INCLUDED==TRUE
202 memset((void *)bta_gattc_cb_ptr, 0, sizeof(tBTA_GATTC_CB));
203 memset((void *)bta_gatts_cb_ptr, 0, sizeof(tBTA_GATTS_CB));
205 #if BTA_PAN_INCLUDED==TRUE
206 memset((void *)bta_pan_cb_ptr, 0, sizeof(tBTA_PAN_CB));
209 #endif /* BTA_INCLUDED == TRUE */