提交 69775ff6 编写于 作者: A Andre Guedes 提交者: Johan Hedberg

Bluetooth: Set DISCOVERY_STOPPED if controller resets

If controller is reset during the discovery procedure, Start Discovery
command stops working. This can be easily reproduced by running
"hciconfig hci0 reset" while discovering devices, for instance.

We should force discovery state to DISCOVERY_STOPPED in case we receive
a reset command complete event. Otherwise we may stuck in one of the
active discovery states (DISCOVERY_INQUIRY, DISCOVERY_LE_SCAN and
DISCOVERY_RESOLVING) and subsequent Start Discovery commands will simply
fail.
Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 60fc5fb6
...@@ -194,6 +194,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -194,6 +194,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
/* Reset all non-persistent flags */ /* Reset all non-persistent flags */
hdev->dev_flags &= ~(BIT(HCI_LE_SCAN)); hdev->dev_flags &= ~(BIT(HCI_LE_SCAN));
hdev->discovery.state = DISCOVERY_STOPPED;
} }
static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册