drivers/net/ethernet/ti/icssg/icssg_prueth.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/icssg/icssg_prueth.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/ti/icssg/icssg_prueth.h
Extension
.h
Size
16408 bytes
Lines
528
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 prueth_tx_chn {
	struct device *dma_dev;
	struct napi_struct napi_tx;
	struct k3_cppi_desc_pool *desc_pool;
	struct k3_udma_glue_tx_channel *tx_chn;
	struct prueth_emac *emac;
	u32 id;
	u32 descs_num;
	unsigned int irq;
	char name[32];
	struct hrtimer tx_hrtimer;
	unsigned long tx_pace_timeout_ns;
	struct xsk_buff_pool *xsk_pool;
	bool irq_disabled;
};

struct prueth_rx_chn {
	struct device *dev;
	struct device *dma_dev;
	struct k3_cppi_desc_pool *desc_pool;
	struct k3_udma_glue_rx_channel *rx_chn;
	u32 descs_num;
	unsigned int irq[ICSSG_MAX_RFLOWS];	/* separate irq per flow */
	char name[32];
	struct page_pool *pg_pool;
	struct xdp_rxq_info xdp_rxq;
	struct xsk_buff_pool *xsk_pool;
	bool irq_disabled;
};

enum prueth_swdata_type {
	PRUETH_SWDATA_INVALID = 0,
	PRUETH_SWDATA_SKB,
	PRUETH_SWDATA_PAGE,
	PRUETH_SWDATA_CMD,
	PRUETH_SWDATA_XDPF,
	PRUETH_SWDATA_XSK,
};

enum prueth_tx_buff_type {
	PRUETH_TX_BUFF_TYPE_XDP_TX,
	PRUETH_TX_BUFF_TYPE_XDP_NDO,
};

struct prueth_swdata {
	enum prueth_swdata_type type;
	union prueth_data {
		struct sk_buff *skb;
		struct page *page;
		u32 cmd;
		struct xdp_frame *xdpf;
		struct xdp_buff *xdp;
	} data;
};

/* There are 4 Tx DMA channels, but the highest priority is CH3 (thread 3)
 * and lower three are lower priority channels or threads.
 */
#define PRUETH_MAX_TX_QUEUES	4

#define PRUETH_MAX_TX_TS_REQUESTS	50 /* Max simultaneous TX_TS requests */

/* XDP BPF state */
#define ICSSG_XDP_PASS           0
#define ICSSG_XDP_CONSUMED       BIT(0)
#define ICSSG_XDP_TX             BIT(1)
#define ICSSG_XDP_REDIR          BIT(2)

/* Minimum coalesce time in usecs for both Tx and Rx */
#define ICSSG_MIN_COALESCE_USECS 20

/* data for each emac port */
struct prueth_emac {
	bool is_sr1;
	struct prueth *prueth;
	struct net_device *ndev;
	u8 mac_addr[6];
	struct napi_struct napi_rx;
	u32 msg_enable;

	int link;
	int speed;
	int duplex;

	const char *phy_id;
	struct device_node *phy_node;
	phy_interface_t phy_if;
	enum prueth_port port_id;
	struct icss_iep *iep;
	unsigned int rx_ts_enabled : 1;

Annotation

Implementation Notes