summaryrefslogtreecommitdiffstats
path: root/hci
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-11-11 21:10:43 +0100
committerPaul Kocialkowski <contact@paulk.fr>2013-11-11 21:10:43 +0100
commit20c13c655e0cdd25d21d562d1d44988107a20711 (patch)
tree05c147bdeea1d7f868976cae3dbf2e7cb81ae28c /hci
parent10b999d68cf2535cd5f7a4df3b20d801c8f09fe0 (diff)
downloadexternal_bluetooth_bluedroid-20c13c655e0cdd25d21d562d1d44988107a20711.zip
external_bluetooth_bluedroid-20c13c655e0cdd25d21d562d1d44988107a20711.tar.gz
external_bluetooth_bluedroid-20c13c655e0cdd25d21d562d1d44988107a20711.tar.bz2
Properly handle missing firmwaresreplicant-4.2-0001
Change-Id: I47d7d59c49d06149cbf27e0ac570188b451197f8 Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'hci')
-rw-r--r--hci/src/bt_hci_bdroid.c6
-rw-r--r--hci/src/bt_hw.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/hci/src/bt_hci_bdroid.c b/hci/src/bt_hci_bdroid.c
index 46355de..9309198 100644
--- a/hci/src/bt_hci_bdroid.c
+++ b/hci/src/bt_hci_bdroid.c
@@ -59,7 +59,7 @@ void lpm_enable(uint8_t turn_on);
void lpm_wake_deassert(void);
void lpm_allow_bt_device_sleep(void);
void lpm_wake_assert(void);
-void init_vnd_if(unsigned char *local_bdaddr);
+int init_vnd_if(unsigned char *local_bdaddr);
void btsnoop_open(char *p_path);
void btsnoop_close(void);
@@ -129,7 +129,9 @@ static int init(const bt_hc_callbacks_t* p_cb, unsigned char *local_bdaddr)
/* store reference to user callbacks */
bt_hc_cbacks = (bt_hc_callbacks_t *) p_cb;
- init_vnd_if(local_bdaddr);
+ result = init_vnd_if(local_bdaddr);
+ if (result != BT_HC_STATUS_SUCCESS)
+ return result;
utils_init();
#ifdef HCI_USE_MCT
diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c
index b2a099f..f2b7b71 100644
--- a/hci/src/bt_hw.c
+++ b/hci/src/bt_hw.c
@@ -184,24 +184,33 @@ static const bt_vendor_callbacks_t vnd_callbacks = {
** Returns None
**
******************************************************************************/
-void init_vnd_if(unsigned char *local_bdaddr)
+int init_vnd_if(unsigned char *local_bdaddr)
{
void *dlhandle;
+ int rc;
dlhandle = dlopen("libbt-vendor.so", RTLD_NOW);
if (!dlhandle)
{
ALOGE("!!! Failed to load libbt-vendor.so !!!");
- return;
+ return BT_HC_STATUS_FAIL;
}
bt_vnd_if = (bt_vendor_interface_t *) dlsym(dlhandle, "BLUETOOTH_VENDOR_LIB_INTERFACE");
if (!bt_vnd_if)
{
ALOGE("!!! Failed to get bt vendor interface !!!");
- return;
+ return BT_HC_STATUS_FAIL;
}
- bt_vnd_if->init(&vnd_callbacks, local_bdaddr);
+ rc = bt_vnd_if->init(&vnd_callbacks, local_bdaddr);
+ if (rc < 0) {
+ dlclose(dlhandle);
+ bt_vnd_if = NULL;
+
+ return BT_HC_STATUS_FAIL;
+ }
+
+ return BT_HC_STATUS_SUCCESS;
}