diff options
Diffstat (limited to 'drivers/net/benet/be_cmds.h')
-rw-r--r-- | drivers/net/benet/be_cmds.h | 181 |
1 files changed, 158 insertions, 23 deletions
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 78256b65cb03..bcf816d76521 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -568,7 +568,7 @@ struct be_cmd_req_if_destroy { | |||
568 | }; | 568 | }; |
569 | 569 | ||
570 | /*************** HW Stats Get **********************************/ | 570 | /*************** HW Stats Get **********************************/ |
571 | struct be_port_rxf_stats { | 571 | struct be_port_rxf_stats_v0 { |
572 | u32 rx_bytes_lsd; /* dword 0*/ | 572 | u32 rx_bytes_lsd; /* dword 0*/ |
573 | u32 rx_bytes_msd; /* dword 1*/ | 573 | u32 rx_bytes_msd; /* dword 1*/ |
574 | u32 rx_total_frames; /* dword 2*/ | 574 | u32 rx_total_frames; /* dword 2*/ |
@@ -637,8 +637,8 @@ struct be_port_rxf_stats { | |||
637 | u32 rx_input_fifo_overflow; /* dword 65*/ | 637 | u32 rx_input_fifo_overflow; /* dword 65*/ |
638 | }; | 638 | }; |
639 | 639 | ||
640 | struct be_rxf_stats { | 640 | struct be_rxf_stats_v0 { |
641 | struct be_port_rxf_stats port[2]; | 641 | struct be_port_rxf_stats_v0 port[2]; |
642 | u32 rx_drops_no_pbuf; /* dword 132*/ | 642 | u32 rx_drops_no_pbuf; /* dword 132*/ |
643 | u32 rx_drops_no_txpb; /* dword 133*/ | 643 | u32 rx_drops_no_txpb; /* dword 133*/ |
644 | u32 rx_drops_no_erx_descr; /* dword 134*/ | 644 | u32 rx_drops_no_erx_descr; /* dword 134*/ |
@@ -661,34 +661,31 @@ struct be_rxf_stats { | |||
661 | u32 rsvd1[6]; | 661 | u32 rsvd1[6]; |
662 | }; | 662 | }; |
663 | 663 | ||
664 | struct be_erx_stats { | 664 | struct be_erx_stats_v0 { |
665 | u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/ | 665 | u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/ |
666 | u32 debug_wdma_sent_hold; /* dword 44*/ | 666 | u32 rsvd[4]; |
667 | u32 debug_wdma_pbfree_sent_hold; /* dword 45*/ | ||
668 | u32 debug_wdma_zerobyte_pbfree_sent_hold; /* dword 46*/ | ||
669 | u32 debug_pmem_pbuf_dealloc; /* dword 47*/ | ||
670 | }; | 667 | }; |
671 | 668 | ||
672 | struct be_pmem_stats { | 669 | struct be_pmem_stats { |
673 | u32 eth_red_drops; | 670 | u32 eth_red_drops; |
674 | u32 rsvd[4]; | 671 | u32 rsvd[5]; |
675 | }; | 672 | }; |
676 | 673 | ||
677 | struct be_hw_stats { | 674 | struct be_hw_stats_v0 { |
678 | struct be_rxf_stats rxf; | 675 | struct be_rxf_stats_v0 rxf; |
679 | u32 rsvd[48]; | 676 | u32 rsvd[48]; |
680 | struct be_erx_stats erx; | 677 | struct be_erx_stats_v0 erx; |
681 | struct be_pmem_stats pmem; | 678 | struct be_pmem_stats pmem; |
682 | }; | 679 | }; |
683 | 680 | ||
684 | struct be_cmd_req_get_stats { | 681 | struct be_cmd_req_get_stats_v0 { |
685 | struct be_cmd_req_hdr hdr; | 682 | struct be_cmd_req_hdr hdr; |
686 | u8 rsvd[sizeof(struct be_hw_stats)]; | 683 | u8 rsvd[sizeof(struct be_hw_stats_v0)]; |
687 | }; | 684 | }; |
688 | 685 | ||
689 | struct be_cmd_resp_get_stats { | 686 | struct be_cmd_resp_get_stats_v0 { |
690 | struct be_cmd_resp_hdr hdr; | 687 | struct be_cmd_resp_hdr hdr; |
691 | struct be_hw_stats hw_stats; | 688 | struct be_hw_stats_v0 hw_stats; |
692 | }; | 689 | }; |
693 | 690 | ||
694 | struct be_cmd_req_get_cntl_addnl_attribs { | 691 | struct be_cmd_req_get_cntl_addnl_attribs { |
@@ -728,13 +725,6 @@ struct be_cmd_req_mcast_mac_config { | |||
728 | struct macaddr mac[BE_MAX_MC]; | 725 | struct macaddr mac[BE_MAX_MC]; |
729 | } __packed; | 726 | } __packed; |
730 | 727 | ||
731 | static inline struct be_hw_stats * | ||
732 | hw_stats_from_cmd(struct be_cmd_resp_get_stats *cmd) | ||
733 | { | ||
734 | return &cmd->hw_stats; | ||
735 | } | ||
736 | |||
737 | |||
738 | /******************* RX FILTER ******************************/ | 728 | /******************* RX FILTER ******************************/ |
739 | struct be_cmd_req_rx_filter { | 729 | struct be_cmd_req_rx_filter { |
740 | struct be_cmd_req_hdr hdr; | 730 | struct be_cmd_req_hdr hdr; |
@@ -1087,6 +1077,151 @@ struct be_cmd_resp_set_func_cap { | |||
1087 | u8 rsvd[212]; | 1077 | u8 rsvd[212]; |
1088 | }; | 1078 | }; |
1089 | 1079 | ||
1080 | /*************** HW Stats Get v1 **********************************/ | ||
1081 | #define BE_TXP_SW_SZ 48 | ||
1082 | struct be_port_rxf_stats_v1 { | ||
1083 | u32 rsvd0[12]; | ||
1084 | u32 rx_crc_errors; | ||
1085 | u32 rx_alignment_symbol_errors; | ||
1086 | u32 rx_pause_frames; | ||
1087 | u32 rx_priority_pause_frames; | ||
1088 | u32 rx_control_frames; | ||
1089 | u32 rx_in_range_errors; | ||
1090 | u32 rx_out_range_errors; | ||
1091 | u32 rx_frame_too_long; | ||
1092 | u32 rx_address_match_errors; | ||
1093 | u32 rx_dropped_too_small; | ||
1094 | u32 rx_dropped_too_short; | ||
1095 | u32 rx_dropped_header_too_small; | ||
1096 | u32 rx_dropped_tcp_length; | ||
1097 | u32 rx_dropped_runt; | ||
1098 | u32 rsvd1[10]; | ||
1099 | u32 rx_ip_checksum_errs; | ||
1100 | u32 rx_tcp_checksum_errs; | ||
1101 | u32 rx_udp_checksum_errs; | ||
1102 | u32 rsvd2[7]; | ||
1103 | u32 rx_switched_unicast_packets; | ||
1104 | u32 rx_switched_multicast_packets; | ||
1105 | u32 rx_switched_broadcast_packets; | ||
1106 | u32 rsvd3[3]; | ||
1107 | u32 tx_pauseframes; | ||
1108 | u32 tx_priority_pauseframes; | ||
1109 | u32 tx_controlframes; | ||
1110 | u32 rsvd4[10]; | ||
1111 | u32 rxpp_fifo_overflow_drop; | ||
1112 | u32 rx_input_fifo_overflow_drop; | ||
1113 | u32 pmem_fifo_overflow_drop; | ||
1114 | u32 jabber_events; | ||
1115 | u32 rsvd5[3]; | ||
1116 | }; | ||
1117 | |||
1118 | |||
1119 | struct be_rxf_stats_v1 { | ||
1120 | struct be_port_rxf_stats_v1 port[4]; | ||
1121 | u32 rsvd0[2]; | ||
1122 | u32 rx_drops_no_pbuf; | ||
1123 | u32 rx_drops_no_txpb; | ||
1124 | u32 rx_drops_no_erx_descr; | ||
1125 | u32 rx_drops_no_tpre_descr; | ||
1126 | u32 rsvd1[6]; | ||
1127 | u32 rx_drops_too_many_frags; | ||
1128 | u32 rx_drops_invalid_ring; | ||
1129 | u32 forwarded_packets; | ||
1130 | u32 rx_drops_mtu; | ||
1131 | u32 rsvd2[14]; | ||
1132 | }; | ||
1133 | |||
1134 | struct be_erx_stats_v1 { | ||
1135 | u32 rx_drops_no_fragments[68]; /* dwordS 0 to 67*/ | ||
1136 | u32 rsvd[4]; | ||
1137 | }; | ||
1138 | |||
1139 | struct be_hw_stats_v1 { | ||
1140 | struct be_rxf_stats_v1 rxf; | ||
1141 | u32 rsvd0[BE_TXP_SW_SZ]; | ||
1142 | struct be_erx_stats_v1 erx; | ||
1143 | struct be_pmem_stats pmem; | ||
1144 | u32 rsvd1[3]; | ||
1145 | }; | ||
1146 | |||
1147 | struct be_cmd_req_get_stats_v1 { | ||
1148 | struct be_cmd_req_hdr hdr; | ||
1149 | u8 rsvd[sizeof(struct be_hw_stats_v1)]; | ||
1150 | }; | ||
1151 | |||
1152 | struct be_cmd_resp_get_stats_v1 { | ||
1153 | struct be_cmd_resp_hdr hdr; | ||
1154 | struct be_hw_stats_v1 hw_stats; | ||
1155 | }; | ||
1156 | |||
1157 | static inline void * | ||
1158 | hw_stats_from_cmd(struct be_adapter *adapter) | ||
1159 | { | ||
1160 | if (adapter->generation == BE_GEN3) { | ||
1161 | struct be_cmd_resp_get_stats_v1 *cmd = adapter->stats_cmd.va; | ||
1162 | |||
1163 | return &cmd->hw_stats; | ||
1164 | } else { | ||
1165 | struct be_cmd_resp_get_stats_v0 *cmd = adapter->stats_cmd.va; | ||
1166 | |||
1167 | return &cmd->hw_stats; | ||
1168 | } | ||
1169 | } | ||
1170 | |||
1171 | static inline void *be_port_rxf_stats_from_cmd(struct be_adapter *adapter) | ||
1172 | { | ||
1173 | if (adapter->generation == BE_GEN3) { | ||
1174 | struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter); | ||
1175 | struct be_rxf_stats_v1 *rxf_stats = &hw_stats->rxf; | ||
1176 | |||
1177 | return &rxf_stats->port[adapter->port_num]; | ||
1178 | } else { | ||
1179 | struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter); | ||
1180 | struct be_rxf_stats_v0 *rxf_stats = &hw_stats->rxf; | ||
1181 | |||
1182 | return &rxf_stats->port[adapter->port_num]; | ||
1183 | } | ||
1184 | } | ||
1185 | |||
1186 | static inline void *be_rxf_stats_from_cmd(struct be_adapter *adapter) | ||
1187 | { | ||
1188 | if (adapter->generation == BE_GEN3) { | ||
1189 | struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter); | ||
1190 | |||
1191 | return &hw_stats->rxf; | ||
1192 | } else { | ||
1193 | struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter); | ||
1194 | |||
1195 | return &hw_stats->rxf; | ||
1196 | } | ||
1197 | } | ||
1198 | |||
1199 | static inline void *be_erx_stats_from_cmd(struct be_adapter *adapter) | ||
1200 | { | ||
1201 | if (adapter->generation == BE_GEN3) { | ||
1202 | struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter); | ||
1203 | |||
1204 | return &hw_stats->erx; | ||
1205 | } else { | ||
1206 | struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter); | ||
1207 | |||
1208 | return &hw_stats->erx; | ||
1209 | } | ||
1210 | } | ||
1211 | |||
1212 | static inline void *be_pmem_stats_from_cmd(struct be_adapter *adapter) | ||
1213 | { | ||
1214 | if (adapter->generation == BE_GEN3) { | ||
1215 | struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter); | ||
1216 | |||
1217 | return &hw_stats->pmem; | ||
1218 | } else { | ||
1219 | struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter); | ||
1220 | |||
1221 | return &hw_stats->pmem; | ||
1222 | } | ||
1223 | } | ||
1224 | |||
1090 | extern int be_pci_fnum_get(struct be_adapter *adapter); | 1225 | extern int be_pci_fnum_get(struct be_adapter *adapter); |
1091 | extern int be_cmd_POST(struct be_adapter *adapter); | 1226 | extern int be_cmd_POST(struct be_adapter *adapter); |
1092 | extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | 1227 | extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, |