drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c- Extension
.c- Size
- 43674 bytes
- Lines
- 1557
- 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.
- 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/slab.hlinux/delay.hlinux/pci.hnet/cfg80211.hnet/mac80211.hbrcmu_utils.haiutils.htypes.hmain.hdma.hsoc.hscb.hampdu.hdebug.hbrcms_trace_events.h
Detected Declarations
struct dma64descstruct dma_infofunction parity32function dma64_dd_parityfunction xxdfunction txdfunction rxdfunction nexttxdfunction prevtxdfunction nextrxdfunction ntxdactivefunction nrxdactivefunction _dma_ctrlflagsfunction _dma64_addrextfunction _dma_isaddrextfunction _dma_descriptor_alignfunction dma_align_sizetobitsfunction dma64_allocfunction _dma_allocfunction dma64_dd_updfunction dma_detachfunction _dma_ddtable_initfunction _dma_rxenablefunction dma_rxinitfunction dma_rxfunction skb_queue_walk_safefunction dma64_rxidlefunction dma64_txidlefunction dma_rxfillfunction dma_rxreclaimfunction dma_counterresetfunction dma_getvarfunction dma_txinitfunction dma_txsuspendfunction dma_txresumefunction dma_txsuspendedfunction dma_txreclaimfunction dma_txresetfunction dma_rxresetfunction dma_txenqfunction ampdu_finalizefunction prep_ampdu_framefunction dma_update_txavailfunction errorfunction dma_txpendingfunction dma_kick_txfunction txdfunction dma_walk_packets
Annotated Snippet
struct dma64desc {
__le32 ctrl1; /* misc control bits & bufcount */
__le32 ctrl2; /* buffer count and address extension */
__le32 addrlow; /* memory address of the date buffer, bits 31:0 */
__le32 addrhigh; /* memory address of the date buffer, bits 63:32 */
};
/* dma engine software state */
struct dma_info {
struct dma_pub dma; /* exported structure */
char name[MAXNAMEL]; /* callers name for diag msgs */
struct bcma_device *core;
struct device *dmadev;
/* session information for AMPDU */
struct brcms_ampdu_session ampdu_session;
bool dma64; /* this dma engine is operating in 64-bit mode */
bool addrext; /* this dma engine supports DmaExtendedAddrChanges */
/* 64-bit dma tx engine registers */
uint d64txregbase;
/* 64-bit dma rx engine registers */
uint d64rxregbase;
/* pointer to dma64 tx descriptor ring */
struct dma64desc *txd64;
/* pointer to dma64 rx descriptor ring */
struct dma64desc *rxd64;
u16 dmadesc_align; /* alignment requirement for dma descriptors */
u16 ntxd; /* # tx descriptors tunable */
u16 txin; /* index of next descriptor to reclaim */
u16 txout; /* index of next descriptor to post */
/* pointer to parallel array of pointers to packets */
struct sk_buff **txp;
/* Aligned physical address of descriptor ring */
dma_addr_t txdpa;
/* Original physical address of descriptor ring */
dma_addr_t txdpaorig;
u16 txdalign; /* #bytes added to alloc'd mem to align txd */
u32 txdalloc; /* #bytes allocated for the ring */
u32 xmtptrbase; /* When using unaligned descriptors, the ptr register
* is not just an index, it needs all 13 bits to be
* an offset from the addr register.
*/
u16 nrxd; /* # rx descriptors tunable */
u16 rxin; /* index of next descriptor to reclaim */
u16 rxout; /* index of next descriptor to post */
/* pointer to parallel array of pointers to packets */
struct sk_buff **rxp;
/* Aligned physical address of descriptor ring */
dma_addr_t rxdpa;
/* Original physical address of descriptor ring */
dma_addr_t rxdpaorig;
u16 rxdalign; /* #bytes added to alloc'd mem to align rxd */
u32 rxdalloc; /* #bytes allocated for the ring */
u32 rcvptrbase; /* Base for ptr reg when using unaligned descriptors */
/* tunables */
unsigned int rxbufsize; /* rx buffer size in bytes, not including
* the extra headroom
*/
uint rxextrahdrroom; /* extra rx headroom, reverseved to assist upper
* stack, e.g. some rx pkt buffers will be
* bridged to tx side without byte copying.
* The extra headroom needs to be large enough
* to fit txheader needs. Some dongle driver may
* not need it.
*/
uint nrxpost; /* # rx buffers to keep posted */
unsigned int rxoffset; /* rxcontrol offset */
/* add to get dma address of descriptor ring, low 32 bits */
uint ddoffsetlow;
/* high 32 bits */
uint ddoffsethigh;
/* add to get dma address of data buffer, low 32 bits */
uint dataoffsetlow;
/* high 32 bits */
uint dataoffsethigh;
/* descriptor base need to be aligned or not */
bool aligndesc_4k;
};
/* Check for odd number of 1's */
static u32 parity32(__le32 data)
{
/* no swap needed for counting 1's */
Annotation
- Immediate include surface: `linux/slab.h`, `linux/delay.h`, `linux/pci.h`, `net/cfg80211.h`, `net/mac80211.h`, `brcmu_utils.h`, `aiutils.h`, `types.h`.
- Detected declarations: `struct dma64desc`, `struct dma_info`, `function parity32`, `function dma64_dd_parity`, `function xxd`, `function txd`, `function rxd`, `function nexttxd`, `function prevtxd`, `function nextrxd`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.