drivers/net/ethernet/microsoft/mana/mana_ethtool.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microsoft/mana/mana_ethtool.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/microsoft/mana/mana_ethtool.c
Extension
.c
Size
21270 bytes
Lines
618
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 mana_stats_desc {
	char name[ETH_GSTRING_LEN];
	u16 offset;
};

static const struct mana_stats_desc mana_eth_stats[] = {
	{"stop_queue", offsetof(struct mana_ethtool_stats, stop_queue)},
	{"wake_queue", offsetof(struct mana_ethtool_stats, wake_queue)},
	{"tx_cq_err", offsetof(struct mana_ethtool_stats, tx_cqe_err)},
	{"tx_cqe_unknown_type", offsetof(struct mana_ethtool_stats,
					tx_cqe_unknown_type)},
	{"tx_linear_pkt_cnt", offsetof(struct mana_ethtool_stats,
				       tx_linear_pkt_cnt)},
	{"rx_cqe_unknown_type", offsetof(struct mana_ethtool_stats,
					rx_cqe_unknown_type)},
};

static const struct mana_stats_desc mana_hc_stats[] = {
	{"hc_rx_discards_no_wqe", offsetof(struct mana_ethtool_hc_stats,
					   hc_rx_discards_no_wqe)},
	{"hc_rx_err_vport_disabled", offsetof(struct mana_ethtool_hc_stats,
					      hc_rx_err_vport_disabled)},
	{"hc_rx_bytes", offsetof(struct mana_ethtool_hc_stats, hc_rx_bytes)},
	{"hc_rx_ucast_pkts", offsetof(struct mana_ethtool_hc_stats,
				      hc_rx_ucast_pkts)},
	{"hc_rx_ucast_bytes", offsetof(struct mana_ethtool_hc_stats,
				       hc_rx_ucast_bytes)},
	{"hc_rx_bcast_pkts", offsetof(struct mana_ethtool_hc_stats,
				      hc_rx_bcast_pkts)},
	{"hc_rx_bcast_bytes", offsetof(struct mana_ethtool_hc_stats,
				       hc_rx_bcast_bytes)},
	{"hc_rx_mcast_pkts", offsetof(struct mana_ethtool_hc_stats,
				      hc_rx_mcast_pkts)},
	{"hc_rx_mcast_bytes", offsetof(struct mana_ethtool_hc_stats,
				       hc_rx_mcast_bytes)},
	{"hc_tx_err_gf_disabled", offsetof(struct mana_ethtool_hc_stats,
					   hc_tx_err_gf_disabled)},
	{"hc_tx_err_vport_disabled", offsetof(struct mana_ethtool_hc_stats,
					      hc_tx_err_vport_disabled)},
	{"hc_tx_err_inval_vportoffset_pkt",
	 offsetof(struct mana_ethtool_hc_stats,
		  hc_tx_err_inval_vportoffset_pkt)},
	{"hc_tx_err_vlan_enforcement", offsetof(struct mana_ethtool_hc_stats,
						hc_tx_err_vlan_enforcement)},
	{"hc_tx_err_eth_type_enforcement",
	 offsetof(struct mana_ethtool_hc_stats, hc_tx_err_eth_type_enforcement)},
	{"hc_tx_err_sa_enforcement", offsetof(struct mana_ethtool_hc_stats,
					      hc_tx_err_sa_enforcement)},
	{"hc_tx_err_sqpdid_enforcement",
	 offsetof(struct mana_ethtool_hc_stats, hc_tx_err_sqpdid_enforcement)},
	{"hc_tx_err_cqpdid_enforcement",
	 offsetof(struct mana_ethtool_hc_stats, hc_tx_err_cqpdid_enforcement)},
	{"hc_tx_err_mtu_violation", offsetof(struct mana_ethtool_hc_stats,
					     hc_tx_err_mtu_violation)},
	{"hc_tx_err_inval_oob", offsetof(struct mana_ethtool_hc_stats,
					 hc_tx_err_inval_oob)},
	{"hc_tx_err_gdma", offsetof(struct mana_ethtool_hc_stats,
				    hc_tx_err_gdma)},
	{"hc_tx_bytes", offsetof(struct mana_ethtool_hc_stats, hc_tx_bytes)},
	{"hc_tx_ucast_pkts", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_ucast_pkts)},
	{"hc_tx_ucast_bytes", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_ucast_bytes)},
	{"hc_tx_bcast_pkts", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_bcast_pkts)},
	{"hc_tx_bcast_bytes", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_bcast_bytes)},
	{"hc_tx_mcast_pkts", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_mcast_pkts)},
	{"hc_tx_mcast_bytes", offsetof(struct mana_ethtool_hc_stats,
					hc_tx_mcast_bytes)},
};

static const struct mana_stats_desc mana_phy_stats[] = {
	{ "hc_rx_pkt_drop_phy", offsetof(struct mana_ethtool_phy_stats, rx_pkt_drop_phy) },
	{ "hc_tx_pkt_drop_phy", offsetof(struct mana_ethtool_phy_stats, tx_pkt_drop_phy) },
	{ "hc_tc0_rx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, rx_pkt_tc0_phy) },
	{ "hc_tc0_rx_byte_phy", offsetof(struct mana_ethtool_phy_stats, rx_byte_tc0_phy) },
	{ "hc_tc0_tx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, tx_pkt_tc0_phy) },
	{ "hc_tc0_tx_byte_phy", offsetof(struct mana_ethtool_phy_stats, tx_byte_tc0_phy) },
	{ "hc_tc1_rx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, rx_pkt_tc1_phy) },
	{ "hc_tc1_rx_byte_phy", offsetof(struct mana_ethtool_phy_stats, rx_byte_tc1_phy) },
	{ "hc_tc1_tx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, tx_pkt_tc1_phy) },
	{ "hc_tc1_tx_byte_phy", offsetof(struct mana_ethtool_phy_stats, tx_byte_tc1_phy) },
	{ "hc_tc2_rx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, rx_pkt_tc2_phy) },
	{ "hc_tc2_rx_byte_phy", offsetof(struct mana_ethtool_phy_stats, rx_byte_tc2_phy) },
	{ "hc_tc2_tx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, tx_pkt_tc2_phy) },
	{ "hc_tc2_tx_byte_phy", offsetof(struct mana_ethtool_phy_stats, tx_byte_tc2_phy) },
	{ "hc_tc3_rx_pkt_phy", offsetof(struct mana_ethtool_phy_stats, rx_pkt_tc3_phy) },
	{ "hc_tc3_rx_byte_phy", offsetof(struct mana_ethtool_phy_stats, rx_byte_tc3_phy) },

Annotation

Implementation Notes