summaryrefslogtreecommitdiffstats
path: root/stack/bnep/bnep_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'stack/bnep/bnep_main.c')
-rw-r--r--stack/bnep/bnep_main.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/stack/bnep/bnep_main.c b/stack/bnep/bnep_main.c
index 62fa31635..b29884075 100644
--- a/stack/bnep/bnep_main.c
+++ b/stack/bnep/bnep_main.c
@@ -43,6 +43,8 @@
#include "bnep_int.h"
#include "bt_utils.h"
+#include "device/include/controller.h"
+
/********************************************************************************/
/* G L O B A L B N E P D A T A */
@@ -65,8 +67,6 @@ static void bnep_disconnect_cfm (UINT16 l2cap_cid, UINT16 result);
static void bnep_data_ind (UINT16 l2cap_cid, BT_HDR *p_msg);
static void bnep_congestion_ind (UINT16 lcid, BOOLEAN is_congested);
-static void bnep_read_addr_cb (void *p_bda);
-
/*******************************************************************************
**
@@ -508,12 +508,11 @@ static void bnep_data_ind (UINT16 l2cap_cid, BT_HDR *p_buf)
** with unknown control extension headers then those should be processed
** according to complain/ignore law
*/
- UINT8 ext, length, *p_data;
+ UINT8 ext, length;
UINT16 org_len, new_len;
/* parse the extension headers and process unknown control headers */
org_len = rem_len;
new_len = 0;
- p_data = p;
do {
ext = *p++;
@@ -639,7 +638,7 @@ static void bnep_data_ind (UINT16 l2cap_cid, BT_HDR *p_buf)
p_src_addr = (UINT8 *) p_bcb->rem_bda;
if (!p_dst_addr)
- p_dst_addr = (UINT8 *) bnep_cb.my_bda;
+ p_dst_addr = (UINT8 *) controller_get_interface()->get_address();
/* check whether there are any extensions to be forwarded */
if (ext_type)
@@ -677,13 +676,6 @@ void bnep_process_timeout (TIMER_LIST_ENT *p_tle)
if (!p_tle->param)
{
- if (!bnep_cb.got_my_bd_addr)
- {
- if (BTM_IsDeviceUp())
- BTM_ReadLocalDeviceAddr (bnep_read_addr_cb);
-
- btu_start_timer (&bnep_cb.bnep_tle, BTU_TTYPE_BNEP, 2);
- }
return;
}
@@ -734,7 +726,6 @@ void bnep_process_timeout (TIMER_LIST_ENT *p_tle)
bnepu_release_bcb (p_bcb);
}
-#if (defined (BNEP_SUPPORTS_PROT_FILTERS) && BNEP_SUPPORTS_PROT_FILTERS == TRUE)
else if (p_bcb->con_flags & BNEP_FLAGS_FILTER_RESP_PEND)
{
if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
@@ -754,8 +745,6 @@ void bnep_process_timeout (TIMER_LIST_ENT *p_tle)
return;
}
}
-#endif
-#if (defined (BNEP_SUPPORTS_MULTI_FILTERS) && BNEP_SUPPORTS_MULTI_FILTERS == TRUE)
else if (p_bcb->con_flags & BNEP_FLAGS_MULTI_RESP_PEND)
{
if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
@@ -775,7 +764,6 @@ void bnep_process_timeout (TIMER_LIST_ENT *p_tle)
return;
}
}
-#endif
}
@@ -810,31 +798,3 @@ void bnep_connected (tBNEP_CONN *p_bcb)
if (bnep_cb.p_conn_state_cb)
(*bnep_cb.p_conn_state_cb) (p_bcb->handle, p_bcb->rem_bda, BNEP_SUCCESS, is_role_change);
}
-
-
-/*******************************************************************************
-**
-** Function bnep_read_addr_cb
-**
-** Description This function is called by BTM when the local BD address
-** is read. It saves the BD address, and flags it as read.
-**
-** Returns void
-**
-*******************************************************************************/
-static void bnep_read_addr_cb (void *p_bda)
-{
- UINT8 *bda = (UINT8 *)p_bda;
- if (p_bda &&
- (bda[0] | bda[1] | bda[2] | bda[3] | bda[4] | bda[5]) != 0)
- {
- /* Save my BD address */
- memcpy (bnep_cb.my_bda, p_bda, BD_ADDR_LEN);
-
- bnep_cb.got_my_bd_addr = TRUE;
- }
- else
- /* Retry after a couple seconds */
- btu_start_timer (&bnep_cb.bnep_tle, BTU_TTYPE_BNEP, 2);
-}
-