diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-01-04 07:23:45 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:20 -0500 |
commit | ff9ef5787046c3fd20cf9f7ca1cd70260c1eedb9 (patch) | |
tree | ba9d936fd1aa8b3a8f4fe0685b71007f9116f30c /net/bluetooth/hci_event.c | |
parent | 30883512be0839349d29c7b0bc31016e0498cf8c (diff) |
Bluetooth: Add discovery state tracking
This patch adds proper state tracking to the device discovery process.
This makes it possible to return appropriate errors when trying to stop
a non-active discovery or start discovery when it is already ongoing.
Once name resolving is implemented this also makes it possible to know
what the right action to do is when a remote name lookup is cancelled.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d4d20df9fbbf..43d69569a0d5 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -65,7 +65,7 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) | |||
65 | clear_bit(HCI_INQUIRY, &hdev->flags); | 65 | clear_bit(HCI_INQUIRY, &hdev->flags); |
66 | 66 | ||
67 | hci_dev_lock(hdev); | 67 | hci_dev_lock(hdev); |
68 | mgmt_discovering(hdev, 0); | 68 | hci_discovery_set_state(hdev, DISCOVERY_STOPPED); |
69 | hci_dev_unlock(hdev); | 69 | hci_dev_unlock(hdev); |
70 | 70 | ||
71 | hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status); | 71 | hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status); |
@@ -1119,7 +1119,7 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) | |||
1119 | set_bit(HCI_INQUIRY, &hdev->flags); | 1119 | set_bit(HCI_INQUIRY, &hdev->flags); |
1120 | 1120 | ||
1121 | hci_dev_lock(hdev); | 1121 | hci_dev_lock(hdev); |
1122 | mgmt_discovering(hdev, 1); | 1122 | hci_discovery_set_state(hdev, DISCOVERY_ACTIVE); |
1123 | hci_dev_unlock(hdev); | 1123 | hci_dev_unlock(hdev); |
1124 | } | 1124 | } |
1125 | 1125 | ||
@@ -1507,7 +1507,7 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
1507 | return; | 1507 | return; |
1508 | 1508 | ||
1509 | hci_dev_lock(hdev); | 1509 | hci_dev_lock(hdev); |
1510 | mgmt_discovering(hdev, 0); | 1510 | hci_discovery_set_state(hdev, DISCOVERY_STOPPED); |
1511 | hci_dev_unlock(hdev); | 1511 | hci_dev_unlock(hdev); |
1512 | } | 1512 | } |
1513 | 1513 | ||