drivers/bluetooth/btbcm.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/btbcm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/btbcm.c- Extension
.c- Size
- 19153 bytes
- Lines
- 783
- 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/efi.hlinux/module.hlinux/firmware.hlinux/dmi.hlinux/of.hlinux/string.hlinux/unaligned.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hbtbcm.h
Detected Declarations
struct bcm_subver_tablefunction Copyrightfunction btbcm_set_bdaddr_from_efifunction btbcm_set_bdaddr_from_efifunction btbcm_check_bdaddrfunction btbcm_set_bdaddrfunction btbcm_read_pcm_int_paramsfunction btbcm_write_pcm_int_paramsfunction btbcm_patchramfunction btbcm_resetfunction btbcm_read_infofunction btbcm_print_controller_featuresfunction btbcm_print_local_namefunction btbcm_initializefunction btbcm_finalizefunction btbcm_setup_patchramfunction btbcm_setup_appleexport btbcm_check_bdaddrexport btbcm_set_bdaddrexport btbcm_read_pcm_int_paramsexport btbcm_write_pcm_int_paramsexport btbcm_patchramexport btbcm_initializeexport btbcm_finalizeexport btbcm_setup_patchramexport btbcm_setup_apple
Annotated Snippet
struct bcm_subver_table {
u16 subver;
const char *name;
};
static const struct bcm_subver_table bcm_uart_subver_table[] = {
{ 0x1111, "BCM4362A2" }, /* 000.017.017 */
{ 0x4103, "BCM4330B1" }, /* 002.001.003 */
{ 0x410d, "BCM4334B0" }, /* 002.001.013 */
{ 0x410e, "BCM43341B0" }, /* 002.001.014 */
{ 0x4204, "BCM2076B1" }, /* 002.002.004 */
{ 0x4406, "BCM4324B3" }, /* 002.004.006 */
{ 0x4606, "BCM4324B5" }, /* 002.006.006 */
{ 0x6109, "BCM4335C0" }, /* 003.001.009 */
{ 0x610c, "BCM4354" }, /* 003.001.012 */
{ 0x2122, "BCM4343A0" }, /* 001.001.034 */
{ 0x2209, "BCM43430A1" }, /* 001.002.009 */
{ 0x6119, "BCM4345C0" }, /* 003.001.025 */
{ 0x6606, "BCM4345C5" }, /* 003.006.006 */
{ 0x230f, "BCM4356A2" }, /* 001.003.015 */
{ 0x2310, "BCM4343A2" }, /* 001.003.016 */
{ 0x220e, "BCM20702A1" }, /* 001.002.014 */
{ 0x420d, "BCM4349B1" }, /* 002.002.013 */
{ 0x420e, "BCM4349B1" }, /* 002.002.014 */
{ 0x4217, "BCM4329B1" }, /* 002.002.023 */
{ 0x6106, "BCM4359C0" }, /* 003.001.006 */
{ 0x4106, "BCM4335A0" }, /* 002.001.006 */
{ 0x410c, "BCM43430B0" }, /* 002.001.012 */
{ 0x2119, "BCM4373A0" }, /* 001.001.025 */
{ }
};
static const struct bcm_subver_table bcm_usb_subver_table[] = {
{ 0x2105, "BCM20703A1" }, /* 001.001.005 */
{ 0x210b, "BCM43142A0" }, /* 001.001.011 */
{ 0x2112, "BCM4314A0" }, /* 001.001.018 */
{ 0x2118, "BCM20702A0" }, /* 001.001.024 */
{ 0x2126, "BCM4335A0" }, /* 001.001.038 */
{ 0x220e, "BCM20702A1" }, /* 001.002.014 */
{ 0x230f, "BCM4356A2" }, /* 001.003.015 */
{ 0x4106, "BCM4335B0" }, /* 002.001.006 */
{ 0x410e, "BCM20702B0" }, /* 002.001.014 */
{ 0x6109, "BCM4335C0" }, /* 003.001.009 */
{ 0x610c, "BCM4354" }, /* 003.001.012 */
{ 0x6607, "BCM4350C5" }, /* 003.006.007 */
{ }
};
/*
* This currently only looks up the device tree board appendix,
* but can be expanded to other mechanisms.
*/
static const char *btbcm_get_board_name(struct device *dev)
{
#ifdef CONFIG_OF
struct device_node *root __free(device_node) = of_find_node_by_path("/");
char *board_type;
const char *tmp;
if (!root)
return NULL;
if (of_property_read_string_index(root, "compatible", 0, &tmp))
return NULL;
/* get rid of any '/' in the compatible string */
board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
if (!board_type)
return NULL;
strreplace(board_type, '/', '-');
return board_type;
#else
return NULL;
#endif
}
int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
{
u16 subver, rev, pid, vid;
struct sk_buff *skb;
struct hci_rp_read_local_version *ver;
const struct bcm_subver_table *bcm_subver_table;
const char *hw_name = NULL;
const char *board_name;
char postfix[16] = "";
int fw_name_count = 0;
bcm_fw_name *fw_name;
const struct firmware *fw;
Annotation
- Immediate include surface: `linux/efi.h`, `linux/module.h`, `linux/firmware.h`, `linux/dmi.h`, `linux/of.h`, `linux/string.h`, `linux/unaligned.h`, `net/bluetooth/bluetooth.h`.
- Detected declarations: `struct bcm_subver_table`, `function Copyright`, `function btbcm_set_bdaddr_from_efi`, `function btbcm_set_bdaddr_from_efi`, `function btbcm_check_bdaddr`, `function btbcm_set_bdaddr`, `function btbcm_read_pcm_int_params`, `function btbcm_write_pcm_int_params`, `function btbcm_patchram`, `function btbcm_reset`.
- 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.