drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c- Extension
.c- Size
- 29639 bytes
- Lines
- 1200
- Domain
- Driver Families
- Bucket
- drivers/net
- 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/firmware.hlinux/pci.hlinux/vmalloc.hlinux/delay.hlinux/interrupt.hlinux/sched.hlinux/completion.hlinux/crc32.hlinux/spinlock.hlinux/circ_buf.hlinux/log2.hpcie_priv.hpearl_pcie_regs.hpearl_pcie_ipc.hqtn_hw_ids.hcore.hbus.hshm_ipc.hdebug.h
Detected Declarations
struct qtnf_pearl_bdastruct qtnf_pearl_tx_bdstruct qtnf_pearl_rx_bdstruct qtnf_pearl_fw_hdrstruct qtnf_pcie_pearl_statefunction qtnf_init_hdp_irqsfunction qtnf_enable_hdp_irqsfunction qtnf_disable_hdp_irqsfunction qtnf_en_rxdone_irqfunction qtnf_dis_rxdone_irqfunction qtnf_en_txdone_irqfunction qtnf_dis_txdone_irqfunction qtnf_deassert_intxfunction qtnf_pearl_reset_epfunction qtnf_pcie_pearl_ipc_gen_ep_intfunction qtnf_is_statefunction qtnf_set_statefunction qtnf_clear_statefunction qtnf_poll_statefunction pearl_alloc_bd_tablefunction pearl_skb2rbd_attachfunction pearl_alloc_rx_buffersfunction qtnf_pearl_free_xfer_buffersfunction pearl_hhbm_initfunction qtnf_pcie_pearl_init_xferfunction qtnf_pearl_data_tx_reclaimfunction qtnf_tx_queue_readyfunction qtnf_pcie_skb_sendfunction qtnf_pcie_data_txfunction qtnf_pcie_data_tx_metafunction qtnf_pcie_pearl_interruptfunction qtnf_rx_data_readyfunction qtnf_pcie_pearl_rx_pollfunction qtnf_pcie_data_tx_timeoutfunction qtnf_pcie_data_rx_startfunction qtnf_pcie_data_rx_stopfunction qtnf_pearl_tx_use_meta_info_setfunction qtnf_dbg_irq_statsfunction qtnf_dbg_hdp_statsfunction qtnf_ep_fw_sendfunction qtnf_ep_fw_loadfunction qtnf_pearl_fw_work_handlerfunction qtnf_pearl_reclaim_tasklet_fnfunction qtnf_pearl_dma_mask_getfunction qtnf_pcie_pearl_probefunction qtnf_pcie_pearl_removefunction qtnf_pcie_pearl_suspendfunction qtnf_pcie_pearl_resume
Annotated Snippet
struct qtnf_pearl_bda {
__le16 bda_len;
__le16 bda_version;
__le32 bda_pci_endian;
__le32 bda_ep_state;
__le32 bda_rc_state;
__le32 bda_dma_mask;
__le32 bda_msi_addr;
__le32 bda_flashsz;
u8 bda_boardname[PCIE_BDA_NAMELEN];
__le32 bda_rc_msi_enabled;
u8 bda_hhbm_list[PCIE_HHBM_MAX_SIZE];
__le32 bda_dsbw_start_index;
__le32 bda_dsbw_end_index;
__le32 bda_dsbw_total_bytes;
__le32 bda_rc_tx_bd_base;
__le32 bda_rc_tx_bd_num;
u8 bda_pcie_mac[QTN_ENET_ADDR_LENGTH];
struct qtnf_shm_ipc_region bda_shm_reg1 __aligned(4096); /* host TX */
struct qtnf_shm_ipc_region bda_shm_reg2 __aligned(4096); /* host RX */
} __packed;
struct qtnf_pearl_tx_bd {
__le32 addr;
__le32 addr_h;
__le32 info;
__le32 info_h;
} __packed;
struct qtnf_pearl_rx_bd {
__le32 addr;
__le32 addr_h;
__le32 info;
__le32 info_h;
__le32 next_ptr;
__le32 next_ptr_h;
} __packed;
struct qtnf_pearl_fw_hdr {
u8 boardflg[8];
__le32 fwsize;
__le32 seqnum;
__le32 type;
__le32 pktlen;
__le32 crc;
} __packed;
struct qtnf_pcie_pearl_state {
struct qtnf_pcie_bus_priv base;
/* lock for irq configuration changes */
spinlock_t irq_lock;
struct qtnf_pearl_bda __iomem *bda;
void __iomem *pcie_reg_base;
struct qtnf_pearl_tx_bd *tx_bd_vbase;
dma_addr_t tx_bd_pbase;
struct qtnf_pearl_rx_bd *rx_bd_vbase;
dma_addr_t rx_bd_pbase;
dma_addr_t bd_table_paddr;
void *bd_table_vaddr;
u32 bd_table_len;
u32 pcie_irq_mask;
u32 pcie_irq_rx_count;
u32 pcie_irq_tx_count;
u32 pcie_irq_uf_count;
};
static inline void qtnf_init_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
{
unsigned long flags;
spin_lock_irqsave(&ps->irq_lock, flags);
ps->pcie_irq_mask = (PCIE_HDP_INT_RX_BITS | PCIE_HDP_INT_TX_BITS);
spin_unlock_irqrestore(&ps->irq_lock, flags);
}
static inline void qtnf_enable_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
{
unsigned long flags;
spin_lock_irqsave(&ps->irq_lock, flags);
writel(ps->pcie_irq_mask, PCIE_HDP_INT_EN(ps->pcie_reg_base));
spin_unlock_irqrestore(&ps->irq_lock, flags);
}
static inline void qtnf_disable_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/firmware.h`, `linux/pci.h`, `linux/vmalloc.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/sched.h`, `linux/completion.h`.
- Detected declarations: `struct qtnf_pearl_bda`, `struct qtnf_pearl_tx_bd`, `struct qtnf_pearl_rx_bd`, `struct qtnf_pearl_fw_hdr`, `struct qtnf_pcie_pearl_state`, `function qtnf_init_hdp_irqs`, `function qtnf_enable_hdp_irqs`, `function qtnf_disable_hdp_irqs`, `function qtnf_en_rxdone_irq`, `function qtnf_dis_rxdone_irq`.
- Atlas domain: Driver Families / drivers/net.
- 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.