summaryrefslogtreecommitdiffstats
path: root/udrv/include
diff options
context:
space:
mode:
authorMattias Agren <magren@broadcom.com>2012-03-26 08:25:00 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:13 -0700
commit254588bfe6c3e70625b0f725b908598f30f476c8 (patch)
tree259c87422e70b74abeab96b3e3155c88791e5b6d /udrv/include
parent3e6f399bdbaca7f8ab0a8b1c6eab7cc1088ab74a (diff)
downloadexternal_bluetooth_bluedroid-254588bfe6c3e70625b0f725b908598f30f476c8.zip
external_bluetooth_bluedroid-254588bfe6c3e70625b0f725b908598f30f476c8.tar.gz
external_bluetooth_bluedroid-254588bfe6c3e70625b0f725b908598f30f476c8.tar.bz2
Added new control and data path interface between audioflinger a2dp HAL
and stack. Added support for suspend and a dedicated HAL callback notifying framework on audiopath events. Cleanup. Change-Id: I3b738611bc8e1d84794f7207413fd9e7dd1fc668
Diffstat (limited to 'udrv/include')
-rw-r--r--udrv/include/uipc.h68
-rw-r--r--udrv/include/unv.h80
2 files changed, 64 insertions, 84 deletions
diff --git a/udrv/include/uipc.h b/udrv/include/uipc.h
index 9fa6fbd..f5847c9 100644
--- a/udrv/include/uipc.h
+++ b/udrv/include/uipc.h
@@ -16,65 +16,44 @@
#define UDRV_API
#endif
+#define UIPC_CH_ID_AV_CTRL 0
+#define UIPC_CH_ID_AV_AUDIO 1
+#define UIPC_CH_NUM 2
-#define UIPC_CH_ID_ALL 0 /* used to address all the ch id at once */
-#define UIPC_CH_ID_0 1 /* shared mem interface */
-#define UIPC_CH_ID_1 2 /* TCP socket (GPS) */
-#define UIPC_CH_ID_2 3 /* BTIF control socket */
-#define UIPC_CH_ID_3 4 /* BTIF HH */
-#define UIPC_CH_ID_4 5 /* Future usage */
-#define UIPC_CH_ID_5 6 /* Future usage */
-#define UIPC_CH_ID_6 7 /* Future usage */
-#define UIPC_CH_ID_7 8 /* Future usage */
-#define UIPC_CH_ID_8 9 /* Future usage */
-#define UIPC_CH_ID_9 10 /* Future usage */
-#define UIPC_CH_ID_10 11 /* Future usage */
-#define UIPC_CH_ID_11 12 /* Future usage */
-#define UIPC_CH_ID_12 13 /* Future usage */
-#define UIPC_CH_ID_13 14 /* Future usage */
-#define UIPC_CH_ID_14 15 /* Future usage */
-#define UIPC_CH_ID_15 16 /* Future usage */
-#define UIPC_CH_ID_16 17 /* Future usage */
-#define UIPC_CH_ID_17 18 /* Future usage */
-#define UIPC_CH_ID_18 19 /* Future usage */
-#define UIPC_CH_ID_19 20 /* Future usage */
-#define UIPC_CH_ID_20 21 /* Future usage */
-#define UIPC_CH_ID_21 22 /* Future usage */
-#define UIPC_CH_ID_22 23 /* Future usage */
-#define UIPC_CH_ID_23 24 /* Future usage */
-#define UIPC_CH_ID_24 25 /* Future usage */
-
-
-
-#define UIPC_CH_NUM 25
+#define UIPC_CH_ID_ALL 3 /* used to address all the ch id at once */
+
+#define DEFAULT_READ_POLL_TMO_MS 100
typedef UINT8 tUIPC_CH_ID;
+/* Events generated */
+typedef enum {
+ UIPC_OPEN_EVT = 0x0001,
+ UIPC_CLOSE_EVT = 0x0002,
+ UIPC_RX_DATA_EVT = 0x0004,
+ UIPC_RX_DATA_READY_EVT = 0x0008,
+ UIPC_TX_DATA_READY_EVT = 0x0010
+} tUIPC_EVENT;
+
/*
* UIPC IOCTL Requests
*/
-enum
-{
- UIPC_REQ_TX_FLUSH = 1, /* Request to flush the TX FIFO */
- UIPC_REQ_RX_FLUSH, /* Request to flush the RX FIFO */
-
- UIPC_WRITE_BLOCK, /* Make write blocking */
- UIPC_WRITE_NONBLOCK, /* Make write non blocking */
- UIPC_REG_CBACK, /* Set a new call back */
- UIPC_SET_RX_WM, /* Set Rx water mark */
+#define UIPC_REQ_RX_FLUSH 1
+#define UIPC_REG_CBACK 2
+#define UIPC_REG_REMOVE_ACTIVE_READSET 3
+#define UIPC_SET_READ_POLL_TMO 4
- UIPC_REQ_TX_READY, /* Request an indication when Tx ready */
- UIPC_REQ_RX_READY /* Request an indication when Rx data ready */
-};
-
-typedef void (tUIPC_RCV_CBACK)(BT_HDR *p_msg); /* points to BT_HDR which describes event type and length of data; len contains the number of bytes of entire message (sizeof(BT_HDR) + offset + size of data) */
+typedef void (tUIPC_RCV_CBACK)(tUIPC_CH_ID ch_id, tUIPC_EVENT event); /* points to BT_HDR which describes event type and length of data; len contains the number of bytes of entire message (sizeof(BT_HDR) + offset + size of data) */
#ifdef __cplusplus
extern "C"
{
#endif
+const char* dump_uipc_event(tUIPC_EVENT event);
+
+
/*******************************************************************************
**
** Function UIPC_Init
@@ -153,6 +132,7 @@ UDRV_API extern UINT32 UIPC_Read(tUIPC_CH_ID ch_id, UINT16 *p_msg_evt, UINT8 *p_
*******************************************************************************/
UDRV_API extern BOOLEAN UIPC_Ioctl(tUIPC_CH_ID ch_id, UINT32 request, void *param);
+
#ifdef __cplusplus
}
#endif
diff --git a/udrv/include/unv.h b/udrv/include/unv.h
index 9e85bc8..87983da 100644
--- a/udrv/include/unv.h
+++ b/udrv/include/unv.h
@@ -3,44 +3,44 @@
* Copyright (C) 2009-2012 Broadcom Corporation
*
* This program is the proprietary software of Broadcom Corporation and/or its
- * licensors, and may only be used, duplicated, modified or distributed
- * pursuant to the terms and conditions of a separate, written license
- * agreement executed between you and Broadcom (an "Authorized License").
- * Except as set forth in an Authorized License, Broadcom grants no license
- * (express or implied), right to use, or waiver of any kind with respect to
- * the Software, and Broadcom expressly reserves all rights in and to the
- * Software and all intellectual property rights therein.
- * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
- * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
- * ALL USE OF THE SOFTWARE.
+ * licensors, and may only be used, duplicated, modified or distributed
+ * pursuant to the terms and conditions of a separate, written license
+ * agreement executed between you and Broadcom (an "Authorized License").
+ * Except as set forth in an Authorized License, Broadcom grants no license
+ * (express or implied), right to use, or waiver of any kind with respect to
+ * the Software, and Broadcom expressly reserves all rights in and to the
+ * Software and all intellectual property rights therein.
+ * IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS
+ * SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
+ * ALL USE OF THE SOFTWARE.
*
* Except as expressly set forth in the Authorized License,
*
- * 1. This program, including its structure, sequence and organization,
- * constitutes the valuable trade secrets of Broadcom, and you shall
- * use all reasonable efforts to protect the confidentiality thereof,
- * and to use this information only in connection with your use of
+ * 1. This program, including its structure, sequence and organization,
+ * constitutes the valuable trade secrets of Broadcom, and you shall
+ * use all reasonable efforts to protect the confidentiality thereof,
+ * and to use this information only in connection with your use of
* Broadcom integrated circuit products.
*
- * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
- * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
- * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
- * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
- * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
- * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
- * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
+ * "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
+ * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
+ * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
+ * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
+ * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
+ * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
* CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT
* OF USE OR PERFORMANCE OF THE SOFTWARE.
*
* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR
- * ITS LICENSORS BE LIABLE FOR
- * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
- * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
- * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
- * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
- * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
- * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
- * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
+ * ITS LICENSORS BE LIABLE FOR
+ * (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY
+ * DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO
+ * YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
+ * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR
+ * (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE
+ * SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
+ * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF
* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
*
************************************************************************************/
@@ -50,7 +50,7 @@
* Filename: unv.h
*
* Description: Universal NV Ram API
- *
+ *
***********************************************************************************/
#ifndef UNV_H
@@ -84,7 +84,7 @@ typedef int (*unv_iter_cb)(char *key, char *val, void *userdata);
**
** Function unv_create_directory
**
-** Description Creates directory, if full path is not available it
+** Description Creates directory, if full path is not available it
** will construct it. Must be called from BTIF task context.
**
** Parameters
@@ -107,7 +107,7 @@ int unv_create_directory(const char *path);
** Parameters
** filename : file path to be created
**
-** Returns 0 if successful, -1 if failure
+** Returns 0 if successful, -1 if failure
**
*******************************************************************************/
@@ -131,7 +131,7 @@ int unv_create_file(const char *filename);
**
*******************************************************************************/
-char* unv_read_key( const char *path,
+char* unv_read_key( const char *path,
const char *key,
char *p_out,
int out_len);
@@ -154,8 +154,8 @@ char* unv_read_key( const char *path,
**
*******************************************************************************/
-int unv_read_key_iter( const char *path,
- unv_iter_cb cb,
+int unv_read_key_iter( const char *path,
+ unv_iter_cb cb,
void *userdata );
@@ -163,7 +163,7 @@ int unv_read_key_iter( const char *path,
**
** Function unv_write_key
**
-** Description Writes key to file. If key value exists it will be updated
+** Description Writes key to file. If key value exists it will be updated
** Path must be an existing absolute path
** Must be called from BTIF task context
**
@@ -172,12 +172,12 @@ int unv_read_key_iter( const char *path,
** key : key string to write
** value : value string to set for this key
**
-** Returns 0 if successful, -1 if failure
+** Returns 0 if successful, -1 if failure
**
*******************************************************************************/
-int unv_write_key( const char *path,
- const char *key,
+int unv_write_key( const char *path,
+ const char *key,
const char *value );
@@ -197,7 +197,7 @@ int unv_write_key( const char *path,
**
*******************************************************************************/
-int unv_remove_key( const char *path,
+int unv_remove_key( const char *path,
const char *key );
#endif /* UNV_H */