summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSudha Bheemanna <b.sudha@samsung.com>2016-09-07 16:47:58 +0530
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:53:12 +0900
commited07651f659a019040780870fbe3ddf08e9f97bd (patch)
tree9a4d68df246db77a86b177c83fe2babe90f045c0 /net
parent306f1007f8a89344498dcbb13b46dce88297aac1 (diff)
Bluetooth: Add H/W TX timeout error MGMT event
This patch sends the H/W TX timeout error MGMT event if HCI command timeout occurs after sending HCI commands. Change-Id: I5eb593f2fe4d31c404dd94ef582790e47d03b10a Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c11
-rw-r--r--net/bluetooth/mgmt.c5
2 files changed, 16 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index bd6557aa8e3e..dd2cf2ac14d5 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1106,6 +1106,13 @@ void hci_le_discovery_set_state(struct hci_dev *hdev, int state)
hdev->le_discovery.state = state;
}
+
+static void hci_tx_timeout_error_evt(struct hci_dev *hdev)
+{
+ BT_ERR("%s H/W TX Timeout error", hdev->name);
+
+ mgmt_tx_timeout_error(hdev);
+}
#endif
void hci_inquiry_cache_flush(struct hci_dev *hdev)
@@ -2581,6 +2588,10 @@ static void hci_cmd_timeout(struct work_struct *work)
BT_ERR("%s command tx timeout", hdev->name);
}
+#ifdef TIZEN_BT
+ hci_tx_timeout_error_evt(hdev);
+#endif
+
atomic_set(&hdev->cmd_cnt, 1);
queue_work(hdev->workqueue, &hdev->cmd_work);
}
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 757754c3219f..a14a00ce7b9b 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -7171,6 +7171,11 @@ void mgmt_hardware_error(struct hci_dev *hdev, u8 err_code)
ev.error_code = err_code;
mgmt_event(MGMT_EV_HARDWARE_ERROR, hdev, &ev, sizeof(ev), NULL);
}
+
+void mgmt_tx_timeout_error(struct hci_dev *hdev)
+{
+ mgmt_event(MGMT_EV_TX_TIMEOUT_ERROR, hdev, NULL, 0, NULL);
+}
#endif /* TIZEN_BT */
static bool ltk_is_valid(struct mgmt_ltk_info *key)