Bluetooth: Send Authentication Request command on pairing failure 83/306583/1
authorSudha Bheemanna <b.sudha@samsung.com>
Thu, 8 Sep 2016 09:41:28 +0000 (15:11 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 23 Feb 2024 02:14:25 +0000 (11:14 +0900)
This patch allows to send HCI_OP_AUTH_REQUESTED command
to the remote device if pairing failure happens because
of pin or key missing error.

Change-Id: I84f5e835507ffa4e4a12d2f40d4765e5068a78df
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>
net/bluetooth/hci_event.c

index 8b2f49d..f7eaf5d 100644 (file)
@@ -3663,6 +3663,24 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
        if (!conn)
                goto unlock;
 
+#ifdef TIZEN_BT
+       /*  PIN or Key Missing patch */
+       BT_DBG("remote_auth %x, remote_cap %x, auth_type %x, io_capability %x",
+              conn->remote_auth, conn->remote_cap,
+              conn->auth_type, conn->io_capability);
+
+       if (ev->status == 0x06 && hci_conn_ssp_enabled(conn)) {
+               struct hci_cp_auth_requested cp;
+
+               BT_DBG("Pin or key missing");
+               hci_remove_link_key(hdev, &conn->dst);
+               cp.handle = cpu_to_le16(conn->handle);
+               hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
+                            sizeof(cp), &cp);
+               goto unlock;
+       }
+#endif
+
        if (!ev->status) {
                clear_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
                set_bit(HCI_CONN_AUTH, &conn->flags);