summaryrefslogtreecommitdiffstats
path: root/bta/sys/bta_sys_main.c
diff options
context:
space:
mode:
authorKausik Sinnaswamy <kausik@broadcom.com>2012-09-24 17:23:51 +0530
committerIliyan Malchev <malchev@google.com>2012-09-26 13:58:19 -0700
commitf8217980ebcc6a6800052d32f023ebd8f4fbf7fc (patch)
tree7a376aa6369b3d45a3595a2acc5220105fb1d603 /bta/sys/bta_sys_main.c
parentbc08278001ea3bdf9e08c2f754b129db34b09eb6 (diff)
downloadexternal_bluetooth_bluedroid-f8217980ebcc6a6800052d32f023ebd8f4fbf7fc.zip
external_bluetooth_bluedroid-f8217980ebcc6a6800052d32f023ebd8f4fbf7fc.tar.gz
external_bluetooth_bluedroid-f8217980ebcc6a6800052d32f023ebd8f4fbf7fc.tar.bz2
Trigger restart on BT Controller H/W error
On a Bluetooth chip h/w error, trigger an event from the core stack to restart the Bluetooth process. This would ensure that any state is cleaned up and the process starts from scratch Bug: 7001800 Change-Id: I57b0b44276585e2ae3c22ddbcc9d80bd467135b2 Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'bta/sys/bta_sys_main.c')
-rw-r--r--bta/sys/bta_sys_main.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/bta/sys/bta_sys_main.c b/bta/sys/bta_sys_main.c
index f3d8cb6..c1554bb 100644
--- a/bta/sys/bta_sys_main.c
+++ b/bta/sys/bta_sys_main.c
@@ -298,42 +298,24 @@ void bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg)
UINT8 module_index;
- for (module_index = 0; module_index < BTA_SYS_MAX_HW_MODULES; module_index++)
- {
- if( bta_sys_cb.sys_hw_module_active & ((UINT32)1 << module_index ))
- switch( module_index)
- {
-
- case BTA_SYS_HW_BLUETOOTH:
- BTA_DisableBluetooth();
- break;
- default:
- /* not yet supported */
- break;
- }
- }
-
- /* turn everything OFF, then re-start the modules that were ON. Let the state machine handle all this... */
+ APPL_TRACE_DEBUG1("%s", __FUNCTION__);
for (module_index = 0; module_index < BTA_SYS_MAX_HW_MODULES; module_index++)
{
- if( bta_sys_cb.sys_hw_module_active & ((UINT32)1 << module_index ))
+ if( bta_sys_cb.sys_hw_module_active & ((UINT32)1 << module_index )) {
switch( module_index)
{
-
case BTA_SYS_HW_BLUETOOTH:
- BTA_EnableBluetooth(NULL);
+ /* Send BTA_SYS_HW_ERROR_EVT to DM */
+ if (bta_sys_cb.sys_hw_cback[module_index] != NULL)
+ bta_sys_cb.sys_hw_cback[module_index] (BTA_SYS_HW_ERROR_EVT);
break;
default:
/* not yet supported */
break;
}
}
-
-
-
-
-
+ }
}