Bluetooth: Fix clearing BT_DEV_ENABLE on HCI reset complete

BT_DEV_ENABLE flag value must be preserved after HCI reset is complete
to not allow calling bt_enable more then once.

Change-Id: I77bf6111d4fc2a209e0c5a56717decba156068a6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-06-02 14:45:07 +02:00 committed by Johan Hedberg
commit 05bdba7768

View file

@ -2021,7 +2021,9 @@ static void hci_reset_complete(struct net_buf *buf)
discovery_results_size = 0;
discovery_results_count = 0;
#endif /* CONFIG_BLUETOOTH_BREDR */
atomic_set(bt_dev.flags, 0);
/* we only allow to enable once so this bit must be keep set */
atomic_set(bt_dev.flags, BIT(BT_DEV_ENABLE));
}
static void hci_cmd_done(uint16_t opcode, uint8_t status, struct net_buf *buf)