summaryrefslogtreecommitdiffstats
path: root/hci/include
diff options
context:
space:
mode:
authorYK Jeffrey Chao <jechao@broadcom.com>2012-08-14 14:38:13 -0700
committerIliyan Malchev <malchev@google.com>2012-08-14 16:03:24 -0700
commit8673be81aa6bb05bb9a7747c150d63514625c03b (patch)
treefba62909459a120a15cd93be4cabb73a2aed2caa /hci/include
parent072cb49cdba074895678f63def089e4be1026bb7 (diff)
downloadexternal_bluetooth_bluedroid-8673be81aa6bb05bb9a7747c150d63514625c03b.zip
external_bluetooth_bluedroid-8673be81aa6bb05bb9a7747c150d63514625c03b.tar.gz
external_bluetooth_bluedroid-8673be81aa6bb05bb9a7747c150d63514625c03b.tar.bz2
Add HCI Multi-Channel Transport support (1/2)
Revise BT Vendor Lib interface and add support of HCI multi-channel transport. Change-Id: I5a7a7b64798bb30be60ed29bd564bc499bd5b5bc
Diffstat (limited to 'hci/include')
-rw-r--r--hci/include/bt_vendor_lib.h25
-rw-r--r--hci/include/hci.h115
-rw-r--r--hci/include/userial.h4
3 files changed, 140 insertions, 4 deletions
diff --git a/hci/include/bt_vendor_lib.h b/hci/include/bt_vendor_lib.h
index 462d4e6..f095f65 100644
--- a/hci/include/bt_vendor_lib.h
+++ b/hci/include/bt_vendor_lib.h
@@ -101,9 +101,18 @@ typedef enum {
* Open UART port on where the BT Controller is attached.
* This is called before stack initialization.
* [input param]
- * None.
+ * A pointer to int array type for open file descriptors.
+ * The mapping of HCI channel to fd slot in the int array is given in
+ * bt_vendor_hci_channels_t.
+ * And, it requires the vendor lib to fill up the content before returning
+ * the call.
+ * Typecasting conversion: (int (*)[]) param.
* [return]
- * fd - the file descriptor of UART port for Bluetooth.
+ * Numbers of opened file descriptors.
+ * Valid number:
+ * 1 - CMD/EVT/ACL-In/ACL-Out via the same fd (e.g. UART)
+ * 2 - CMD/EVT on one fd, and ACL-In/ACL-Out on the other fd
+ * 4 - CMD, EVT, ACL-In, ACL-Out are on their individual fd
* [callback]
* None.
*/
@@ -169,6 +178,18 @@ typedef enum {
BT_VND_PWR_ON,
} bt_vendor_power_state_t;
+/** Define HCI channel identifier in the file descriptors array
+ used in BT_VND_OP_USERIAL_OPEN operation.
+ */
+typedef enum {
+ CH_CMD, // HCI Command channel
+ CH_EVT, // HCI Event channel
+ CH_ACL_OUT, // HCI ACL downstream channel
+ CH_ACL_IN, // HCI ACL upstream channel
+
+ CH_MAX // Total channels
+} bt_vendor_hci_channels_t;
+
/** LPM disable/enable request */
typedef enum {
BT_VND_LPM_DISABLE,
diff --git a/hci/include/hci.h b/hci/include/hci.h
new file mode 100644
index 0000000..2682536
--- /dev/null
+++ b/hci/include/hci.h
@@ -0,0 +1,115 @@
+/******************************************************************************
+ *
+ * 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.
+ *
+ * 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
+ * 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
+ * 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
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * Filename: hci.h
+ *
+ * Description: Contains definitions used for HCI transport controls
+ *
+ ******************************************************************************/
+
+#ifndef HCI_H
+#define HCI_H
+
+/******************************************************************************
+** Constants & Macros
+******************************************************************************/
+
+/******************************************************************************
+** Type definitions
+******************************************************************************/
+
+/** Prototypes for HCI Service interface functions **/
+
+/* Initialize transport's control block */
+typedef void (*tHCI_INIT)(void);
+
+/* Do transport's control block clean-up */
+typedef void (*tHCI_CLEANUP)(void);
+
+/* Send HCI command/data to the transport */
+typedef void (*tHCI_SEND)(HC_BT_HDR *p_msg);
+
+/* Handler for HCI upstream path */
+typedef uint16_t (*tHCI_RCV)(void);
+
+/* Callback function for the returned event of internally issued command */
+typedef void (*tINT_CMD_CBACK)(void *p_mem);
+
+/* Handler for sending HCI command from the local module */
+typedef uint8_t (*tHCI_SEND_INT)(uint16_t opcode, HC_BT_HDR *p_buf, \
+ tINT_CMD_CBACK p_cback);
+
+/* Handler for getting acl data length */
+typedef void (*tHCI_ACL_DATA_LEN_HDLR)(void);
+
+/******************************************************************************
+** Extern variables and functions
+******************************************************************************/
+
+typedef struct {
+ tHCI_INIT init;
+ tHCI_CLEANUP cleanup;
+ tHCI_SEND send;
+ tHCI_SEND_INT send_int_cmd;
+ tHCI_ACL_DATA_LEN_HDLR get_acl_max_len;
+#ifdef HCI_USE_MCT
+ tHCI_RCV evt_rcv;
+ tHCI_RCV acl_rcv;
+#else
+ tHCI_RCV rcv;
+#endif
+} tHCI_IF;
+
+/******************************************************************************
+** Functions
+******************************************************************************/
+
+
+#endif /* HCI_H */
+
diff --git a/hci/include/userial.h b/hci/include/userial.h
index 92458e5..57da4e0 100644
--- a/hci/include/userial.h
+++ b/hci/include/userial.h
@@ -130,7 +130,7 @@ uint8_t userial_open(uint8_t port);
** copied into p_data. This may be less than len.
**
*******************************************************************************/
-uint16_t userial_read(uint8_t *p_buffer, uint16_t len);
+uint16_t userial_read(uint16_t msg_id, uint8_t *p_buffer, uint16_t len);
/*******************************************************************************
**
@@ -142,7 +142,7 @@ uint16_t userial_read(uint8_t *p_buffer, uint16_t len);
** may be less than len.
**
*******************************************************************************/
-uint16_t userial_write(uint8_t *p_data, uint16_t len);
+uint16_t userial_write(uint16_t msg_id, uint8_t *p_data, uint16_t len);
/*******************************************************************************
**