aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-01 05:05:16 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-01-02 16:22:04 -0500
commitec6cef9cd98d9d2dac8ec8f1d11b8a3a9524e390 (patch)
treea39ccb2ca5525e2f200663acf19f5d8a56d594b6
parent203de21bf6b19f81267c373ca5323e6386fe5809 (diff)
Bluetooth: Fix SMP channel registration for unconfigured controllers
When the Bluetooth controllers requires an unconfigured state (for example when the BD_ADDR is missing), then it is important to try to register the SMP channels when the controller transitions to the configured state. This also fixes an issue with the debugfs entires that are not present for controllers that start out as unconfigured. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 5ef5221c1813..6c12110b75a7 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -931,10 +931,20 @@ static int __hci_init(struct hci_dev *hdev)
931 if (err < 0) 931 if (err < 0)
932 return err; 932 return err;
933 933
934 /* Only create debugfs entries during the initial setup 934 /* This function is only called when the controller is actually in
935 * phase and not every time the controller gets powered on. 935 * configured state. When the controller is marked as unconfigured,
936 * this initialization procedure is not run.
937 *
938 * It means that it is possible that a controller runs through its
939 * setup phase and then discovers missing settings. If that is the
940 * case, then this function will not be called. It then will only
941 * be called during the config phase.
942 *
943 * So only when in setup phase or config phase, create the debugfs
944 * entries and register the SMP channels.
936 */ 945 */
937 if (!test_bit(HCI_SETUP, &hdev->dev_flags)) 946 if (!test_bit(HCI_SETUP, &hdev->dev_flags) &&
947 !test_bit(HCI_CONFIG, &hdev->dev_flags))
938 return 0; 948 return 0;
939 949
940 hci_debugfs_create_common(hdev); 950 hci_debugfs_create_common(hdev);