hci_sync.c (b7c15a3ce6fea5da3aa836c897a78ac628467d54) hci_sync.c (6b5c1cdac44f3bcd0bd1514eed6b8b9ad141a404)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2021 Intel Corporation
6 */
7
8#include <linux/property.h>

--- 3811 unchanged lines hidden (view full) ---

3820 hci_debugfs_create_bredr(hdev);
3821
3822 if (lmp_le_capable(hdev))
3823 hci_debugfs_create_le(hdev);
3824
3825 return 0;
3826}
3827
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2021 Intel Corporation
6 */
7
8#include <linux/property.h>

--- 3811 unchanged lines hidden (view full) ---

3820 hci_debugfs_create_bredr(hdev);
3821
3822 if (lmp_le_capable(hdev))
3823 hci_debugfs_create_le(hdev);
3824
3825 return 0;
3826}
3827
3828#define HCI_QUIRK_BROKEN(_quirk, _desc) { HCI_QUIRK_BROKEN_##_quirk, _desc }
3829
3830static const struct {
3831 unsigned long quirk;
3832 const char *desc;
3833} hci_broken_table[] = {
3834 HCI_QUIRK_BROKEN(LOCAL_COMMANDS,
3835 "HCI Read Local Supported Commands not supported"),
3836 HCI_QUIRK_BROKEN(STORED_LINK_KEY,
3837 "HCI Delete Stored Link Key command is advertised, "
3838 "but not supported."),
3839 HCI_QUIRK_BROKEN(ERR_DATA_REPORTING,
3840 "HCI Read Default Erroneous Data Reporting command is "
3841 "advertised, but not supported."),
3842 HCI_QUIRK_BROKEN(READ_TRANSMIT_POWER,
3843 "HCI Read Transmit Power Level command is advertised, "
3844 "but not supported."),
3845 HCI_QUIRK_BROKEN(FILTER_CLEAR_ALL,
3846 "HCI Set Event Filter command not supported."),
3847 HCI_QUIRK_BROKEN(ENHANCED_SETUP_SYNC_CONN,
3848 "HCI Enhanced Setup Synchronous Connection command is "
3849 "advertised, but not supported.")
3850};
3851
3828int hci_dev_open_sync(struct hci_dev *hdev)
3829{
3830 int ret = 0;
3831
3832 bt_dev_dbg(hdev, "");
3833
3834 if (hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
3835 ret = -ENODEV;

--- 45 unchanged lines hidden (view full) ---

3881 hci_sock_dev_event(hdev, HCI_DEV_OPEN);
3882
3883 atomic_set(&hdev->cmd_cnt, 1);
3884 set_bit(HCI_INIT, &hdev->flags);
3885
3886 if (hci_dev_test_flag(hdev, HCI_SETUP) ||
3887 test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
3888 bool invalid_bdaddr;
3852int hci_dev_open_sync(struct hci_dev *hdev)
3853{
3854 int ret = 0;
3855
3856 bt_dev_dbg(hdev, "");
3857
3858 if (hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
3859 ret = -ENODEV;

--- 45 unchanged lines hidden (view full) ---

3905 hci_sock_dev_event(hdev, HCI_DEV_OPEN);
3906
3907 atomic_set(&hdev->cmd_cnt, 1);
3908 set_bit(HCI_INIT, &hdev->flags);
3909
3910 if (hci_dev_test_flag(hdev, HCI_SETUP) ||
3911 test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
3912 bool invalid_bdaddr;
3913 size_t i;
3889
3890 hci_sock_dev_event(hdev, HCI_DEV_SETUP);
3891
3892 if (hdev->setup)
3893 ret = hdev->setup(hdev);
3894
3914
3915 hci_sock_dev_event(hdev, HCI_DEV_SETUP);
3916
3917 if (hdev->setup)
3918 ret = hdev->setup(hdev);
3919
3920 for (i = 0; i < ARRAY_SIZE(hci_broken_table); i++) {
3921 if (test_bit(hci_broken_table[i].quirk, &hdev->quirks))
3922 bt_dev_warn(hdev, "%s",
3923 hci_broken_table[i].desc);
3924 }
3925
3895 /* The transport driver can set the quirk to mark the
3896 * BD_ADDR invalid before creating the HCI device or in
3897 * its setup callback.
3898 */
3899 invalid_bdaddr = test_bit(HCI_QUIRK_INVALID_BDADDR,
3900 &hdev->quirks);
3901
3902 if (ret)

--- 1416 unchanged lines hidden ---
3926 /* The transport driver can set the quirk to mark the
3927 * BD_ADDR invalid before creating the HCI device or in
3928 * its setup callback.
3929 */
3930 invalid_bdaddr = test_bit(HCI_QUIRK_INVALID_BDADDR,
3931 &hdev->quirks);
3932
3933 if (ret)

--- 1416 unchanged lines hidden ---