The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 2009-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 | * |
| 21 | * Filename: bte_main.c |
| 22 | * |
| 23 | * Description: Contains BTE core stack initialization and shutdown code |
| 24 | * |
| 25 | ******************************************************************************/ |
| 26 | #include <fcntl.h> |
| 27 | #include <stdlib.h> |
| 28 | #include <assert.h> |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 29 | #include <signal.h> |
| 30 | #include <time.h> |
| 31 | #include <hardware/bluetooth.h> |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 32 | |
| 33 | #include "gki.h" |
| 34 | #include "bd.h" |
| 35 | #include "btu.h" |
| 36 | #include "bte.h" |
| 37 | #include "bta_api.h" |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 38 | #include "bt_utils.h" |
Matthew Xie | 66432dc | 2014-04-27 05:45:32 -0700 | [diff] [blame] | 39 | #include "bt_hci_bdroid.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 40 | |
| 41 | /******************************************************************************* |
| 42 | ** Constants & Macros |
| 43 | *******************************************************************************/ |
| 44 | |
| 45 | /* Run-time configuration file */ |
| 46 | #ifndef BTE_STACK_CONF_FILE |
| 47 | #define BTE_STACK_CONF_FILE "/etc/bluetooth/bt_stack.conf" |
| 48 | #endif |
Prerepa Viswanadham | 4c94c5f | 2014-07-18 15:20:54 -0700 | [diff] [blame^] | 49 | /* Run-time configuration file for BLE*/ |
| 50 | #ifndef BTE_BLE_STACK_CONF_FILE |
| 51 | #define BTE_BLE_STACK_CONF_FILE "/etc/bluetooth/ble_stack.conf" |
| 52 | #endif |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 53 | |
| 54 | /* if not specified in .txt file then use this as default */ |
| 55 | #ifndef HCI_LOGGING_FILENAME |
| 56 | #define HCI_LOGGING_FILENAME "/data/misc/bluedroid/btsnoop_hci.log" |
| 57 | #endif |
| 58 | |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 59 | /* Stack preload process timeout period */ |
| 60 | #ifndef PRELOAD_START_TIMEOUT_MS |
| 61 | #define PRELOAD_START_TIMEOUT_MS 3000 // 3 seconds |
| 62 | #endif |
| 63 | |
| 64 | /* Stack preload process maximum retry attempts */ |
| 65 | #ifndef PRELOAD_MAX_RETRY_ATTEMPTS |
| 66 | #define PRELOAD_MAX_RETRY_ATTEMPTS 0 |
| 67 | #endif |
| 68 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 69 | /******************************************************************************* |
| 70 | ** Local type definitions |
| 71 | *******************************************************************************/ |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 72 | /* Preload retry control block */ |
| 73 | typedef struct |
| 74 | { |
| 75 | int retry_counts; |
| 76 | BOOLEAN timer_created; |
| 77 | timer_t timer_id; |
| 78 | } bt_preload_retry_cb_t; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 79 | |
| 80 | /****************************************************************************** |
| 81 | ** Variables |
| 82 | ******************************************************************************/ |
| 83 | BOOLEAN hci_logging_enabled = FALSE; /* by default, turn hci log off */ |
Zhihai Xu | bad70b1 | 2013-06-04 18:21:25 -0700 | [diff] [blame] | 84 | BOOLEAN hci_logging_config = FALSE; /* configured from bluetooth framework */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 85 | char hci_logfile[256] = HCI_LOGGING_FILENAME; |
| 86 | |
| 87 | |
| 88 | /******************************************************************************* |
| 89 | ** Static variables |
| 90 | *******************************************************************************/ |
| 91 | static bt_hc_interface_t *bt_hc_if=NULL; |
| 92 | static const bt_hc_callbacks_t hc_callbacks; |
| 93 | static BOOLEAN lpm_enabled = FALSE; |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 94 | static bt_preload_retry_cb_t preload_retry_cb; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 95 | |
| 96 | /******************************************************************************* |
| 97 | ** Static functions |
| 98 | *******************************************************************************/ |
| 99 | static void bte_main_in_hw_init(void); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 100 | static void bte_hci_enable(void); |
| 101 | static void bte_hci_disable(void); |
| 102 | static void preload_start_wait_timer(void); |
| 103 | static void preload_stop_wait_timer(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 104 | |
| 105 | /******************************************************************************* |
| 106 | ** Externs |
| 107 | *******************************************************************************/ |
| 108 | BTU_API extern UINT32 btu_task (UINT32 param); |
| 109 | BTU_API extern void BTE_Init (void); |
| 110 | BT_API extern void BTE_LoadStack(void); |
| 111 | BT_API void BTE_UnloadStack(void); |
| 112 | extern void scru_flip_bda (BD_ADDR dst, const BD_ADDR src); |
| 113 | extern void bte_load_conf(const char *p_path); |
Prerepa Viswanadham | 4c94c5f | 2014-07-18 15:20:54 -0700 | [diff] [blame^] | 114 | extern void bte_load_ble_conf(const char *p_path); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 115 | extern bt_bdaddr_t btif_local_bd_addr; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 116 | |
| 117 | |
| 118 | /******************************************************************************* |
| 119 | ** System Task Configuration |
| 120 | *******************************************************************************/ |
| 121 | |
| 122 | /* bluetooth protocol stack (BTU) task */ |
| 123 | #ifndef BTE_BTU_STACK_SIZE |
| 124 | #define BTE_BTU_STACK_SIZE 0//0x2000 /* In bytes */ |
| 125 | #endif |
| 126 | #define BTE_BTU_TASK_STR ((INT8 *) "BTU") |
| 127 | UINT32 bte_btu_stack[(BTE_BTU_STACK_SIZE + 3) / 4]; |
| 128 | |
| 129 | /****************************************************************************** |
| 130 | ** |
| 131 | ** Function bte_main_in_hw_init |
| 132 | ** |
| 133 | ** Description Internal helper function for chip hardware init |
| 134 | ** |
| 135 | ** Returns None |
| 136 | ** |
| 137 | ******************************************************************************/ |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 138 | static void bte_main_in_hw_init(void) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 139 | { |
| 140 | if ( (bt_hc_if = (bt_hc_interface_t *) bt_hc_get_interface()) \ |
| 141 | == NULL) |
| 142 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 143 | APPL_TRACE_ERROR("!!! Failed to get BtHostControllerInterface !!!"); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 144 | } |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 145 | |
| 146 | memset(&preload_retry_cb, 0, sizeof(bt_preload_retry_cb_t)); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | /****************************************************************************** |
| 150 | ** |
| 151 | ** Function bte_main_boot_entry |
| 152 | ** |
| 153 | ** Description BTE MAIN API - Entry point for BTE chip/stack initialization |
| 154 | ** |
| 155 | ** Returns None |
| 156 | ** |
| 157 | ******************************************************************************/ |
| 158 | void bte_main_boot_entry(void) |
| 159 | { |
| 160 | /* initialize OS */ |
| 161 | GKI_init(); |
| 162 | |
| 163 | bte_main_in_hw_init(); |
| 164 | |
| 165 | bte_load_conf(BTE_STACK_CONF_FILE); |
Prerepa Viswanadham | 4c94c5f | 2014-07-18 15:20:54 -0700 | [diff] [blame^] | 166 | #if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) |
| 167 | bte_load_ble_conf(BTE_BLE_STACK_CONF_FILE); |
| 168 | #endif |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 169 | |
| 170 | #if (BTTRC_INCLUDED == TRUE) |
| 171 | /* Initialize trace feature */ |
| 172 | BTTRC_TraceInit(MAX_TRACE_RAM_SIZE, &BTE_TraceLogBuf[0], BTTRC_METHOD_RAM); |
| 173 | #endif |
| 174 | } |
| 175 | |
| 176 | /****************************************************************************** |
| 177 | ** |
| 178 | ** Function bte_main_shutdown |
| 179 | ** |
| 180 | ** Description BTE MAIN API - Shutdown code for BTE chip/stack |
| 181 | ** |
| 182 | ** Returns None |
| 183 | ** |
| 184 | ******************************************************************************/ |
| 185 | void bte_main_shutdown() |
| 186 | { |
| 187 | GKI_shutdown(); |
| 188 | } |
| 189 | |
| 190 | /****************************************************************************** |
| 191 | ** |
| 192 | ** Function bte_main_enable |
| 193 | ** |
| 194 | ** Description BTE MAIN API - Creates all the BTE tasks. Should be called |
| 195 | ** part of the Bluetooth stack enable sequence |
| 196 | ** |
| 197 | ** Returns None |
| 198 | ** |
| 199 | ******************************************************************************/ |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 200 | void bte_main_enable() |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 201 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 202 | APPL_TRACE_DEBUG("%s", __FUNCTION__); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 203 | |
| 204 | /* Initialize BTE control block */ |
| 205 | BTE_Init(); |
| 206 | |
| 207 | lpm_enabled = FALSE; |
| 208 | |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 209 | GKI_create_task((TASKPTR)btu_task, BTU_TASK, BTE_BTU_TASK_STR, |
| 210 | (UINT16 *) ((UINT8 *)bte_btu_stack + BTE_BTU_STACK_SIZE), |
| 211 | sizeof(bte_btu_stack)); |
| 212 | |
Zhihai Xu | 1a558ca | 2014-01-15 10:28:55 -0800 | [diff] [blame] | 213 | bte_hci_enable(); |
| 214 | |
Sharvil Nanavati | b538248 | 2014-06-29 18:10:15 -0700 | [diff] [blame] | 215 | GKI_run(); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | /****************************************************************************** |
| 219 | ** |
| 220 | ** Function bte_main_disable |
| 221 | ** |
| 222 | ** Description BTE MAIN API - Destroys all the BTE tasks. Should be called |
| 223 | ** part of the Bluetooth stack disable sequence |
| 224 | ** |
| 225 | ** Returns None |
| 226 | ** |
| 227 | ******************************************************************************/ |
| 228 | void bte_main_disable(void) |
| 229 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 230 | APPL_TRACE_DEBUG("%s", __FUNCTION__); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 231 | |
| 232 | preload_stop_wait_timer(); |
| 233 | bte_hci_disable(); |
| 234 | GKI_destroy_task(BTU_TASK); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | /****************************************************************************** |
| 238 | ** |
Zhihai Xu | bad70b1 | 2013-06-04 18:21:25 -0700 | [diff] [blame] | 239 | ** Function bte_main_config_hci_logging |
| 240 | ** |
| 241 | ** Description enable or disable HIC snoop logging |
| 242 | ** |
| 243 | ** Returns None |
| 244 | ** |
| 245 | ******************************************************************************/ |
| 246 | void bte_main_config_hci_logging(BOOLEAN enable, BOOLEAN bt_disabled) |
| 247 | { |
| 248 | int old = (hci_logging_enabled == TRUE) || (hci_logging_config == TRUE); |
| 249 | int new; |
| 250 | |
| 251 | if (enable) { |
| 252 | hci_logging_config = TRUE; |
| 253 | } else { |
| 254 | hci_logging_config = FALSE; |
| 255 | } |
| 256 | |
| 257 | new = (hci_logging_enabled == TRUE) || (hci_logging_config == TRUE); |
| 258 | |
| 259 | if ((old == new) || bt_disabled || (bt_hc_if == NULL)) { |
| 260 | return; |
| 261 | } |
| 262 | |
| 263 | bt_hc_if->logging(new ? BT_HC_LOGGING_ON : BT_HC_LOGGING_OFF, hci_logfile); |
| 264 | } |
| 265 | |
| 266 | /****************************************************************************** |
| 267 | ** |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 268 | ** Function bte_hci_enable |
| 269 | ** |
| 270 | ** Description Enable HCI & Vendor modules |
| 271 | ** |
| 272 | ** Returns None |
| 273 | ** |
| 274 | ******************************************************************************/ |
| 275 | static void bte_hci_enable(void) |
| 276 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 277 | APPL_TRACE_DEBUG("%s", __FUNCTION__); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 278 | |
| 279 | preload_start_wait_timer(); |
| 280 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 281 | if (bt_hc_if) |
| 282 | { |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 283 | int result = bt_hc_if->init(&hc_callbacks, btif_local_bd_addr.address); |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 284 | APPL_TRACE_EVENT("libbt-hci init returns %d", result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 285 | |
| 286 | assert(result == BT_HC_STATUS_SUCCESS); |
| 287 | |
Zhihai Xu | bad70b1 | 2013-06-04 18:21:25 -0700 | [diff] [blame] | 288 | if (hci_logging_enabled == TRUE || hci_logging_config == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 289 | bt_hc_if->logging(BT_HC_LOGGING_ON, hci_logfile); |
| 290 | |
| 291 | #if (defined (BT_CLEAN_TURN_ON_DISABLED) && BT_CLEAN_TURN_ON_DISABLED == TRUE) |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 292 | APPL_TRACE_DEBUG("%s Not Turninig Off the BT before Turninig ON", __FUNCTION__); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 293 | |
| 294 | /* Do not power off the chip before powering on if BT_CLEAN_TURN_ON_DISABLED flag |
| 295 | is defined and set to TRUE to avoid below mentioned issue. |
| 296 | |
| 297 | Wingray kernel driver maintains a combined counter to keep track of |
| 298 | BT-Wifi state. Invoking set_power(BT_HC_CHIP_PWR_OFF) when the BT is already |
| 299 | in OFF state causes this counter to be incorrectly decremented and results in undesired |
| 300 | behavior of the chip. |
| 301 | |
| 302 | This is only a workaround and when the issue is fixed in the kernel this work around |
| 303 | should be removed. */ |
| 304 | #else |
| 305 | /* toggle chip power to ensure we will reset chip in case |
| 306 | a previous stack shutdown wasn't completed gracefully */ |
| 307 | bt_hc_if->set_power(BT_HC_CHIP_PWR_OFF); |
| 308 | #endif |
| 309 | bt_hc_if->set_power(BT_HC_CHIP_PWR_ON); |
| 310 | |
| 311 | bt_hc_if->preload(NULL); |
| 312 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | /****************************************************************************** |
| 316 | ** |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 317 | ** Function bte_hci_disable |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 318 | ** |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 319 | ** Description Disable HCI & Vendor modules |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 320 | ** |
| 321 | ** Returns None |
| 322 | ** |
| 323 | ******************************************************************************/ |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 324 | static void bte_hci_disable(void) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 325 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 326 | APPL_TRACE_DEBUG("%s", __FUNCTION__); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 327 | |
| 328 | if (bt_hc_if) |
| 329 | { |
Zhihai Xu | bad70b1 | 2013-06-04 18:21:25 -0700 | [diff] [blame] | 330 | if (hci_logging_enabled == TRUE || hci_logging_config == TRUE) |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 331 | bt_hc_if->logging(BT_HC_LOGGING_OFF, hci_logfile); |
Sharvil Nanavati | f3b23f2 | 2014-06-15 13:36:45 -0700 | [diff] [blame] | 332 | bt_hc_if->cleanup(); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 333 | } |
| 334 | } |
| 335 | |
| 336 | /******************************************************************************* |
| 337 | ** |
| 338 | ** Function preload_wait_timeout |
| 339 | ** |
| 340 | ** Description Timeout thread of preload watchdog timer |
| 341 | ** |
| 342 | ** Returns None |
| 343 | ** |
| 344 | *******************************************************************************/ |
| 345 | static void preload_wait_timeout(union sigval arg) |
| 346 | { |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 347 | UNUSED(arg); |
| 348 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 349 | APPL_TRACE_ERROR("...preload_wait_timeout (retried:%d/max-retry:%d)...", |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 350 | preload_retry_cb.retry_counts, |
| 351 | PRELOAD_MAX_RETRY_ATTEMPTS); |
| 352 | |
| 353 | if (preload_retry_cb.retry_counts++ < PRELOAD_MAX_RETRY_ATTEMPTS) |
| 354 | { |
| 355 | bte_hci_disable(); |
| 356 | GKI_delay(100); |
| 357 | bte_hci_enable(); |
| 358 | } |
| 359 | else |
| 360 | { |
| 361 | /* Notify BTIF_TASK that the init procedure had failed*/ |
| 362 | GKI_send_event(BTIF_TASK, BT_EVT_HARDWARE_INIT_FAIL); |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | /******************************************************************************* |
| 367 | ** |
| 368 | ** Function preload_start_wait_timer |
| 369 | ** |
| 370 | ** Description Launch startup watchdog timer |
| 371 | ** |
| 372 | ** Returns None |
| 373 | ** |
| 374 | *******************************************************************************/ |
| 375 | static void preload_start_wait_timer(void) |
| 376 | { |
| 377 | int status; |
| 378 | struct itimerspec ts; |
| 379 | struct sigevent se; |
| 380 | UINT32 timeout_ms = PRELOAD_START_TIMEOUT_MS; |
| 381 | |
| 382 | if (preload_retry_cb.timer_created == FALSE) |
| 383 | { |
| 384 | se.sigev_notify = SIGEV_THREAD; |
| 385 | se.sigev_value.sival_ptr = &preload_retry_cb.timer_id; |
| 386 | se.sigev_notify_function = preload_wait_timeout; |
| 387 | se.sigev_notify_attributes = NULL; |
| 388 | |
| 389 | status = timer_create(CLOCK_MONOTONIC, &se, &preload_retry_cb.timer_id); |
| 390 | |
| 391 | if (status == 0) |
| 392 | preload_retry_cb.timer_created = TRUE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 393 | } |
| 394 | |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 395 | if (preload_retry_cb.timer_created == TRUE) |
| 396 | { |
| 397 | ts.it_value.tv_sec = timeout_ms/1000; |
| 398 | ts.it_value.tv_nsec = 1000000*(timeout_ms%1000); |
| 399 | ts.it_interval.tv_sec = 0; |
| 400 | ts.it_interval.tv_nsec = 0; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 401 | |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 402 | status = timer_settime(preload_retry_cb.timer_id, 0, &ts, 0); |
| 403 | if (status == -1) |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 404 | APPL_TRACE_ERROR("Failed to fire preload watchdog timer"); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 405 | } |
| 406 | } |
| 407 | |
| 408 | /******************************************************************************* |
| 409 | ** |
| 410 | ** Function preload_stop_wait_timer |
| 411 | ** |
| 412 | ** Description Stop preload watchdog timer |
| 413 | ** |
| 414 | ** Returns None |
| 415 | ** |
| 416 | *******************************************************************************/ |
| 417 | static void preload_stop_wait_timer(void) |
| 418 | { |
| 419 | if (preload_retry_cb.timer_created == TRUE) |
| 420 | { |
| 421 | timer_delete(preload_retry_cb.timer_id); |
| 422 | preload_retry_cb.timer_created = FALSE; |
| 423 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | /****************************************************************************** |
| 427 | ** |
| 428 | ** Function bte_main_postload_cfg |
| 429 | ** |
| 430 | ** Description BTE MAIN API - Stack postload configuration |
| 431 | ** |
| 432 | ** Returns None |
| 433 | ** |
| 434 | ******************************************************************************/ |
| 435 | void bte_main_postload_cfg(void) |
| 436 | { |
| 437 | if (bt_hc_if) |
| 438 | bt_hc_if->postload(NULL); |
| 439 | } |
| 440 | |
| 441 | #if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) |
| 442 | /****************************************************************************** |
| 443 | ** |
| 444 | ** Function bte_main_enable_lpm |
| 445 | ** |
| 446 | ** Description BTE MAIN API - Enable/Disable low power mode operation |
| 447 | ** |
| 448 | ** Returns None |
| 449 | ** |
| 450 | ******************************************************************************/ |
| 451 | void bte_main_enable_lpm(BOOLEAN enable) |
| 452 | { |
| 453 | int result = -1; |
| 454 | |
| 455 | if (bt_hc_if) |
| 456 | result = bt_hc_if->lpm( \ |
| 457 | (enable == TRUE) ? BT_HC_LPM_ENABLE : BT_HC_LPM_DISABLE \ |
| 458 | ); |
| 459 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 460 | APPL_TRACE_EVENT("HC lib lpm enable=%d return %d", enable, result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | /****************************************************************************** |
| 464 | ** |
| 465 | ** Function bte_main_lpm_allow_bt_device_sleep |
| 466 | ** |
| 467 | ** Description BTE MAIN API - Allow BT controller goest to sleep |
| 468 | ** |
| 469 | ** Returns None |
| 470 | ** |
| 471 | ******************************************************************************/ |
| 472 | void bte_main_lpm_allow_bt_device_sleep() |
| 473 | { |
| 474 | int result = -1; |
| 475 | |
| 476 | if ((bt_hc_if) && (lpm_enabled == TRUE)) |
| 477 | result = bt_hc_if->lpm(BT_HC_LPM_WAKE_DEASSERT); |
| 478 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 479 | APPL_TRACE_DEBUG("HC lib lpm deassertion return %d", result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 480 | } |
| 481 | |
| 482 | /****************************************************************************** |
| 483 | ** |
| 484 | ** Function bte_main_lpm_wake_bt_device |
| 485 | ** |
| 486 | ** Description BTE MAIN API - Wake BT controller up if it is in sleep mode |
| 487 | ** |
| 488 | ** Returns None |
| 489 | ** |
| 490 | ******************************************************************************/ |
| 491 | void bte_main_lpm_wake_bt_device() |
| 492 | { |
| 493 | int result = -1; |
| 494 | |
| 495 | if ((bt_hc_if) && (lpm_enabled == TRUE)) |
| 496 | result = bt_hc_if->lpm(BT_HC_LPM_WAKE_ASSERT); |
| 497 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 498 | APPL_TRACE_DEBUG("HC lib lpm assertion return %d", result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 499 | } |
| 500 | #endif // HCILP_INCLUDED |
| 501 | |
Matthew Xie | 66432dc | 2014-04-27 05:45:32 -0700 | [diff] [blame] | 502 | |
| 503 | /* NOTICE: |
| 504 | * Definitions for audio state structure, this type needs to match to |
| 505 | * the bt_vendor_op_audio_state_t type defined in bt_vendor_lib.h |
| 506 | */ |
| 507 | typedef struct { |
| 508 | UINT16 handle; |
| 509 | UINT16 peer_codec; |
| 510 | UINT16 state; |
| 511 | } bt_hc_audio_state_t; |
| 512 | |
| 513 | struct bt_audio_state_tag { |
| 514 | BT_HDR hdr; |
| 515 | bt_hc_audio_state_t audio; |
| 516 | }; |
| 517 | |
| 518 | /****************************************************************************** |
| 519 | ** |
| 520 | ** Function set_audio_state |
| 521 | ** |
| 522 | ** Description Sets audio state on controller state for SCO (PCM, WBS, FM) |
| 523 | ** |
| 524 | ** Parameters handle: codec related handle for SCO: sco cb idx, unused for |
| 525 | ** codec: BTA_AG_CODEC_MSBC, BTA_AG_CODEC_CSVD or FM codec |
| 526 | ** state: codec state, eg. BTA_AG_CO_AUD_STATE_SETUP |
| 527 | ** param: future extensions, e.g. call-in structure/event. |
| 528 | ** |
| 529 | ** Returns None |
| 530 | ** |
| 531 | ******************************************************************************/ |
| 532 | int set_audio_state(UINT16 handle, UINT16 codec, UINT8 state, void *param) |
| 533 | { |
| 534 | struct bt_audio_state_tag *p_msg; |
| 535 | int result = -1; |
| 536 | |
| 537 | APPL_TRACE_API("set_audio_state(handle: %d, codec: 0x%x, state: %d)", handle, |
| 538 | codec, state); |
| 539 | if (NULL != param) |
| 540 | APPL_TRACE_WARNING("set_audio_state() non-null param not supported"); |
| 541 | p_msg = (struct bt_audio_state_tag *)GKI_getbuf(sizeof(*p_msg)); |
| 542 | if (!p_msg) |
| 543 | return result; |
| 544 | p_msg->audio.handle = handle; |
| 545 | p_msg->audio.peer_codec = codec; |
| 546 | p_msg->audio.state = state; |
| 547 | |
| 548 | p_msg->hdr.event = MSG_CTRL_TO_HC_CMD | (MSG_SUB_EVT_MASK & BT_HC_AUDIO_STATE); |
| 549 | p_msg->hdr.len = sizeof(p_msg->audio); |
| 550 | p_msg->hdr.offset = 0; |
| 551 | /* layer_specific shall contain return path event! for BTA events! |
| 552 | * 0 means no return message is expected. */ |
| 553 | p_msg->hdr.layer_specific = 0; |
| 554 | if (bt_hc_if) |
| 555 | { |
| 556 | bt_hc_if->tx_cmd((TRANSAC)p_msg, (char *)(&p_msg->audio), sizeof(*p_msg)); |
| 557 | } |
| 558 | return result; |
| 559 | } |
| 560 | |
| 561 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 562 | /****************************************************************************** |
| 563 | ** |
| 564 | ** Function bte_main_hci_send |
| 565 | ** |
| 566 | ** Description BTE MAIN API - This function is called by the upper stack to |
| 567 | ** send an HCI message. The function displays a protocol trace |
| 568 | ** message (if enabled), and then calls the 'transmit' function |
| 569 | ** associated with the currently selected HCI transport |
| 570 | ** |
| 571 | ** Returns None |
| 572 | ** |
| 573 | ******************************************************************************/ |
| 574 | void bte_main_hci_send (BT_HDR *p_msg, UINT16 event) |
| 575 | { |
| 576 | UINT16 sub_event = event & BT_SUB_EVT_MASK; /* local controller ID */ |
| 577 | |
| 578 | p_msg->event = event; |
| 579 | |
| 580 | |
| 581 | if((sub_event == LOCAL_BR_EDR_CONTROLLER_ID) || \ |
| 582 | (sub_event == LOCAL_BLE_CONTROLLER_ID)) |
| 583 | { |
| 584 | if (bt_hc_if) |
| 585 | bt_hc_if->transmit_buf((TRANSAC)p_msg, \ |
| 586 | (char *) (p_msg + 1), \ |
| 587 | p_msg->len); |
| 588 | else |
| 589 | GKI_freebuf(p_msg); |
| 590 | } |
| 591 | else |
| 592 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 593 | APPL_TRACE_ERROR("Invalid Controller ID. Discarding message."); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 594 | GKI_freebuf(p_msg); |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | /****************************************************************************** |
| 599 | ** |
| 600 | ** Function bte_main_post_reset_init |
| 601 | ** |
| 602 | ** Description BTE MAIN API - This function is mapped to BTM_APP_DEV_INIT |
| 603 | ** and shall be automatically called from BTE after HCI_Reset |
| 604 | ** |
| 605 | ** Returns None |
| 606 | ** |
| 607 | ******************************************************************************/ |
| 608 | void bte_main_post_reset_init() |
| 609 | { |
| 610 | BTM_ContinueReset(); |
| 611 | } |
| 612 | |
| 613 | /***************************************************************************** |
| 614 | ** |
| 615 | ** libbt-hci Callback Functions |
| 616 | ** |
| 617 | *****************************************************************************/ |
| 618 | |
| 619 | /****************************************************************************** |
| 620 | ** |
| 621 | ** Function preload_cb |
| 622 | ** |
| 623 | ** Description HOST/CONTROLLER LIB CALLBACK API - This function is called |
| 624 | ** when the libbt-hci completed stack preload process |
| 625 | ** |
| 626 | ** Returns None |
| 627 | ** |
| 628 | ******************************************************************************/ |
| 629 | static void preload_cb(TRANSAC transac, bt_hc_preload_result_t result) |
| 630 | { |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 631 | UNUSED(transac); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 632 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 633 | APPL_TRACE_EVENT("HC preload_cb %d [0:SUCCESS 1:FAIL]", result); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 634 | |
| 635 | if (result == BT_HC_PRELOAD_SUCCESS) |
| 636 | { |
| 637 | preload_stop_wait_timer(); |
| 638 | |
| 639 | /* notify BTU task that libbt-hci is ready */ |
| 640 | GKI_send_event(BTU_TASK, BT_EVT_PRELOAD_CMPL); |
| 641 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 642 | } |
| 643 | |
| 644 | /****************************************************************************** |
| 645 | ** |
| 646 | ** Function postload_cb |
| 647 | ** |
| 648 | ** Description HOST/CONTROLLER LIB CALLBACK API - This function is called |
| 649 | ** when the libbt-hci lib completed stack postload process |
| 650 | ** |
| 651 | ** Returns None |
| 652 | ** |
| 653 | ******************************************************************************/ |
| 654 | static void postload_cb(TRANSAC transac, bt_hc_postload_result_t result) |
| 655 | { |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 656 | UNUSED(transac); |
| 657 | |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 658 | APPL_TRACE_EVENT("HC postload_cb %d", result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | /****************************************************************************** |
| 662 | ** |
| 663 | ** Function lpm_cb |
| 664 | ** |
| 665 | ** Description HOST/CONTROLLER LIB CALLBACK API - This function is called |
| 666 | ** back from the libbt-hci to indicate the current LPM state |
| 667 | ** |
| 668 | ** Returns None |
| 669 | ** |
| 670 | ******************************************************************************/ |
| 671 | static void lpm_cb(bt_hc_lpm_request_result_t result) |
| 672 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 673 | APPL_TRACE_EVENT("HC lpm_result_cb %d", result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 674 | lpm_enabled = (result == BT_HC_LPM_ENABLED) ? TRUE : FALSE; |
| 675 | } |
| 676 | |
| 677 | /****************************************************************************** |
| 678 | ** |
| 679 | ** Function hostwake_ind |
| 680 | ** |
| 681 | ** Description HOST/CONTROLLER LIB CALLOUT API - This function is called |
| 682 | ** from the libbt-hci to indicate the HostWake event |
| 683 | ** |
| 684 | ** Returns None |
| 685 | ** |
| 686 | ******************************************************************************/ |
| 687 | static void hostwake_ind(bt_hc_low_power_event_t event) |
| 688 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 689 | APPL_TRACE_EVENT("HC hostwake_ind %d", event); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | /****************************************************************************** |
| 693 | ** |
| 694 | ** Function alloc |
| 695 | ** |
| 696 | ** Description HOST/CONTROLLER LIB CALLOUT API - This function is called |
| 697 | ** from the libbt-hci to request for data buffer allocation |
| 698 | ** |
| 699 | ** Returns NULL / pointer to allocated buffer |
| 700 | ** |
| 701 | ******************************************************************************/ |
| 702 | static char *alloc(int size) |
| 703 | { |
| 704 | BT_HDR *p_hdr = NULL; |
| 705 | |
| 706 | /* |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 707 | APPL_TRACE_DEBUG("HC alloc size=%d", size); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 708 | */ |
| 709 | |
Ganesh Ganapathi Batta | 8fe5887 | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 710 | /* Requested buffer size cannot exceed GKI_MAX_BUF_SIZE. */ |
| 711 | if (size > GKI_MAX_BUF_SIZE) |
| 712 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 713 | APPL_TRACE_ERROR("HCI DATA SIZE %d greater than MAX %d", |
Ganesh Ganapathi Batta | 8fe5887 | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 714 | size, GKI_MAX_BUF_SIZE); |
| 715 | return NULL; |
| 716 | } |
| 717 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 718 | p_hdr = (BT_HDR *) GKI_getbuf ((UINT16) size); |
| 719 | |
| 720 | if (p_hdr == NULL) |
| 721 | { |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 722 | APPL_TRACE_WARNING("alloc returns NO BUFFER! (sz %d)", size); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 723 | } |
| 724 | |
| 725 | return ((char *) p_hdr); |
| 726 | } |
| 727 | |
| 728 | /****************************************************************************** |
| 729 | ** |
| 730 | ** Function dealloc |
| 731 | ** |
| 732 | ** Description HOST/CONTROLLER LIB CALLOUT API - This function is called |
| 733 | ** from the libbt-hci to release the data buffer allocated |
| 734 | ** through the alloc call earlier |
| 735 | ** |
| 736 | ** Bluedroid libbt-hci library uses 'transac' parameter to |
| 737 | ** pass data-path buffer/packet across bt_hci_lib interface |
Sharvil Nanavati | 75e8f41 | 2014-06-24 17:02:30 -0700 | [diff] [blame] | 738 | ** boundary. |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 739 | ** |
| 740 | ******************************************************************************/ |
Sharvil Nanavati | 75e8f41 | 2014-06-24 17:02:30 -0700 | [diff] [blame] | 741 | static void dealloc(TRANSAC transac) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 742 | { |
| 743 | GKI_freebuf(transac); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 744 | } |
| 745 | |
| 746 | /****************************************************************************** |
| 747 | ** |
| 748 | ** Function data_ind |
| 749 | ** |
| 750 | ** Description HOST/CONTROLLER LIB CALLOUT API - This function is called |
| 751 | ** from the libbt-hci to pass in the received HCI packets |
| 752 | ** |
| 753 | ** The core stack is responsible for releasing the data buffer |
| 754 | ** passed in from the libbt-hci once the core stack has done |
| 755 | ** with it. |
| 756 | ** |
| 757 | ** Bluedroid libbt-hci library uses 'transac' parameter to |
| 758 | ** pass data-path buffer/packet across bt_hci_lib interface |
| 759 | ** boundary. The 'p_buf' and 'len' parameters are not intended |
| 760 | ** to be used here but might point to data portion in data- |
| 761 | ** path buffer and length of valid data respectively. |
| 762 | ** |
| 763 | ** Returns bt_hc_status_t |
| 764 | ** |
| 765 | ******************************************************************************/ |
| 766 | static int data_ind(TRANSAC transac, char *p_buf, int len) |
| 767 | { |
| 768 | BT_HDR *p_msg = (BT_HDR *) transac; |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 769 | UNUSED(p_buf); |
| 770 | UNUSED(len); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 771 | |
| 772 | /* |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 773 | APPL_TRACE_DEBUG("HC data_ind event=0x%04X (len=%d)", p_msg->event, len); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 774 | */ |
| 775 | |
| 776 | GKI_send_msg (BTU_TASK, BTU_HCI_RCV_MBOX, transac); |
| 777 | return BT_HC_STATUS_SUCCESS; |
| 778 | } |
| 779 | |
| 780 | /****************************************************************************** |
| 781 | ** |
| 782 | ** Function tx_result |
| 783 | ** |
| 784 | ** Description HOST/CONTROLLER LIB CALLBACK API - This function is called |
| 785 | ** from the libbt-hci once it has processed/sent the prior data |
| 786 | ** buffer which core stack passed to it through transmit_buf |
| 787 | ** call earlier. |
| 788 | ** |
| 789 | ** The core stack is responsible for releasing the data buffer |
| 790 | ** if it has been completedly processed. |
| 791 | ** |
| 792 | ** Bluedroid libbt-hci library uses 'transac' parameter to |
| 793 | ** pass data-path buffer/packet across bt_hci_lib interface |
| 794 | ** boundary. The 'p_buf' is not intended to be used here |
| 795 | ** but might point to data portion in data-path buffer. |
| 796 | ** |
| 797 | ** Returns bt_hc_status_t |
| 798 | ** |
| 799 | ******************************************************************************/ |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 800 | static int tx_result(TRANSAC transac, char *p_buf, bt_hc_transmit_result_t result) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 801 | { |
Mike J. Chen | 5cd8bff | 2014-01-31 18:16:59 -0800 | [diff] [blame] | 802 | UNUSED(p_buf); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 803 | /* |
Sharvil Nanavati | e8c3d75 | 2014-05-04 10:12:26 -0700 | [diff] [blame] | 804 | APPL_TRACE_DEBUG("HC tx_result %d (event=%04X)", result, \ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 805 | ((BT_HDR *)transac)->event); |
| 806 | */ |
| 807 | |
| 808 | if (result == BT_HC_TX_FRAGMENT) |
| 809 | { |
| 810 | GKI_send_msg (BTU_TASK, BTU_HCI_RCV_MBOX, transac); |
| 811 | } |
| 812 | else |
| 813 | { |
| 814 | GKI_freebuf(transac); |
| 815 | } |
| 816 | |
| 817 | return BT_HC_STATUS_SUCCESS; |
| 818 | } |
| 819 | |
| 820 | /***************************************************************************** |
| 821 | ** The libbt-hci Callback Functions Table |
| 822 | *****************************************************************************/ |
| 823 | static const bt_hc_callbacks_t hc_callbacks = { |
| 824 | sizeof(bt_hc_callbacks_t), |
| 825 | preload_cb, |
| 826 | postload_cb, |
| 827 | lpm_cb, |
| 828 | hostwake_ind, |
| 829 | alloc, |
| 830 | dealloc, |
| 831 | data_ind, |
| 832 | tx_result |
| 833 | }; |
| 834 | |