android_kernel_xiaomi_sm8350/net/bluetooth
Marcel Holtmann 7c6a329e44 [Bluetooth] Fix regression from using default link policy
To speed up the Simple Pairing connection setup, the support for the
default link policy has been enabled. This is in contrast to settings
the link policy on every connection setup. Using the default link policy
is the preferred way since there is no need to dynamically change it for
every connection.

For backward compatibility reason and to support old userspace the
HCISETLINKPOL ioctl has been switched over to using hci_request() to
issue the HCI command for setting the default link policy instead of
just storing it in the HCI device structure.

However the hci_request() can only be issued when the device is
brought up. If used on a device that is registered, but still down
it will timeout and fail. This is problematic since the command is
put on the TX queue and the Bluetooth core tries to submit it to
hardware that is not ready yet. The timeout for these requests is
10 seconds and this causes a significant regression when setting up
a new device.

The userspace can perfectly handle a failure of the HCISETLINKPOL
ioctl and will re-submit it later, but the 10 seconds delay causes
a problem. So in case hci_request() is called on a device that is
still down, just fail it with ENETDOWN to indicate what happens.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2008-09-12 03:11:54 +02:00
..
bnep [Bluetooth] Consolidate maintainers information 2008-08-18 13:23:53 +02:00
cmtp [BLUETOOTH]: Use sockfd_put() 2008-01-28 15:00:48 -08:00
hidp [Bluetooth] Signal user-space for HIDP and BNEP socket errors 2008-07-14 20:13:53 +02:00
rfcomm [Bluetooth] Consolidate maintainers information 2008-08-18 13:23:53 +02:00
af_bluetooth.c [Bluetooth] Reject L2CAP connections on an insecure ACL link 2008-09-09 07:19:20 +02:00
hci_conn.c [Bluetooth] Reject L2CAP connections on an insecure ACL link 2008-09-09 07:19:20 +02:00
hci_core.c [Bluetooth] Fix regression from using default link policy 2008-09-12 03:11:54 +02:00
hci_event.c [Bluetooth] Fix reference counting during ACL config stage 2008-09-09 07:19:19 +02:00
hci_sock.c [Bluetooth] Export details about authentication requirements 2008-07-14 20:13:50 +02:00
hci_sysfs.c [Bluetooth] Fix userspace breakage due missing class links 2008-08-18 13:23:53 +02:00
Kconfig
l2cap.c [Bluetooth] Reject L2CAP connections on an insecure ACL link 2008-09-09 07:19:20 +02:00
lib.c
Makefile
sco.c [Bluetooth] Enforce correct authentication requirements 2008-09-09 07:19:20 +02:00