summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbt-vendor/Android.mk13
-rw-r--r--libbt-vendor/include/bt_vendor_qcom.h6
-rw-r--r--libbt-vendor/src/bt_vendor_qcom.c19
-rw-r--r--libbt-vendor/src/hardware.c2
-rw-r--r--libbt-vendor/src/hci_smd.c29
-rw-r--r--libbt-vendor/src/hci_uart.c2
-rw-r--r--libbt-vendor/src/hw_ar3k.c1
-rw-r--r--libbt-vendor/src/hw_rome.c5
8 files changed, 56 insertions, 21 deletions
diff --git a/libbt-vendor/Android.mk b/libbt-vendor/Android.mk
index c959b9f..a12feb0 100644
--- a/libbt-vendor/Android.mk
+++ b/libbt-vendor/Android.mk
@@ -20,7 +20,6 @@ ifeq ($(BOARD_HAVE_BLUETOOTH_QCOM),true)
include $(CLEAR_VARS)
-BDROID_DIR:= external/bluetooth/bluedroid
LOCAL_SRC_FILES := \
src/bt_vendor_qcom.c \
@@ -45,7 +44,8 @@ endif
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/include \
- $(BDROID_DIR)/hci/include \
+ external/bluetooth/bluedroid/hci/include \
+ system/bt/hci/include \
$(TARGET_OUT_HEADERS)/bt/hci_qcomm_init
ifeq ($(BOARD_HAS_QCA_BT_AR3002), true)
@@ -67,10 +67,17 @@ LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_OWNER := qcom
+ifdef TARGET_2ND_ARCH
+LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
+LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
+else
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
+endif
+
LOCAL_CFLAGS += -DBT_NV_SUPPORT
#LOCAL_CFLAGS += -DREAD_BT_ADDR_FROM_PROP
-include $(LOCAL_PATH)/vnd_buildcfg.mk
+#include $(LOCAL_PATH)/vnd_buildcfg.mk
include $(BUILD_SHARED_LIBRARY)
diff --git a/libbt-vendor/include/bt_vendor_qcom.h b/libbt-vendor/include/bt_vendor_qcom.h
index 739a517..f4b7a2d 100644
--- a/libbt-vendor/include/bt_vendor_qcom.h
+++ b/libbt-vendor/include/bt_vendor_qcom.h
@@ -19,7 +19,7 @@
#include "bt_vendor_lib.h"
//#include "vnd_buildcfg.h"
-#include "utils.h"
+
#ifndef FALSE
#define FALSE 0
@@ -29,6 +29,10 @@
#define TRUE (!FALSE)
#endif
+#define STREAM_TO_UINT16(u16, p) {u16 = ((uint16_t)(*(p)) + (((uint16_t)(*((p) + 1))) << 8)); (p) += 2;}
+#define UINT16_TO_STREAM(p, u16) {*(p)++ = (uint8_t)(u16); *(p)++ = (uint8_t)((u16) >> 8);}
+#define UINT32_TO_STREAM(p, u32) {*(p)++ = (uint8_t)(u32); *(p)++ = (uint8_t)((u32) >> 8); *(p)++ = (uint8_t)((u32) >> 16); *(p)++ = (uint8_t)((u32) >> 24);}
+
typedef enum {
BT_SOC_DEFAULT = 0,
BT_SOC_SMD = BT_SOC_DEFAULT,
diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c
index cb5491f..838efc0 100644
--- a/libbt-vendor/src/bt_vendor_qcom.c
+++ b/libbt-vendor/src/bt_vendor_qcom.c
@@ -39,8 +39,9 @@
#include <linux/un.h>
#include "bt_vendor_persist.h"
#include "hw_rome.h"
-
+#include "bt_vendor_lib.h"
#define WAIT_TIMEOUT 200000
+#define BT_VND_OP_GET_LINESPEED 12
#ifdef PANIC_ON_SOC_CRASH
#define BT_VND_FILTER_START "wc_transport.start_root"
@@ -73,6 +74,13 @@ static int rfkill_id = -1;
static char *rfkill_state = NULL;
bool enable_extldo = FALSE;
+int userial_clock_operation(int fd, int cmd);
+int ath3k_init(int fd, int speed, int init_speed, char *bdaddr, struct termios *ti);
+int rome_soc_init(int fd, char *bdaddr);
+int userial_vendor_get_baud(void);
+int readTrpState();
+void lpm_set_ar3k(uint8_t pio, uint8_t action, uint8_t polarity);
+
static const tUSERIAL_CFG userial_init_cfg =
{
(USERIAL_DATABITS_8 | USERIAL_PARITY_NONE | USERIAL_STOPBITS_1),
@@ -698,11 +706,14 @@ static int op(bt_vendor_opcode_t opcode, void *param)
}
break;
#ifdef BT_SOC_TYPE_ROME
+#ifdef ENABLE_ANT
case BT_VND_OP_ANT_USERIAL_OPEN:
ALOGI("bt-vendor : BT_VND_OP_ANT_USERIAL_OPEN");
is_ant_req = true;
//fall through
#endif
+
+#endif
case BT_VND_OP_USERIAL_OPEN:
{
int (*fd_array)[] = (int (*)[]) param;
@@ -875,6 +886,7 @@ static int op(bt_vendor_opcode_t opcode, void *param)
}
break;
#ifdef BT_SOC_TYPE_ROME
+#ifdef ENABLE_ANT
case BT_VND_OP_ANT_USERIAL_CLOSE:
{
ALOGI("bt-vendor : BT_VND_OP_ANT_USERIAL_CLOSE");
@@ -887,6 +899,7 @@ static int op(bt_vendor_opcode_t opcode, void *param)
}
break;
#endif
+#endif
case BT_VND_OP_USERIAL_CLOSE:
{
ALOGI("bt-vendor : BT_VND_OP_USERIAL_CLOSE btSocType: %d", btSocType);
@@ -1044,6 +1057,7 @@ static void ssr_cleanup(void) {
if (btSocType == BT_SOC_ROME) {
#ifdef BT_SOC_TYPE_ROME
+#ifdef ENABLE_ANT
//Indicate to filter by sending
//special byte
trig_ssr = 0xEE;
@@ -1052,11 +1066,14 @@ static void ssr_cleanup(void) {
/*Close both ANT channel*/
op(BT_VND_OP_ANT_USERIAL_CLOSE, NULL);
#endif
+#endif
/*Close both ANT channel*/
op(BT_VND_OP_USERIAL_CLOSE, NULL);
/*CTRL OFF twice to make sure hw
* turns off*/
+#ifdef ENABLE_ANT
op(BT_VND_OP_POWER_CTRL, &pwr_state);
+#endif
}
#ifdef BT_SOC_TYPE_ROME
diff --git a/libbt-vendor/src/hardware.c b/libbt-vendor/src/hardware.c
index 4d82b18..cebeba7 100644
--- a/libbt-vendor/src/hardware.c
+++ b/libbt-vendor/src/hardware.c
@@ -39,7 +39,7 @@
#include <stdlib.h>
#include "bt_hci_bdroid.h"
#include "bt_vendor_qcom.h"
-
+#include <string.h>
#define MAX_CNT_RETRY 100
int hw_config(int nState)
diff --git a/libbt-vendor/src/hci_smd.c b/libbt-vendor/src/hci_smd.c
index 603a278..7e5b16d 100644
--- a/libbt-vendor/src/hci_smd.c
+++ b/libbt-vendor/src/hci_smd.c
@@ -31,6 +31,8 @@
#include <stdio.h>
#include "bt_vendor_qcom.h"
#include "hci_smd.h"
+#include <string.h>
+#include <cutils/properties.h>
/*****************************************************************************
** Macros & Constants
@@ -50,19 +52,6 @@ extern int is_bt_ssr_hci;
/*****************************************************************************
** Functions
*****************************************************************************/
-int bt_hci_init_transport(int *pFd)
-{
- int i = 0;
- int fd;
- for(i=0; i < NUM_OF_DEVS; i++){
- fd = bt_hci_init_transport_id(i);
- if(fd < 0 ){
- return -1;
- }
- pFd[i] = fd;
- }
- return 0;
-}
int bt_hci_init_transport_id (int chId )
{
@@ -150,6 +139,20 @@ int bt_hci_init_transport_id (int chId )
return fd;
}
+int bt_hci_init_transport(int *pFd)
+{
+ int i = 0;
+ int fd;
+ for(i=0; i < NUM_OF_DEVS; i++){
+ fd = bt_hci_init_transport_id(i);
+ if(fd < 0 ){
+ return -1;
+ }
+ pFd[i] = fd;
+ }
+ return 0;
+}
+
int bt_hci_deinit_transport(int *pFd)
{
close(pFd[0]);
diff --git a/libbt-vendor/src/hci_uart.c b/libbt-vendor/src/hci_uart.c
index 0475c99..2fbba95 100644
--- a/libbt-vendor/src/hci_uart.c
+++ b/libbt-vendor/src/hci_uart.c
@@ -33,7 +33,7 @@
#include <stdio.h>
#include "bt_vendor_qcom.h"
#include "hci_uart.h"
-
+#include <string.h>
/******************************************************************************
** Constants & Macros
diff --git a/libbt-vendor/src/hw_ar3k.c b/libbt-vendor/src/hw_ar3k.c
index 3f830b4..2f6da66 100644
--- a/libbt-vendor/src/hw_ar3k.c
+++ b/libbt-vendor/src/hw_ar3k.c
@@ -47,6 +47,7 @@ extern "C" {
#include <cutils/properties.h>
#include <stdlib.h>
#include <termios.h>
+#include <string.h>
#include "bt_hci_bdroid.h"
#include "hci_uart.h"
diff --git a/libbt-vendor/src/hw_rome.c b/libbt-vendor/src/hw_rome.c
index 3cf379e..aa672a5 100644
--- a/libbt-vendor/src/hw_rome.c
+++ b/libbt-vendor/src/hw_rome.c
@@ -47,7 +47,8 @@ extern "C" {
#include <cutils/properties.h>
#include <stdlib.h>
#include <termios.h>
-
+#include <string.h>
+#include <stdbool.h>
#include "bt_hci_bdroid.h"
#include "bt_vendor_qcom.h"
#include "hci_uart.h"
@@ -59,6 +60,8 @@ extern "C" {
}
#endif
+int read_vs_hci_event(int fd, unsigned char* buf, int size);
+
/******************************************************************************
** Variables
******************************************************************************/