summaryrefslogtreecommitdiffstats
path: root/stack/avdt/avdt_ccb.c
diff options
context:
space:
mode:
Diffstat (limited to 'stack/avdt/avdt_ccb.c')
-rw-r--r--stack/avdt/avdt_ccb.c110
1 files changed, 61 insertions, 49 deletions
diff --git a/stack/avdt/avdt_ccb.c b/stack/avdt/avdt_ccb.c
index ea1990d..9cb40b2 100644
--- a/stack/avdt/avdt_ccb.c
+++ b/stack/avdt/avdt_ccb.c
@@ -1,15 +1,27 @@
-/*****************************************************************************
-**
-** Name: avdt_ccb.c
-**
-** Description: This module contains the channel control block state
-** machine and functions which operate on the channel
-** control block.
-**
-** Copyright (c) 2002-2008, Broadcom Corp., All Rights Reserved.
-** WIDCOMM Bluetooth Core. Proprietary and confidential.
-**
-*****************************************************************************/
+/******************************************************************************
+ *
+ * Copyright (C) 2002-2012 Broadcom Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * This module contains the channel control block state machine and
+ * functions which operate on the channel control block.
+ *
+ ******************************************************************************/
#include <string.h>
#include "data_types.h"
@@ -35,33 +47,33 @@ const char * const avdt_ccb_st_str[] = {
/* verbose event strings for trace */
const char * const avdt_ccb_evt_str[] = {
- "API_DISCOVER_REQ_EVT",
- "API_GETCAP_REQ_EVT",
- "API_START_REQ_EVT",
- "API_SUSPEND_REQ_EVT",
- "API_DISCOVER_RSP_EVT",
- "API_GETCAP_RSP_EVT",
- "API_START_RSP_EVT",
- "API_SUSPEND_RSP_EVT",
- "API_CONNECT_REQ_EVT",
+ "API_DISCOVER_REQ_EVT",
+ "API_GETCAP_REQ_EVT",
+ "API_START_REQ_EVT",
+ "API_SUSPEND_REQ_EVT",
+ "API_DISCOVER_RSP_EVT",
+ "API_GETCAP_RSP_EVT",
+ "API_START_RSP_EVT",
+ "API_SUSPEND_RSP_EVT",
+ "API_CONNECT_REQ_EVT",
"API_DISCONNECT_REQ_EVT",
- "MSG_DISCOVER_CMD_EVT",
- "MSG_GETCAP_CMD_EVT",
- "MSG_START_CMD_EVT",
- "MSG_SUSPEND_CMD_EVT",
- "MSG_DISCOVER_RSP_EVT",
- "MSG_GETCAP_RSP_EVT",
- "MSG_START_RSP_EVT",
- "MSG_SUSPEND_RSP_EVT",
- "RCVRSP_EVT",
- "SENDMSG_EVT",
- "RET_TOUT_EVT",
- "RSP_TOUT_EVT",
- "IDLE_TOUT_EVT",
- "UL_OPEN_EVT",
- "UL_CLOSE_EVT",
- "LL_OPEN_EVT",
- "LL_CLOSE_EVT",
+ "MSG_DISCOVER_CMD_EVT",
+ "MSG_GETCAP_CMD_EVT",
+ "MSG_START_CMD_EVT",
+ "MSG_SUSPEND_CMD_EVT",
+ "MSG_DISCOVER_RSP_EVT",
+ "MSG_GETCAP_RSP_EVT",
+ "MSG_START_RSP_EVT",
+ "MSG_SUSPEND_RSP_EVT",
+ "RCVRSP_EVT",
+ "SENDMSG_EVT",
+ "RET_TOUT_EVT",
+ "RSP_TOUT_EVT",
+ "IDLE_TOUT_EVT",
+ "UL_OPEN_EVT",
+ "UL_CLOSE_EVT",
+ "LL_OPEN_EVT",
+ "LL_CLOSE_EVT",
"LL_CONG_EVT"
};
@@ -261,7 +273,7 @@ const tAVDT_CCB_ST_TBL avdt_ccb_st_tbl[] = {
** Function avdt_ccb_init
**
** Description Initialize channel control block module.
-**
+**
**
** Returns Nothing.
**
@@ -277,7 +289,7 @@ void avdt_ccb_init(void)
** Function avdt_ccb_event
**
** Description State machine event handling function for ccb
-**
+**
**
** Returns Nothing.
**
@@ -306,7 +318,7 @@ void avdt_ccb_event(tAVDT_CCB *p_ccb, UINT8 event, tAVDT_CCB_EVT *p_data)
{
if ((action = state_table[event][i]) != AVDT_CCB_IGNORE)
{
- BTTRC_AVDT_CCB_ACTION(action);
+ BTTRC_AVDT_CCB_ACTION(action);
(*avdt_cb.p_ccb_act[action])(p_ccb, p_data);
}
else
@@ -322,7 +334,7 @@ void avdt_ccb_event(tAVDT_CCB *p_ccb, UINT8 event, tAVDT_CCB_EVT *p_data)
** Function avdt_ccb_by_bd
**
** Description This lookup function finds the ccb for a BD address.
-**
+**
**
** Returns pointer to the ccb, or NULL if none found.
**
@@ -340,7 +352,7 @@ tAVDT_CCB *avdt_ccb_by_bd(BD_ADDR bd_addr)
break;
}
}
-
+
if (i == AVDT_NUM_LINKS)
{
/* if no ccb found */
@@ -357,7 +369,7 @@ tAVDT_CCB *avdt_ccb_by_bd(BD_ADDR bd_addr)
** Function avdt_ccb_alloc
**
** Description Allocate a channel control block.
-**
+**
**
** Returns pointer to the ccb, or NULL if none could be allocated.
**
@@ -380,7 +392,7 @@ tAVDT_CCB *avdt_ccb_alloc(BD_ADDR bd_addr)
break;
}
}
-
+
if (i == AVDT_NUM_LINKS)
{
/* out of ccbs */
@@ -395,7 +407,7 @@ tAVDT_CCB *avdt_ccb_alloc(BD_ADDR bd_addr)
** Function avdt_ccb_dealloc
**
** Description Deallocate a stream control block.
-**
+**
**
** Returns void.
**
@@ -412,7 +424,7 @@ void avdt_ccb_dealloc(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
** Function avdt_ccb_to_idx
**
** Description Given a pointer to an ccb, return its index.
-**
+**
**
** Returns Index of ccb.
**
@@ -428,7 +440,7 @@ UINT8 avdt_ccb_to_idx(tAVDT_CCB *p_ccb)
** Function avdt_ccb_by_idx
**
** Description Return ccb pointer based on ccb index.
-**
+**
**
** Returns pointer to the ccb, or NULL if none found.
**
@@ -440,7 +452,7 @@ tAVDT_CCB *avdt_ccb_by_idx(UINT8 idx)
/* verify index */
if (idx < AVDT_NUM_LINKS)
{
- p_ccb = &avdt_cb.ccb[idx];
+ p_ccb = &avdt_cb.ccb[idx];
}
else
{