aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-10-19 13:57:47 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-10-24 09:11:37 -0400
commite36b04c805e452689d468f9783e5dffa61e38be7 (patch)
tree07c1c9de38ecdaa0cbd7b5b2d2cceeaefda0572b
parent572c7f8429e3c015dd8931b2d3f71b512a7f15f1 (diff)
Bluetooth: Add setting of the LE event mask
This patch adds setting of the LE event mask to the HCI init procedure for LE-capable controllers. Right now we only set the default mask which is good enough for the events available in the 4.0 core specification. 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>
-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 f4f0b8bfdee6..78f1af52ed81 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -550,6 +550,13 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
550 events[7] |= 0x20; /* LE Meta-Event */ 550 events[7] |= 0x20; /* LE Meta-Event */
551 551
552 hci_send_cmd(hdev, HCI_OP_SET_EVENT_MASK, sizeof(events), events); 552 hci_send_cmd(hdev, HCI_OP_SET_EVENT_MASK, sizeof(events), events);
553
554 if (lmp_le_capable(hdev)) {
555 memset(events, 0, sizeof(events));
556 events[0] = 0x1f;
557 hci_send_cmd(hdev, HCI_OP_LE_SET_EVENT_MASK,
558 sizeof(events), events);
559 }
553} 560}
554 561
555static void bredr_init(struct hci_dev *hdev) 562static void bredr_init(struct hci_dev *hdev)
@@ -1066,6 +1073,15 @@ static void hci_cc_le_read_buffer_size(struct hci_dev *hdev,
1066 hci_req_complete(hdev, HCI_OP_LE_READ_BUFFER_SIZE, rp->status); 1073 hci_req_complete(hdev, HCI_OP_LE_READ_BUFFER_SIZE, rp->status);
1067} 1074}
1068 1075
1076static void hci_cc_le_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb)
1077{
1078 __u8 status = *((__u8 *) skb->data);
1079
1080 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1081
1082 hci_req_complete(hdev, HCI_OP_LE_SET_EVENT_MASK, status);
1083}
1084
1069static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb) 1085static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb)
1070{ 1086{
1071 struct hci_rp_user_confirm_reply *rp = (void *) skb->data; 1087 struct hci_rp_user_confirm_reply *rp = (void *) skb->data;
@@ -2489,6 +2505,10 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2489 hci_cc_le_read_buffer_size(hdev, skb); 2505 hci_cc_le_read_buffer_size(hdev, skb);
2490 break; 2506 break;
2491 2507
2508 case HCI_OP_LE_SET_EVENT_MASK:
2509 hci_cc_le_set_event_mask(hdev, skb);
2510 break;
2511
2492 case HCI_OP_USER_CONFIRM_REPLY: 2512 case HCI_OP_USER_CONFIRM_REPLY:
2493 hci_cc_user_confirm_reply(hdev, skb); 2513 hci_cc_user_confirm_reply(hdev, skb);
2494 break; 2514 break;