15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************
25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Copyright (C) 2001-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 file contains internally used BNEP definitions
225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/
245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
25911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#ifndef BNEP_INT_H
26911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_INT_H
275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bnep_api.h"
29911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#include "bt_common.h"
30911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#include "bt_target.h"
315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "btm_int.h"
325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "btu.h"
335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BNEP frame types
355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
36911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FRAME_GENERAL_ETHERNET 0x00
37911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FRAME_CONTROL 0x01
38911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FRAME_COMPRESSED_ETHERNET 0x02
39911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FRAME_COMPRESSED_ETHERNET_SRC_ONLY 0x03
40911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FRAME_COMPRESSED_ETHERNET_DEST_ONLY 0x04
415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BNEP filter control message types
435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
44911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD 0x00
45911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_CONNECTION_REQUEST_MSG 0x01
46911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_CONNECTION_RESPONSE_MSG 0x02
47911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_NET_TYPE_SET_MSG 0x03
48911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_NET_TYPE_RESPONSE_MSG 0x04
49911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_MULTI_ADDR_SET_MSG 0x05
50911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_MULTI_ADDR_RESPONSE_MSG 0x06
515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BNEP header extension types
535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
54911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_EXTENSION_FILTER_CONTROL 0x00
555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BNEP Setup Connection response codes
575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
58911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_CONN_OK 0x0000
59911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_INVALID_DEST_UUID 0x0001
60911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_INVALID_SRC_UUID 0x0002
61911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_INVALID_UUID_SIZE 0x0003
62911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_SETUP_CONN_NOT_ALLOWED 0x0004
635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* BNEP filter control response codes
655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
66911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_CRL_OK 0x0000
67911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_CRL_UNSUPPORTED 0x0001
68911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_CRL_BAD_RANGE 0x0002
69911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_CRL_MAX_REACHED 0x0003
70911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_CRL_SECURITY_ERR 0x0004
715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* 802.1p protocol packet will have actual protocol field in side the payload */
73911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_802_1_P_PROTOCOL 0x8100
745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
759ca07091a1f07ea201cee0504dab6a1d7073d429Myles Watson/* Timeout definitions.  */
769ca07091a1f07ea201cee0504dab6a1d7073d429Myles Watson/* Connection related timeout */
77911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_CONN_TIMEOUT_MS (20 * 1000)
789ca07091a1f07ea201cee0504dab6a1d7073d429Myles Watson/* host response timeout */
79911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_HOST_TIMEOUT_MS (200 * 1000)
80911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FILTER_SET_TIMEOUT_MS (10 * 1000)
815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Define the Out-Flow default values. */
83911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_QOS_FLAG 0
84911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_SERV_TYPE 0
85911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_TOKEN_RATE 0
86911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_TOKEN_BUCKET_SIZE 0
87911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_PEAK_BANDWIDTH 0
88911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_LATENCY 0
89911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_OFLOW_DELAY_VARIATION 0
905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Define the In-Flow default values. */
92911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_QOS_FLAG 0
93911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_SERV_TYPE 0
94911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_TOKEN_RATE 0
95911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_TOKEN_BUCKET_SIZE 0
96911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_PEAK_BANDWIDTH 0
97911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_LATENCY 0
98911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_IFLOW_DELAY_VARIATION 0
995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
100911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLUSH_TO 0xFFFF
1015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
102911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_MAX_RETRANSMITS 3
1035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Define the BNEP Connection Control Block
1055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
106911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsontypedef struct {
107911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_IDLE 0
108911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_CONN_START 1
109911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_CFG_SETUP 2
110911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_CONN_SETUP 3
111911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_SEC_CHECKING 4
112911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_SETUP_RCVD 5
113911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_STATE_CONNECTED 6
114911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint8_t con_state;
115911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
116911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_IS_ORIG 0x01
117911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_HIS_CFG_DONE 0x02
118911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_MY_CFG_DONE 0x04
119911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_L2CAP_CONGESTED 0x08
120911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_FILTER_RESP_PEND 0x10
121911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_MULTI_RESP_PEND 0x20
122911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_SETUP_RCVD 0x40
123911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson#define BNEP_FLAGS_CONN_COMPLETED 0x80
124911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint8_t con_flags;
125911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BT_HDR* p_pending_data;
126911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
127911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t l2cap_cid;
128911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BD_ADDR rem_bda;
129911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t rem_mtu_size;
130911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  alarm_t* conn_timer;
131911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  fixed_queue_t* xmit_q;
132911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
133911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t sent_num_filters;
134911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t sent_prot_filter_start[BNEP_MAX_PROT_FILTERS];
135911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t sent_prot_filter_end[BNEP_MAX_PROT_FILTERS];
136911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
137911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t sent_mcast_filters;
138911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BD_ADDR sent_mcast_filter_start[BNEP_MAX_MULTI_FILTERS];
139911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BD_ADDR sent_mcast_filter_end[BNEP_MAX_MULTI_FILTERS];
140911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
141911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t rcvd_num_filters;
142911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t rcvd_prot_filter_start[BNEP_MAX_PROT_FILTERS];
143911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t rcvd_prot_filter_end[BNEP_MAX_PROT_FILTERS];
144911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
145911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t rcvd_mcast_filters;
146911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BD_ADDR rcvd_mcast_filter_start[BNEP_MAX_MULTI_FILTERS];
147911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  BD_ADDR rcvd_mcast_filter_end[BNEP_MAX_MULTI_FILTERS];
148911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
149911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t bad_pkts_rcvd;
150911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint8_t re_transmits;
151911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint16_t handle;
152911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBT_UUID prv_src_uuid;
153911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBT_UUID prv_dst_uuid;
154911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBT_UUID src_uuid;
155911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBT_UUID dst_uuid;
1565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBNEP_CONN;
1585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*  The main BNEP control block
1605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
161911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsontypedef struct {
162911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tL2CAP_CFG_INFO l2cap_my_cfg; /* My L2CAP config     */
163911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_CONN bcb[BNEP_MAX_CONNECTIONS];
1645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
165911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_CONNECT_IND_CB* p_conn_ind_cb;
166911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_CONN_STATE_CB* p_conn_state_cb;
167911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_DATA_IND_CB* p_data_ind_cb;
168911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_DATA_BUF_CB* p_data_buf_cb;
169911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_FILTER_IND_CB* p_filter_ind_cb;
170911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_MFILTER_IND_CB* p_mfilter_ind_cb;
171911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tBNEP_TX_DATA_FLOW_CB* p_tx_data_flow_cb;
1725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
173911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  tL2CAP_APPL_INFO reg_info;
1745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
175911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  bool profile_registered; /* true when we got our BD addr */
176911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson  uint8_t trace_level;
1775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tBNEP_CB;
1795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Global BNEP data
1815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
18237c1b5f8ccf4fc6d5132e07f98f0f40f65d5bfafPavlin Radoslavovextern tBNEP_CB bnep_cb;
1835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
184b2a292b5d8df2f359c38b0787bc01181225a9bc9Pavlin Radoslavov/* Functions provided by bnep_main.cc
1855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
186911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_RESULT bnep_register_with_l2cap(void);
187911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_disconnect(tBNEP_CONN* p_bcb, uint16_t reason);
188911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_CONN* bnep_conn_originate(uint8_t* p_bd_addr);
189911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_conn_timer_timeout(void* data);
190911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_connected(tBNEP_CONN* p_bcb);
1915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
192b2a292b5d8df2f359c38b0787bc01181225a9bc9Pavlin Radoslavov/* Functions provided by bnep_utils.cc
1935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*/
194911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_CONN* bnepu_find_bcb_by_cid(uint16_t cid);
195911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_CONN* bnepu_find_bcb_by_bd_addr(uint8_t* p_bda);
196911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_CONN* bnepu_allocate_bcb(BD_ADDR p_rem_bda);
197911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_release_bcb(tBNEP_CONN* p_bcb);
198911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_send_peer_our_filters(tBNEP_CONN* p_bcb);
199911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_send_peer_our_multi_filters(tBNEP_CONN* p_bcb);
200911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern bool bnepu_does_dest_support_prot(tBNEP_CONN* p_bcb, uint16_t protocol);
201911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_build_bnep_hdr(tBNEP_CONN* p_bcb, BT_HDR* p_buf,
202911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                 uint16_t protocol, uint8_t* p_src_addr,
203911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                 uint8_t* p_dest_addr, bool ext_bit);
204911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void test_bnepu_build_bnep_hdr(tBNEP_CONN* p_bcb, BT_HDR* p_buf,
205911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                      uint16_t protocol, uint8_t* p_src_addr,
206911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                      uint8_t* p_dest_addr, uint8_t type);
207911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson
208911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_CONN* bnepu_get_route_to_dest(uint8_t* p_bda);
209911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_check_send_packet(tBNEP_CONN* p_bcb, BT_HDR* p_buf);
210911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_send_command_not_understood(tBNEP_CONN* p_bcb,
211911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                             uint8_t cmd_code);
212911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_process_peer_filter_set(tBNEP_CONN* p_bcb, uint8_t* p_filters,
213911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                          uint16_t len);
214911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_process_peer_filter_rsp(tBNEP_CONN* p_bcb, uint8_t* p_data);
215911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnepu_process_multicast_filter_rsp(tBNEP_CONN* p_bcb,
216911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                               uint8_t* p_data);
217911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_send_conn_req(tBNEP_CONN* p_bcb);
218911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_send_conn_responce(tBNEP_CONN* p_bcb, uint16_t resp_code);
219911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_process_setup_conn_req(tBNEP_CONN* p_bcb, uint8_t* p_setup,
220911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                        uint8_t len);
221911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_process_setup_conn_responce(tBNEP_CONN* p_bcb,
222911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                             uint8_t* p_setup);
223911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern uint8_t* bnep_process_control_packet(tBNEP_CONN* p_bcb, uint8_t* p,
224911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                            uint16_t* len, bool is_ext);
225911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern void bnep_sec_check_complete(BD_ADDR bd_addr, tBT_TRANSPORT trasnport,
226911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                    void* p_ref_data, uint8_t result);
227911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern tBNEP_RESULT bnep_is_packet_allowed(tBNEP_CONN* p_bcb,
228911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                           BD_ADDR p_dest_addr,
229911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                           uint16_t protocol,
230911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                           bool fw_ext_present,
231911d1ae03efec2d54c3b1b605589d790d1745488Myles Watson                                           uint8_t* p_data);
232911d1ae03efec2d54c3b1b605589d790d1745488Myles Watsonextern uint32_t bnep_get_uuid32(tBT_UUID* src_uuid);
2335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif
235