drivers/net/ethernet/spacemit/k1_emac.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/spacemit/k1_emac.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/spacemit/k1_emac.h
Extension
.h
Size
13514 bytes
Lines
417
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 emac_desc {
	u32 desc0;
	u32 desc1;
	u32 buffer_addr_1;
	u32 buffer_addr_2;
};

/* Keep stats in this order, index used for accessing hardware */

union emac_hw_tx_stats {
	struct individual_tx_stats {
		u64 tx_ok_pkts;
		u64 tx_total_pkts;
		u64 tx_ok_bytes;
		u64 tx_err_pkts;
		u64 tx_singleclsn_pkts;
		u64 tx_multiclsn_pkts;
		u64 tx_lateclsn_pkts;
		u64 tx_excessclsn_pkts;
		u64 tx_unicast_pkts;
		u64 tx_multicast_pkts;
		u64 tx_broadcast_pkts;
		u64 tx_pause_pkts;
	} stats;

	u64 array[sizeof(struct individual_tx_stats) / sizeof(u64)];
};

union emac_hw_rx_stats {
	struct individual_rx_stats {
		u64 rx_ok_pkts;
		u64 rx_total_pkts;
		u64 rx_crc_err_pkts;
		u64 rx_align_err_pkts;
		u64 rx_err_total_pkts;
		u64 rx_ok_bytes;
		u64 rx_total_bytes;
		u64 rx_unicast_pkts;
		u64 rx_multicast_pkts;
		u64 rx_broadcast_pkts;
		u64 rx_pause_pkts;
		u64 rx_len_err_pkts;
		u64 rx_len_undersize_pkts;
		u64 rx_len_oversize_pkts;
		u64 rx_len_fragment_pkts;
		u64 rx_len_jabber_pkts;
		u64 rx_64_pkts;
		u64 rx_65_127_pkts;
		u64 rx_128_255_pkts;
		u64 rx_256_511_pkts;
		u64 rx_512_1023_pkts;
		u64 rx_1024_1518_pkts;
		u64 rx_1519_plus_pkts;
		u64 rx_drp_fifo_full_pkts;
		u64 rx_truncate_fifo_full_pkts;
	} stats;

	u64 array[sizeof(struct individual_rx_stats) / sizeof(u64)];
};

#endif /* _K1_EMAC_H_ */

Annotation

Implementation Notes