Skip to content
Snippets Groups Projects
Commit 69d9425b authored by Jonas Dreßler's avatar Jonas Dreßler Committed by Sasha Levin
Browse files

Bluetooth: Remove superfluous call to hci_conn_check_pending()


[ Upstream commit 78e3639f ]

The "pending connections" feature was originally introduced with commit
4c67bc74 ("[Bluetooth] Support concurrent connect requests") and
6bd57416 ("[Bluetooth] Handling pending connect attempts after
inquiry") to handle controllers supporting only a single connection request
at a time. Later things were extended to also cancel ongoing inquiries on
connect() with commit 89e65975 ("Bluetooth: Cancel Inquiry before
Create Connection").

With commit a9de9248 ("[Bluetooth] Switch from OGF+OCF to using only
opcodes"), hci_conn_check_pending() was introduced as a helper to
consolidate a few places where we check for pending connections (indicated
by the BT_CONNECT2 flag) and then try to connect.

This refactoring commit also snuck in two more calls to
hci_conn_check_pending():

- One is in the failure callback of hci_cs_inquiry(), this one probably
makes sense: If we send an "HCI Inquiry" command and then immediately
after a "Create Connection" command, the "Create Connection" command might
fail before the "HCI Inquiry" command, and then we want to retry the
"Create Connection" on failure of the "HCI Inquiry".

- The other added call to hci_conn_check_pending() is in the event handler
for the "Remote Name" event, this seems unrelated and is possibly a
copy-paste error, so remove that one.

Fixes: a9de9248 ("[Bluetooth] Switch from OGF+OCF to using only opcodes")
Signed-off-by: default avatarJonas Dreßler <verdre@v0yd.nl>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent cbe742db
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment