From: Sudha Bheemanna Date: Thu, 8 Sep 2016 09:41:28 +0000 (+0530) Subject: Bluetooth: Send Authentication Request command on pairing failure X-Git-Tag: accepted/tizen/unified/20250103.010701~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0817a942e1c9a2ffd807d20363933bbb2e23edfa;p=platform%2Fkernel%2Flinux-riscv.git Bluetooth: Send Authentication Request command on pairing failure 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: I66b74a074c281da86d5c6121b4f41602e31dbf0a Signed-off-by: Sudha Bheemanna Signed-off-by: Amit Purwar Signed-off-by: Wootak Jung Signed-off-by: Jaehoon Chung --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 320b8fec9f0f..56c90a3f5cc3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3628,6 +3628,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);