summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSudha Bheemanna <b.sudha@samsung.com>2016-09-08 10:56:15 +0530
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:53:11 +0900
commit982ae0161355576215c548d6d657699c996e1afb (patch)
treebcade62a575b191bb6e6e2bd266c6f40564cc2c4 /net
parent85519ab575e7815f2a05ba49d7fc0984cf9f48f5 (diff)
Bluetooth: Add LE vendor specific event handler
This patch adds the vendor specific LE meta event handler. It handles the vendor specific handles like, LE_MULTI_ADV_STATE_CHANGE_SUB_EVENT, LE_RSSI_LINK_ALERT. Change-Id: I1f344a31e36f9c7442fe0bd8b598e67d9f5fb9bf Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com> [divide hci vendor speicif group event function] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ecf9b697c777..28392d47e887 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1449,6 +1449,50 @@ static void hci_cc_get_raw_rssi(struct hci_dev *hdev,
mgmt_raw_rssi_response(hdev, rp, rp->status);
}
+
+static void hci_vendor_specific_group_ext_evt(struct hci_dev *hdev,
+ struct sk_buff *skb)
+{
+ struct hci_ev_ext_vendor_specific *ev = (void *)skb->data;
+ __u8 event_le_ext_sub_code;
+
+ BT_DBG("RSSI event LE_META_VENDOR_SPECIFIC_GROUP_EVENT: %X",
+ LE_META_VENDOR_SPECIFIC_GROUP_EVENT);
+
+ skb_pull(skb, sizeof(*ev));
+ event_le_ext_sub_code = ev->event_le_ext_sub_code;
+
+ switch (event_le_ext_sub_code) {
+ case LE_RSSI_LINK_ALERT:
+ BT_DBG("RSSI event LE_RSSI_LINK_ALERT %X",
+ LE_RSSI_LINK_ALERT);
+ mgmt_rssi_alert_evt(hdev, skb);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void hci_vendor_specific_evt(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ struct hci_ev_vendor_specific *ev = (void *)skb->data;
+ __u8 event_sub_code;
+
+ BT_DBG("hci_vendor_specific_evt");
+
+ skb_pull(skb, sizeof(*ev));
+ event_sub_code = ev->event_sub_code;
+
+ switch (event_sub_code) {
+ case LE_META_VENDOR_SPECIFIC_GROUP_EVENT:
+ hci_vendor_specific_group_ext_evt(hdev, skb);
+ break;
+
+ default:
+ break;
+ }
+}
#endif
static void hci_cc_read_rssi(struct hci_dev *hdev, struct sk_buff *skb)
@@ -5444,6 +5488,12 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
hci_num_comp_blocks_evt(hdev, skb);
break;
+#ifdef TIZEN_BT
+ case HCI_EV_VENDOR_SPECIFIC:
+ hci_vendor_specific_evt(hdev, skb);
+ break;
+#endif
+
default:
BT_DBG("%s event 0x%2.2x", hdev->name, event);
break;