blob: bf617d0f42f8ce38a18ffddeed7ab7d124930477 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
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 Radoslavov258c2532015-09-27 20:59:05 -070031#include "bt_common.h"
Pavlin Radoslavov78bcff72015-12-04 17:36:34 -080032#include "osi/include/alarm.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080033
Zach Johnson218f3752014-09-03 14:36:44 -070034// 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
36typedef struct {
37 void (*callback)(BT_HDR *);
38} post_to_task_hack_t;
39
40typedef struct {
41 void (*callback)(BT_HDR *);
42 BT_HDR *response;
43 void *context;
44} command_complete_hack_t;
45
46typedef struct {
47 void (*callback)(BT_HDR *);
48 uint8_t status;
49 BT_HDR *command;
50 void *context;
51} command_status_hack_t;
52
Manu Viswanadhan32151b42016-05-25 12:17:20 +053053void bte_ssr_cleanup(int reason);
The Android Open Source Project5738f832012-12-12 16:00:35 -080054
55#ifdef __cplusplus
56extern "C" {
57#endif
58
59/* Global BTU data */
Pavlin Radoslavov78bcff72015-12-04 17:36:34 -080060extern uint8_t btu_trace_level;
The Android Open Source Project5738f832012-12-12 16:00:35 -080061
June R. Tate-Gans24933b52014-09-24 15:25:02 -070062extern const BD_ADDR BT_BD_ANY;
The Android Open Source Project5738f832012-12-12 16:00:35 -080063
64/* Functions provided by btu_task.c
65************************************
66*/
The Android Open Source Project5738f832012-12-12 16:00:35 -080067
68#if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE)
June R. Tate-Gans24933b52014-09-24 15:25:02 -070069extern void btu_check_bt_sleep (void);
The Android Open Source Project5738f832012-12-12 16:00:35 -080070#endif
71
72/* Functions provided by btu_hcif.c
73************************************
74*/
June R. Tate-Gans24933b52014-09-24 15:25:02 -070075extern void btu_hcif_process_event (UINT8 controller_id, BT_HDR *p_buf);
76extern void btu_hcif_send_cmd (UINT8 controller_id, BT_HDR *p_msg);
The Android Open Source Project5738f832012-12-12 16:00:35 -080077
78/* Functions provided by btu_core.c
79************************************
80*/
June R. Tate-Gans24933b52014-09-24 15:25:02 -070081extern void btu_init_core(void);
82extern void btu_free_core(void);
Sharvil Nanavatif79d2862014-09-06 16:16:19 -070083
84void BTU_StartUp(void);
85void BTU_ShutDown(void);
86
The Android Open Source Project5738f832012-12-12 16:00:35 -080087#ifdef __cplusplus
88}
89#endif
90
91#endif