aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-14 15:43:11 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-15 12:54:31 +0200
commit162a3bac8d007aae3d1ba9da9b0d0b9ecfef87cc (patch)
tree133dd1138167c94e30661c6c9e757b80b5855943 /net/bluetooth/hci_core.c
parentBluetooth: Don't register any SMP channel if LE is not supported (diff)
downloadlinux-dev-162a3bac8d007aae3d1ba9da9b0d0b9ecfef87cc.tar.xz
linux-dev-162a3bac8d007aae3d1ba9da9b0d0b9ecfef87cc.zip
Bluetooth: Bind the SMP channel registration to management power state
When the controller gets powered on via the management interface, then register the supported SMP channels. There is no point in registering these channels earlier since it is not know what identity address the controller is going to operate with. When powering down a controller unregister all SMP channels. This is required since a powered down controller is allowed to change its identity address. In addition the SMP channels are only available when the controller is powered via the management interface. When using legacy ioctl, then Bluetooth Low Energy is not supported and registering kernel side SMP integration may actually cause confusion. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index c04197347c90..34c17a0645ce 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -933,10 +933,8 @@ static int __hci_init(struct hci_dev *hdev)
if (lmp_bredr_capable(hdev))
hci_debugfs_create_bredr(hdev);
- if (lmp_le_capable(hdev)) {
+ if (lmp_le_capable(hdev))
hci_debugfs_create_le(hdev);
- smp_register(hdev);
- }
return 0;
}
@@ -2133,6 +2131,8 @@ static void hci_power_off(struct work_struct *work)
BT_DBG("%s", hdev->name);
hci_dev_do_close(hdev);
+
+ smp_unregister(hdev);
}
static void hci_discov_off(struct work_struct *work)