Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291061
b: refs/heads/master
c: 24b78d0
h: refs/heads/master
i:
  291059: 36861e5
v: v3
  • Loading branch information
Johan Hedberg committed Feb 23, 2012
1 parent 9b5c6c5 commit e49e211
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90e704543d6702971ecfe3fe2325829d89b76f6b
refs/heads/master: 24b78d0f49b94f658e8bae707c158962535053dd
23 changes: 19 additions & 4 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,20 @@ static int add_uuid(struct sock *sk, u16 index, void *data, u16 len)
return err;
}

static bool enable_service_cache(struct hci_dev *hdev)
{
if (!hdev_is_powered(hdev))
return false;

if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
schedule_delayed_work(&hdev->service_cache,
msecs_to_jiffies(SERVICE_CACHE_TIMEOUT));
return true;
}

return false;
}

static int remove_uuid(struct sock *sk, u16 index, void *data, u16 len)
{
struct mgmt_cp_remove_uuid *cp = data;
Expand Down Expand Up @@ -1425,10 +1439,11 @@ static int remove_uuid(struct sock *sk, u16 index, void *data, u16 len)
if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) {
err = hci_uuids_clear(hdev);

if (hdev_is_powered(hdev) &&
!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
schedule_delayed_work(&hdev->service_cache,
msecs_to_jiffies(SERVICE_CACHE_TIMEOUT));
if (enable_service_cache(hdev)) {
err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, 0,
hdev->dev_class, 3);
goto unlock;
}

goto update_class;
}
Expand Down

0 comments on commit e49e211

Please sign in to comment.