The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 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 Viswanadham | 16fe082 | 2014-08-07 11:38:06 -0700 | [diff] [blame] | 21 | * This module contains the routines that initialize the stack components. |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 22 | * 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 | |
| 33 | /* Include initialization functions definitions */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 34 | #include "port_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 35 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 36 | #if (BNEP_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 37 | #include "bnep_api.h" |
| 38 | #endif |
| 39 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 40 | #include "gap_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 41 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 42 | #if (PAN_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 43 | #include "pan_api.h" |
| 44 | #endif |
| 45 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 46 | #include "avrc_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 47 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 48 | #if (A2D_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 49 | #include "a2d_api.h" |
| 50 | #endif |
| 51 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 52 | #if (HID_HOST_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 53 | #include "hidh_api.h" |
| 54 | #endif |
| 55 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 56 | #if (MCA_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 57 | #include "mca_api.h" |
| 58 | #endif |
| 59 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 60 | #if (BLE_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 61 | #include "gatt_api.h" |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 62 | #if (SMP_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 63 | #include "smp_api.h" |
| 64 | #endif |
| 65 | #endif |
| 66 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 67 | /***************************************************************************** |
| 68 | ** F U N C T I O N S * |
| 69 | ******************************************************************************/ |
| 70 | |
| 71 | /***************************************************************************** |
| 72 | ** |
| 73 | ** Function BTE_InitStack |
| 74 | ** |
| 75 | ** Description Initialize control block memory for each component. |
| 76 | ** |
| 77 | ** Note: The core stack components must be called |
| 78 | ** before creating the BTU Task. The rest of the |
| 79 | ** components can be initialized at a later time if desired |
| 80 | ** as long as the component's init function is called |
| 81 | ** before accessing any of its functions. |
| 82 | ** |
| 83 | ** Returns void |
| 84 | ** |
| 85 | ******************************************************************************/ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 86 | void BTE_InitStack(void) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 87 | { |
| 88 | /* Initialize the optional stack components */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 89 | RFCOMM_Init(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 90 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 91 | /************************** |
| 92 | ** BNEP and its profiles ** |
| 93 | ***************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 94 | #if (BNEP_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 95 | BNEP_Init(); |
| 96 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 97 | #if (PAN_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 98 | PAN_Init(); |
| 99 | #endif /* PAN */ |
| 100 | #endif /* BNEP Included */ |
| 101 | |
| 102 | |
| 103 | /************************** |
| 104 | ** AVDT and its profiles ** |
| 105 | ***************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 106 | #if (A2D_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 107 | A2D_Init(); |
| 108 | #endif /* AADP */ |
| 109 | |
| 110 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 111 | AVRC_Init(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 112 | |
| 113 | |
| 114 | /*********** |
| 115 | ** Others ** |
| 116 | ************/ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 117 | GAP_Init(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 118 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 119 | #if (HID_HOST_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 120 | HID_HostInit(); |
| 121 | #endif |
| 122 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame^] | 123 | #if (MCA_INCLUDED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 124 | MCA_Init(); |
Zach Johnson | 9df3c8c | 2014-10-20 13:22:43 -0700 | [diff] [blame] | 125 | #endif |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 126 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 127 | } |