Bluetooth: Add hardware error MGMT event 71/306571/1
authorSudha Bheemanna <b.sudha@samsung.com>
Wed, 7 Sep 2016 10:12:22 +0000 (15:42 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 23 Feb 2024 02:13:12 +0000 (11:13 +0900)
Add code to handle hardware error MGMT event.

Change-Id: I7966385b6711b944baa17a7ebe671cc94b3e948e
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
include/net/bluetooth/hci_core.h
include/net/bluetooth/mgmt_tizen.h
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c

index 016c598..7657824 100644 (file)
@@ -2388,6 +2388,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
 
 int hci_abort_conn(struct hci_conn *conn, u8 reason);
index 4c2e9d0..680ad8b 100644 (file)
@@ -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 {
index 1cae8aa..02fbc7c 100644 (file)
@@ -4495,6 +4495,11 @@ static void hci_hardware_error_evt(struct hci_dev *hdev, void *data,
 
        bt_dev_dbg(hdev, "code 0x%2.2x", ev->code);
 
+#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);
index 7fe034e..52bca43 100644 (file)
@@ -8829,6 +8829,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)