summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpramod kotreshappa <kpramod@codeaurora.org>2015-05-06 09:53:03 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-05-14 10:36:04 -0700
commit0da3f87790b5a3cf2491edb06514c4d36b41db2b (patch)
treed86497c682ec6445f6984f4094178f40528e3960
parented7acc335480900f62da397a1b70ea53553ab6e8 (diff)
downloadandroid_hardware_qcom_bt-0da3f87790b5a3cf2491edb06514c4d36b41db2b.tar.gz
android_hardware_qcom_bt-0da3f87790b5a3cf2491edb06514c4d36b41db2b.tar.bz2
android_hardware_qcom_bt-0da3f87790b5a3cf2491edb06514c4d36b41db2b.zip
Bluetooth: Fix for ANT standalone turn on failure
Ignore VS event and hci_event in ANT standalone scenario for controller logging VS command to fix ANT turn on failure. Change-Id: I4025beeca684b896dd3607c904d047036e4b9ad9
-rw-r--r--libbt-vendor/src/bt_vendor_qcom.c11
-rw-r--r--libbt-vendor/src/hw_rome.c18
2 files changed, 16 insertions, 13 deletions
diff --git a/libbt-vendor/src/bt_vendor_qcom.c b/libbt-vendor/src/bt_vendor_qcom.c
index 9bf833c..422da8a 100644
--- a/libbt-vendor/src/bt_vendor_qcom.c
+++ b/libbt-vendor/src/bt_vendor_qcom.c
@@ -52,7 +52,7 @@ extern int rome_soc_init(int fd, char *bdaddr);
extern int check_embedded_mode(int fd);
extern int rome_get_addon_feature_list(int fd);
extern int rome_ver;
-extern int enable_controller_log(int fd);
+extern int enable_controller_log(int fd, unsigned char req);
/******************************************************************************
** Variables
******************************************************************************/
@@ -619,7 +619,7 @@ static int op(bt_vendor_opcode_t opcode, void *param)
uint8_t local_bd_addr_from_prop[6];
char* tok;
#endif
-
+ bool skip_init = true;
ALOGV("bt-vendor : op for %d", opcode);
switch(opcode)
@@ -800,6 +800,7 @@ static int op(bt_vendor_opcode_t opcode, void *param)
ALOGV("rome_soc_init is completed");
property_set("wc_transport.soc_initialized", "1");
userial_clock_operation(fd, USERIAL_OP_CLK_OFF);
+ skip_init = false;
/*Close the UART port*/
close(fd);
}
@@ -831,7 +832,11 @@ static int op(bt_vendor_opcode_t opcode, void *param)
rome_get_addon_feature_list(fd);
}
}
- enable_controller_log(fd);
+ if (!skip_init) {
+ /*Skip if already sent*/
+ enable_controller_log(fd, is_ant_req);
+ skip_init = true;
+ }
for (idx=0; idx < CH_MAX; idx++)
(*fd_array)[idx] = fd;
retval = 1;
diff --git a/libbt-vendor/src/hw_rome.c b/libbt-vendor/src/hw_rome.c
index 06241f5..6dcb183 100644
--- a/libbt-vendor/src/hw_rome.c
+++ b/libbt-vendor/src/hw_rome.c
@@ -1700,7 +1700,7 @@ error:
}
-void enable_controller_log (int fd)
+void enable_controller_log (int fd, unsigned char wait_for_evt)
{
int ret = 0;
/* VS command to enable controller logging to the HOST. By default it is disabled */
@@ -1713,16 +1713,22 @@ void enable_controller_log (int fd)
// value at cmd[5]: 1 - to enable, 0 - to disable
ret = (strcmp(value, "true") == 0) ? cmd[5] = 0x01: 0;
ALOGI("%s: %d", __func__, ret);
+ /* Ignore vsc evt if wait_for_evt is true */
+ if (wait_for_evt) wait_vsc_evt = FALSE;
ret = hci_send_vs_cmd(fd, (unsigned char *)cmd, rsp, 6);
if (ret != 6) {
ALOGE("%s: command failed", __func__);
}
-
+ /*Ignore hci_event if wait_for_evt is true*/
+ if (wait_for_evt)
+ goto end;
ret = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE);
if (ret < 0) {
ALOGE("%s: Failed to get CC for enable SoC log", __FUNCTION__);
}
+end:
+ wait_vsc_evt = TRUE;
return;
}
@@ -1862,14 +1868,6 @@ download:
}
ALOGI("%s: Download TLV file successfully ", __FUNCTION__);
- /* This function sends a vendor specific command to enable/disable
- * controller logs on need. Once the command is received to the SOC,
- * It would start sending cotroller's print strings and LMP RX/TX
- * packets to the HOST (over the UART) which will be logged in QXDM.
- * The property 'enablebtsoclog' used to send this command on BT init
- * sequence.
- */
-
/* Get SU FM label information */
if((err = rome_get_build_info_req(fd)) <0){
ALOGI("%s: Fail to get Rome FW SU Build info (0x%x)", __FUNCTION__, err);