drivers/bluetooth/btintel.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/btintel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/btintel.c- Extension
.c- Size
- 102794 bytes
- Lines
- 3882
- Domain
- Driver Families
- Bucket
- drivers/bluetooth
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/firmware.hlinux/regmap.hlinux/string_choices.hlinux/acpi.hacpi/acpi_bus.hlinux/unaligned.hlinux/efi.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hbtintel.h
Detected Declarations
struct cmd_write_boot_paramsstruct regmap_ibt_contextstruct ibt_cp_reg_accessstruct ibt_rp_reg_accessstruct btintel_dsbrstruct btintel_dsbr_cmdfunction Copyrightfunction btintel_check_bdaddrfunction btintel_enter_mfgfunction btintel_exit_mfgfunction btintel_set_bdaddrfunction btintel_set_event_maskfunction btintel_set_diagfunction btintel_set_diag_mfgfunction btintel_set_diag_combinedfunction btintel_hw_errorfunction btintel_version_infofunction btintel_secure_sendfunction btintel_load_ddc_configfunction Lengthfunction btintel_set_event_mask_mfgfunction btintel_read_versionfunction btintel_version_info_tlvfunction btintel_parse_version_tlvfunction btintel_read_version_tlvfunction regmap_ibt_readfunction regmap_ibt_gather_writefunction regmap_ibt_writefunction regmap_ibt_free_contextfunction btintel_send_intel_resetfunction btintel_read_boot_paramsfunction btintel_sfi_rsa_header_secure_sendfunction btintel_sfi_ecdsa_header_secure_sendfunction btintel_sfi_hybrid_header_secure_sendfunction btintel_download_firmware_payloadfunction btintel_firmware_versionfunction btintel_download_firmwarefunction btintel_download_fw_tlvfunction btintel_reset_to_bootloaderfunction btintel_read_debug_featuresfunction btintel_set_debug_featuresfunction btintel_reset_debug_featuresfunction btintel_set_quality_reportfunction btintel_coredumpfunction btintel_dmp_hdrfunction btintel_register_devcoredump_supportfunction btintel_legacy_rom_patchingfunction __hci_cmd_sync_ev
Annotated Snippet
struct cmd_write_boot_params {
__le32 boot_addr;
u8 fw_build_num;
u8 fw_build_ww;
u8 fw_build_yy;
} __packed;
static struct {
const char *driver_name;
u8 hw_variant;
u32 fw_build_num;
} coredump_info;
const guid_t btintel_guid_dsm =
GUID_INIT(0xaa10f4e0, 0x81ac, 0x4233,
0xab, 0xf6, 0x3b, 0x2a, 0xc5, 0x0e, 0x28, 0xd9);
EXPORT_SYMBOL_GPL(btintel_guid_dsm);
int btintel_check_bdaddr(struct hci_dev *hdev)
{
struct hci_rp_read_bd_addr *bda;
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL,
HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) {
int err = PTR_ERR(skb);
bt_dev_err(hdev, "Reading Intel device address failed (%d)",
err);
return err;
}
if (skb->len != sizeof(*bda)) {
bt_dev_err(hdev, "Intel device address length mismatch");
kfree_skb(skb);
return -EIO;
}
bda = (struct hci_rp_read_bd_addr *)skb->data;
/* For some Intel based controllers, the default Bluetooth device
* address 00:03:19:9E:8B:00 can be found. These controllers are
* fully operational, but have the danger of duplicate addresses
* and that in turn can cause problems with Bluetooth operation.
*/
if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) {
bt_dev_err(hdev, "Found Intel default device address (%pMR)",
&bda->bdaddr);
hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
}
kfree_skb(skb);
return 0;
}
EXPORT_SYMBOL_GPL(btintel_check_bdaddr);
int btintel_enter_mfg(struct hci_dev *hdev)
{
static const u8 param[] = { 0x01, 0x00 };
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT);
if (IS_ERR(skb)) {
bt_dev_err(hdev, "Entering manufacturer mode failed (%ld)",
PTR_ERR(skb));
return PTR_ERR(skb);
}
kfree_skb(skb);
return 0;
}
EXPORT_SYMBOL_GPL(btintel_enter_mfg);
int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched)
{
u8 param[] = { 0x00, 0x00 };
struct sk_buff *skb;
/* The 2nd command parameter specifies the manufacturing exit method:
* 0x00: Just disable the manufacturing mode (0x00).
* 0x01: Disable manufacturing mode and reset with patches deactivated.
* 0x02: Disable manufacturing mode and reset with patches activated.
*/
if (reset)
param[1] |= patched ? 0x02 : 0x01;
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT);
if (IS_ERR(skb)) {
bt_dev_err(hdev, "Exiting manufacturer mode failed (%ld)",
Annotation
- Immediate include surface: `linux/module.h`, `linux/firmware.h`, `linux/regmap.h`, `linux/string_choices.h`, `linux/acpi.h`, `acpi/acpi_bus.h`, `linux/unaligned.h`, `linux/efi.h`.
- Detected declarations: `struct cmd_write_boot_params`, `struct regmap_ibt_context`, `struct ibt_cp_reg_access`, `struct ibt_rp_reg_access`, `struct btintel_dsbr`, `struct btintel_dsbr_cmd`, `function Copyright`, `function btintel_check_bdaddr`, `function btintel_enter_mfg`, `function btintel_exit_mfg`.
- Atlas domain: Driver Families / drivers/bluetooth.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.