1 #include <linux/ethtool.h> 2 3 #include "fbnic_csr.h" 4 5 struct fbnic_stat_counter { 6 u64 value; 7 union { 8 u32 old_reg_value_32; 9 u64 old_reg_value_64; 10 } u; 11 bool reported; 12 }; 13 14 struct fbnic_eth_mac_stats { 15 struct fbnic_stat_counter FramesTransmittedOK; 16 struct fbnic_stat_counter FramesReceivedOK; 17 struct fbnic_stat_counter FrameCheckSequenceErrors; 18 struct fbnic_stat_counter AlignmentErrors; 19 struct fbnic_stat_counter OctetsTransmittedOK; 20 struct fbnic_stat_counter FramesLostDueToIntMACXmitError; 21 struct fbnic_stat_counter OctetsReceivedOK; 22 struct fbnic_stat_counter FramesLostDueToIntMACRcvError; 23 struct fbnic_stat_counter MulticastFramesXmittedOK; 24 struct fbnic_stat_counter BroadcastFramesXmittedOK; 25 struct fbnic_stat_counter MulticastFramesReceivedOK; 26 struct fbnic_stat_counter BroadcastFramesReceivedOK; 27 struct fbnic_stat_counter FrameTooLongErrors; 28 }; 29 30 struct fbnic_mac_stats { 31 struct fbnic_eth_mac_stats eth_mac; 32 }; 33 34 struct fbnic_hw_stats { 35 struct fbnic_mac_stats mac; 36 }; 37 38 u64 fbnic_stat_rd64(struct fbnic_dev *fbd, u32 reg, u32 offset); 39 40 void fbnic_get_hw_stats(struct fbnic_dev *fbd); 41