summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudha Bheemanna <b.sudha@samsung.com>2016-09-07 15:42:22 +0530
committerAmit Purwar <amit.purwar@samsung.com>2019-06-27 17:20:56 +0530
commit4eba792a3433ff0b39afa00fe40cd948beab6182 (patch)
tree30cd4d7bf65ff14732fa57e98aad96d779aa31b2
parent90d3f0dce7fb1ba148d0bf3bf3f34db5f7c99c4d (diff)
downloadlinux-rpi3-4eba792a3433ff0b39afa00fe40cd948beab6182.tar.gz
linux-rpi3-4eba792a3433ff0b39afa00fe40cd948beab6182.tar.bz2
linux-rpi3-4eba792a3433ff0b39afa00fe40cd948beab6182.zip
Bluetooth: Add hardware error MGMT event
Add code to handle hardware error MGMT event. Change-Id: I5875ea2aeae7aba95c1f8e15b456704dc6bcdee4 Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com> Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
-rw-r--r--include/net/bluetooth/hci_core.h1
-rw-r--r--include/net/bluetooth/mgmt_tizen.h7
-rw-r--r--net/bluetooth/hci_event.c5
-rw-r--r--net/bluetooth/mgmt.c8
4 files changed, 21 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index cfbf41dda85c..6998103ceb59 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1676,6 +1676,7 @@ int mgmt_le_conn_updated(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type,
u16 supervision_timeout);
int mgmt_le_conn_update_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 link_type, u8 addr_type, u8 status);
+void mgmt_hardware_error(struct hci_dev *hdev, u8 err_code);
#endif
u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
diff --git a/include/net/bluetooth/mgmt_tizen.h b/include/net/bluetooth/mgmt_tizen.h
index 4c2e9d0c54d6..680ad8b9b1a0 100644
--- a/include/net/bluetooth/mgmt_tizen.h
+++ b/include/net/bluetooth/mgmt_tizen.h
@@ -162,6 +162,13 @@ struct mgmt_ev_device_name_update {
} __packed;
/* Device name update changes */
+/* For handling of hardware error event */
+#define MGMT_EV_HARDWARE_ERROR (TIZEN_EV_BASE + 0x02)
+struct mgmt_ev_hardware_error {
+ __u8 error_code;
+} __packed;
+/* handling of hardware error event */
+
/* For handling of RSSI Events */
#define MGMT_EV_RSSI_ALERT (TIZEN_EV_BASE + 0x04)
struct mgmt_ev_vendor_specific_rssi_alert {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 77f1d107d95b..457849ac3a5a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3574,6 +3574,11 @@ static void hci_hardware_error_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_hardware_error *ev = (void *) skb->data;
+#ifdef TIZEN_BT
+ hci_dev_lock(hdev);
+ mgmt_hardware_error(hdev, ev->code);
+ hci_dev_unlock(hdev);
+#endif
hdev->hw_error_code = ev->code;
queue_work(hdev->req_workqueue, &hdev->error_reset);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index afadd7c90e91..6481015b6553 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6743,6 +6743,14 @@ static int le_set_scan_params(struct sock *sk, struct hci_dev *hdev,
return err;
}
+
+void mgmt_hardware_error(struct hci_dev *hdev, u8 err_code)
+{
+ struct mgmt_ev_hardware_error ev;
+
+ ev.error_code = err_code;
+ mgmt_event(MGMT_EV_HARDWARE_ERROR, hdev, &ev, sizeof(ev), NULL);
+}
#endif /* TIZEN_BT */
static bool ltk_is_valid(struct mgmt_ltk_info *key)