From 34242195e584331abc22e5113a48150dc678c8b6 Mon Sep 17 00:00:00 2001 From: Ganesh Ganapathi Batta Date: Mon, 9 Jul 2012 13:53:56 -0700 Subject: Work around for CR BLTH01373902 While enabling BT, Do not toggle the chip power if the target is wingray. Change-Id: If044361d51354cfd3695d84895dada4342ef28c8 --- main/bte_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100644 => 100755 main/bte_main.c (limited to 'main') diff --git a/main/bte_main.c b/main/bte_main.c old mode 100644 new mode 100755 index f724bae..4f63d42 --- 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); -- cgit v1.1