drivers/net/ethernet/tehuti/tn40.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/tehuti/tn40.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/tehuti/tn40.h- Extension
.h- Size
- 6384 bytes
- Lines
- 267
- 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
linux/property.htn40_regs.h
Detected Declarations
struct tn40_fifostruct tn40_txf_fifostruct tn40_txd_fifostruct tn40_rxf_fifostruct tn40_rxd_fifostruct tn40_rx_mapstruct tn40_rxdbstruct tn40_tx_mapstruct tn40_txdbstruct tn40_nodesstruct tn40_privstruct tn40_rxf_descstruct tn40_rxd_descstruct tn40_pblstruct tn40_txd_descstruct tn40_txf_descenum tn40_swnodesfunction tn40_read_regfunction tn40_write_reg
Annotated Snippet
struct tn40_fifo {
dma_addr_t da; /* Physical address of fifo (used by HW) */
char *va; /* Virtual address of fifo (used by SW) */
u32 rptr, wptr;
/* Cached values of RPTR and WPTR registers,
* they're 32 bits on both 32 and 64 archs.
*/
u16 reg_cfg0;
u16 reg_cfg1;
u16 reg_rptr;
u16 reg_wptr;
u16 memsz; /* Memory size allocated for fifo */
u16 size_mask;
u16 pktsz; /* Skb packet size to allocate */
u16 rcvno; /* Number of buffers that come from this RXF */
};
struct tn40_txf_fifo {
struct tn40_fifo m; /* The minimal set of variables used by all fifos */
};
struct tn40_txd_fifo {
struct tn40_fifo m; /* The minimal set of variables used by all fifos */
};
struct tn40_rxf_fifo {
struct tn40_fifo m; /* The minimal set of variables used by all fifos */
};
struct tn40_rxd_fifo {
struct tn40_fifo m; /* The minimal set of variables used by all fifos */
};
struct tn40_rx_map {
struct page *page;
};
struct tn40_rxdb {
unsigned int *stack;
struct tn40_rx_map *elems;
unsigned int nelem;
unsigned int top;
};
union tn40_tx_dma_addr {
dma_addr_t dma;
struct sk_buff *skb;
};
/* Entry in the db.
* if len == 0 addr is dma
* if len != 0 addr is skb
*/
struct tn40_tx_map {
union tn40_tx_dma_addr addr;
int len;
};
/* tx database - implemented as circular fifo buffer */
struct tn40_txdb {
struct tn40_tx_map *start; /* Points to the first element */
struct tn40_tx_map *end; /* Points just AFTER the last element */
struct tn40_tx_map *rptr; /* Points to the next element to read */
struct tn40_tx_map *wptr; /* Points to the next element to write */
int size; /* Number of elements in the db */
};
#define NODE_PROP(_NAME, _PROP) ( \
(const struct software_node) { \
.name = _NAME, \
.properties = _PROP, \
})
#define NODE_PAR_PROP(_NAME, _PAR, _PROP) ( \
(const struct software_node) { \
.name = _NAME, \
.parent = _PAR, \
.properties = _PROP, \
})
enum tn40_swnodes {
SWNODE_MDIO,
SWNODE_PHY,
SWNODE_MAX
};
struct tn40_nodes {
char phy_name[32];
char mdio_name[32];
struct property_entry phy_props[3];
Annotation
- Immediate include surface: `linux/property.h`, `tn40_regs.h`.
- Detected declarations: `struct tn40_fifo`, `struct tn40_txf_fifo`, `struct tn40_txd_fifo`, `struct tn40_rxf_fifo`, `struct tn40_rxd_fifo`, `struct tn40_rx_map`, `struct tn40_rxdb`, `struct tn40_tx_map`, `struct tn40_txdb`, `struct tn40_nodes`.
- 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.