The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 1999-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 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 19 | #define LOG_TAG "btu_task" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 20 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 21 | #include <assert.h> |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 22 | #include <stdlib.h> |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 23 | #include <stdio.h> |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 24 | #include <string.h> |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 25 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 26 | #include "alarm.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 27 | #include "bt_target.h" |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 28 | #include "bt_trace.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 29 | #include "bt_types.h" |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 30 | #include "bt_utils.h" |
Chris Manton | 0eefef0 | 2014-09-08 15:01:39 -0700 | [diff] [blame] | 31 | #include "btif_common.h" |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 32 | #include "btm_api.h" |
| 33 | #include "btm_int.h" |
| 34 | #include "btu.h" |
| 35 | #include "fixed_queue.h" |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 36 | #include "future.h" |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 37 | #include "gki.h" |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 38 | #include "hash_map.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 39 | #include "hcimsgs.h" |
| 40 | #include "l2c_int.h" |
Zach Johnson | 9891f32 | 2014-09-22 22:11:55 -0700 | [diff] [blame] | 41 | #include "module.h" |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 42 | #include "osi.h" |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 43 | #include "osi/include/log.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 44 | #include "sdpint.h" |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 45 | #include "thread.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 46 | |
| 47 | #if ( defined(RFCOMM_INCLUDED) && RFCOMM_INCLUDED == TRUE ) |
| 48 | #include "port_api.h" |
| 49 | #include "port_ext.h" |
| 50 | #endif |
| 51 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 52 | #if (defined(EVAL) && EVAL == TRUE) |
| 53 | #include "btu_eval.h" |
| 54 | #endif |
| 55 | |
| 56 | #if GAP_INCLUDED == TRUE |
| 57 | #include "gap_int.h" |
| 58 | #endif |
| 59 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 60 | /* BTE application task */ |
| 61 | #if APPL_INCLUDED == TRUE |
| 62 | #include "bte_appl.h" |
| 63 | #endif |
| 64 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 65 | #if (defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE) |
| 66 | #include "bnep_int.h" |
| 67 | #endif |
| 68 | |
| 69 | #if (defined(PAN_INCLUDED) && PAN_INCLUDED == TRUE) |
| 70 | #include "pan_int.h" |
| 71 | #endif |
| 72 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 73 | #if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE ) |
| 74 | #include "hidh_int.h" |
| 75 | #endif |
| 76 | |
| 77 | #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) |
| 78 | #include "avdt_int.h" |
| 79 | #else |
| 80 | extern void avdt_rcv_sync_info (BT_HDR *p_buf); /* this is for hci_test */ |
| 81 | #endif |
| 82 | |
| 83 | #if (defined(MCA_INCLUDED) && MCA_INCLUDED == TRUE) |
| 84 | #include "mca_api.h" |
| 85 | #include "mca_defs.h" |
| 86 | #include "mca_int.h" |
| 87 | #endif |
| 88 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 89 | #include "bta_sys.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 90 | |
| 91 | #if (BLE_INCLUDED == TRUE) |
| 92 | #include "gatt_int.h" |
| 93 | #if (SMP_INCLUDED == TRUE) |
| 94 | #include "smp_int.h" |
| 95 | #endif |
| 96 | #include "btm_ble_int.h" |
| 97 | #endif |
| 98 | |
| 99 | #ifdef __cplusplus |
| 100 | extern "C" |
| 101 | { |
| 102 | #endif |
| 103 | |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 104 | extern void BTE_InitStack(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 105 | |
| 106 | #ifdef __cplusplus |
| 107 | } |
| 108 | #endif |
| 109 | |
| 110 | /* Define BTU storage area |
| 111 | */ |
| 112 | #if BTU_DYNAMIC_MEMORY == FALSE |
| 113 | tBTU_CB btu_cb; |
| 114 | #endif |
| 115 | |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 116 | // Communication queue between btu_task and bta. |
| 117 | extern fixed_queue_t *btu_bta_msg_queue; |
| 118 | |
| 119 | // Communication queue between btu_task and hci. |
| 120 | extern fixed_queue_t *btu_hci_msg_queue; |
| 121 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 122 | // Timer queue between btu_task and bta. |
| 123 | extern fixed_queue_t *btu_bta_alarm_queue; |
| 124 | |
| 125 | // General timer queue. |
| 126 | extern fixed_queue_t *btu_general_alarm_queue; |
| 127 | extern hash_map_t *btu_general_alarm_hash_map; |
| 128 | extern pthread_mutex_t btu_general_alarm_lock; |
| 129 | |
| 130 | // Oneshot timer queue. |
| 131 | extern fixed_queue_t *btu_oneshot_alarm_queue; |
| 132 | extern hash_map_t *btu_oneshot_alarm_hash_map; |
| 133 | extern pthread_mutex_t btu_oneshot_alarm_lock; |
| 134 | |
| 135 | // l2cap timer queue. |
| 136 | extern fixed_queue_t *btu_l2cap_alarm_queue; |
| 137 | extern hash_map_t *btu_l2cap_alarm_hash_map; |
| 138 | extern pthread_mutex_t btu_l2cap_alarm_lock; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 139 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 140 | extern fixed_queue_t *event_queue; |
| 141 | extern fixed_queue_t *btif_msg_queue; |
| 142 | |
| 143 | extern thread_t *bt_workqueue_thread; |
| 144 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 145 | /* Define a function prototype to allow a generic timeout handler */ |
| 146 | typedef void (tUSER_TIMEOUT_FUNC) (TIMER_LIST_ENT *p_tle); |
| 147 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 148 | static void btu_l2cap_alarm_process(TIMER_LIST_ENT *p_tle); |
| 149 | static void btu_general_alarm_process(TIMER_LIST_ENT *p_tle); |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 150 | static void btu_bta_alarm_process(TIMER_LIST_ENT *p_tle); |
| 151 | static void btu_hci_msg_process(BT_HDR *p_msg); |
| 152 | |
| 153 | void btu_hci_msg_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 154 | BT_HDR *p_msg = (BT_HDR *)fixed_queue_dequeue(queue); |
| 155 | btu_hci_msg_process(p_msg); |
| 156 | } |
| 157 | |
| 158 | void btu_general_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 159 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue); |
| 160 | btu_general_alarm_process(p_tle); |
| 161 | } |
| 162 | |
| 163 | void btu_oneshot_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 164 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue); |
| 165 | btu_general_alarm_process(p_tle); |
| 166 | |
| 167 | switch (p_tle->event) { |
| 168 | #if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE) |
| 169 | case BTU_TTYPE_BLE_RANDOM_ADDR: |
| 170 | btm_ble_timeout(p_tle); |
| 171 | break; |
| 172 | #endif |
| 173 | |
| 174 | case BTU_TTYPE_USER_FUNC: |
| 175 | { |
| 176 | tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_tle->param; |
| 177 | (*p_uf)(p_tle); |
| 178 | } |
| 179 | break; |
| 180 | |
| 181 | default: |
| 182 | // FAIL |
| 183 | BTM_TRACE_WARNING("Received unexpected oneshot timer event:0x%x\n", |
| 184 | p_tle->event); |
| 185 | break; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | void btu_l2cap_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 190 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue); |
| 191 | btu_l2cap_alarm_process(p_tle); |
| 192 | } |
| 193 | |
| 194 | void btu_bta_msg_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 195 | BT_HDR *p_msg = (BT_HDR *)fixed_queue_dequeue(queue); |
| 196 | bta_sys_event(p_msg); |
| 197 | } |
| 198 | |
| 199 | void btu_bta_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) { |
| 200 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue); |
| 201 | btu_bta_alarm_process(p_tle); |
| 202 | } |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 203 | |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 204 | static void btu_hci_msg_process(BT_HDR *p_msg) { |
| 205 | /* Determine the input message type. */ |
| 206 | switch (p_msg->event & BT_EVT_MASK) |
| 207 | { |
Zach Johnson | 218f375 | 2014-09-03 14:36:44 -0700 | [diff] [blame] | 208 | case BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK: // TODO(zachoverflow): remove this |
| 209 | ((post_to_task_hack_t *)(&p_msg->data[0]))->callback(p_msg); |
| 210 | break; |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 211 | case BT_EVT_TO_BTU_HCI_ACL: |
| 212 | /* All Acl Data goes to L2CAP */ |
| 213 | l2c_rcv_acl_data (p_msg); |
| 214 | break; |
| 215 | |
| 216 | case BT_EVT_TO_BTU_L2C_SEG_XMIT: |
| 217 | /* L2CAP segment transmit complete */ |
| 218 | l2c_link_segments_xmitted (p_msg); |
| 219 | break; |
| 220 | |
| 221 | case BT_EVT_TO_BTU_HCI_SCO: |
| 222 | #if BTM_SCO_INCLUDED == TRUE |
| 223 | btm_route_sco_data (p_msg); |
| 224 | break; |
| 225 | #endif |
| 226 | |
| 227 | case BT_EVT_TO_BTU_HCI_EVT: |
| 228 | btu_hcif_process_event ((UINT8)(p_msg->event & BT_SUB_EVT_MASK), p_msg); |
| 229 | GKI_freebuf(p_msg); |
| 230 | |
| 231 | #if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) |
| 232 | /* If host receives events which it doesn't response to, */ |
| 233 | /* host should start idle timer to enter sleep mode. */ |
| 234 | btu_check_bt_sleep (); |
| 235 | #endif |
| 236 | break; |
| 237 | |
| 238 | case BT_EVT_TO_BTU_HCI_CMD: |
| 239 | btu_hcif_send_cmd ((UINT8)(p_msg->event & BT_SUB_EVT_MASK), p_msg); |
| 240 | break; |
| 241 | |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 242 | default:; |
| 243 | int i = 0; |
| 244 | uint16_t mask = (UINT16) (p_msg->event & BT_EVT_MASK); |
| 245 | BOOLEAN handled = FALSE; |
| 246 | |
| 247 | for (; !handled && i < BTU_MAX_REG_EVENT; i++) |
| 248 | { |
| 249 | if (btu_cb.event_reg[i].event_cb == NULL) |
| 250 | continue; |
| 251 | |
| 252 | if (mask == btu_cb.event_reg[i].event_range) |
| 253 | { |
| 254 | if (btu_cb.event_reg[i].event_cb) |
| 255 | { |
| 256 | btu_cb.event_reg[i].event_cb(p_msg); |
| 257 | handled = TRUE; |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | if (handled == FALSE) |
| 263 | GKI_freebuf (p_msg); |
| 264 | |
| 265 | break; |
| 266 | } |
| 267 | |
| 268 | } |
| 269 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 270 | static void btu_bta_alarm_process(TIMER_LIST_ENT *p_tle) { |
| 271 | /* call timer callback */ |
| 272 | if (p_tle->p_cback) { |
| 273 | (*p_tle->p_cback)(p_tle); |
| 274 | } else if (p_tle->event) { |
| 275 | BT_HDR *p_msg; |
| 276 | if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) { |
| 277 | p_msg->event = p_tle->event; |
| 278 | p_msg->layer_specific = 0; |
| 279 | bta_sys_sendmsg(p_msg); |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 280 | } |
| 281 | } |
Chris Manton | 860a9af | 2014-08-27 10:30:47 -0700 | [diff] [blame] | 282 | } |
| 283 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 284 | void btu_task_start_up(UNUSED_ATTR void *context) { |
| 285 | BT_TRACE(TRACE_LAYER_BTU, TRACE_TYPE_API, |
| 286 | "btu_task pending for preload complete event"); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 287 | |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 288 | LOG_INFO("Bluetooth chip preload is complete"); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 289 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 290 | BT_TRACE(TRACE_LAYER_BTU, TRACE_TYPE_API, |
| 291 | "btu_task received preload complete event"); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 292 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 293 | /* Initialize the mandatory core stack control blocks |
| 294 | (BTU, BTM, L2CAP, and SDP) |
| 295 | */ |
| 296 | btu_init_core(); |
YK Jeffrey Chao | 48ebe2c | 2013-04-24 11:38:06 -0700 | [diff] [blame] | 297 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 298 | /* Initialize any optional stack components */ |
| 299 | BTE_InitStack(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 300 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 301 | bta_sys_init(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 302 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 303 | /* Initialise platform trace levels at this point as BTE_InitStack() and bta_sys_init() |
| 304 | * reset the control blocks and preset the trace level with XXX_INITIAL_TRACE_LEVEL |
| 305 | */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 306 | #if ( BT_USE_TRACES==TRUE ) |
Zach Johnson | 9891f32 | 2014-09-22 22:11:55 -0700 | [diff] [blame] | 307 | module_init(get_module(BTE_LOGMSG_MODULE)); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 308 | #endif |
| 309 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 310 | // Inform the bt jni thread initialization is ok. |
| 311 | btif_transfer_context(btif_init_ok, 0, NULL, 0, NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 312 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 313 | fixed_queue_register_dequeue(btu_bta_msg_queue, |
| 314 | thread_get_reactor(bt_workqueue_thread), |
| 315 | btu_bta_msg_ready, |
| 316 | NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 317 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 318 | fixed_queue_register_dequeue(btu_hci_msg_queue, |
| 319 | thread_get_reactor(bt_workqueue_thread), |
| 320 | btu_hci_msg_ready, |
| 321 | NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 322 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 323 | fixed_queue_register_dequeue(btu_general_alarm_queue, |
| 324 | thread_get_reactor(bt_workqueue_thread), |
| 325 | btu_general_alarm_ready, |
| 326 | NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 327 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 328 | fixed_queue_register_dequeue(btu_oneshot_alarm_queue, |
| 329 | thread_get_reactor(bt_workqueue_thread), |
| 330 | btu_oneshot_alarm_ready, |
| 331 | NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 332 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 333 | fixed_queue_register_dequeue(btu_l2cap_alarm_queue, |
| 334 | thread_get_reactor(bt_workqueue_thread), |
| 335 | btu_l2cap_alarm_ready, |
| 336 | NULL); |
| 337 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 338 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 339 | void btu_task_shut_down(UNUSED_ATTR void *context) { |
Zach Johnson | c8ac8a2 | 2014-09-26 17:04:51 -0700 | [diff] [blame] | 340 | fixed_queue_unregister_dequeue(btu_bta_msg_queue); |
| 341 | fixed_queue_unregister_dequeue(btu_hci_msg_queue); |
| 342 | fixed_queue_unregister_dequeue(btu_general_alarm_queue); |
| 343 | fixed_queue_unregister_dequeue(btu_oneshot_alarm_queue); |
| 344 | fixed_queue_unregister_dequeue(btu_l2cap_alarm_queue); |
| 345 | |
Chris Manton | b1f9915 | 2014-09-26 21:31:38 -0700 | [diff] [blame] | 346 | #if ( BT_USE_TRACES==TRUE ) |
| 347 | module_clean_up(get_module(BTE_LOGMSG_MODULE)); |
| 348 | #endif |
| 349 | |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 350 | bta_sys_free(); |
Chris Manton | 307381e | 2014-09-04 19:48:49 -0700 | [diff] [blame] | 351 | btu_free_core(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | /******************************************************************************* |
| 355 | ** |
| 356 | ** Function btu_start_timer |
| 357 | ** |
| 358 | ** Description Start a timer for the specified amount of time. |
| 359 | ** NOTE: The timeout resolution is in SECONDS! (Even |
| 360 | ** though the timer structure field is ticks) |
| 361 | ** |
| 362 | ** Returns void |
| 363 | ** |
| 364 | *******************************************************************************/ |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 365 | static void btu_general_alarm_process(TIMER_LIST_ENT *p_tle) { |
| 366 | assert(p_tle != NULL); |
| 367 | |
| 368 | switch (p_tle->event) { |
| 369 | case BTU_TTYPE_BTM_DEV_CTL: |
| 370 | btm_dev_timeout(p_tle); |
| 371 | break; |
| 372 | |
| 373 | case BTU_TTYPE_BTM_ACL: |
| 374 | btm_acl_timeout(p_tle); |
| 375 | break; |
| 376 | |
| 377 | case BTU_TTYPE_L2CAP_LINK: |
| 378 | case BTU_TTYPE_L2CAP_CHNL: |
| 379 | case BTU_TTYPE_L2CAP_HOLD: |
| 380 | case BTU_TTYPE_L2CAP_INFO: |
| 381 | case BTU_TTYPE_L2CAP_FCR_ACK: |
| 382 | l2c_process_timeout (p_tle); |
| 383 | break; |
| 384 | |
| 385 | case BTU_TTYPE_SDP: |
| 386 | sdp_conn_timeout ((tCONN_CB *)p_tle->param); |
| 387 | break; |
| 388 | |
| 389 | case BTU_TTYPE_BTM_RMT_NAME: |
| 390 | btm_inq_rmt_name_failed(); |
| 391 | break; |
| 392 | |
| 393 | #if (defined(RFCOMM_INCLUDED) && RFCOMM_INCLUDED == TRUE) |
| 394 | case BTU_TTYPE_RFCOMM_MFC: |
| 395 | case BTU_TTYPE_RFCOMM_PORT: |
| 396 | rfcomm_process_timeout (p_tle); |
| 397 | break; |
| 398 | |
| 399 | #endif /* If defined(RFCOMM_INCLUDED) && RFCOMM_INCLUDED == TRUE */ |
| 400 | |
| 401 | #if ((defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE)) |
| 402 | case BTU_TTYPE_BNEP: |
| 403 | bnep_process_timeout(p_tle); |
| 404 | break; |
| 405 | #endif |
| 406 | |
| 407 | |
| 408 | #if (defined(AVDT_INCLUDED) && AVDT_INCLUDED == TRUE) |
| 409 | case BTU_TTYPE_AVDT_CCB_RET: |
| 410 | case BTU_TTYPE_AVDT_CCB_RSP: |
| 411 | case BTU_TTYPE_AVDT_CCB_IDLE: |
| 412 | case BTU_TTYPE_AVDT_SCB_TC: |
| 413 | avdt_process_timeout(p_tle); |
| 414 | break; |
| 415 | #endif |
| 416 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 417 | #if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE) |
| 418 | case BTU_TTYPE_HID_HOST_REPAGE_TO : |
| 419 | hidh_proc_repage_timeout(p_tle); |
| 420 | break; |
| 421 | #endif |
| 422 | |
| 423 | #if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE) |
| 424 | case BTU_TTYPE_BLE_INQUIRY: |
| 425 | case BTU_TTYPE_BLE_GAP_LIM_DISC: |
| 426 | case BTU_TTYPE_BLE_RANDOM_ADDR: |
| 427 | case BTU_TTYPE_BLE_GAP_FAST_ADV: |
| 428 | case BTU_TTYPE_BLE_OBSERVE: |
| 429 | btm_ble_timeout(p_tle); |
| 430 | break; |
| 431 | |
| 432 | case BTU_TTYPE_ATT_WAIT_FOR_RSP: |
| 433 | gatt_rsp_timeout(p_tle); |
| 434 | break; |
| 435 | |
| 436 | case BTU_TTYPE_ATT_WAIT_FOR_IND_ACK: |
| 437 | gatt_ind_ack_timeout(p_tle); |
| 438 | break; |
| 439 | #if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE) |
| 440 | case BTU_TTYPE_SMP_PAIRING_CMD: |
| 441 | smp_rsp_timeout(p_tle); |
| 442 | break; |
| 443 | #endif |
| 444 | |
| 445 | #endif |
| 446 | |
| 447 | #if (MCA_INCLUDED == TRUE) |
| 448 | case BTU_TTYPE_MCA_CCB_RSP: |
| 449 | mca_process_timeout(p_tle); |
| 450 | break; |
| 451 | #endif |
| 452 | case BTU_TTYPE_USER_FUNC: |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 453 | { |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 454 | tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_tle->param; |
| 455 | (*p_uf)(p_tle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 456 | } |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 457 | break; |
| 458 | |
| 459 | default:; |
| 460 | int i = 0; |
| 461 | BOOLEAN handled = FALSE; |
| 462 | |
| 463 | for (; !handled && i < BTU_MAX_REG_TIMER; i++) |
| 464 | { |
| 465 | if (btu_cb.timer_reg[i].timer_cb == NULL) |
| 466 | continue; |
| 467 | if (btu_cb.timer_reg[i].p_tle == p_tle) |
| 468 | { |
| 469 | btu_cb.timer_reg[i].timer_cb(p_tle); |
| 470 | handled = TRUE; |
| 471 | } |
| 472 | } |
| 473 | break; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 474 | } |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 475 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 476 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 477 | void btu_general_alarm_cb(void *data) { |
| 478 | assert(data != NULL); |
| 479 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 480 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 481 | fixed_queue_enqueue(btu_general_alarm_queue, p_tle); |
| 482 | GKI_send_event(BTU_TASK, TIMER_0_EVT_MASK); |
| 483 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 484 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 485 | void btu_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) { |
| 486 | assert(p_tle != NULL); |
| 487 | |
| 488 | // Get the alarm for the timer list entry. |
| 489 | pthread_mutex_lock(&btu_general_alarm_lock); |
| 490 | if (!hash_map_has_key(btu_general_alarm_hash_map, p_tle)) { |
| 491 | hash_map_set(btu_general_alarm_hash_map, p_tle, alarm_new()); |
| 492 | } |
| 493 | pthread_mutex_unlock(&btu_general_alarm_lock); |
| 494 | |
| 495 | alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle); |
| 496 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 497 | LOG_ERROR("%s Unable to create alarm\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 498 | return; |
| 499 | } |
| 500 | alarm_cancel(alarm); |
| 501 | |
| 502 | p_tle->event = type; |
| 503 | // NOTE: This value is in seconds but stored in a ticks field. |
| 504 | p_tle->ticks = timeout_sec; |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 505 | p_tle->in_use = TRUE; |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 506 | alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_general_alarm_cb, (void *)p_tle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 507 | } |
| 508 | |
| 509 | /******************************************************************************* |
| 510 | ** |
| 511 | ** Function btu_remaining_time |
| 512 | ** |
| 513 | ** Description Return amount of time to expire |
| 514 | ** |
| 515 | ** Returns time in second |
| 516 | ** |
| 517 | *******************************************************************************/ |
| 518 | UINT32 btu_remaining_time (TIMER_LIST_ENT *p_tle) |
| 519 | { |
| 520 | return(GKI_get_remaining_ticks (&btu_cb.timer_queue, p_tle)); |
| 521 | } |
| 522 | |
| 523 | /******************************************************************************* |
| 524 | ** |
| 525 | ** Function btu_stop_timer |
| 526 | ** |
| 527 | ** Description Stop a timer. |
| 528 | ** |
| 529 | ** Returns void |
| 530 | ** |
| 531 | *******************************************************************************/ |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 532 | void btu_stop_timer(TIMER_LIST_ENT *p_tle) { |
| 533 | assert(p_tle != NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 534 | |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 535 | if (p_tle->in_use == FALSE) |
| 536 | return; |
| 537 | p_tle->in_use = FALSE; |
| 538 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 539 | // Get the alarm for the timer list entry. |
| 540 | alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle); |
| 541 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 542 | LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 543 | return; |
| 544 | } |
| 545 | alarm_cancel(alarm); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | #if defined(QUICK_TIMER_TICKS_PER_SEC) && (QUICK_TIMER_TICKS_PER_SEC > 0) |
| 549 | /******************************************************************************* |
| 550 | ** |
| 551 | ** Function btu_start_quick_timer |
| 552 | ** |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 553 | ** Description Start a timer for the specified amount of time in ticks. |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 554 | ** |
| 555 | ** Returns void |
| 556 | ** |
| 557 | *******************************************************************************/ |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 558 | static void btu_l2cap_alarm_process(TIMER_LIST_ENT *p_tle) { |
| 559 | assert(p_tle != NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 560 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 561 | switch (p_tle->event) { |
| 562 | case BTU_TTYPE_L2CAP_CHNL: /* monitor or retransmission timer */ |
| 563 | case BTU_TTYPE_L2CAP_FCR_ACK: /* ack timer */ |
| 564 | l2c_process_timeout (p_tle); |
| 565 | break; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 566 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 567 | default: |
| 568 | break; |
| 569 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 570 | } |
| 571 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 572 | static void btu_l2cap_alarm_cb(void *data) { |
| 573 | assert(data != NULL); |
| 574 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data; |
| 575 | |
| 576 | fixed_queue_enqueue(btu_l2cap_alarm_queue, p_tle); |
| 577 | GKI_send_event(BTU_TASK, TIMER_2_EVT_MASK); |
| 578 | } |
| 579 | |
| 580 | void btu_start_quick_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_ticks) { |
| 581 | assert(p_tle != NULL); |
| 582 | |
| 583 | // Get the alarm for the timer list entry. |
| 584 | pthread_mutex_lock(&btu_l2cap_alarm_lock); |
| 585 | if (!hash_map_has_key(btu_l2cap_alarm_hash_map, p_tle)) { |
| 586 | hash_map_set(btu_l2cap_alarm_hash_map, p_tle, alarm_new()); |
| 587 | } |
| 588 | pthread_mutex_unlock(&btu_l2cap_alarm_lock); |
| 589 | |
| 590 | alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle); |
| 591 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 592 | LOG_ERROR("%s Unable to create alarm\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 593 | return; |
| 594 | } |
| 595 | alarm_cancel(alarm); |
| 596 | |
| 597 | p_tle->event = type; |
| 598 | p_tle->ticks = timeout_ticks; |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 599 | p_tle->in_use = TRUE; |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 600 | // The quick timer ticks are 100ms long. |
| 601 | alarm_set(alarm, (period_ms_t)(timeout_ticks * 100), btu_l2cap_alarm_cb, (void *)p_tle); |
| 602 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 603 | |
| 604 | /******************************************************************************* |
| 605 | ** |
| 606 | ** Function btu_stop_quick_timer |
| 607 | ** |
| 608 | ** Description Stop a timer. |
| 609 | ** |
| 610 | ** Returns void |
| 611 | ** |
| 612 | *******************************************************************************/ |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 613 | void btu_stop_quick_timer(TIMER_LIST_ENT *p_tle) { |
| 614 | assert(p_tle != NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 615 | |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 616 | if (p_tle->in_use == FALSE) |
| 617 | return; |
| 618 | p_tle->in_use = FALSE; |
| 619 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 620 | // Get the alarm for the timer list entry. |
| 621 | alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle); |
| 622 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 623 | LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 624 | return; |
| 625 | } |
| 626 | alarm_cancel(alarm); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 627 | } |
| 628 | #endif /* defined(QUICK_TIMER_TICKS_PER_SEC) && (QUICK_TIMER_TICKS_PER_SEC > 0) */ |
| 629 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 630 | void btu_oneshot_alarm_cb(void *data) { |
| 631 | assert(data != NULL); |
| 632 | TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data; |
| 633 | |
| 634 | btu_stop_timer_oneshot(p_tle); |
| 635 | |
| 636 | fixed_queue_enqueue(btu_oneshot_alarm_queue, p_tle); |
| 637 | GKI_send_event(BTU_TASK, TIMER_3_EVT_MASK); |
| 638 | } |
| 639 | |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 640 | /* |
| 641 | * Starts a oneshot timer with a timeout in seconds. |
| 642 | */ |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 643 | void btu_start_timer_oneshot(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) { |
| 644 | assert(p_tle != NULL); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 645 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 646 | // Get the alarm for the timer list entry. |
| 647 | pthread_mutex_lock(&btu_oneshot_alarm_lock); |
| 648 | if (!hash_map_has_key(btu_oneshot_alarm_hash_map, p_tle)) { |
| 649 | hash_map_set(btu_oneshot_alarm_hash_map, p_tle, alarm_new()); |
| 650 | } |
| 651 | pthread_mutex_unlock(&btu_oneshot_alarm_lock); |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 652 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 653 | alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle); |
| 654 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 655 | LOG_ERROR("%s Unable to create alarm\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 656 | return; |
| 657 | } |
| 658 | alarm_cancel(alarm); |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 659 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 660 | p_tle->event = type; |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 661 | p_tle->in_use = TRUE; |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 662 | // NOTE: This value is in seconds but stored in a ticks field. |
| 663 | p_tle->ticks = timeout_sec; |
| 664 | alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_oneshot_alarm_cb, (void *)p_tle); |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 665 | } |
| 666 | |
| 667 | void btu_stop_timer_oneshot(TIMER_LIST_ENT *p_tle) { |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 668 | assert(p_tle != NULL); |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 669 | |
Chris Manton | bc3ac06 | 2014-09-17 13:30:13 -0700 | [diff] [blame] | 670 | if (p_tle->in_use == FALSE) |
| 671 | return; |
| 672 | p_tle->in_use = FALSE; |
| 673 | |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 674 | // Get the alarm for the timer list entry. |
| 675 | alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle); |
| 676 | if (alarm == NULL) { |
Sharvil Nanavati | 4480276 | 2014-12-23 23:08:58 -0800 | [diff] [blame^] | 677 | LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__); |
Chris Manton | 1802329 | 2014-08-29 09:12:06 -0700 | [diff] [blame] | 678 | return; |
| 679 | } |
| 680 | alarm_cancel(alarm); |
Chris Manton | 0aee331 | 2014-06-12 12:52:33 -0700 | [diff] [blame] | 681 | } |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 682 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 683 | #if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) |
| 684 | /******************************************************************************* |
| 685 | ** |
| 686 | ** Function btu_check_bt_sleep |
| 687 | ** |
| 688 | ** Description This function is called to check if controller can go to sleep. |
| 689 | ** |
| 690 | ** Returns void |
| 691 | ** |
| 692 | *******************************************************************************/ |
| 693 | void btu_check_bt_sleep (void) |
| 694 | { |
Zach Johnson | 91ba12d | 2014-09-26 14:03:13 -0700 | [diff] [blame] | 695 | // TODO(zachoverflow) take pending commands into account? |
| 696 | if (l2cb.controller_xmit_window == l2cb.num_lm_acl_bufs) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 697 | { |
Zach Johnson | 91ba12d | 2014-09-26 14:03:13 -0700 | [diff] [blame] | 698 | bte_main_lpm_allow_bt_device_sleep(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 699 | } |
| 700 | } |
| 701 | #endif |