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