blob: 751acaa3c35efd4b627c8c73105b150fc0425135 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 2000-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 *
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -070021 * This module contains the routines that initialize the stack components.
The Android Open Source Project5738f832012-12-12 16:00:35 -080022 * It must be called before the BTU task is started.
23 *
24 ******************************************************************************/
25
26#include "bt_target.h"
27#include <string.h>
28
29#ifndef BTA_INCLUDED
30#define BTA_INCLUDED FALSE
31#endif
32
Pavlin Radoslavovb2a292b2016-10-14 19:34:48 -070033#include "bte.h"
34
The Android Open Source Project5738f832012-12-12 16:00:35 -080035/* Include initialization functions definitions */
The Android Open Source Project5738f832012-12-12 16:00:35 -080036#include "port_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080037
Marie Janssend19e0782016-07-15 12:48:27 -070038#if (BNEP_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080039#include "bnep_api.h"
40#endif
41
The Android Open Source Project5738f832012-12-12 16:00:35 -080042#include "gap_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080043
Marie Janssend19e0782016-07-15 12:48:27 -070044#if (PAN_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080045#include "pan_api.h"
46#endif
47
The Android Open Source Project5738f832012-12-12 16:00:35 -080048#include "avrc_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080049
Marie Janssend19e0782016-07-15 12:48:27 -070050#if (A2D_INCLUDED == TRUE)
Pavlin Radoslavovf66f4e92016-10-14 15:14:37 -070051#include "a2dp_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080052#endif
53
Marie Janssend19e0782016-07-15 12:48:27 -070054#if (HID_HOST_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080055#include "hidh_api.h"
56#endif
57
Marie Janssend19e0782016-07-15 12:48:27 -070058#if (MCA_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080059#include "mca_api.h"
60#endif
61
Marie Janssend19e0782016-07-15 12:48:27 -070062#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080063#include "gatt_api.h"
Marie Janssend19e0782016-07-15 12:48:27 -070064#if (SMP_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080065#include "smp_api.h"
66#endif
67#endif
68
The Android Open Source Project5738f832012-12-12 16:00:35 -080069/*****************************************************************************
70** F U N C T I O N S *
71******************************************************************************/
72
73/*****************************************************************************
74**
75** Function BTE_InitStack
76**
77** Description Initialize control block memory for each component.
78**
79** Note: The core stack components must be called
80** before creating the BTU Task. The rest of the
81** components can be initialized at a later time if desired
82** as long as the component's init function is called
83** before accessing any of its functions.
84**
85** Returns void
86**
87******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -070088void BTE_InitStack(void)
The Android Open Source Project5738f832012-12-12 16:00:35 -080089{
90/* Initialize the optional stack components */
The Android Open Source Project5738f832012-12-12 16:00:35 -080091 RFCOMM_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -080092
The Android Open Source Project5738f832012-12-12 16:00:35 -080093/**************************
94** BNEP and its profiles **
95***************************/
Marie Janssend19e0782016-07-15 12:48:27 -070096#if (BNEP_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080097 BNEP_Init();
98
Marie Janssend19e0782016-07-15 12:48:27 -070099#if (PAN_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800100 PAN_Init();
101#endif /* PAN */
102#endif /* BNEP Included */
103
104
105/**************************
106** AVDT and its profiles **
107***************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700108#if (A2D_INCLUDED == TRUE)
Pavlin Radoslavovf66f4e92016-10-14 15:14:37 -0700109 A2DP_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -0800110#endif /* AADP */
111
112
The Android Open Source Project5738f832012-12-12 16:00:35 -0800113 AVRC_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -0800114
115
116/***********
117** Others **
118************/
The Android Open Source Project5738f832012-12-12 16:00:35 -0800119 GAP_Init();
The Android Open Source Project5738f832012-12-12 16:00:35 -0800120
Marie Janssend19e0782016-07-15 12:48:27 -0700121#if (HID_HOST_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800122 HID_HostInit();
123#endif
124
Marie Janssend19e0782016-07-15 12:48:27 -0700125#if (MCA_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800126 MCA_Init();
Zach Johnson9df3c8c2014-10-20 13:22:43 -0700127#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800128
The Android Open Source Project5738f832012-12-12 16:00:35 -0800129}