drivers/bluetooth/hci_mrvl.c
Source file repositories/reference/linux-study-clean/drivers/bluetooth/hci_mrvl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bluetooth/hci_mrvl.c- Extension
.c- Size
- 11810 bytes
- Lines
- 517
- 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.
- 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/tty.hlinux/of.hlinux/serdev.hnet/bluetooth/bluetooth.hnet/bluetooth/hci_core.hhci_uart.h
Detected Declarations
struct mrvl_datastruct mrvl_serdevstruct hci_mrvl_pktfunction mrvl_openfunction mrvl_closefunction mrvl_flushfunction mrvl_enqueuefunction mrvl_send_ackfunction mrvl_recv_fw_reqfunction mrvl_recv_chip_verfunction mrvl_recvfunction mrvl_load_firmwarefunction mrvl_setupfunction mrvl_set_baudratefunction mrvl_serdev_probefunction mrvl_serdev_removefunction mrvl_initfunction mrvl_deinit
Annotated Snippet
struct mrvl_data {
struct sk_buff *rx_skb;
struct sk_buff_head txq;
struct sk_buff_head rawq;
unsigned long flags;
unsigned int tx_len;
u8 id, rev;
};
struct mrvl_serdev {
struct hci_uart hu;
};
struct hci_mrvl_pkt {
__le16 lhs;
__le16 rhs;
} __packed;
#define HCI_MRVL_PKT_SIZE 4
static int mrvl_open(struct hci_uart *hu)
{
struct mrvl_data *mrvl;
int ret;
BT_DBG("hu %p", hu);
if (!hci_uart_has_flow_control(hu))
return -EOPNOTSUPP;
mrvl = kzalloc_obj(*mrvl);
if (!mrvl)
return -ENOMEM;
skb_queue_head_init(&mrvl->txq);
skb_queue_head_init(&mrvl->rawq);
set_bit(STATE_CHIP_VER_PENDING, &mrvl->flags);
hu->priv = mrvl;
if (hu->serdev) {
ret = serdev_device_open(hu->serdev);
if (ret)
goto err;
}
return 0;
err:
kfree(mrvl);
return ret;
}
static int mrvl_close(struct hci_uart *hu)
{
struct mrvl_data *mrvl = hu->priv;
BT_DBG("hu %p", hu);
if (hu->serdev)
serdev_device_close(hu->serdev);
skb_queue_purge(&mrvl->txq);
skb_queue_purge(&mrvl->rawq);
kfree_skb(mrvl->rx_skb);
kfree(mrvl);
hu->priv = NULL;
return 0;
}
static int mrvl_flush(struct hci_uart *hu)
{
struct mrvl_data *mrvl = hu->priv;
BT_DBG("hu %p", hu);
skb_queue_purge(&mrvl->txq);
skb_queue_purge(&mrvl->rawq);
return 0;
}
static struct sk_buff *mrvl_dequeue(struct hci_uart *hu)
{
struct mrvl_data *mrvl = hu->priv;
struct sk_buff *skb;
skb = skb_dequeue(&mrvl->txq);
if (!skb) {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/skbuff.h`, `linux/firmware.h`, `linux/module.h`, `linux/tty.h`, `linux/of.h`, `linux/serdev.h`.
- Detected declarations: `struct mrvl_data`, `struct mrvl_serdev`, `struct hci_mrvl_pkt`, `function mrvl_open`, `function mrvl_close`, `function mrvl_flush`, `function mrvl_enqueue`, `function mrvl_send_ack`, `function mrvl_recv_fw_req`, `function mrvl_recv_chip_ver`.
- Atlas domain: Driver Families / drivers/bluetooth.
- Implementation status: source 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.