diff options
author | Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> | 2012-04-26 06:31:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-27 00:03:35 -0400 |
commit | 54a8997c6a0266a91a287b5dcb05da394ac0e42a (patch) | |
tree | 1c30d77d7df803bbe4eb8e219a400fcb8638386b /drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |
parent | b43e5ee76a4320c070cf0fe65cf4927198fbb4d1 (diff) |
qlcnic: Adding mac statistics to ethtool.
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index f419965f3a6d..a7e2f7453b90 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -607,6 +607,7 @@ struct qlcnic_recv_context { | |||
607 | #define QLCNIC_CDRP_CMD_CONFIG_PORT 0x0000002E | 607 | #define QLCNIC_CDRP_CMD_CONFIG_PORT 0x0000002E |
608 | #define QLCNIC_CDRP_CMD_TEMP_SIZE 0x0000002f | 608 | #define QLCNIC_CDRP_CMD_TEMP_SIZE 0x0000002f |
609 | #define QLCNIC_CDRP_CMD_GET_TEMP_HDR 0x00000030 | 609 | #define QLCNIC_CDRP_CMD_GET_TEMP_HDR 0x00000030 |
610 | #define QLCNIC_CDRP_CMD_GET_MAC_STATS 0x00000037 | ||
610 | 611 | ||
611 | #define QLCNIC_RCODE_SUCCESS 0 | 612 | #define QLCNIC_RCODE_SUCCESS 0 |
612 | #define QLCNIC_RCODE_NOT_SUPPORTED 9 | 613 | #define QLCNIC_RCODE_NOT_SUPPORTED 9 |
@@ -1180,18 +1181,62 @@ struct qlcnic_esw_func_cfg { | |||
1180 | #define QLCNIC_STATS_ESWITCH 2 | 1181 | #define QLCNIC_STATS_ESWITCH 2 |
1181 | #define QLCNIC_QUERY_RX_COUNTER 0 | 1182 | #define QLCNIC_QUERY_RX_COUNTER 0 |
1182 | #define QLCNIC_QUERY_TX_COUNTER 1 | 1183 | #define QLCNIC_QUERY_TX_COUNTER 1 |
1183 | #define QLCNIC_ESW_STATS_NOT_AVAIL 0xffffffffffffffffULL | 1184 | #define QLCNIC_STATS_NOT_AVAIL 0xffffffffffffffffULL |
1185 | #define QLCNIC_FILL_STATS(VAL1) \ | ||
1186 | (((VAL1) == QLCNIC_STATS_NOT_AVAIL) ? 0 : VAL1) | ||
1187 | #define QLCNIC_MAC_STATS 1 | ||
1188 | #define QLCNIC_ESW_STATS 2 | ||
1184 | 1189 | ||
1185 | #define QLCNIC_ADD_ESW_STATS(VAL1, VAL2)\ | 1190 | #define QLCNIC_ADD_ESW_STATS(VAL1, VAL2)\ |
1186 | do { \ | 1191 | do { \ |
1187 | if (((VAL1) == QLCNIC_ESW_STATS_NOT_AVAIL) && \ | 1192 | if (((VAL1) == QLCNIC_STATS_NOT_AVAIL) && \ |
1188 | ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ | 1193 | ((VAL2) != QLCNIC_STATS_NOT_AVAIL)) \ |
1189 | (VAL1) = (VAL2); \ | 1194 | (VAL1) = (VAL2); \ |
1190 | else if (((VAL1) != QLCNIC_ESW_STATS_NOT_AVAIL) && \ | 1195 | else if (((VAL1) != QLCNIC_STATS_NOT_AVAIL) && \ |
1191 | ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \ | 1196 | ((VAL2) != QLCNIC_STATS_NOT_AVAIL)) \ |
1192 | (VAL1) += (VAL2); \ | 1197 | (VAL1) += (VAL2); \ |
1193 | } while (0) | 1198 | } while (0) |
1194 | 1199 | ||
1200 | struct qlcnic_mac_statistics{ | ||
1201 | __le64 mac_tx_frames; | ||
1202 | __le64 mac_tx_bytes; | ||
1203 | __le64 mac_tx_mcast_pkts; | ||
1204 | __le64 mac_tx_bcast_pkts; | ||
1205 | __le64 mac_tx_pause_cnt; | ||
1206 | __le64 mac_tx_ctrl_pkt; | ||
1207 | __le64 mac_tx_lt_64b_pkts; | ||
1208 | __le64 mac_tx_lt_127b_pkts; | ||
1209 | __le64 mac_tx_lt_255b_pkts; | ||
1210 | __le64 mac_tx_lt_511b_pkts; | ||
1211 | __le64 mac_tx_lt_1023b_pkts; | ||
1212 | __le64 mac_tx_lt_1518b_pkts; | ||
1213 | __le64 mac_tx_gt_1518b_pkts; | ||
1214 | __le64 rsvd1[3]; | ||
1215 | |||
1216 | __le64 mac_rx_frames; | ||
1217 | __le64 mac_rx_bytes; | ||
1218 | __le64 mac_rx_mcast_pkts; | ||
1219 | __le64 mac_rx_bcast_pkts; | ||
1220 | __le64 mac_rx_pause_cnt; | ||
1221 | __le64 mac_rx_ctrl_pkt; | ||
1222 | __le64 mac_rx_lt_64b_pkts; | ||
1223 | __le64 mac_rx_lt_127b_pkts; | ||
1224 | __le64 mac_rx_lt_255b_pkts; | ||
1225 | __le64 mac_rx_lt_511b_pkts; | ||
1226 | __le64 mac_rx_lt_1023b_pkts; | ||
1227 | __le64 mac_rx_lt_1518b_pkts; | ||
1228 | __le64 mac_rx_gt_1518b_pkts; | ||
1229 | __le64 rsvd2[3]; | ||
1230 | |||
1231 | __le64 mac_rx_length_error; | ||
1232 | __le64 mac_rx_length_small; | ||
1233 | __le64 mac_rx_length_large; | ||
1234 | __le64 mac_rx_jabber; | ||
1235 | __le64 mac_rx_dropped; | ||
1236 | __le64 mac_rx_crc_error; | ||
1237 | __le64 mac_align_error; | ||
1238 | } __packed; | ||
1239 | |||
1195 | struct __qlcnic_esw_statistics { | 1240 | struct __qlcnic_esw_statistics { |
1196 | __le16 context_id; | 1241 | __le16 context_id; |
1197 | __le16 version; | 1242 | __le16 version; |
@@ -1512,6 +1557,7 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *, const u8, const u8, | |||
1512 | int qlcnic_get_eswitch_stats(struct qlcnic_adapter *, const u8, u8, | 1557 | int qlcnic_get_eswitch_stats(struct qlcnic_adapter *, const u8, u8, |
1513 | struct __qlcnic_esw_statistics *); | 1558 | struct __qlcnic_esw_statistics *); |
1514 | int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, u8, u8, u8); | 1559 | int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, u8, u8, u8); |
1560 | int qlcnic_get_mac_stats(struct qlcnic_adapter *, struct qlcnic_mac_statistics *); | ||
1515 | extern int qlcnic_config_tso; | 1561 | extern int qlcnic_config_tso; |
1516 | 1562 | ||
1517 | /* | 1563 | /* |