15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Copyright (C) 2003-2012 Broadcom Corporation 45738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 55738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 65738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * you may not use this file except in compliance with the License. 75738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * You may obtain a copy of the License at: 85738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 95738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * See the License for the specific language governing permissions and 155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * limitations under the License. 165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/ 185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This is the private interface file for the BTA system manager. 225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/ 245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTA_SYS_INT_H 255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTA_SYS_INT_H 265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "ptim.h" 285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Constants and data types 315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** state table 355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* SYS HW state */ 385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectenum 395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BTA_SYS_HW_OFF, 415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BTA_SYS_HW_STARTING, 425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BTA_SYS_HW_ON, 435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BTA_SYS_HW_STOPPING 445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project}; 455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef UINT8 tBTA_SYS_HW_STATE; 465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Collision callback */ 485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define MAX_COLLISION_REG 5 495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef struct 515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT8 id[MAX_COLLISION_REG]; 535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *p_coll_cback[MAX_COLLISION_REG]; 545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_SYS_COLLISION; 555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* system manager control block */ 575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef struct 585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_REG *reg[BTA_ID_MAX]; /* registration structures */ 605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BOOLEAN is_reg[BTA_ID_MAX]; /* registration structures */ 615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tPTIM_CB ptim_cb; /* protocol timer list */ 625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BOOLEAN timers_disabled; /* TRUE if sys timers disabled */ 635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT8 task_id; /* GKI task id */ 645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_HW_STATE state; 655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_HW_CBACK *sys_hw_cback[BTA_SYS_MAX_HW_MODULES]; /* enable callback for each HW modules */ 665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT32 sys_hw_module_active; /* bitmask of all active modules */ 675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT16 sys_features; /* Bitmask of sys features */ 685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *prm_cb; /* role management callback registered by DM */ 705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *ppm_cb; /* low power management callback registered by DM */ 715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *p_policy_cb; /* link policy change callback registered by DM */ 725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *p_sco_cb; /* SCO connection change callback registered by AV */ 735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_CONN_CBACK *p_role_cb; /* role change callback registered by AV */ 745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_COLLISION colli_reg; /* collision handling module */ 755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&(BTA_EIR_CANNED_UUID_LIST != TRUE) 765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_EIR_CBACK *eir_cb; /* add/remove UUID into EIR */ 775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif 785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#if (BTM_SSR_INCLUDED == TRUE) 795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tBTA_SYS_SSR_CFG_CBACK *p_ssr_cb; 805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif 815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBTA_SYS_CB; 825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Global variables 885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* system manager control block */ 915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#if BTA_DYNAMIC_MEMORY == FALSE 925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectextern tBTA_SYS_CB bta_sys_cb; 935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#else 945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectextern tBTA_SYS_CB *bta_sys_cb_ptr; 955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define bta_sys_cb (*bta_sys_cb_ptr) 965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif 975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* system manager configuration structure */ 1005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectextern tBTA_SYS_CFG *p_bta_sys_cfg; 1015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* functions used for BTA SYS HW state machine */ 1055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_btm_cback( tBTM_DEV_STATUS status ); 1065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg); 1075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_api_enable( tBTA_SYS_HW_MSG *p_sys_hw_msg ); 1085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_api_disable(tBTA_SYS_HW_MSG *p_sys_hw_msg); 1095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_evt_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg); 1105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_evt_disabled(tBTA_SYS_HW_MSG *p_sys_hw_msg); 1115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectvoid bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg); 1125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source ProjectBOOLEAN bta_sys_sm_execute(BT_HDR *p_msg); 1145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* BTA_SYS_INT_H */ 120