diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-03-21 15:18:10 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-21 16:02:12 -0400 |
commit | 533553f8738184bcf957d97fed9eb4d5f023e4a7 (patch) | |
tree | c1da118314500d76145b46113c8076fa0298a82e /net/bluetooth/hci_event.c | |
parent | d986b4a6480bdd55c073635ef883c754e46ac0eb (diff) |
Bluetooth: Track current configured LE scan type parameter
The LE scan type paramter defines if active scanning or passive scanning
is in use. Track the currently set value so it can be used for decision
making from other pieces in the core.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 1e386edc338f..9ee081b9c064 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -199,6 +199,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) | |||
199 | memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data)); | 199 | memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data)); |
200 | hdev->scan_rsp_data_len = 0; | 200 | hdev->scan_rsp_data_len = 0; |
201 | 201 | ||
202 | hdev->le_scan_type = LE_SCAN_PASSIVE; | ||
203 | |||
202 | hdev->ssp_debug_mode = 0; | 204 | hdev->ssp_debug_mode = 0; |
203 | } | 205 | } |
204 | 206 | ||
@@ -997,6 +999,25 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb) | |||
997 | hci_dev_unlock(hdev); | 999 | hci_dev_unlock(hdev); |
998 | } | 1000 | } |
999 | 1001 | ||
1002 | static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb) | ||
1003 | { | ||
1004 | struct hci_cp_le_set_scan_param *cp; | ||
1005 | __u8 status = *((__u8 *) skb->data); | ||
1006 | |||
1007 | BT_DBG("%s status 0x%2.2x", hdev->name, status); | ||
1008 | |||
1009 | cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_PARAM); | ||
1010 | if (!cp) | ||
1011 | return; | ||
1012 | |||
1013 | hci_dev_lock(hdev); | ||
1014 | |||
1015 | if (!status) | ||
1016 | hdev->le_scan_type = cp->type; | ||
1017 | |||
1018 | hci_dev_unlock(hdev); | ||
1019 | } | ||
1020 | |||
1000 | static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, | 1021 | static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, |
1001 | struct sk_buff *skb) | 1022 | struct sk_buff *skb) |
1002 | { | 1023 | { |
@@ -2488,6 +2509,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2488 | hci_cc_le_set_adv_enable(hdev, skb); | 2509 | hci_cc_le_set_adv_enable(hdev, skb); |
2489 | break; | 2510 | break; |
2490 | 2511 | ||
2512 | case HCI_OP_LE_SET_SCAN_PARAM: | ||
2513 | hci_cc_le_set_scan_param(hdev, skb); | ||
2514 | break; | ||
2515 | |||
2491 | case HCI_OP_LE_SET_SCAN_ENABLE: | 2516 | case HCI_OP_LE_SET_SCAN_ENABLE: |
2492 | hci_cc_le_set_scan_enable(hdev, skb); | 2517 | hci_cc_le_set_scan_enable(hdev, skb); |
2493 | break; | 2518 | break; |