summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2012-07-09 13:53:56 -0700
committerMatthew Xie <mattx@google.com>2012-07-25 01:11:13 -0700
commit34242195e584331abc22e5113a48150dc678c8b6 (patch)
tree790260a544017c426102e8e32e4d0ecd614214a1 /main
parenta6cfa0a9b59e7604c87d03ecdd23385146032b8d (diff)
downloadexternal_bluetooth_bluedroid-34242195e584331abc22e5113a48150dc678c8b6.zip
external_bluetooth_bluedroid-34242195e584331abc22e5113a48150dc678c8b6.tar.gz
external_bluetooth_bluedroid-34242195e584331abc22e5113a48150dc678c8b6.tar.bz2
Work around for CR BLTH01373902
While enabling BT, Do not toggle the chip power if the target is wingray. Change-Id: If044361d51354cfd3695d84895dada4342ef28c8
Diffstat (limited to 'main')
-rwxr-xr-x[-rw-r--r--]main/bte_main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/bte_main.c b/main/bte_main.c
index f724bae..4f63d42 100644..100755
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -207,9 +207,24 @@ void bte_main_enable(uint8_t *local_addr)
if (hci_logging_enabled == TRUE)
bt_hc_if->logging(BT_HC_LOGGING_ON, hci_logfile);
+#if (defined (BT_CLEAN_TURN_ON_DISABLED) && BT_CLEAN_TURN_ON_DISABLED == TRUE)
+ APPL_TRACE_DEBUG1("%s Not Turninig Off the BT before Turninig ON", __FUNCTION__);
+
+ /* Do not power off the chip before powering on if BT_CLEAN_TURN_ON_DISABLED flag
+ is defined and set to TRUE to avoid below mentioned issue.
+
+ Wingray kernel driver maintains a combined counter to keep track of
+ BT-Wifi state. Invoking set_power(BT_HC_CHIP_PWR_OFF) when the BT is already
+ in OFF state causes this counter to be incorrectly decremented and results in undesired
+ behavior of the chip.
+
+ This is only a workaround and when the issue is fixed in the kernel this work around
+ should be removed. */
+#else
/* toggle chip power to ensure we will reset chip in case
a previous stack shutdown wasn't completed gracefully */
bt_hc_if->set_power(BT_HC_CHIP_PWR_OFF);
+#endif
bt_hc_if->set_power(BT_HC_CHIP_PWR_ON);
bt_hc_if->preload(NULL);