Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Fix link security setting when powering on
@ 2013-01-26 22:33 Johan Hedberg
  2013-01-26 22:33 ` [PATCH 2/2] Bluetooth: Increment Management interface revision Johan Hedberg
  2013-01-27  3:15 ` [PATCH 1/2] Bluetooth: Fix link security setting when powering on Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Hedberg @ 2013-01-26 22:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

If a controller is powered on while the HCI_AUTO_OFF flag is set the
link security setting (HCI_LINK_SECURITY) might not be in sync with the
actual state of the controller (HCI_AUTH). This patch fixes the issue by
checking for inequality between the intended and actual settings and
sends a HCI_Write_Auth_Enable command if necessary.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/mgmt.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index fbc8edf..f6ef8ff 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3096,6 +3096,13 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
 					     sizeof(cp), &cp);
 		}
 
+		if (test_bit(HCI_LINK_SECURITY, &hdev->dev_flags) !=
+		    test_bit(HCI_AUTH, &hdev->flags)) {
+			u8 val = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
+			hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE,
+				     sizeof(val), &val);
+		}
+
 		if (lmp_bredr_capable(hdev)) {
 			set_bredr_scan(hdev);
 			update_class(hdev);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH 2/2] Bluetooth: Increment management interface revision
@ 2020-04-02 13:29 Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2020-04-02 13:29 UTC (permalink / raw)
  To: linux-bluetooth

Increment the mgmt revision due to the recently added new commands.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 7b9eac339c87..f8c0a4fc8090 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -38,7 +38,7 @@
 #include "mgmt_util.h"
 
 #define MGMT_VERSION	1
-#define MGMT_REVISION	16
+#define MGMT_REVISION	17
 
 static const u16 mgmt_commands[] = {
 	MGMT_OP_READ_INDEX_LIST,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-02 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-26 22:33 [PATCH 1/2] Bluetooth: Fix link security setting when powering on Johan Hedberg
2013-01-26 22:33 ` [PATCH 2/2] Bluetooth: Increment Management interface revision Johan Hedberg
2013-01-27  3:15 ` [PATCH 1/2] Bluetooth: Fix link security setting when powering on Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2020-04-02 13:29 [PATCH 2/2] Bluetooth: Increment management interface revision Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox