drivers/dma/bestcomm/gen_bd.c
Source file repositories/reference/linux-study-clean/drivers/dma/bestcomm/gen_bd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/bestcomm/gen_bd.c- Extension
.c- Size
- 9425 bytes
- Lines
- 351
- Domain
- Driver Families
- Bucket
- drivers/dma
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/string.hlinux/types.hasm/errno.hasm/io.hasm/mpc52xx.hasm/mpc52xx_psc.hlinux/fsl/bestcomm/bestcomm.hlinux/fsl/bestcomm/bestcomm_priv.hlinux/fsl/bestcomm/gen_bd.h
Detected Declarations
struct bcom_gen_bd_rx_varstruct bcom_gen_bd_rx_incstruct bcom_gen_bd_tx_varstruct bcom_gen_bd_tx_incstruct bcom_gen_bd_privstruct pscfunction bcom_gen_bd_rx_initfunction bcom_gen_bd_rx_resetfunction bcom_gen_bd_rx_releasefunction bcom_gen_bd_tx_initfunction bcom_gen_bd_tx_resetfunction bcom_gen_bd_tx_releasefunction bcom_psc_gen_bd_rx_initfunction bcom_psc_gen_bd_tx_initexport bcom_gen_bd_rx_initexport bcom_gen_bd_rx_resetexport bcom_gen_bd_rx_releaseexport bcom_gen_bd_tx_initexport bcom_gen_bd_tx_resetexport bcom_gen_bd_tx_releaseexport bcom_psc_gen_bd_rx_initexport bcom_psc_gen_bd_tx_init
Annotated Snippet
struct bcom_gen_bd_rx_var {
u32 enable; /* (u16*) address of task's control register */
u32 fifo; /* (u32*) address of gen_bd's fifo */
u32 bd_base; /* (struct bcom_bd*) beginning of ring buffer */
u32 bd_last; /* (struct bcom_bd*) end of ring buffer */
u32 bd_start; /* (struct bcom_bd*) current bd */
u32 buffer_size; /* size of receive buffer */
};
/* rx task incs that need to be set before enabling the task */
struct bcom_gen_bd_rx_inc {
u16 pad0;
s16 incr_bytes;
u16 pad1;
s16 incr_dst;
};
/* tx task vars that need to be set before enabling the task */
struct bcom_gen_bd_tx_var {
u32 fifo; /* (u32*) address of gen_bd's fifo */
u32 enable; /* (u16*) address of task's control register */
u32 bd_base; /* (struct bcom_bd*) beginning of ring buffer */
u32 bd_last; /* (struct bcom_bd*) end of ring buffer */
u32 bd_start; /* (struct bcom_bd*) current bd */
u32 buffer_size; /* set by uCode for each packet */
};
/* tx task incs that need to be set before enabling the task */
struct bcom_gen_bd_tx_inc {
u16 pad0;
s16 incr_bytes;
u16 pad1;
s16 incr_src;
u16 pad2;
s16 incr_src_ma;
};
/* private structure */
struct bcom_gen_bd_priv {
phys_addr_t fifo;
int initiator;
int ipr;
int maxbufsize;
};
/* ======================================================================== */
/* Task support code */
/* ======================================================================== */
struct bcom_task *
bcom_gen_bd_rx_init(int queue_len, phys_addr_t fifo,
int initiator, int ipr, int maxbufsize)
{
struct bcom_task *tsk;
struct bcom_gen_bd_priv *priv;
tsk = bcom_task_alloc(queue_len, sizeof(struct bcom_gen_bd),
sizeof(struct bcom_gen_bd_priv));
if (!tsk)
return NULL;
tsk->flags = BCOM_FLAGS_NONE;
priv = tsk->priv;
priv->fifo = fifo;
priv->initiator = initiator;
priv->ipr = ipr;
priv->maxbufsize = maxbufsize;
if (bcom_gen_bd_rx_reset(tsk)) {
bcom_task_free(tsk);
return NULL;
}
return tsk;
}
EXPORT_SYMBOL_GPL(bcom_gen_bd_rx_init);
int
bcom_gen_bd_rx_reset(struct bcom_task *tsk)
{
struct bcom_gen_bd_priv *priv = tsk->priv;
struct bcom_gen_bd_rx_var *var;
struct bcom_gen_bd_rx_inc *inc;
/* Shutdown the task */
bcom_disable_task(tsk->tasknum);
/* Reset the microcode */
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/string.h`, `linux/types.h`, `asm/errno.h`, `asm/io.h`, `asm/mpc52xx.h`, `asm/mpc52xx_psc.h`.
- Detected declarations: `struct bcom_gen_bd_rx_var`, `struct bcom_gen_bd_rx_inc`, `struct bcom_gen_bd_tx_var`, `struct bcom_gen_bd_tx_inc`, `struct bcom_gen_bd_priv`, `struct psc`, `function bcom_gen_bd_rx_init`, `function bcom_gen_bd_rx_reset`, `function bcom_gen_bd_rx_release`, `function bcom_gen_bd_tx_init`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: integration 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.