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.

Dependency Surface

Detected Declarations

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

Implementation Notes