drivers/net/ethernet/ti/netcp.h

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/ti/netcp.h
Extension
.h
Size
7011 bytes
Lines
252
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 netcp_tx_pipe {
	struct netcp_device	*netcp_device;
	void			*dma_queue;
	unsigned int		dma_queue_id;
	/* To port for packet forwarded to switch. Used only by ethss */
	u8			switch_to_port;
#define	SWITCH_TO_PORT_IN_TAGINFO	BIT(0)
	u8			flags;
	void			*dma_channel;
	const char		*dma_chan_name;
};

#define ADDR_NEW			BIT(0)
#define ADDR_VALID			BIT(1)

enum netcp_addr_type {
	ADDR_ANY,
	ADDR_DEV,
	ADDR_UCAST,
	ADDR_MCAST,
	ADDR_BCAST
};

struct netcp_addr {
	struct netcp_intf	*netcp;
	unsigned char		addr[ETH_ALEN];
	enum netcp_addr_type	type;
	unsigned int		flags;
	struct list_head	node;
};

struct netcp_stats {
	struct u64_stats_sync   syncp_rx ____cacheline_aligned_in_smp;
	u64_stats_t             rx_packets;
	u64_stats_t             rx_bytes;
	u32                     rx_errors;
	u32                     rx_dropped;

	struct u64_stats_sync   syncp_tx ____cacheline_aligned_in_smp;
	u64_stats_t             tx_packets;
	u64_stats_t             tx_bytes;
	u32                     tx_errors;
	u32                     tx_dropped;
};

struct netcp_intf {
	struct device		*dev;
	struct device		*ndev_dev;
	struct net_device	*ndev;
	bool			big_endian;
	unsigned int		tx_compl_qid;
	void			*tx_pool;
	struct list_head	txhook_list_head;
	unsigned int		tx_pause_threshold;
	void			*tx_compl_q;

	unsigned int		tx_resume_threshold;
	void			*rx_queue;
	void			*rx_pool;
	struct list_head	rxhook_list_head;
	unsigned int		rx_queue_id;
	void			*rx_fdq[KNAV_DMA_FDQ_PER_CHAN];
	struct napi_struct	rx_napi;
	struct napi_struct	tx_napi;
#define ETH_SW_CAN_REMOVE_ETH_FCS	BIT(0)
	u32			hw_cap;

	/* 64-bit netcp stats */
	struct netcp_stats	stats;

	void			*rx_channel;
	const char		*dma_chan_name;
	u32			rx_pool_size;
	u32			rx_pool_region_id;
	u32			tx_pool_size;
	u32			tx_pool_region_id;
	struct list_head	module_head;
	struct list_head	interface_list;
	struct list_head	addr_list;
	bool			netdev_registered;
	bool			primary_module_attached;

	/* Lock used for protecting Rx/Tx hook list management */
	spinlock_t		lock;
	struct netcp_device	*netcp_device;
	struct device_node	*node_interface;

	/* DMA configuration data */
	u32			msg_enable;
	u32			rx_queue_depths[KNAV_DMA_FDQ_PER_CHAN];

Annotation

Implementation Notes