* [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on
@ 2013-01-27 14:32 Johan Hedberg
2013-01-27 14:32 ` [PATCH 2/2 v2] Bluetooth: Increment Management interface revision Johan Hedberg
2013-01-27 14:36 ` [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Marcel Holtmann
0 siblings, 2 replies; 5+ messages in thread
From: Johan Hedberg @ 2013-01-27 14:32 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..ae7585d 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3073,6 +3073,8 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
mgmt_pending_foreach(MGMT_OP_SET_POWERED, hdev, settings_rsp, &match);
if (powered) {
+ u8 link_sec;
+
if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
!lmp_host_ssp_capable(hdev)) {
u8 ssp = 1;
@@ -3096,6 +3098,11 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
sizeof(cp), &cp);
}
+ link_sec = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
+ if (link_sec != test_bit(HCI_AUTH, &hdev->flags))
+ hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE,
+ sizeof(link_sec), &link_sec);
+
if (lmp_bredr_capable(hdev)) {
set_bredr_scan(hdev);
update_class(hdev);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
2013-01-27 14:32 [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Johan Hedberg
@ 2013-01-27 14:32 ` Johan Hedberg
2013-01-27 14:37 ` Marcel Holtmann
2013-01-28 18:33 ` Gustavo Padovan
2013-01-27 14:36 ` [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Marcel Holtmann
1 sibling, 2 replies; 5+ messages in thread
From: Johan Hedberg @ 2013-01-27 14:32 UTC (permalink / raw)
To: linux-bluetooth
From: Johan Hedberg <johan.hedberg@intel.com>
This patch increments the management interface revision due to the
various fixes, improvements and other changes that have gone in lately.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
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 ae7585d..3bd4c41 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -35,7 +35,7 @@
bool enable_hs;
#define MGMT_VERSION 1
-#define MGMT_REVISION 2
+#define MGMT_REVISION 3
static const u16 mgmt_commands[] = {
MGMT_OP_READ_INDEX_LIST,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on
2013-01-27 14:32 [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Johan Hedberg
2013-01-27 14:32 ` [PATCH 2/2 v2] Bluetooth: Increment Management interface revision Johan Hedberg
@ 2013-01-27 14:36 ` Marcel Holtmann
1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2013-01-27 14:36 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
> 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(+)
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
2013-01-27 14:32 ` [PATCH 2/2 v2] Bluetooth: Increment Management interface revision Johan Hedberg
@ 2013-01-27 14:37 ` Marcel Holtmann
2013-01-28 18:33 ` Gustavo Padovan
1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2013-01-27 14:37 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
> This patch increments the management interface revision due to the
> various fixes, improvements and other changes that have gone in lately.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
2013-01-27 14:32 ` [PATCH 2/2 v2] Bluetooth: Increment Management interface revision Johan Hedberg
2013-01-27 14:37 ` Marcel Holtmann
@ 2013-01-28 18:33 ` Gustavo Padovan
1 sibling, 0 replies; 5+ messages in thread
From: Gustavo Padovan @ 2013-01-28 18:33 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
* Johan Hedberg <johan.hedberg@gmail.com> [2013-01-27 08:32:01 -0600]:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> This patch increments the management interface revision due to the
> various fixes, improvements and other changes that have gone in lately.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Both patches have been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-28 18:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 14:32 [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Johan Hedberg
2013-01-27 14:32 ` [PATCH 2/2 v2] Bluetooth: Increment Management interface revision Johan Hedberg
2013-01-27 14:37 ` Marcel Holtmann
2013-01-28 18:33 ` Gustavo Padovan
2013-01-27 14:36 ` [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox