Bluetooth: Call HCI_Reset synchronously to catch errors

Change-Id: I882ec6ce5823afbf3cd423c36e0ac740c69574ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-03-14 13:04:29 +02:00
commit e4e04adb88

View file

@ -1505,15 +1505,6 @@ static void hci_cmd_complete(struct net_buf *buf)
*/ */
status = buf->data[0]; status = buf->data[0];
switch (opcode) {
case BT_HCI_OP_RESET:
hci_reset_complete(buf);
break;
default:
BT_DBG("Unhandled opcode 0x%04x", opcode);
break;
}
hci_cmd_done(opcode, status, buf); hci_cmd_done(opcode, status, buf);
if (evt->ncmd && !bt_dev.ncmd) { if (evt->ncmd && !bt_dev.ncmd) {
@ -2092,10 +2083,12 @@ static int common_init(void)
int err; int err;
/* Send HCI_RESET */ /* Send HCI_RESET */
err = bt_hci_cmd_send(BT_HCI_OP_RESET, NULL); err = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, &rsp);
if (err) { if (err) {
return err; return err;
} }
hci_reset_complete(rsp);
net_buf_unref(rsp);
/* Read Local Supported Features */ /* Read Local Supported Features */
err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LOCAL_FEATURES, NULL, &rsp); err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_LOCAL_FEATURES, NULL, &rsp);