Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: hci_dev: replace 'quirks' integer by 'quirk_flags' bitmap

The 'quirks' member already ran out of bits on some platforms some time
ago. Replace the integer member by a bitmap in order to have enough bits
in future. Replace raw bit operations by accessor macros.

Fixes: ff26b2dd6568 ("Bluetooth: Add quirk for broken READ_VOICE_SETTING")
Fixes: 127881334eaa ("Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE")
Suggested-by: Pauli Virtanen <pav@iki.fi>
Tested-by: Ivan Pravdin <ipravdin.official@gmail.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Christian Eggers and committed by
Luiz Augusto von Dentz
6851a0c2 cdee6a44

+187 -185
+1 -1
drivers/bluetooth/bfusb.c
··· 670 670 hdev->flush = bfusb_flush; 671 671 hdev->send = bfusb_send_frame; 672 672 673 - set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks); 673 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_COMMANDS); 674 674 675 675 if (hci_register_dev(hdev) < 0) { 676 676 BT_ERR("Can't register HCI device");
+1 -1
drivers/bluetooth/bpa10x.c
··· 398 398 hdev->send = bpa10x_send_frame; 399 399 hdev->set_diag = bpa10x_set_diag; 400 400 401 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 401 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 402 402 403 403 err = hci_register_dev(hdev); 404 404 if (err < 0) {
+4 -4
drivers/bluetooth/btbcm.c
··· 135 135 if (btbcm_set_bdaddr_from_efi(hdev) != 0) { 136 136 bt_dev_info(hdev, "BCM: Using default device address (%pMR)", 137 137 &bda->bdaddr); 138 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 138 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 139 139 } 140 140 } 141 141 ··· 467 467 468 468 /* Read DMI and disable broken Read LE Min/Max Tx Power */ 469 469 if (dmi_first_match(disable_broken_read_transmit_power)) 470 - set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks); 470 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER); 471 471 472 472 return 0; 473 473 } ··· 706 706 707 707 btbcm_check_bdaddr(hdev); 708 708 709 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 709 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 710 710 711 711 return 0; 712 712 } ··· 769 769 kfree_skb(skb); 770 770 } 771 771 772 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 772 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 773 773 774 774 return 0; 775 775 }
+14 -14
drivers/bluetooth/btintel.c
··· 88 88 if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) { 89 89 bt_dev_err(hdev, "Found Intel default device address (%pMR)", 90 90 &bda->bdaddr); 91 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 91 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 92 92 } 93 93 94 94 kfree_skb(skb); ··· 2027 2027 */ 2028 2028 if (!bacmp(&params->otp_bdaddr, BDADDR_ANY)) { 2029 2029 bt_dev_info(hdev, "No device address configured"); 2030 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 2030 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 2031 2031 } 2032 2032 2033 2033 download: ··· 2295 2295 */ 2296 2296 if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { 2297 2297 bt_dev_info(hdev, "No device address configured"); 2298 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 2298 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 2299 2299 } 2300 2300 } 2301 2301 ··· 3435 3435 } 3436 3436 3437 3437 /* Apply the common HCI quirks for Intel device */ 3438 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 3439 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 3440 - set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); 3438 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 3439 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 3440 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG); 3441 3441 3442 3442 /* Set up the quality report callback for Intel devices */ 3443 3443 hdev->set_quality_report = btintel_set_quality_report; ··· 3475 3475 */ 3476 3476 if (!btintel_test_flag(hdev, 3477 3477 INTEL_ROM_LEGACY_NO_WBS_SUPPORT)) 3478 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 3479 - &hdev->quirks); 3478 + hci_set_quirk(hdev, 3479 + HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 3480 3480 3481 3481 err = btintel_legacy_rom_setup(hdev, &ver); 3482 3482 break; ··· 3491 3491 * 3492 3492 * All Legacy bootloader devices support WBS 3493 3493 */ 3494 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 3495 - &hdev->quirks); 3494 + hci_set_quirk(hdev, 3495 + HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 3496 3496 3497 3497 /* These variants don't seem to support LE Coded PHY */ 3498 - set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); 3498 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED); 3499 3499 3500 3500 /* Setup MSFT Extension support */ 3501 3501 btintel_set_msft_opcode(hdev, ver.hw_variant); ··· 3571 3571 * 3572 3572 * All Legacy bootloader devices support WBS 3573 3573 */ 3574 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 3574 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 3575 3575 3576 3576 /* These variants don't seem to support LE Coded PHY */ 3577 - set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); 3577 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED); 3578 3578 3579 3579 /* Setup MSFT Extension support */ 3580 3580 btintel_set_msft_opcode(hdev, ver.hw_variant); ··· 3600 3600 * 3601 3601 * All TLV based devices support WBS 3602 3602 */ 3603 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 3603 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 3604 3604 3605 3605 /* Setup MSFT Extension support */ 3606 3606 btintel_set_msft_opcode(hdev,
+4 -4
drivers/bluetooth/btintel_pcie.c
··· 2081 2081 } 2082 2082 2083 2083 /* Apply the common HCI quirks for Intel device */ 2084 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 2085 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 2086 - set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); 2084 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 2085 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 2086 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG); 2087 2087 2088 2088 /* Set up the quality report callback for Intel devices */ 2089 2089 hdev->set_quality_report = btintel_set_quality_report; ··· 2123 2123 * 2124 2124 * All TLV based devices support WBS 2125 2125 */ 2126 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 2126 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 2127 2127 2128 2128 /* Setup MSFT Extension support */ 2129 2129 btintel_set_msft_opcode(hdev,
+2 -2
drivers/bluetooth/btmtksdio.c
··· 1141 1141 } 1142 1142 1143 1143 /* Enable WBS with mSBC codec */ 1144 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 1144 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 1145 1145 1146 1146 /* Enable GPIO reset mechanism */ 1147 1147 if (bdev->reset) { ··· 1384 1384 SET_HCIDEV_DEV(hdev, &func->dev); 1385 1385 1386 1386 hdev->manufacturer = 70; 1387 - set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); 1387 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP); 1388 1388 1389 1389 sdio_set_drvdata(func, bdev); 1390 1390
+1 -1
drivers/bluetooth/btmtkuart.c
··· 872 872 SET_HCIDEV_DEV(hdev, &serdev->dev); 873 873 874 874 hdev->manufacturer = 70; 875 - set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); 875 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP); 876 876 877 877 if (btmtkuart_is_standalone(bdev)) { 878 878 err = clk_prepare_enable(bdev->osc);
+1 -1
drivers/bluetooth/btnxpuart.c
··· 1807 1807 "local-bd-address", 1808 1808 (u8 *)&ba, sizeof(ba)); 1809 1809 if (bacmp(&ba, BDADDR_ANY)) 1810 - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); 1810 + hci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 1811 1811 1812 1812 if (hci_register_dev(hdev) < 0) { 1813 1813 dev_err(&serdev->dev, "Can't register HCI device\n");
+1 -1
drivers/bluetooth/btqca.c
··· 739 739 740 740 bda = (struct hci_rp_read_bd_addr *)skb->data; 741 741 if (!bacmp(&bda->bdaddr, &config->bdaddr)) 742 - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); 742 + hci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 743 743 744 744 kfree_skb(skb); 745 745
+1 -1
drivers/bluetooth/btqcomsmd.c
··· 117 117 /* Devices do not have persistent storage for BD address. Retrieve 118 118 * it from the firmware node property. 119 119 */ 120 - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); 120 + hci_set_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 121 121 122 122 return 0; 123 123 }
+5 -5
drivers/bluetooth/btrtl.c
··· 1287 1287 /* Enable controller to do both LE scan and BR/EDR inquiry 1288 1288 * simultaneously. 1289 1289 */ 1290 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 1290 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 1291 1291 1292 1292 /* Enable central-peripheral role (able to create new connections with 1293 1293 * an existing connection in slave role). ··· 1301 1301 case CHIP_ID_8851B: 1302 1302 case CHIP_ID_8922A: 1303 1303 case CHIP_ID_8852BT: 1304 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 1304 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 1305 1305 1306 1306 /* RTL8852C needs to transmit mSBC data continuously without 1307 1307 * the zero length of USB packets for the ALT 6 supported chips ··· 1312 1312 if (btrtl_dev->project_id == CHIP_ID_8852A || 1313 1313 btrtl_dev->project_id == CHIP_ID_8852B || 1314 1314 btrtl_dev->project_id == CHIP_ID_8852C) 1315 - set_bit(HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, &hdev->quirks); 1315 + hci_set_quirk(hdev, 1316 + HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER); 1316 1317 1317 1318 hci_set_aosp_capable(hdev); 1318 1319 break; ··· 1332 1331 * but it doesn't support any features from page 2 - 1333 1332 * it either responds with garbage or with error status 1334 1333 */ 1335 - set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, 1336 - &hdev->quirks); 1334 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2); 1337 1335 break; 1338 1336 default: 1339 1337 break;
+1 -1
drivers/bluetooth/btsdio.c
··· 327 327 hdev->send = btsdio_send_frame; 328 328 329 329 if (func->vendor == 0x0104 && func->device == 0x00c5) 330 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 330 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 331 331 332 332 err = hci_register_dev(hdev); 333 333 if (err < 0) {
+35 -35
drivers/bluetooth/btusb.c
··· 2472 2472 * Probably will need to be expanded in the future; 2473 2473 * without these the controller will lock up. 2474 2474 */ 2475 - set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); 2476 - set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks); 2477 - set_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks); 2478 - set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks); 2479 - set_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &hdev->quirks); 2480 - set_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks); 2475 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_STORED_LINK_KEY); 2476 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_ERR_DATA_REPORTING); 2477 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL); 2478 + hci_set_quirk(hdev, HCI_QUIRK_NO_SUSPEND_NOTIFIER); 2479 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_VOICE_SETTING); 2480 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE); 2481 2481 2482 2482 /* Clear the reset quirk since this is not an actual 2483 2483 * early Bluetooth 1.1 device from CSR. 2484 2484 */ 2485 - clear_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 2486 - clear_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 2485 + hci_clear_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 2486 + hci_clear_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 2487 2487 2488 2488 /* 2489 2489 * Special workaround for these BT 4.0 chip clones, and potentially more: ··· 3494 3494 /* Mark HCI_OP_ENHANCED_SETUP_SYNC_CONN as broken as it doesn't seem to 3495 3495 * work with the likes of HSP/HFP mSBC. 3496 3496 */ 3497 - set_bit(HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN, &hdev->quirks); 3497 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN); 3498 3498 3499 3499 return 0; 3500 3500 } ··· 4008 4008 } 4009 4009 #endif 4010 4010 if (id->driver_info & BTUSB_CW6622) 4011 - set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); 4011 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_STORED_LINK_KEY); 4012 4012 4013 4013 if (id->driver_info & BTUSB_BCM2045) 4014 - set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); 4014 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_STORED_LINK_KEY); 4015 4015 4016 4016 if (id->driver_info & BTUSB_BCM92035) 4017 4017 hdev->setup = btusb_setup_bcm92035; ··· 4068 4068 hdev->reset = btmtk_reset_sync; 4069 4069 hdev->set_bdaddr = btmtk_set_bdaddr; 4070 4070 hdev->send = btusb_send_frame_mtk; 4071 - set_bit(HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN, &hdev->quirks); 4072 - set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); 4071 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN); 4072 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP); 4073 4073 data->recv_acl = btmtk_usb_recv_acl; 4074 4074 data->suspend = btmtk_usb_suspend; 4075 4075 data->resume = btmtk_usb_resume; ··· 4077 4077 } 4078 4078 4079 4079 if (id->driver_info & BTUSB_SWAVE) { 4080 - set_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks); 4081 - set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks); 4080 + hci_set_quirk(hdev, HCI_QUIRK_FIXUP_INQUIRY_MODE); 4081 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_COMMANDS); 4082 4082 } 4083 4083 4084 4084 if (id->driver_info & BTUSB_INTEL_BOOT) { 4085 4085 hdev->manufacturer = 2; 4086 - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 4086 + hci_set_quirk(hdev, HCI_QUIRK_RAW_DEVICE); 4087 4087 } 4088 4088 4089 4089 if (id->driver_info & BTUSB_ATH3012) { 4090 4090 data->setup_on_usb = btusb_setup_qca; 4091 4091 hdev->set_bdaddr = btusb_set_bdaddr_ath3012; 4092 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 4093 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 4092 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 4093 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 4094 4094 } 4095 4095 4096 4096 if (id->driver_info & BTUSB_QCA_ROME) { ··· 4098 4098 hdev->shutdown = btusb_shutdown_qca; 4099 4099 hdev->set_bdaddr = btusb_set_bdaddr_ath3012; 4100 4100 hdev->reset = btusb_qca_reset; 4101 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 4101 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 4102 4102 btusb_check_needs_reset_resume(intf); 4103 4103 } 4104 4104 ··· 4112 4112 hdev->shutdown = btusb_shutdown_qca; 4113 4113 hdev->set_bdaddr = btusb_set_bdaddr_wcn6855; 4114 4114 hdev->reset = btusb_qca_reset; 4115 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 4115 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 4116 4116 hci_set_msft_opcode(hdev, 0xFD70); 4117 4117 } 4118 4118 ··· 4140 4140 4141 4141 if (id->driver_info & BTUSB_ACTIONS_SEMI) { 4142 4142 /* Support is advertised, but not implemented */ 4143 - set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks); 4144 - set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks); 4145 - set_bit(HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT, &hdev->quirks); 4146 - set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks); 4147 - set_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &hdev->quirks); 4148 - set_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, &hdev->quirks); 4149 - set_bit(HCI_QUIRK_BROKEN_WRITE_AUTH_PAYLOAD_TIMEOUT, &hdev->quirks); 4143 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_ERR_DATA_REPORTING); 4144 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER); 4145 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT); 4146 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_EXT_SCAN); 4147 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE); 4148 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_EXT_CREATE_CONN); 4149 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_WRITE_AUTH_PAYLOAD_TIMEOUT); 4150 4150 } 4151 4151 4152 4152 if (!reset) 4153 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 4153 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 4154 4154 4155 4155 if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) { 4156 4156 if (!disable_scofix) 4157 - set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks); 4157 + hci_set_quirk(hdev, HCI_QUIRK_FIXUP_BUFFER_SIZE); 4158 4158 } 4159 4159 4160 4160 if (id->driver_info & BTUSB_BROKEN_ISOC) 4161 4161 data->isoc = NULL; 4162 4162 4163 4163 if (id->driver_info & BTUSB_WIDEBAND_SPEECH) 4164 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 4164 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 4165 4165 4166 4166 if (id->driver_info & BTUSB_INVALID_LE_STATES) 4167 - set_bit(HCI_QUIRK_BROKEN_LE_STATES, &hdev->quirks); 4167 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_STATES); 4168 4168 4169 4169 if (id->driver_info & BTUSB_DIGIANSWER) { 4170 4170 data->cmdreq_type = USB_TYPE_VENDOR; 4171 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 4171 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 4172 4172 } 4173 4173 4174 4174 if (id->driver_info & BTUSB_CSR) { ··· 4177 4177 4178 4178 /* Old firmware would otherwise execute USB reset */ 4179 4179 if (bcdDevice < 0x117) 4180 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 4180 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 4181 4181 4182 4182 /* This must be set first in case we disable it for fakes */ 4183 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 4183 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 4184 4184 4185 4185 /* Fake CSR devices with broken commands */ 4186 4186 if (le16_to_cpu(udev->descriptor.idVendor) == 0x0a12 && ··· 4193 4193 4194 4194 /* New sniffer firmware has crippled HCI interface */ 4195 4195 if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997) 4196 - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 4196 + hci_set_quirk(hdev, HCI_QUIRK_RAW_DEVICE); 4197 4197 } 4198 4198 4199 4199 if (id->driver_info & BTUSB_INTEL_BOOT) {
+1 -1
drivers/bluetooth/hci_aml.c
··· 424 424 425 425 if (!bacmp(&paddr->bdaddr, AML_BDADDR_DEFAULT)) { 426 426 bt_dev_info(hdev, "amlbt using default bdaddr (%pM)", &paddr->bdaddr); 427 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 427 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 428 428 } 429 429 430 430 exit:
+2 -2
drivers/bluetooth/hci_bcm.c
··· 643 643 * Allow the bootloader to set a valid address through the 644 644 * device tree. 645 645 */ 646 - if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks)) 647 - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks); 646 + if (hci_test_quirk(hu->hdev, HCI_QUIRK_INVALID_BDADDR)) 647 + hci_set_quirk(hu->hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 648 648 649 649 if (!bcm_request_irq(bcm)) 650 650 err = bcm_setup_sleep(hu);
+5 -5
drivers/bluetooth/hci_bcm4377.c
··· 1435 1435 1436 1436 bda = (struct hci_rp_read_bd_addr *)skb->data; 1437 1437 if (!bcm4377_is_valid_bdaddr(bcm4377, &bda->bdaddr)) 1438 - set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &bcm4377->hdev->quirks); 1438 + hci_set_quirk(bcm4377->hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 1439 1439 1440 1440 kfree_skb(skb); 1441 1441 return 0; ··· 2389 2389 hdev->setup = bcm4377_hci_setup; 2390 2390 2391 2391 if (bcm4377->hw->broken_mws_transport_config) 2392 - set_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks); 2392 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG); 2393 2393 if (bcm4377->hw->broken_ext_scan) 2394 - set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks); 2394 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_EXT_SCAN); 2395 2395 if (bcm4377->hw->broken_le_coded) 2396 - set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); 2396 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED); 2397 2397 if (bcm4377->hw->broken_le_ext_adv_report_phy) 2398 - set_bit(HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY, &hdev->quirks); 2398 + hci_set_quirk(hdev, HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY); 2399 2399 2400 2400 pci_set_drvdata(pdev, bcm4377); 2401 2401 hci_set_drvdata(hdev, bcm4377);
+1 -1
drivers/bluetooth/hci_intel.c
··· 660 660 */ 661 661 if (!bacmp(&params.otp_bdaddr, BDADDR_ANY)) { 662 662 bt_dev_info(hdev, "No device address configured"); 663 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); 663 + hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR); 664 664 } 665 665 666 666 /* With this Intel bootloader only the hardware variant and device
+3 -3
drivers/bluetooth/hci_ldisc.c
··· 667 667 SET_HCIDEV_DEV(hdev, hu->tty->dev); 668 668 669 669 if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) 670 - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 670 + hci_set_quirk(hdev, HCI_QUIRK_RAW_DEVICE); 671 671 672 672 if (test_bit(HCI_UART_EXT_CONFIG, &hu->hdev_flags)) 673 - set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); 673 + hci_set_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG); 674 674 675 675 if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags)) 676 - set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); 676 + hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); 677 677 678 678 /* Only call open() for the protocol after hdev is fully initialized as 679 679 * open() (or a timer/workqueue it starts) may attempt to reference it.
+2 -2
drivers/bluetooth/hci_ll.c
··· 649 649 /* This means that there was an error getting the BD address 650 650 * during probe, so mark the device as having a bad address. 651 651 */ 652 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); 652 + hci_set_quirk(hu->hdev, HCI_QUIRK_INVALID_BDADDR); 653 653 } else if (bacmp(&lldev->bdaddr, BDADDR_ANY)) { 654 654 err = ll_set_bdaddr(hu->hdev, &lldev->bdaddr); 655 655 if (err) 656 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); 656 + hci_set_quirk(hu->hdev, HCI_QUIRK_INVALID_BDADDR); 657 657 } 658 658 659 659 /* Operational speed if any */
+1 -1
drivers/bluetooth/hci_nokia.c
··· 439 439 440 440 if (btdev->man_id == NOKIA_ID_BCM2048) { 441 441 hu->hdev->set_bdaddr = btbcm_set_bdaddr; 442 - set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); 442 + hci_set_quirk(hu->hdev, HCI_QUIRK_INVALID_BDADDR); 443 443 dev_dbg(dev, "bcm2048 has invalid bluetooth address!"); 444 444 } 445 445
+7 -7
drivers/bluetooth/hci_qca.c
··· 1892 1892 /* Enable controller to do both LE scan and BR/EDR inquiry 1893 1893 * simultaneously. 1894 1894 */ 1895 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 1895 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 1896 1896 1897 1897 switch (soc_type) { 1898 1898 case QCA_QCA2066: ··· 1944 1944 case QCA_WCN7850: 1945 1945 qcadev = serdev_device_get_drvdata(hu->serdev); 1946 1946 if (qcadev->bdaddr_property_broken) 1947 - set_bit(HCI_QUIRK_BDADDR_PROPERTY_BROKEN, &hdev->quirks); 1947 + hci_set_quirk(hdev, HCI_QUIRK_BDADDR_PROPERTY_BROKEN); 1948 1948 1949 1949 hci_set_aosp_capable(hdev); 1950 1950 ··· 2487 2487 hdev = qcadev->serdev_hu.hdev; 2488 2488 2489 2489 if (power_ctrl_enabled) { 2490 - set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); 2490 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP); 2491 2491 hdev->shutdown = qca_power_off; 2492 2492 } 2493 2493 ··· 2496 2496 * be queried via hci. Same with the valid le states quirk. 2497 2497 */ 2498 2498 if (data->capabilities & QCA_CAP_WIDEBAND_SPEECH) 2499 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 2500 - &hdev->quirks); 2499 + hci_set_quirk(hdev, 2500 + HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 2501 2501 2502 2502 if (!(data->capabilities & QCA_CAP_VALID_LE_STATES)) 2503 - set_bit(HCI_QUIRK_BROKEN_LE_STATES, &hdev->quirks); 2503 + hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_STATES); 2504 2504 } 2505 2505 2506 2506 return 0; ··· 2550 2550 * invoked and the SOC is already in the initial state, so 2551 2551 * don't also need to send the VSC. 2552 2552 */ 2553 - if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks) || 2553 + if (hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP) || 2554 2554 hci_dev_test_flag(hdev, HCI_SETUP)) 2555 2555 return; 2556 2556
+4 -4
drivers/bluetooth/hci_serdev.c
··· 152 152 * BT SOC is completely powered OFF during BT OFF, holding port 153 153 * open may drain the battery. 154 154 */ 155 - if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) { 155 + if (hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP)) { 156 156 clear_bit(HCI_UART_PROTO_READY, &hu->flags); 157 157 serdev_device_close(hu->serdev); 158 158 } ··· 358 358 SET_HCIDEV_DEV(hdev, &hu->serdev->dev); 359 359 360 360 if (test_bit(HCI_UART_NO_SUSPEND_NOTIFIER, &hu->flags)) 361 - set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks); 361 + hci_set_quirk(hdev, HCI_QUIRK_NO_SUSPEND_NOTIFIER); 362 362 363 363 if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags)) 364 - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 364 + hci_set_quirk(hdev, HCI_QUIRK_RAW_DEVICE); 365 365 366 366 if (test_bit(HCI_UART_EXT_CONFIG, &hu->hdev_flags)) 367 - set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); 367 + hci_set_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG); 368 368 369 369 if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags)) 370 370 return 0;
+4 -4
drivers/bluetooth/hci_vhci.c
··· 415 415 hdev->get_codec_config_data = vhci_get_codec_config_data; 416 416 hdev->wakeup = vhci_wakeup; 417 417 hdev->setup = vhci_setup; 418 - set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); 419 - set_bit(HCI_QUIRK_SYNC_FLOWCTL_SUPPORTED, &hdev->quirks); 418 + hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP); 419 + hci_set_quirk(hdev, HCI_QUIRK_SYNC_FLOWCTL_SUPPORTED); 420 420 421 421 /* bit 6 is for external configuration */ 422 422 if (opcode & 0x40) 423 - set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); 423 + hci_set_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG); 424 424 425 425 /* bit 7 is for raw device */ 426 426 if (opcode & 0x80) 427 - set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 427 + hci_set_quirk(hdev, HCI_QUIRK_RAW_DEVICE); 428 428 429 429 if (hci_register_dev(hdev) < 0) { 430 430 BT_ERR("Can't register HCI device");
+5 -5
drivers/bluetooth/virtio_bt.c
··· 327 327 hdev->setup = virtbt_setup_intel; 328 328 hdev->shutdown = virtbt_shutdown_generic; 329 329 hdev->set_bdaddr = virtbt_set_bdaddr_intel; 330 - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); 331 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 332 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 330 + hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER); 331 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 332 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 333 333 break; 334 334 335 335 case VIRTIO_BT_CONFIG_VENDOR_REALTEK: 336 336 hdev->manufacturer = 93; 337 337 hdev->setup = virtbt_setup_realtek; 338 338 hdev->shutdown = virtbt_shutdown_generic; 339 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); 340 - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); 339 + hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY); 340 + hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED); 341 341 break; 342 342 } 343 343 }
+2
include/net/bluetooth/hci.h
··· 377 377 * This quirk must be set before hci_register_dev is called. 378 378 */ 379 379 HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, 380 + 381 + __HCI_NUM_QUIRKS, 380 382 }; 381 383 382 384 /* HCI device flags */
+16 -12
include/net/bluetooth/hci_core.h
··· 464 464 465 465 unsigned int auto_accept_delay; 466 466 467 - unsigned long quirks; 467 + DECLARE_BITMAP(quirk_flags, __HCI_NUM_QUIRKS); 468 468 469 469 atomic_t cmd_cnt; 470 470 unsigned int acl_cnt; ··· 656 656 u8 (*classify_pkt_type)(struct hci_dev *hdev, struct sk_buff *skb); 657 657 }; 658 658 659 + #define hci_set_quirk(hdev, nr) set_bit((nr), (hdev)->quirk_flags) 660 + #define hci_clear_quirk(hdev, nr) clear_bit((nr), (hdev)->quirk_flags) 661 + #define hci_test_quirk(hdev, nr) test_bit((nr), (hdev)->quirk_flags) 662 + 659 663 #define HCI_PHY_HANDLE(handle) (handle & 0xff) 660 664 661 665 enum conn_reasons { ··· 843 839 } while (0) 844 840 845 841 #define hci_dev_le_state_simultaneous(hdev) \ 846 - (!test_bit(HCI_QUIRK_BROKEN_LE_STATES, &(hdev)->quirks) && \ 842 + (!hci_test_quirk((hdev), HCI_QUIRK_BROKEN_LE_STATES) && \ 847 843 ((hdev)->le_states[4] & 0x08) && /* Central */ \ 848 844 ((hdev)->le_states[4] & 0x40) && /* Peripheral */ \ 849 845 ((hdev)->le_states[3] & 0x10)) /* Simultaneous */ ··· 1935 1931 ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M)) 1936 1932 1937 1933 #define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \ 1938 - !test_bit(HCI_QUIRK_BROKEN_LE_CODED, \ 1939 - &(dev)->quirks)) 1934 + !hci_test_quirk((dev), \ 1935 + HCI_QUIRK_BROKEN_LE_CODED)) 1940 1936 1941 1937 #define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \ 1942 1938 ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED)) ··· 1948 1944 1949 1945 #define read_key_size_capable(dev) \ 1950 1946 ((dev)->commands[20] & 0x10 && \ 1951 - !test_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &(dev)->quirks)) 1947 + !hci_test_quirk((dev), HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE)) 1952 1948 1953 1949 #define read_voice_setting_capable(dev) \ 1954 1950 ((dev)->commands[9] & 0x04 && \ 1955 - !test_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &(dev)->quirks)) 1951 + !hci_test_quirk((dev), HCI_QUIRK_BROKEN_READ_VOICE_SETTING)) 1956 1952 1957 1953 /* Use enhanced synchronous connection if command is supported and its quirk 1958 1954 * has not been set. 1959 1955 */ 1960 1956 #define enhanced_sync_conn_capable(dev) \ 1961 1957 (((dev)->commands[29] & 0x08) && \ 1962 - !test_bit(HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN, &(dev)->quirks)) 1958 + !hci_test_quirk((dev), HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN)) 1963 1959 1964 1960 /* Use ext scanning if set ext scan param and ext scan enable is supported */ 1965 1961 #define use_ext_scan(dev) (((dev)->commands[37] & 0x20) && \ 1966 1962 ((dev)->commands[37] & 0x40) && \ 1967 - !test_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &(dev)->quirks)) 1963 + !hci_test_quirk((dev), HCI_QUIRK_BROKEN_EXT_SCAN)) 1968 1964 1969 1965 /* Use ext create connection if command is supported */ 1970 1966 #define use_ext_conn(dev) (((dev)->commands[37] & 0x80) && \ 1971 - !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, &(dev)->quirks)) 1967 + !hci_test_quirk((dev), HCI_QUIRK_BROKEN_EXT_CREATE_CONN)) 1972 1968 /* Extended advertising support */ 1973 1969 #define ext_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV)) 1974 1970 ··· 1983 1979 */ 1984 1980 #define use_enhanced_conn_complete(dev) ((ll_privacy_capable(dev) || \ 1985 1981 ext_adv_capable(dev)) && \ 1986 - !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, \ 1987 - &(dev)->quirks)) 1982 + !hci_test_quirk((dev), \ 1983 + HCI_QUIRK_BROKEN_EXT_CREATE_CONN)) 1988 1984 1989 1985 /* Periodic advertising support */ 1990 1986 #define per_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_PERIODIC_ADV)) ··· 2001 1997 #define sync_recv_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER) 2002 1998 2003 1999 #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \ 2004 - (!test_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &(dev)->quirks))) 2000 + (!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG))) 2005 2001 2006 2002 /* ----- HCI protocols ----- */ 2007 2003 #define HCI_PROTO_DEFER 0x01
+2 -2
net/bluetooth/hci_core.c
··· 2654 2654 /* Devices that are marked for raw-only usage are unconfigured 2655 2655 * and should not be included in normal operation. 2656 2656 */ 2657 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 2657 + if (hci_test_quirk(hdev, HCI_QUIRK_RAW_DEVICE)) 2658 2658 hci_dev_set_flag(hdev, HCI_UNCONFIGURED); 2659 2659 2660 2660 /* Mark Remote Wakeup connection flag as supported if driver has wakeup ··· 2784 2784 int ret = 0; 2785 2785 2786 2786 if (!hdev->suspend_notifier.notifier_call && 2787 - !test_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks)) { 2787 + !hci_test_quirk(hdev, HCI_QUIRK_NO_SUSPEND_NOTIFIER)) { 2788 2788 hdev->suspend_notifier.notifier_call = hci_suspend_notifier; 2789 2789 ret = register_pm_notifier(&hdev->suspend_notifier); 2790 2790 }
+4 -4
net/bluetooth/hci_debugfs.c
··· 38 38 struct hci_dev *hdev = file->private_data; \ 39 39 char buf[3]; \ 40 40 \ 41 - buf[0] = test_bit(__quirk, &hdev->quirks) ? 'Y' : 'N'; \ 41 + buf[0] = test_bit(__quirk, hdev->quirk_flags) ? 'Y' : 'N'; \ 42 42 buf[1] = '\n'; \ 43 43 buf[2] = '\0'; \ 44 44 return simple_read_from_buffer(user_buf, count, ppos, buf, 2); \ ··· 59 59 if (err) \ 60 60 return err; \ 61 61 \ 62 - if (enable == test_bit(__quirk, &hdev->quirks)) \ 62 + if (enable == test_bit(__quirk, hdev->quirk_flags)) \ 63 63 return -EALREADY; \ 64 64 \ 65 - change_bit(__quirk, &hdev->quirks); \ 65 + change_bit(__quirk, hdev->quirk_flags); \ 66 66 \ 67 67 return count; \ 68 68 } \ ··· 1356 1356 * for the vendor callback. Instead just store the desired value and 1357 1357 * the setting will be programmed when the controller gets powered on. 1358 1358 */ 1359 - if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && 1359 + if (hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG) && 1360 1360 (!test_bit(HCI_RUNNING, &hdev->flags) || 1361 1361 hci_dev_test_flag(hdev, HCI_USER_CHANNEL))) 1362 1362 goto done;
+9 -10
net/bluetooth/hci_event.c
··· 908 908 return rp->status; 909 909 910 910 if (hdev->max_page < rp->max_page) { 911 - if (test_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, 912 - &hdev->quirks)) 911 + if (hci_test_quirk(hdev, 912 + HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2)) 913 913 bt_dev_warn(hdev, "broken local ext features page 2"); 914 914 else 915 915 hdev->max_page = rp->max_page; ··· 936 936 hdev->acl_pkts = __le16_to_cpu(rp->acl_max_pkt); 937 937 hdev->sco_pkts = __le16_to_cpu(rp->sco_max_pkt); 938 938 939 - if (test_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks)) { 939 + if (hci_test_quirk(hdev, HCI_QUIRK_FIXUP_BUFFER_SIZE)) { 940 940 hdev->sco_mtu = 64; 941 941 hdev->sco_pkts = 8; 942 942 } ··· 2971 2971 * state to indicate completion. 2972 2972 */ 2973 2973 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || 2974 - !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) 2974 + !hci_test_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY)) 2975 2975 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 2976 2976 goto unlock; 2977 2977 } ··· 2990 2990 * state to indicate completion. 2991 2991 */ 2992 2992 if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || 2993 - !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) 2993 + !hci_test_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY)) 2994 2994 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 2995 2995 } 2996 2996 ··· 3614 3614 /* We skip the WRITE_AUTH_PAYLOAD_TIMEOUT for ATS2851 based controllers 3615 3615 * to avoid unexpected SMP command errors when pairing. 3616 3616 */ 3617 - if (test_bit(HCI_QUIRK_BROKEN_WRITE_AUTH_PAYLOAD_TIMEOUT, 3618 - &hdev->quirks)) 3617 + if (hci_test_quirk(hdev, HCI_QUIRK_BROKEN_WRITE_AUTH_PAYLOAD_TIMEOUT)) 3619 3618 goto notify; 3620 3619 3621 3620 /* Set the default Authenticated Payload Timeout after ··· 5913 5914 * while we have an existing one in peripheral role. 5914 5915 */ 5915 5916 if (hdev->conn_hash.le_num_peripheral > 0 && 5916 - (test_bit(HCI_QUIRK_BROKEN_LE_STATES, &hdev->quirks) || 5917 + (hci_test_quirk(hdev, HCI_QUIRK_BROKEN_LE_STATES) || 5917 5918 !(hdev->le_states[3] & 0x10))) 5918 5919 return NULL; 5919 5920 ··· 6309 6310 evt_type = __le16_to_cpu(info->type) & LE_EXT_ADV_EVT_TYPE_MASK; 6310 6311 legacy_evt_type = ext_evt_type_to_legacy(hdev, evt_type); 6311 6312 6312 - if (test_bit(HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY, 6313 - &hdev->quirks)) { 6313 + if (hci_test_quirk(hdev, 6314 + HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY)) { 6314 6315 info->primary_phy &= 0x1f; 6315 6316 info->secondary_phy &= 0x1f; 6316 6317 }
+29 -30
net/bluetooth/hci_sync.c
··· 393 393 if (hdev->discovery.type != DISCOV_TYPE_INTERLEAVED) 394 394 goto _return; 395 395 396 - if (test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) { 396 + if (hci_test_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY)) { 397 397 if (!test_bit(HCI_INQUIRY, &hdev->flags) && 398 398 hdev->discovery.state != DISCOVERY_RESOLVING) 399 399 goto discov_stopped; ··· 3587 3587 if (ret < 0 || !bacmp(&ba, BDADDR_ANY)) 3588 3588 return; 3589 3589 3590 - if (test_bit(HCI_QUIRK_BDADDR_PROPERTY_BROKEN, &hdev->quirks)) 3590 + if (hci_test_quirk(hdev, HCI_QUIRK_BDADDR_PROPERTY_BROKEN)) 3591 3591 baswap(&hdev->public_addr, &ba); 3592 3592 else 3593 3593 bacpy(&hdev->public_addr, &ba); ··· 3662 3662 bt_dev_dbg(hdev, ""); 3663 3663 3664 3664 /* Reset */ 3665 - if (!test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) { 3665 + if (!hci_test_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE)) { 3666 3666 err = hci_reset_sync(hdev); 3667 3667 if (err) 3668 3668 return err; ··· 3675 3675 { 3676 3676 int err; 3677 3677 3678 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 3678 + if (hci_test_quirk(hdev, HCI_QUIRK_RAW_DEVICE)) 3679 3679 return 0; 3680 3680 3681 3681 err = hci_init0_sync(hdev); ··· 3718 3718 * supported commands. 3719 3719 */ 3720 3720 if (hdev->hci_ver > BLUETOOTH_VER_1_1 && 3721 - !test_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks)) 3721 + !hci_test_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_COMMANDS)) 3722 3722 return __hci_cmd_sync_status(hdev, HCI_OP_READ_LOCAL_COMMANDS, 3723 3723 0, NULL, HCI_CMD_TIMEOUT); 3724 3724 ··· 3732 3732 bt_dev_dbg(hdev, ""); 3733 3733 3734 3734 /* Reset */ 3735 - if (!test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) { 3735 + if (!hci_test_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE)) { 3736 3736 err = hci_reset_sync(hdev); 3737 3737 if (err) 3738 3738 return err; ··· 3795 3795 if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) 3796 3796 return 0; 3797 3797 3798 - if (test_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks)) 3798 + if (hci_test_quirk(hdev, HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL)) 3799 3799 return 0; 3800 3800 3801 3801 memset(&cp, 0, sizeof(cp)); ··· 3822 3822 * a hci_set_event_filter_sync() call succeeds, but we do 3823 3823 * the check both for parity and as a future reminder. 3824 3824 */ 3825 - if (test_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks)) 3825 + if (hci_test_quirk(hdev, HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL)) 3826 3826 return 0; 3827 3827 3828 3828 return hci_set_event_filter_sync(hdev, HCI_FLT_CLEAR_ALL, 0x00, ··· 3846 3846 3847 3847 /* Check if the controller supports SCO and HCI_OP_WRITE_SYNC_FLOWCTL */ 3848 3848 if (!lmp_sco_capable(hdev) || !(hdev->commands[10] & BIT(4)) || 3849 - !test_bit(HCI_QUIRK_SYNC_FLOWCTL_SUPPORTED, &hdev->quirks)) 3849 + !hci_test_quirk(hdev, HCI_QUIRK_SYNC_FLOWCTL_SUPPORTED)) 3850 3850 return 0; 3851 3851 3852 3852 memset(&cp, 0, sizeof(cp)); ··· 3921 3921 u8 mode; 3922 3922 3923 3923 if (!lmp_inq_rssi_capable(hdev) && 3924 - !test_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks)) 3924 + !hci_test_quirk(hdev, HCI_QUIRK_FIXUP_INQUIRY_MODE)) 3925 3925 return 0; 3926 3926 3927 3927 /* If Extended Inquiry Result events are supported, then ··· 4111 4111 } 4112 4112 4113 4113 if (lmp_inq_rssi_capable(hdev) || 4114 - test_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks)) 4114 + hci_test_quirk(hdev, HCI_QUIRK_FIXUP_INQUIRY_MODE)) 4115 4115 events[4] |= 0x02; /* Inquiry Result with RSSI */ 4116 4116 4117 4117 if (lmp_ext_feat_capable(hdev)) ··· 4163 4163 struct hci_cp_read_stored_link_key cp; 4164 4164 4165 4165 if (!(hdev->commands[6] & 0x20) || 4166 - test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) 4166 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_STORED_LINK_KEY)) 4167 4167 return 0; 4168 4168 4169 4169 memset(&cp, 0, sizeof(cp)); ··· 4212 4212 { 4213 4213 if (!(hdev->commands[18] & 0x04) || 4214 4214 !(hdev->features[0][6] & LMP_ERR_DATA_REPORTING) || 4215 - test_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks)) 4215 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_ERR_DATA_REPORTING)) 4216 4216 return 0; 4217 4217 4218 4218 return __hci_cmd_sync_status(hdev, HCI_OP_READ_DEF_ERR_DATA_REPORTING, ··· 4226 4226 * this command in the bit mask of supported commands. 4227 4227 */ 4228 4228 if (!(hdev->commands[13] & 0x01) || 4229 - test_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks)) 4229 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE)) 4230 4230 return 0; 4231 4231 4232 4232 return __hci_cmd_sync_status(hdev, HCI_OP_READ_PAGE_SCAN_TYPE, ··· 4421 4421 static int hci_le_read_tx_power_sync(struct hci_dev *hdev) 4422 4422 { 4423 4423 if (!(hdev->commands[38] & 0x80) || 4424 - test_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks)) 4424 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER)) 4425 4425 return 0; 4426 4426 4427 4427 return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_TRANSMIT_POWER, ··· 4464 4464 __le16 timeout = cpu_to_le16(hdev->rpa_timeout); 4465 4465 4466 4466 if (!(hdev->commands[35] & 0x04) || 4467 - test_bit(HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT, &hdev->quirks)) 4467 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT)) 4468 4468 return 0; 4469 4469 4470 4470 return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_RPA_TIMEOUT, ··· 4609 4609 * just disable this command. 4610 4610 */ 4611 4611 if (!(hdev->commands[6] & 0x80) || 4612 - test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) 4612 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_STORED_LINK_KEY)) 4613 4613 return 0; 4614 4614 4615 4615 memset(&cp, 0, sizeof(cp)); ··· 4735 4735 4736 4736 if (!(hdev->commands[18] & 0x08) || 4737 4737 !(hdev->features[0][6] & LMP_ERR_DATA_REPORTING) || 4738 - test_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks)) 4738 + hci_test_quirk(hdev, HCI_QUIRK_BROKEN_ERR_DATA_REPORTING)) 4739 4739 return 0; 4740 4740 4741 4741 if (enabled == hdev->err_data_reporting) ··· 4948 4948 size_t i; 4949 4949 4950 4950 if (!hci_dev_test_flag(hdev, HCI_SETUP) && 4951 - !test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) 4951 + !hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP)) 4952 4952 return 0; 4953 4953 4954 4954 bt_dev_dbg(hdev, ""); ··· 4959 4959 ret = hdev->setup(hdev); 4960 4960 4961 4961 for (i = 0; i < ARRAY_SIZE(hci_broken_table); i++) { 4962 - if (test_bit(hci_broken_table[i].quirk, &hdev->quirks)) 4962 + if (hci_test_quirk(hdev, hci_broken_table[i].quirk)) 4963 4963 bt_dev_warn(hdev, "%s", hci_broken_table[i].desc); 4964 4964 } 4965 4965 ··· 4967 4967 * BD_ADDR invalid before creating the HCI device or in 4968 4968 * its setup callback. 4969 4969 */ 4970 - invalid_bdaddr = test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) || 4971 - test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); 4970 + invalid_bdaddr = hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) || 4971 + hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY); 4972 4972 if (!ret) { 4973 - if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && 4973 + if (hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY) && 4974 4974 !bacmp(&hdev->public_addr, BDADDR_ANY)) 4975 4975 hci_dev_get_bd_addr_from_property(hdev); 4976 4976 ··· 4992 4992 * In case any of them is set, the controller has to 4993 4993 * start up as unconfigured. 4994 4994 */ 4995 - if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) || 4995 + if (hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG) || 4996 4996 invalid_bdaddr) 4997 4997 hci_dev_set_flag(hdev, HCI_UNCONFIGURED); 4998 4998 ··· 5052 5052 * then they need to be reprogrammed after the init procedure 5053 5053 * completed. 5054 5054 */ 5055 - if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && 5055 + if (hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG) && 5056 5056 !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && 5057 5057 hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) && hdev->set_diag) 5058 5058 ret = hdev->set_diag(hdev, true); ··· 5309 5309 /* Reset device */ 5310 5310 skb_queue_purge(&hdev->cmd_q); 5311 5311 atomic_set(&hdev->cmd_cnt, 1); 5312 - if (test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks) && 5312 + if (hci_test_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE) && 5313 5313 !auto_off && !hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { 5314 5314 set_bit(HCI_INIT, &hdev->flags); 5315 5315 hci_reset_sync(hdev); ··· 5959 5959 own_addr_type = ADDR_LE_DEV_PUBLIC; 5960 5960 5961 5961 if (hci_is_adv_monitoring(hdev) || 5962 - (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) && 5962 + (hci_test_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER) && 5963 5963 hdev->discovery.result_filtering)) { 5964 5964 /* Duplicate filter should be disabled when some advertisement 5965 5965 * monitor is activated, otherwise AdvMon can only receive one ··· 6022 6022 * and LE scanning are done sequentially with separate 6023 6023 * timeouts. 6024 6024 */ 6025 - if (test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 6026 - &hdev->quirks)) { 6025 + if (hci_test_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY)) { 6027 6026 timeout = msecs_to_jiffies(DISCOV_LE_TIMEOUT); 6028 6027 /* During simultaneous discovery, we double LE scan 6029 6028 * interval. We must leave some time for the controller ··· 6099 6100 /* Some fake CSR controllers lock up after setting this type of 6100 6101 * filter, so avoid sending the request altogether. 6101 6102 */ 6102 - if (test_bit(HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, &hdev->quirks)) 6103 + if (hci_test_quirk(hdev, HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL)) 6103 6104 return 0; 6104 6105 6105 6106 /* Always clear event filter when starting */
+18 -20
net/bluetooth/mgmt.c
··· 464 464 /* Devices marked as raw-only are neither configured 465 465 * nor unconfigured controllers. 466 466 */ 467 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &d->quirks)) 467 + if (hci_test_quirk(d, HCI_QUIRK_RAW_DEVICE)) 468 468 continue; 469 469 470 470 if (!hci_dev_test_flag(d, HCI_UNCONFIGURED)) { ··· 522 522 /* Devices marked as raw-only are neither configured 523 523 * nor unconfigured controllers. 524 524 */ 525 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &d->quirks)) 525 + if (hci_test_quirk(d, HCI_QUIRK_RAW_DEVICE)) 526 526 continue; 527 527 528 528 if (hci_dev_test_flag(d, HCI_UNCONFIGURED)) { ··· 576 576 /* Devices marked as raw-only are neither configured 577 577 * nor unconfigured controllers. 578 578 */ 579 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &d->quirks)) 579 + if (hci_test_quirk(d, HCI_QUIRK_RAW_DEVICE)) 580 580 continue; 581 581 582 582 if (hci_dev_test_flag(d, HCI_UNCONFIGURED)) ··· 612 612 613 613 static bool is_configured(struct hci_dev *hdev) 614 614 { 615 - if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) && 615 + if (hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG) && 616 616 !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) 617 617 return false; 618 618 619 - if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) || 620 - test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) && 619 + if ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) || 620 + hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) && 621 621 !bacmp(&hdev->public_addr, BDADDR_ANY)) 622 622 return false; 623 623 ··· 628 628 { 629 629 u32 options = 0; 630 630 631 - if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) && 631 + if (hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG) && 632 632 !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) 633 633 options |= MGMT_OPTION_EXTERNAL_CONFIG; 634 634 635 - if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) || 636 - test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) && 635 + if ((hci_test_quirk(hdev, HCI_QUIRK_INVALID_BDADDR) || 636 + hci_test_quirk(hdev, HCI_QUIRK_USE_BDADDR_PROPERTY)) && 637 637 !bacmp(&hdev->public_addr, BDADDR_ANY)) 638 638 options |= MGMT_OPTION_PUBLIC_ADDRESS; 639 639 ··· 669 669 memset(&rp, 0, sizeof(rp)); 670 670 rp.manufacturer = cpu_to_le16(hdev->manufacturer); 671 671 672 - if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks)) 672 + if (hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG)) 673 673 options |= MGMT_OPTION_EXTERNAL_CONFIG; 674 674 675 675 if (hdev->set_bdaddr) ··· 828 828 if (lmp_sc_capable(hdev)) 829 829 settings |= MGMT_SETTING_SECURE_CONN; 830 830 831 - if (test_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 832 - &hdev->quirks)) 831 + if (hci_test_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED)) 833 832 settings |= MGMT_SETTING_WIDEBAND_SPEECH; 834 833 } 835 834 ··· 840 841 settings |= MGMT_SETTING_ADVERTISING; 841 842 } 842 843 843 - if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) || 844 - hdev->set_bdaddr) 844 + if (hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG) || hdev->set_bdaddr) 845 845 settings |= MGMT_SETTING_CONFIGURATION; 846 846 847 847 if (cis_central_capable(hdev)) ··· 4305 4307 4306 4308 bt_dev_dbg(hdev, "sock %p", sk); 4307 4309 4308 - if (!test_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks)) 4310 + if (!hci_test_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED)) 4309 4311 return mgmt_cmd_status(sk, hdev->id, 4310 4312 MGMT_OP_SET_WIDEBAND_SPEECH, 4311 4313 MGMT_STATUS_NOT_SUPPORTED); ··· 7933 7935 return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_EXTERNAL_CONFIG, 7934 7936 MGMT_STATUS_INVALID_PARAMS); 7935 7937 7936 - if (!test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks)) 7938 + if (!hci_test_quirk(hdev, HCI_QUIRK_EXTERNAL_CONFIG)) 7937 7939 return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_EXTERNAL_CONFIG, 7938 7940 MGMT_STATUS_NOT_SUPPORTED); 7939 7941 ··· 9336 9338 { 9337 9339 struct mgmt_ev_ext_index ev; 9338 9340 9339 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 9341 + if (hci_test_quirk(hdev, HCI_QUIRK_RAW_DEVICE)) 9340 9342 return; 9341 9343 9342 9344 if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { ··· 9360 9362 struct mgmt_ev_ext_index ev; 9361 9363 struct cmd_lookup match = { NULL, hdev, MGMT_STATUS_INVALID_INDEX }; 9362 9364 9363 - if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) 9365 + if (hci_test_quirk(hdev, HCI_QUIRK_RAW_DEVICE)) 9364 9366 return; 9365 9367 9366 9368 mgmt_pending_foreach(0, hdev, true, cmd_complete_rsp, &match); ··· 10087 10089 if (hdev->discovery.rssi != HCI_RSSI_INVALID && 10088 10090 (rssi == HCI_RSSI_INVALID || 10089 10091 (rssi < hdev->discovery.rssi && 10090 - !test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)))) 10092 + !hci_test_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER)))) 10091 10093 return false; 10092 10094 10093 10095 if (hdev->discovery.uuid_count != 0) { ··· 10105 10107 /* If duplicate filtering does not report RSSI changes, then restart 10106 10108 * scanning to ensure updated result with updated RSSI values. 10107 10109 */ 10108 - if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)) { 10110 + if (hci_test_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER)) { 10109 10111 /* Validate RSSI value against the RSSI threshold once more. */ 10110 10112 if (hdev->discovery.rssi != HCI_RSSI_INVALID && 10111 10113 rssi < hdev->discovery.rssi)
+1 -1
net/bluetooth/msft.c
··· 989 989 990 990 handle_data = msft_find_handle_data(hdev, ev->monitor_handle, false); 991 991 992 - if (!test_bit(HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, &hdev->quirks)) { 992 + if (!hci_test_quirk(hdev, HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER)) { 993 993 if (!handle_data) 994 994 return; 995 995 mgmt_handle = handle_data->mgmt_handle;