summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudha Bheemanna <b.sudha@samsung.com>2016-09-08 10:31:17 +0530
committerAmit Purwar <amit.purwar@samsung.com>2019-06-28 09:38:13 +0530
commit1c116e14d23c157f5b19a359648b314a2a70e4aa (patch)
treec58e29b99da7867e283e73cd383798630d4878d3
parentab4abe03b59a6ac1262b739b2f148c1fde92c630 (diff)
downloadlinux-rpi3-1c116e14d23c157f5b19a359648b314a2a70e4aa.tar.gz
linux-rpi3-1c116e14d23c157f5b19a359648b314a2a70e4aa.tar.bz2
linux-rpi3-1c116e14d23c157f5b19a359648b314a2a70e4aa.zip
Bluetooth: Add multiple LE advertise state change event
This patch adds code for providing multiple LE advertisement state changed event to upper layer. Change-Id: I58fb8044e74402376ec30b121081edce7c8709d1 Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com> [divide hci_vendor_mutli_adv_state_change_evt and remove hci event structure from mgmt] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
-rw-r--r--net/bluetooth/hci_event.c16
-rw-r--r--net/bluetooth/mgmt.c17
2 files changed, 33 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 62e3a3120015..d888e72e2667 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1666,6 +1666,18 @@ static void hci_vendor_specific_group_ext_evt(struct hci_dev *hdev,
}
}
+static void hci_vendor_multi_adv_state_change_evt(struct hci_dev *hdev,
+ struct sk_buff *skb)
+{
+ struct hci_ev_vendor_specific_multi_adv_state *ev = (void *)skb->data;
+
+ BT_DBG("LE_MULTI_ADV_STATE_CHANGE_SUB_EVENT");
+
+ mgmt_multi_adv_state_change_evt(hdev, ev->adv_instance,
+ ev->state_change_reason,
+ ev->connection_handle);
+}
+
static void hci_vendor_specific_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_vendor_specific *ev = (void *)skb->data;
@@ -1681,6 +1693,10 @@ static void hci_vendor_specific_evt(struct hci_dev *hdev, struct sk_buff *skb)
hci_vendor_specific_group_ext_evt(hdev, skb);
break;
+ case LE_MULTI_ADV_STATE_CHANGE_SUB_EVENT:
+ hci_vendor_multi_adv_state_change_evt(hdev, skb);
+ break;
+
default:
break;
}
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 27563d2639b2..aaf9d6252095 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6756,6 +6756,23 @@ void mgmt_tx_timeout_error(struct hci_dev *hdev)
{
mgmt_event(MGMT_EV_TX_TIMEOUT_ERROR, hdev, NULL, 0, NULL);
}
+
+void mgmt_multi_adv_state_change_evt(struct hci_dev *hdev, u8 adv_instance,
+ u8 state_change_reason, u16 connection_handle)
+{
+ struct mgmt_ev_vendor_specific_multi_adv_state_changed mgmt_ev;
+
+ BT_DBG("Multi adv state changed [%2.2X %2.2X %2.2X]",
+ adv_instance, state_change_reason, connection_handle);
+
+ mgmt_ev.adv_instance = adv_instance;
+ mgmt_ev.state_change_reason = state_change_reason;
+ mgmt_ev.connection_handle = connection_handle;
+
+ mgmt_event(MGMT_EV_MULTI_ADV_STATE_CHANGED, hdev, &mgmt_ev,
+ sizeof(struct mgmt_ev_vendor_specific_multi_adv_state_changed),
+ NULL);
+}
#endif /* TIZEN_BT */
static bool ltk_is_valid(struct mgmt_ltk_info *key)