Bluetooth: Add debugfs quirk for forcing Secure Connections support
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 Bluetooth: Add debugfs quirk for forcing Secure Connections support
The Bluetooth 4.1 specification with Secure Connections support has just been released and controllers with this feature are still in an early stage.
A handful of controllers have already support for it, but they do not always identify this feature correctly. This debugfs entry allows to tell the kernel that the controller can be treated as it would fully support Secure Connections.
Using debugfs to force Secure Connections support of course does not make this feature magically appear in all controllers. This is a debug functionality for early adopters. Once the majority of controllers matures this quirk will be removed.
Signed-off-by Marcel Holtmann <[email protected]>
--- include/net/bluetooth/hci.h | 1 + net/bluetooth/hci_core.c | 51 ++++++++++++++++++++++++++++++++++++++++++++- net/bluetooth/mgmt.c | 6 ++++-- 3 files changed, 55 insertions(+), 3 deletions(-)
include/net/bluetooth/hci.h +1 -0
@@ -117,6 +117,7 @@ enum {HCI_SERVICE_CACHE ,HCI_DEBUG_KEYS ,HCI_DUT_MODE , +HCI_FORCE_SC ,HCI_UNREGISTER , HCI_USER_CHANNEL,
net/bluetooth/hci_core.c +50 -1
69 lines not on this page · raw message
net/bluetooth/mgmt.c +4 -2
@@ -378,7 +378,8 @@ static u32 get_supported_settings(struct hci_dev *hdev) settings |=MGMT_SETTING_HS ; } -if (lmp_sc_capable (hdev)) +if (lmp_sc_capable (hdev) || +test_bit (HCI_FORCE_SC , &hdev->dev_flags)) settings |=MGMT_SETTING_SECURE_CONN ; }
@@ -4026,7 +4027,8 @@ static int set_secure_conn(struct sock *sk, struct hci_dev *hdev,return cmd_status (sk, hdev->id,MGMT_OP_SET_SECURE_CONN , status); -if (!lmp_sc_capable (hdev)) +if (!lmp_sc_capable (hdev) && + !test_bit (HCI_FORCE_SC , &hdev->dev_flags))return cmd_status (sk, hdev->id,MGMT_OP_SET_SECURE_CONN ,MGMT_STATUS_NOT_SUPPORTED );
Signature · 1 line
1.8.4.2