drivers/net/ethernet/mscc/ocelot_fdma.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mscc/ocelot_fdma.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mscc/ocelot_fdma.h- Extension
.h- Size
- 5036 bytes
- Lines
- 167
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ocelot.h
Detected Declarations
struct ocelot_fdma_dcbstruct ocelot_fdma_tx_bufstruct ocelot_fdma_tx_ringstruct ocelot_fdma_rx_bufstruct ocelot_fdma_rx_ringstruct ocelot_fdma
Annotated Snippet
struct ocelot_fdma_dcb {
u32 llp;
u32 datap;
u32 datal;
u32 stat;
} __packed;
/**
* struct ocelot_fdma_tx_buf - TX buffer structure
* @skb: SKB currently used in the corresponding DCB.
* @dma_addr: SKB DMA mapped address.
*/
struct ocelot_fdma_tx_buf {
struct sk_buff *skb;
DEFINE_DMA_UNMAP_ADDR(dma_addr);
};
/**
* struct ocelot_fdma_tx_ring - TX ring description of DCBs
*
* @dcbs: DCBs allocated for the ring
* @dcbs_dma: DMA base address of the DCBs
* @bufs: List of TX buffer associated to the DCBs
* @xmit_lock: lock for concurrent xmit access
* @next_to_clean: Next DCB to be cleaned in tx_cleanup
* @next_to_use: Next available DCB to send SKB
*/
struct ocelot_fdma_tx_ring {
struct ocelot_fdma_dcb *dcbs;
dma_addr_t dcbs_dma;
struct ocelot_fdma_tx_buf bufs[OCELOT_FDMA_TX_RING_SIZE];
/* Protect concurrent xmit calls */
spinlock_t xmit_lock;
u16 next_to_clean;
u16 next_to_use;
};
/**
* struct ocelot_fdma_rx_buf - RX buffer structure
* @page: Struct page used in this buffer
* @page_offset: Current page offset (either 0 or PAGE_SIZE/2)
* @dma_addr: DMA address of the page
*/
struct ocelot_fdma_rx_buf {
struct page *page;
u32 page_offset;
dma_addr_t dma_addr;
};
/**
* struct ocelot_fdma_rx_ring - TX ring description of DCBs
*
* @dcbs: DCBs allocated for the ring
* @dcbs_dma: DMA base address of the DCBs
* @bufs: List of RX buffer associated to the DCBs
* @skb: SKB currently received by the netdev
* @next_to_clean: Next DCB to be cleaned NAPI polling
* @next_to_use: Next available DCB to send SKB
* @next_to_alloc: Next buffer that needs to be allocated (page reuse or alloc)
*/
struct ocelot_fdma_rx_ring {
struct ocelot_fdma_dcb *dcbs;
dma_addr_t dcbs_dma;
struct ocelot_fdma_rx_buf bufs[OCELOT_FDMA_RX_RING_SIZE];
struct sk_buff *skb;
u16 next_to_clean;
u16 next_to_use;
u16 next_to_alloc;
};
/**
* struct ocelot_fdma - FDMA context
*
* @irq: FDMA interrupt
* @ndev: Net device used to initialize NAPI
* @dcbs_base: Memory coherent DCBs
* @dcbs_dma_base: DMA base address of memory coherent DCBs
* @tx_ring: Injection ring
* @rx_ring: Extraction ring
* @napi: NAPI context
* @ocelot: Back-pointer to ocelot struct
*/
struct ocelot_fdma {
int irq;
struct net_device *ndev;
struct ocelot_fdma_dcb *dcbs_base;
dma_addr_t dcbs_dma_base;
struct ocelot_fdma_tx_ring tx_ring;
struct ocelot_fdma_rx_ring rx_ring;
struct napi_struct napi;
Annotation
- Immediate include surface: `ocelot.h`.
- Detected declarations: `struct ocelot_fdma_dcb`, `struct ocelot_fdma_tx_buf`, `struct ocelot_fdma_tx_ring`, `struct ocelot_fdma_rx_buf`, `struct ocelot_fdma_rx_ring`, `struct ocelot_fdma`.
- Atlas domain: Driver Families / drivers/net.
- 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.