diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index c2db60ad0f1d..4f022f53d0e0 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1303,7 +1303,9 @@ static void hci_req_add_set_adv_filter_enable(struct hci_request *req, void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next) { int old_state; +#ifndef CONFIG_AMLOGIC_LINUX_BT_SUPPORT_WAKEUP struct hci_conn *conn; +#endif struct hci_request req; u8 page_scan; int disconnect_counter; @@ -1372,10 +1374,12 @@ void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next) disconnect_counter = 0; /* Soft disconnect everything (power off) */ +#ifndef CONFIG_AMLOGIC_LINUX_BT_SUPPORT_WAKEUP list_for_each_entry(conn, &hdev->conn_hash.list, list) { hci_disconnect(conn, HCI_ERROR_REMOTE_POWER_OFF); disconnect_counter++; } +#endif if (disconnect_counter > 0) { bt_dev_dbg(hdev, diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index f688f941c40c..8db1b5944918 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -883,6 +883,13 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT) smp->method = JUST_WORKS; +#if IS_ENABLED(CONFIG_AMLOGIC_LINUX_BT_SMP) + /* If Just Works, Continue with Zero TK */ + if (smp->method == JUST_WORKS) { + set_bit(SMP_FLAG_TK_VALID, &smp->flags); + return 0; + } +#else /* If Just Works, Continue with Zero TK and ask user-space for * confirmation */ if (smp->method == JUST_WORKS) { @@ -895,6 +902,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, set_bit(SMP_FLAG_WAIT_USER, &smp->flags); return 0; } +#endif /* If this function is used for SC -> legacy fallback we * can only recover the just-works case.