Commit aa12af77 authored by Ankit Navik's avatar Ankit Navik Committed by Marcel Holtmann

Bluetooth: Add definitions for LE set address resolution

Add the definitions for LE address resolution enable HCI commands.
When the LE address resolution enable gets changed via HCI commands
make sure that flag gets updated.
Signed-off-by: default avatarAnkit Navik <ankit.p.navik@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent b9763cdf
...@@ -269,6 +269,7 @@ enum { ...@@ -269,6 +269,7 @@ enum {
HCI_VENDOR_DIAG, HCI_VENDOR_DIAG,
HCI_FORCE_BREDR_SMP, HCI_FORCE_BREDR_SMP,
HCI_FORCE_STATIC_ADDR, HCI_FORCE_STATIC_ADDR,
HCI_LL_RPA_RESOLUTION,
__HCI_NUM_FLAGS, __HCI_NUM_FLAGS,
}; };
...@@ -1524,6 +1525,8 @@ struct hci_rp_le_read_resolv_list_size { ...@@ -1524,6 +1525,8 @@ struct hci_rp_le_read_resolv_list_size {
__u8 size; __u8 size;
} __packed; } __packed;
#define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
#define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f
struct hci_rp_le_read_max_data_len { struct hci_rp_le_read_max_data_len {
__u8 status; __u8 status;
......
...@@ -1480,6 +1480,30 @@ static void hci_cc_le_read_resolv_list_size(struct hci_dev *hdev, ...@@ -1480,6 +1480,30 @@ static void hci_cc_le_read_resolv_list_size(struct hci_dev *hdev,
hdev->le_resolv_list_size = rp->size; hdev->le_resolv_list_size = rp->size;
} }
static void hci_cc_le_set_addr_resolution_enable(struct hci_dev *hdev,
struct sk_buff *skb)
{
__u8 *sent, status = *((__u8 *) skb->data);
BT_DBG("%s status 0x%2.2x", hdev->name, status);
if (status)
return;
sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADDR_RESOLV_ENABLE);
if (!sent)
return;
hci_dev_lock(hdev);
if (*sent)
hci_dev_set_flag(hdev, HCI_LL_RPA_RESOLUTION);
else
hci_dev_clear_flag(hdev, HCI_LL_RPA_RESOLUTION);
hci_dev_unlock(hdev);
}
static void hci_cc_le_read_max_data_len(struct hci_dev *hdev, static void hci_cc_le_read_max_data_len(struct hci_dev *hdev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
...@@ -3263,6 +3287,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb, ...@@ -3263,6 +3287,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb,
hci_cc_le_read_resolv_list_size(hdev, skb); hci_cc_le_read_resolv_list_size(hdev, skb);
break; break;
case HCI_OP_LE_SET_ADDR_RESOLV_ENABLE:
hci_cc_le_set_addr_resolution_enable(hdev, skb);
break;
case HCI_OP_LE_READ_MAX_DATA_LEN: case HCI_OP_LE_READ_MAX_DATA_LEN:
hci_cc_le_read_max_data_len(hdev, skb); hci_cc_le_read_max_data_len(hdev, skb);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment