diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2011-05-26 15:23:51 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-08 15:58:17 -0400 |
commit | 9aa04c9108164e62cf94d6913183817a0d3dbf03 (patch) | |
tree | 4d2f14f8227e140fa0a320e0325765e6f1b59356 /net/bluetooth/hci_event.c | |
parent | 76c8686f8871f1bcb2dc8b4c5311cd0e2f73d4cd (diff) |
Bluetooth: Add Advertising Report Meta Event handler
This patch adds a function to handle LE Advertising Report Meta
Events.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
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 f13ddbf858ba..db74958d3ad9 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2680,6 +2680,27 @@ unlock: | |||
2680 | hci_dev_unlock(hdev); | 2680 | hci_dev_unlock(hdev); |
2681 | } | 2681 | } |
2682 | 2682 | ||
2683 | static inline void hci_le_adv_report_evt(struct hci_dev *hdev, | ||
2684 | struct sk_buff *skb) | ||
2685 | { | ||
2686 | struct hci_ev_le_advertising_info *ev; | ||
2687 | u8 num_reports; | ||
2688 | |||
2689 | num_reports = skb->data[0]; | ||
2690 | ev = (void *) &skb->data[1]; | ||
2691 | |||
2692 | hci_dev_lock(hdev); | ||
2693 | |||
2694 | hci_add_adv_entry(hdev, ev); | ||
2695 | |||
2696 | while (--num_reports) { | ||
2697 | ev = (void *) (ev->data + ev->length + 1); | ||
2698 | hci_add_adv_entry(hdev, ev); | ||
2699 | } | ||
2700 | |||
2701 | hci_dev_unlock(hdev); | ||
2702 | } | ||
2703 | |||
2683 | static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) | 2704 | static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) |
2684 | { | 2705 | { |
2685 | struct hci_ev_le_meta *le_ev = (void *) skb->data; | 2706 | struct hci_ev_le_meta *le_ev = (void *) skb->data; |
@@ -2691,6 +2712,10 @@ static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2691 | hci_le_conn_complete_evt(hdev, skb); | 2712 | hci_le_conn_complete_evt(hdev, skb); |
2692 | break; | 2713 | break; |
2693 | 2714 | ||
2715 | case HCI_EV_LE_ADVERTISING_REPORT: | ||
2716 | hci_le_adv_report_evt(hdev, skb); | ||
2717 | break; | ||
2718 | |||
2694 | default: | 2719 | default: |
2695 | break; | 2720 | break; |
2696 | } | 2721 | } |