drivers/bluetooth/hci_qca.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/hci_qca.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/hci_qca.c- Extension
.c- Size
- 72621 bytes
- Lines
- 2843
- Domain
- Driver Families
- Bucket
- drivers/bluetooth
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kernel.hlinux/clk.hlinux/completion.hlinux/debugfs.hlinux/delay.hlinux/devcoredump.hlinux/device.hlinux/gpio/consumer.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/acpi.hlinux/platform_device.hlinux/pwrseq/consumer.hlinux/regulator/consumer.hlinux/serdev.hlinux/string_choices.hlinux/mutex.hlinux/unaligned.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hhci_uart.hbtqca.h
Detected Declarations
struct qca_memdump_infostruct qca_memdump_event_hdrstruct qca_dump_sizestruct qca_datastruct qca_vregstruct qca_device_datastruct qca_powerstruct qca_serdevenum qca_flagsenum qca_capabilitiesenum tx_ibs_statesenum rx_statesenum hci_ibs_clock_state_voteenum qca_memdump_statesenum qca_speed_typefunction qca_soc_typefunction __serial_clock_onfunction send_hci_ibs_cmdfunction qca_wq_awake_devicefunction qca_wq_awake_rxfunction qca_wq_serial_rx_clock_vote_offfunction qca_wq_serial_tx_clock_vote_offfunction hci_ibs_tx_idle_timeoutfunction hci_ibs_wake_retrans_timeoutfunction qca_controller_memdump_timeoutfunction qca_openfunction qca_debugfs_initfunction qca_flushfunction qca_closefunction device_want_to_wakeupfunction device_want_to_sleepfunction device_woke_upfunction qca_enqueuefunction test_bitfunction qca_ibs_sleep_indfunction qca_ibs_wake_indfunction qca_ibs_wake_ackfunction qca_recv_acl_datafunction qca_dmp_hdrfunction qca_controller_memdumpfunction qca_controller_memdump_eventfunction qca_recv_eventfunction qca_recvfunction qca_get_baudrate_valuefunction qca_set_baudratefunction host_set_baudratefunction qca_send_power_pulsefunction qca_get_speed
Annotated Snippet
struct qca_memdump_info {
u32 current_seq_no;
u32 received_dump;
u32 ram_dump_size;
};
struct qca_memdump_event_hdr {
__u8 evt;
__u8 plen;
__u16 opcode;
__le16 seq_no;
__u8 reserved;
} __packed;
struct qca_dump_size {
__le32 dump_size;
} __packed;
struct qca_data {
struct hci_uart *hu;
struct sk_buff *rx_skb;
struct sk_buff_head txq;
struct sk_buff_head tx_wait_q; /* HCI_IBS wait queue */
struct sk_buff_head rx_memdump_q; /* Memdump wait queue */
spinlock_t hci_ibs_lock; /* HCI_IBS state lock */
u8 tx_ibs_state; /* HCI_IBS transmit side power state*/
u8 rx_ibs_state; /* HCI_IBS receive side power state */
bool tx_vote; /* Clock must be on for TX */
bool rx_vote; /* Clock must be on for RX */
struct timer_list tx_idle_timer;
u32 tx_idle_delay;
struct timer_list wake_retrans_timer;
u32 wake_retrans;
struct workqueue_struct *workqueue;
struct work_struct ws_awake_rx;
struct work_struct ws_awake_device;
struct work_struct ws_rx_vote_off;
struct work_struct ws_tx_vote_off;
struct work_struct ctrl_memdump_evt;
struct delayed_work ctrl_memdump_timeout;
struct qca_memdump_info *qca_memdump;
unsigned long flags;
struct completion drop_ev_comp;
wait_queue_head_t suspend_wait_q;
enum qca_memdump_states memdump_state;
struct mutex hci_memdump_lock;
u16 fw_version;
u16 controller_id;
/* For debugging purpose */
u64 ibs_sent_wacks;
u64 ibs_sent_slps;
u64 ibs_sent_wakes;
u64 ibs_recv_wacks;
u64 ibs_recv_slps;
u64 ibs_recv_wakes;
u64 vote_last_jif;
u32 vote_on_ms;
u32 vote_off_ms;
u64 tx_votes_on;
u64 rx_votes_on;
u64 tx_votes_off;
u64 rx_votes_off;
u64 votes_on;
u64 votes_off;
};
enum qca_speed_type {
QCA_INIT_SPEED = 1,
QCA_OPER_SPEED
};
/*
* Voltage regulator information required for configuring the
* QCA Bluetooth chipset
*/
struct qca_vreg {
const char *name;
unsigned int load_uA;
};
struct qca_device_data {
enum qca_btsoc_type soc_type;
struct qca_vreg *vregs;
size_t num_vregs;
uint32_t capabilities;
};
/*
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/clk.h`, `linux/completion.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/devcoredump.h`, `linux/device.h`, `linux/gpio/consumer.h`.
- Detected declarations: `struct qca_memdump_info`, `struct qca_memdump_event_hdr`, `struct qca_dump_size`, `struct qca_data`, `struct qca_vreg`, `struct qca_device_data`, `struct qca_power`, `struct qca_serdev`, `enum qca_flags`, `enum qca_capabilities`.
- Atlas domain: Driver Families / drivers/bluetooth.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.