drivers/bluetooth/hci_intel.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/hci_intel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/hci_intel.c- Extension
.c- Size
- 29986 bytes
- Lines
- 1225
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/errno.hlinux/skbuff.hlinux/firmware.hlinux/module.hlinux/wait.hlinux/tty.hlinux/platform_device.hlinux/gpio/consumer.hlinux/acpi.hlinux/interrupt.hlinux/pm_runtime.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hhci_uart.hbtintel.h
Detected Declarations
struct hci_lpm_pktstruct intel_devicestruct intel_datafunction intel_convert_speedfunction intel_wait_bootingfunction intel_wait_lpm_transactionfunction intel_lpm_suspendfunction intel_lpm_resumefunction intel_lpm_host_wakefunction intel_irqfunction intel_set_powerfunction list_for_each_entryfunction intel_busy_workfunction intel_openfunction intel_closefunction intel_flushfunction inject_cmd_completefunction intel_set_baudratefunction intel_setupfunction intel_recv_eventfunction intel_recv_lpm_notifyfunction intel_recv_lpmfunction intel_recvfunction intel_enqueuefunction intel_suspend_devicefunction intel_resume_devicefunction intel_suspendfunction intel_resumefunction intel_probefunction intel_removefunction intel_initfunction intel_deinit
Annotated Snippet
struct hci_lpm_pkt {
__u8 opcode;
__u8 dlen;
__u8 data[];
} __packed;
struct intel_device {
struct list_head list;
struct platform_device *pdev;
struct gpio_desc *reset;
struct hci_uart *hu;
struct mutex hu_lock;
int irq;
};
static LIST_HEAD(intel_device_list);
static DEFINE_MUTEX(intel_device_list_lock);
struct intel_data {
struct sk_buff *rx_skb;
struct sk_buff_head txq;
struct work_struct busy_work;
struct hci_uart *hu;
unsigned long flags;
};
static u8 intel_convert_speed(unsigned int speed)
{
switch (speed) {
case 9600:
return 0x00;
case 19200:
return 0x01;
case 38400:
return 0x02;
case 57600:
return 0x03;
case 115200:
return 0x04;
case 230400:
return 0x05;
case 460800:
return 0x06;
case 921600:
return 0x07;
case 1843200:
return 0x08;
case 3250000:
return 0x09;
case 2000000:
return 0x0a;
case 3000000:
return 0x0b;
default:
return 0xff;
}
}
static int intel_wait_booting(struct hci_uart *hu)
{
struct intel_data *intel = hu->priv;
int err;
err = wait_on_bit_timeout(&intel->flags, STATE_BOOTING,
TASK_INTERRUPTIBLE,
msecs_to_jiffies(1000));
if (err == -EINTR) {
bt_dev_err(hu->hdev, "Device boot interrupted");
return -EINTR;
}
if (err) {
bt_dev_err(hu->hdev, "Device boot timeout");
return -ETIMEDOUT;
}
return err;
}
static int intel_wait_lpm_transaction(struct hci_uart *hu)
{
struct intel_data *intel = hu->priv;
int err;
err = wait_on_bit_timeout(&intel->flags, STATE_LPM_TRANSACTION,
TASK_INTERRUPTIBLE,
msecs_to_jiffies(1000));
if (err == -EINTR) {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/skbuff.h`, `linux/firmware.h`, `linux/module.h`, `linux/wait.h`, `linux/tty.h`, `linux/platform_device.h`.
- Detected declarations: `struct hci_lpm_pkt`, `struct intel_device`, `struct intel_data`, `function intel_convert_speed`, `function intel_wait_booting`, `function intel_wait_lpm_transaction`, `function intel_lpm_suspend`, `function intel_lpm_resume`, `function intel_lpm_host_wake`, `function intel_irq`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.