Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279387
b: refs/heads/master
c: 68a8aea
h: refs/heads/master
i:
  279385: 82263f3
  279383: d52c922
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo F. Padovan committed Dec 22, 2011
1 parent fddb2b2 commit ef427e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 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: 8a154a8feb805394d1fd46281becaf876e18860a
refs/heads/master: 68a8aea45973c8d0bc05f58389ce9e82e04bb5f6
3 changes: 3 additions & 0 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,9 @@ struct hci_cp_le_set_scan_param {
__u8 filter_policy;
} __packed;

#define LE_SCANNING_DISABLED 0x00
#define LE_SCANNING_ENABLED 0x01

#define HCI_OP_LE_SET_SCAN_ENABLE 0x200c
struct hci_cp_le_set_scan_enable {
__u8 enable;
Expand Down
12 changes: 10 additions & 2 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,20 +1033,28 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
if (!cp)
return;

if (cp->enable == 0x01) {
switch (cp->enable) {
case LE_SCANNING_ENABLED:
set_bit(HCI_LE_SCAN, &hdev->dev_flags);

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) {
break;

case LE_SCANNING_DISABLED:
clear_bit(HCI_LE_SCAN, &hdev->dev_flags);

cancel_delayed_work_sync(&hdev->adv_work);
queue_delayed_work(hdev->workqueue, &hdev->adv_work,
jiffies + ADV_CLEAR_TIMEOUT);
break;

default:
BT_ERR("Used reserved LE_Scan_Enable param %d", cp->enable);
break;
}
}

Expand Down

0 comments on commit ef427e3

Please sign in to comment.