Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279261
b: refs/heads/master
c: db323f2
h: refs/heads/master
i:
  279259: 713f4ea
v: v3
  • Loading branch information
Gustavo F. Padovan committed Dec 18, 2011
1 parent 01338a0 commit 374a5d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 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: 19c40e3bcaf2d969f5d4ee85bbe1330b54d36d9c
refs/heads/master: db323f2fff0ded058f033df6235e8c2be4146bfd
2 changes: 1 addition & 1 deletion trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct hci_dev {
struct list_head remote_oob_data;

struct list_head adv_entries;
struct timer_list adv_timer;
struct delayed_work adv_work;

struct hci_dev_stats stat;

Expand Down
10 changes: 5 additions & 5 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,9 +1340,10 @@ int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr)
return mgmt_device_unblocked(hdev, bdaddr);
}

static void hci_clear_adv_cache(unsigned long arg)
static void hci_clear_adv_cache(struct work_struct *work)
{
struct hci_dev *hdev = (void *) arg;
struct hci_dev *hdev = container_of(work, struct hci_dev,
adv_work.work);

hci_dev_lock(hdev);

Expand Down Expand Up @@ -1488,9 +1489,8 @@ int hci_register_dev(struct hci_dev *hdev)
INIT_LIST_HEAD(&hdev->remote_oob_data);

INIT_LIST_HEAD(&hdev->adv_entries);
setup_timer(&hdev->adv_timer, hci_clear_adv_cache,
(unsigned long) hdev);

INIT_DELAYED_WORK(&hdev->adv_work, hci_clear_adv_cache);
INIT_WORK(&hdev->power_on, hci_power_on);
INIT_DELAYED_WORK(&hdev->power_off, hci_power_off);

Expand Down Expand Up @@ -1576,7 +1576,7 @@ void hci_unregister_dev(struct hci_dev *hdev)

hci_del_sysfs(hdev);

del_timer(&hdev->adv_timer);
cancel_delayed_work_sync(&hdev->adv_work);

destroy_workqueue(hdev->workqueue);

Expand Down
6 changes: 4 additions & 2 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,15 +1017,17 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
if (cp->enable == 0x01) {
set_bit(HCI_LE_SCAN, &hdev->dev_flags);

del_timer(&hdev->adv_timer);
cancel_delayed_work_sync(&hdev->adv_work);

hci_dev_lock(hdev);
hci_adv_entries_clear(hdev);
hci_dev_unlock(hdev);
} else if (cp->enable == 0x00) {
clear_bit(HCI_LE_SCAN, &hdev->dev_flags);

mod_timer(&hdev->adv_timer, jiffies + ADV_CLEAR_TIMEOUT);
cancel_delayed_work_sync(&hdev->adv_work);
queue_delayed_work(hdev->workqueue, &hdev->adv_work,
jiffies + ADV_CLEAR_TIMEOUT);
}
}

Expand Down

0 comments on commit 374a5d6

Please sign in to comment.