aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-01-22 07:02:00 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-01-22 23:08:43 -0500
commitcf1d081f6597a45e5ff63f55c893494a8ae1cdaf (patch)
tree5112451c53e886ec798c9967c3db67224d5aeb78 /net
parent60e77321985ab599fac010afdc465c3e30281a06 (diff)
Bluetooth: Add support for reading LE White List Size
The LE White List Size is necessary to be known before attempting to feed the controller with any addresses intended for the white list. This patch adds the necessary HCI command sending to the HCI init sequence. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 07c8c79a9fd1..d2fee64b728c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -614,6 +614,9 @@ static void le_setup(struct hci_dev *hdev)
614 614
615 /* Read LE Advertising Channel TX Power */ 615 /* Read LE Advertising Channel TX Power */
616 hci_send_cmd(hdev, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL); 616 hci_send_cmd(hdev, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
617
618 /* Read LE White List Size */
619 hci_send_cmd(hdev, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL);
617} 620}
618 621
619static void hci_setup(struct hci_dev *hdev) 622static void hci_setup(struct hci_dev *hdev)
@@ -1306,6 +1309,19 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
1306 } 1309 }
1307} 1310}
1308 1311
1312static void hci_cc_le_read_white_list_size(struct hci_dev *hdev,
1313 struct sk_buff *skb)
1314{
1315 struct hci_rp_le_read_white_list_size *rp = (void *) skb->data;
1316
1317 BT_DBG("%s status 0x%2.2x size %u", hdev->name, rp->status, rp->size);
1318
1319 if (!rp->status)
1320 hdev->le_white_list_size = rp->size;
1321
1322 hci_req_complete(hdev, HCI_OP_LE_READ_WHITE_LIST_SIZE, rp->status);
1323}
1324
1309static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb) 1325static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb)
1310{ 1326{
1311 struct hci_rp_le_ltk_reply *rp = (void *) skb->data; 1327 struct hci_rp_le_ltk_reply *rp = (void *) skb->data;
@@ -2684,6 +2700,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2684 hci_cc_le_set_scan_enable(hdev, skb); 2700 hci_cc_le_set_scan_enable(hdev, skb);
2685 break; 2701 break;
2686 2702
2703 case HCI_OP_LE_READ_WHITE_LIST_SIZE:
2704 hci_cc_le_read_white_list_size(hdev, skb);
2705 break;
2706
2687 case HCI_OP_LE_LTK_REPLY: 2707 case HCI_OP_LE_LTK_REPLY:
2688 hci_cc_le_ltk_reply(hdev, skb); 2708 hci_cc_le_ltk_reply(hdev, skb);
2689 break; 2709 break;