diff options
author | Ankit Navik <ankit.p.navik@intel.com> | 2018-06-29 02:43:20 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2018-07-06 06:40:08 -0400 |
commit | 545f2596b907f0747170c7cb71edc74cecf68c5c (patch) | |
tree | a2a9ac6f4162fd339372be5133ec1b25f0afc885 /net/bluetooth | |
parent | cfdb0c2d095ac5d7f09cac1317b7d0a9e8178134 (diff) |
Bluetooth: Add HCI command for clear Resolv list
Check for Resolv list supported by controller. So check the supported
commmand first before issuing this command i.e.,HCI_OP_LE_CLEAR_RESOLV_LIST
Before patch:
< HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 13.338168
> HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 13.338842
LE Read White List Size (0x08|0x000f) ncmd 1
Status: Success (0x00)
Size: 25
< HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 13.339029
> HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 13.339939
LE Clear White List (0x08|0x0010) ncmd 1
Status: Success (0x00)
< HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0 #59 [hci0] 13.340152
> HCI Event: Command Complete (0x0e) plen 5 #60 [hci0] 13.340952
LE Read Resolving List Size (0x08|0x002a) ncmd 1
Status: Success (0x00)
Size: 25
< HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #61 [hci0] 13.341180
> HCI Event: Command Complete (0x0e) plen 12 #62 [hci0] 13.341898
LE Read Maximum Data Length (0x08|0x002f) ncmd 1
Status: Success (0x00)
Max TX octets: 251
Max TX time: 17040
Max RX octets: 251
Max RX time: 17040
After patch:
< HCI Command: LE Read White List... (0x08|0x000f) plen 0 #55 [hci0] 28.919131
> HCI Event: Command Complete (0x0e) plen 5 #56 [hci0] 28.920016
LE Read White List Size (0x08|0x000f) ncmd 1
Status: Success (0x00)
Size: 25
< HCI Command: LE Clear White List (0x08|0x0010) plen 0 #57 [hci0] 28.920164
> HCI Event: Command Complete (0x0e) plen 4 #58 [hci0] 28.920873
LE Clear White List (0x08|0x0010) ncmd 1
Status: Success (0x00)
< HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0 #59 [hci0] 28.921109
> HCI Event: Command Complete (0x0e) plen 5 #60 [hci0] 28.922016
LE Read Resolving List Size (0x08|0x002a) ncmd 1
Status: Success (0x00)
Size: 25
< HCI Command: LE Clear Resolving... (0x08|0x0029) plen 0 #61 [hci0] 28.922166
> HCI Event: Command Complete (0x0e) plen 4 #62 [hci0] 28.922872
LE Clear Resolving List (0x08|0x0029) ncmd 1
Status: Success (0x00)
< HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0 #63 [hci0] 28.923117
> HCI Event: Command Complete (0x0e) plen 12 #64 [hci0] 28.924030
LE Read Maximum Data Length (0x08|0x002f) ncmd 1
Status: Success (0x00)
Max TX octets: 251
Max TX time: 17040
Max RX octets: 251
Max RX time: 17040
Signed-off-by: Ankit Navik <ankit.p.navik@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 036e14267d0a..ce2447d89ce1 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -720,6 +720,11 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) | |||
720 | 0, NULL); | 720 | 0, NULL); |
721 | } | 721 | } |
722 | 722 | ||
723 | if (hdev->commands[34] & 0x20) { | ||
724 | /* Clear LE Resolving List */ | ||
725 | hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL); | ||
726 | } | ||
727 | |||
723 | if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { | 728 | if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { |
724 | /* Read LE Maximum Data Length */ | 729 | /* Read LE Maximum Data Length */ |
725 | hci_req_add(req, HCI_OP_LE_READ_MAX_DATA_LEN, 0, NULL); | 730 | hci_req_add(req, HCI_OP_LE_READ_MAX_DATA_LEN, 0, NULL); |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 6ee69a79258f..562e7a854ed6 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1307,6 +1307,19 @@ static void hci_cc_le_write_def_data_len(struct hci_dev *hdev, | |||
1307 | hdev->le_def_tx_time = le16_to_cpu(sent->tx_time); | 1307 | hdev->le_def_tx_time = le16_to_cpu(sent->tx_time); |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | static void hci_cc_le_clear_resolv_list(struct hci_dev *hdev, | ||
1311 | struct sk_buff *skb) | ||
1312 | { | ||
1313 | __u8 status = *((__u8 *) skb->data); | ||
1314 | |||
1315 | BT_DBG("%s status 0x%2.2x", hdev->name, status); | ||
1316 | |||
1317 | if (status) | ||
1318 | return; | ||
1319 | |||
1320 | hci_bdaddr_list_clear(&hdev->le_resolv_list); | ||
1321 | } | ||
1322 | |||
1310 | static void hci_cc_le_read_resolv_list_size(struct hci_dev *hdev, | 1323 | static void hci_cc_le_read_resolv_list_size(struct hci_dev *hdev, |
1311 | struct sk_buff *skb) | 1324 | struct sk_buff *skb) |
1312 | { | 1325 | { |
@@ -3029,6 +3042,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb, | |||
3029 | hci_cc_le_write_def_data_len(hdev, skb); | 3042 | hci_cc_le_write_def_data_len(hdev, skb); |
3030 | break; | 3043 | break; |
3031 | 3044 | ||
3045 | case HCI_OP_LE_CLEAR_RESOLV_LIST: | ||
3046 | hci_cc_le_clear_resolv_list(hdev, skb); | ||
3047 | break; | ||
3048 | |||
3032 | case HCI_OP_LE_READ_RESOLV_LIST_SIZE: | 3049 | case HCI_OP_LE_READ_RESOLV_LIST_SIZE: |
3033 | hci_cc_le_read_resolv_list_size(hdev, skb); | 3050 | hci_cc_le_read_resolv_list_size(hdev, skb); |
3034 | break; | 3051 | break; |