diff options
author | Johan Hedberg | 2014-07-08 15:07:47 +0300 |
---|---|---|
committer | Marcel Holtmann | 2014-07-08 14:22:05 +0200 |
commit | 66c417c1ee01398ac5ab1c749a20c4d8ba50e9a9 (patch) | |
tree | 80181e7387748ebd19496e5bb8dc50265400b5d4 /net/bluetooth | |
parent | a70f4b5f14a029c14c3901f429e4d3d7e5477b4f (diff) |
Bluetooth: Add flag to track the real advertising state
Having a single HCI_ADVERTISING flag is problematic since it tries to
track both the real advertising state and the corresponding mgmt
setting. To make the logic simpler and more reliable add a new flag that
only tracks the actual advertising state that has been written to the
controller.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_event.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index a6816498b0b9..10f8de9400bc 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -1069,11 +1069,15 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb) if (*sent) { struct hci_conn *conn; + set_bit(HCI_LE_ADV, &hdev->dev_flags); + conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); if (conn) queue_delayed_work(hdev->workqueue, &conn->le_conn_timeout, conn->conn_timeout); + } else { + clear_bit(HCI_LE_ADV, &hdev->dev_flags); } mgmt_advertising(hdev, *sent); |