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 | |
| 19 | /****************************************************************************** |
| 20 | * |
| 21 | * this file contains the main Bluetooth Upper Layer definitions. The Broadcom |
| 22 | * implementations of L2CAP RFCOMM, SDP and the BTIf run as one GKI task. The |
| 23 | * btu_task switches between them. |
| 24 | * |
| 25 | ******************************************************************************/ |
| 26 | |
| 27 | #ifndef BTU_H |
| 28 | #define BTU_H |
| 29 | |
| 30 | #include "bt_target.h" |
Pavlin Radoslavov | 258c253 | 2015-09-27 20:59:05 -0700 | [diff] [blame] | 31 | #include "bt_common.h" |
Pavlin Radoslavov | 78bcff7 | 2015-12-04 17:36:34 -0800 | [diff] [blame] | 32 | #include "osi/include/alarm.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 33 | |
Zach Johnson | 218f375 | 2014-09-03 14:36:44 -0700 | [diff] [blame] | 34 | // HACK(zachoverflow): temporary dark magic |
| 35 | #define BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK 0x1700 // didn't look used in bt_types...here goes nothing |
| 36 | typedef struct { |
| 37 | void (*callback)(BT_HDR *); |
| 38 | } post_to_task_hack_t; |
| 39 | |
| 40 | typedef struct { |
| 41 | void (*callback)(BT_HDR *); |
| 42 | BT_HDR *response; |
| 43 | void *context; |
| 44 | } command_complete_hack_t; |
| 45 | |
| 46 | typedef struct { |
| 47 | void (*callback)(BT_HDR *); |
| 48 | uint8_t status; |
| 49 | BT_HDR *command; |
| 50 | void *context; |
| 51 | } command_status_hack_t; |
| 52 | |
Manu Viswanadhan | 32151b4 | 2016-05-25 12:17:20 +0530 | [diff] [blame] | 53 | void bte_ssr_cleanup(int reason); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 54 | |
| 55 | #ifdef __cplusplus |
| 56 | extern "C" { |
| 57 | #endif |
| 58 | |
| 59 | /* Global BTU data */ |
Pavlin Radoslavov | 78bcff7 | 2015-12-04 17:36:34 -0800 | [diff] [blame] | 60 | extern uint8_t btu_trace_level; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 61 | |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 62 | extern const BD_ADDR BT_BD_ANY; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 63 | |
| 64 | /* Functions provided by btu_task.c |
| 65 | ************************************ |
| 66 | */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 67 | |
| 68 | #if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 69 | extern void btu_check_bt_sleep (void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 70 | #endif |
| 71 | |
| 72 | /* Functions provided by btu_hcif.c |
| 73 | ************************************ |
| 74 | */ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 75 | extern void btu_hcif_process_event (UINT8 controller_id, BT_HDR *p_buf); |
| 76 | extern void btu_hcif_send_cmd (UINT8 controller_id, BT_HDR *p_msg); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 77 | |
| 78 | /* Functions provided by btu_core.c |
| 79 | ************************************ |
| 80 | */ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 81 | extern void btu_init_core(void); |
| 82 | extern void btu_free_core(void); |
Sharvil Nanavati | f79d286 | 2014-09-06 16:16:19 -0700 | [diff] [blame] | 83 | |
| 84 | void BTU_StartUp(void); |
| 85 | void BTU_ShutDown(void); |
| 86 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 87 | #ifdef __cplusplus |
| 88 | } |
| 89 | #endif |
| 90 | |
| 91 | #endif |