diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2010-07-27 08:36:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-27 23:35:42 -0400 |
commit | 6c719d00bd99113a4af417620d891aeba98b8d03 (patch) | |
tree | 37ea9444a060e0fae54219d890d980aca0fdba86 /drivers/net/bnx2x/bnx2x.h | |
parent | de0c62dba71389bcf3d9249d6e6edbc5a032c5ce (diff) |
bnx2x: Move statistics handling code to bnx2x_stats.*
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x.h')
-rw-r--r-- | drivers/net/bnx2x/bnx2x.h | 212 |
1 files changed, 4 insertions, 208 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index ed7058fe94cd..383e13ee1dbb 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #include "bnx2x_fw_defs.h" | 54 | #include "bnx2x_fw_defs.h" |
55 | #include "bnx2x_hsi.h" | 55 | #include "bnx2x_hsi.h" |
56 | #include "bnx2x_link.h" | 56 | #include "bnx2x_link.h" |
57 | #include "bnx2x_stats.h" | ||
57 | 58 | ||
58 | /* error/debug prints */ | 59 | /* error/debug prints */ |
59 | 60 | ||
@@ -111,6 +112,7 @@ do { \ | |||
111 | dev_info(&bp->pdev->dev, __fmt, ##__args); \ | 112 | dev_info(&bp->pdev->dev, __fmt, ##__args); \ |
112 | } while (0) | 113 | } while (0) |
113 | 114 | ||
115 | void bnx2x_panic_dump(struct bnx2x *bp); | ||
114 | 116 | ||
115 | #ifdef BNX2X_STOP_ON_ERROR | 117 | #ifdef BNX2X_STOP_ON_ERROR |
116 | #define bnx2x_panic() do { \ | 118 | #define bnx2x_panic() do { \ |
@@ -253,43 +255,6 @@ union db_prod { | |||
253 | #define NEXT_SGE_MASK_ELEM(el) (((el) + 1) & RX_SGE_MASK_LEN_MASK) | 255 | #define NEXT_SGE_MASK_ELEM(el) (((el) + 1) & RX_SGE_MASK_LEN_MASK) |
254 | 256 | ||
255 | 257 | ||
256 | struct bnx2x_eth_q_stats { | ||
257 | u32 total_bytes_received_hi; | ||
258 | u32 total_bytes_received_lo; | ||
259 | u32 total_bytes_transmitted_hi; | ||
260 | u32 total_bytes_transmitted_lo; | ||
261 | u32 total_unicast_packets_received_hi; | ||
262 | u32 total_unicast_packets_received_lo; | ||
263 | u32 total_multicast_packets_received_hi; | ||
264 | u32 total_multicast_packets_received_lo; | ||
265 | u32 total_broadcast_packets_received_hi; | ||
266 | u32 total_broadcast_packets_received_lo; | ||
267 | u32 total_unicast_packets_transmitted_hi; | ||
268 | u32 total_unicast_packets_transmitted_lo; | ||
269 | u32 total_multicast_packets_transmitted_hi; | ||
270 | u32 total_multicast_packets_transmitted_lo; | ||
271 | u32 total_broadcast_packets_transmitted_hi; | ||
272 | u32 total_broadcast_packets_transmitted_lo; | ||
273 | u32 valid_bytes_received_hi; | ||
274 | u32 valid_bytes_received_lo; | ||
275 | |||
276 | u32 error_bytes_received_hi; | ||
277 | u32 error_bytes_received_lo; | ||
278 | u32 etherstatsoverrsizepkts_hi; | ||
279 | u32 etherstatsoverrsizepkts_lo; | ||
280 | u32 no_buff_discard_hi; | ||
281 | u32 no_buff_discard_lo; | ||
282 | |||
283 | u32 driver_xoff; | ||
284 | u32 rx_err_discard_pkt; | ||
285 | u32 rx_skb_alloc_failed; | ||
286 | u32 hw_csum_err; | ||
287 | }; | ||
288 | |||
289 | #define BNX2X_NUM_Q_STATS 13 | ||
290 | #define Q_STATS_OFFSET32(stat_name) \ | ||
291 | (offsetof(struct bnx2x_eth_q_stats, stat_name) / 4) | ||
292 | |||
293 | struct bnx2x_fastpath { | 258 | struct bnx2x_fastpath { |
294 | 259 | ||
295 | struct napi_struct napi; | 260 | struct napi_struct napi; |
@@ -598,27 +563,6 @@ struct bnx2x_common { | |||
598 | 563 | ||
599 | /* port */ | 564 | /* port */ |
600 | 565 | ||
601 | struct nig_stats { | ||
602 | u32 brb_discard; | ||
603 | u32 brb_packet; | ||
604 | u32 brb_truncate; | ||
605 | u32 flow_ctrl_discard; | ||
606 | u32 flow_ctrl_octets; | ||
607 | u32 flow_ctrl_packet; | ||
608 | u32 mng_discard; | ||
609 | u32 mng_octet_inp; | ||
610 | u32 mng_octet_out; | ||
611 | u32 mng_packet_inp; | ||
612 | u32 mng_packet_out; | ||
613 | u32 pbf_octets; | ||
614 | u32 pbf_packet; | ||
615 | u32 safc_inp; | ||
616 | u32 egress_mac_pkt0_lo; | ||
617 | u32 egress_mac_pkt0_hi; | ||
618 | u32 egress_mac_pkt1_lo; | ||
619 | u32 egress_mac_pkt1_hi; | ||
620 | }; | ||
621 | |||
622 | struct bnx2x_port { | 566 | struct bnx2x_port { |
623 | u32 pmf; | 567 | u32 pmf; |
624 | 568 | ||
@@ -646,156 +590,6 @@ struct bnx2x_port { | |||
646 | /* end of port */ | 590 | /* end of port */ |
647 | 591 | ||
648 | 592 | ||
649 | enum bnx2x_stats_event { | ||
650 | STATS_EVENT_PMF = 0, | ||
651 | STATS_EVENT_LINK_UP, | ||
652 | STATS_EVENT_UPDATE, | ||
653 | STATS_EVENT_STOP, | ||
654 | STATS_EVENT_MAX | ||
655 | }; | ||
656 | |||
657 | enum bnx2x_stats_state { | ||
658 | STATS_STATE_DISABLED = 0, | ||
659 | STATS_STATE_ENABLED, | ||
660 | STATS_STATE_MAX | ||
661 | }; | ||
662 | |||
663 | struct bnx2x_eth_stats { | ||
664 | u32 total_bytes_received_hi; | ||
665 | u32 total_bytes_received_lo; | ||
666 | u32 total_bytes_transmitted_hi; | ||
667 | u32 total_bytes_transmitted_lo; | ||
668 | u32 total_unicast_packets_received_hi; | ||
669 | u32 total_unicast_packets_received_lo; | ||
670 | u32 total_multicast_packets_received_hi; | ||
671 | u32 total_multicast_packets_received_lo; | ||
672 | u32 total_broadcast_packets_received_hi; | ||
673 | u32 total_broadcast_packets_received_lo; | ||
674 | u32 total_unicast_packets_transmitted_hi; | ||
675 | u32 total_unicast_packets_transmitted_lo; | ||
676 | u32 total_multicast_packets_transmitted_hi; | ||
677 | u32 total_multicast_packets_transmitted_lo; | ||
678 | u32 total_broadcast_packets_transmitted_hi; | ||
679 | u32 total_broadcast_packets_transmitted_lo; | ||
680 | u32 valid_bytes_received_hi; | ||
681 | u32 valid_bytes_received_lo; | ||
682 | |||
683 | u32 error_bytes_received_hi; | ||
684 | u32 error_bytes_received_lo; | ||
685 | u32 etherstatsoverrsizepkts_hi; | ||
686 | u32 etherstatsoverrsizepkts_lo; | ||
687 | u32 no_buff_discard_hi; | ||
688 | u32 no_buff_discard_lo; | ||
689 | |||
690 | u32 rx_stat_ifhcinbadoctets_hi; | ||
691 | u32 rx_stat_ifhcinbadoctets_lo; | ||
692 | u32 tx_stat_ifhcoutbadoctets_hi; | ||
693 | u32 tx_stat_ifhcoutbadoctets_lo; | ||
694 | u32 rx_stat_dot3statsfcserrors_hi; | ||
695 | u32 rx_stat_dot3statsfcserrors_lo; | ||
696 | u32 rx_stat_dot3statsalignmenterrors_hi; | ||
697 | u32 rx_stat_dot3statsalignmenterrors_lo; | ||
698 | u32 rx_stat_dot3statscarriersenseerrors_hi; | ||
699 | u32 rx_stat_dot3statscarriersenseerrors_lo; | ||
700 | u32 rx_stat_falsecarriererrors_hi; | ||
701 | u32 rx_stat_falsecarriererrors_lo; | ||
702 | u32 rx_stat_etherstatsundersizepkts_hi; | ||
703 | u32 rx_stat_etherstatsundersizepkts_lo; | ||
704 | u32 rx_stat_dot3statsframestoolong_hi; | ||
705 | u32 rx_stat_dot3statsframestoolong_lo; | ||
706 | u32 rx_stat_etherstatsfragments_hi; | ||
707 | u32 rx_stat_etherstatsfragments_lo; | ||
708 | u32 rx_stat_etherstatsjabbers_hi; | ||
709 | u32 rx_stat_etherstatsjabbers_lo; | ||
710 | u32 rx_stat_maccontrolframesreceived_hi; | ||
711 | u32 rx_stat_maccontrolframesreceived_lo; | ||
712 | u32 rx_stat_bmac_xpf_hi; | ||
713 | u32 rx_stat_bmac_xpf_lo; | ||
714 | u32 rx_stat_bmac_xcf_hi; | ||
715 | u32 rx_stat_bmac_xcf_lo; | ||
716 | u32 rx_stat_xoffstateentered_hi; | ||
717 | u32 rx_stat_xoffstateentered_lo; | ||
718 | u32 rx_stat_xonpauseframesreceived_hi; | ||
719 | u32 rx_stat_xonpauseframesreceived_lo; | ||
720 | u32 rx_stat_xoffpauseframesreceived_hi; | ||
721 | u32 rx_stat_xoffpauseframesreceived_lo; | ||
722 | u32 tx_stat_outxonsent_hi; | ||
723 | u32 tx_stat_outxonsent_lo; | ||
724 | u32 tx_stat_outxoffsent_hi; | ||
725 | u32 tx_stat_outxoffsent_lo; | ||
726 | u32 tx_stat_flowcontroldone_hi; | ||
727 | u32 tx_stat_flowcontroldone_lo; | ||
728 | u32 tx_stat_etherstatscollisions_hi; | ||
729 | u32 tx_stat_etherstatscollisions_lo; | ||
730 | u32 tx_stat_dot3statssinglecollisionframes_hi; | ||
731 | u32 tx_stat_dot3statssinglecollisionframes_lo; | ||
732 | u32 tx_stat_dot3statsmultiplecollisionframes_hi; | ||
733 | u32 tx_stat_dot3statsmultiplecollisionframes_lo; | ||
734 | u32 tx_stat_dot3statsdeferredtransmissions_hi; | ||
735 | u32 tx_stat_dot3statsdeferredtransmissions_lo; | ||
736 | u32 tx_stat_dot3statsexcessivecollisions_hi; | ||
737 | u32 tx_stat_dot3statsexcessivecollisions_lo; | ||
738 | u32 tx_stat_dot3statslatecollisions_hi; | ||
739 | u32 tx_stat_dot3statslatecollisions_lo; | ||
740 | u32 tx_stat_etherstatspkts64octets_hi; | ||
741 | u32 tx_stat_etherstatspkts64octets_lo; | ||
742 | u32 tx_stat_etherstatspkts65octetsto127octets_hi; | ||
743 | u32 tx_stat_etherstatspkts65octetsto127octets_lo; | ||
744 | u32 tx_stat_etherstatspkts128octetsto255octets_hi; | ||
745 | u32 tx_stat_etherstatspkts128octetsto255octets_lo; | ||
746 | u32 tx_stat_etherstatspkts256octetsto511octets_hi; | ||
747 | u32 tx_stat_etherstatspkts256octetsto511octets_lo; | ||
748 | u32 tx_stat_etherstatspkts512octetsto1023octets_hi; | ||
749 | u32 tx_stat_etherstatspkts512octetsto1023octets_lo; | ||
750 | u32 tx_stat_etherstatspkts1024octetsto1522octets_hi; | ||
751 | u32 tx_stat_etherstatspkts1024octetsto1522octets_lo; | ||
752 | u32 tx_stat_etherstatspktsover1522octets_hi; | ||
753 | u32 tx_stat_etherstatspktsover1522octets_lo; | ||
754 | u32 tx_stat_bmac_2047_hi; | ||
755 | u32 tx_stat_bmac_2047_lo; | ||
756 | u32 tx_stat_bmac_4095_hi; | ||
757 | u32 tx_stat_bmac_4095_lo; | ||
758 | u32 tx_stat_bmac_9216_hi; | ||
759 | u32 tx_stat_bmac_9216_lo; | ||
760 | u32 tx_stat_bmac_16383_hi; | ||
761 | u32 tx_stat_bmac_16383_lo; | ||
762 | u32 tx_stat_dot3statsinternalmactransmiterrors_hi; | ||
763 | u32 tx_stat_dot3statsinternalmactransmiterrors_lo; | ||
764 | u32 tx_stat_bmac_ufl_hi; | ||
765 | u32 tx_stat_bmac_ufl_lo; | ||
766 | |||
767 | u32 pause_frames_received_hi; | ||
768 | u32 pause_frames_received_lo; | ||
769 | u32 pause_frames_sent_hi; | ||
770 | u32 pause_frames_sent_lo; | ||
771 | |||
772 | u32 etherstatspkts1024octetsto1522octets_hi; | ||
773 | u32 etherstatspkts1024octetsto1522octets_lo; | ||
774 | u32 etherstatspktsover1522octets_hi; | ||
775 | u32 etherstatspktsover1522octets_lo; | ||
776 | |||
777 | u32 brb_drop_hi; | ||
778 | u32 brb_drop_lo; | ||
779 | u32 brb_truncate_hi; | ||
780 | u32 brb_truncate_lo; | ||
781 | |||
782 | u32 mac_filter_discard; | ||
783 | u32 xxoverflow_discard; | ||
784 | u32 brb_truncate_discard; | ||
785 | u32 mac_discard; | ||
786 | |||
787 | u32 driver_xoff; | ||
788 | u32 rx_err_discard_pkt; | ||
789 | u32 rx_skb_alloc_failed; | ||
790 | u32 hw_csum_err; | ||
791 | |||
792 | u32 nig_timer_max; | ||
793 | }; | ||
794 | |||
795 | #define BNX2X_NUM_STATS 43 | ||
796 | #define STATS_OFFSET32(stat_name) \ | ||
797 | (offsetof(struct bnx2x_eth_stats, stat_name) / 4) | ||
798 | |||
799 | 593 | ||
800 | #ifdef BCM_CNIC | 594 | #ifdef BCM_CNIC |
801 | #define MAX_CONTEXT 15 | 595 | #define MAX_CONTEXT 15 |
@@ -1394,4 +1188,6 @@ BNX2X_EXTERN int load_count[3]; /* 0-common, 1-port0, 2-port1 */ | |||
1394 | 1188 | ||
1395 | extern void bnx2x_set_ethtool_ops(struct net_device *netdev); | 1189 | extern void bnx2x_set_ethtool_ops(struct net_device *netdev); |
1396 | 1190 | ||
1191 | void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx); | ||
1192 | |||
1397 | #endif /* bnx2x.h */ | 1193 | #endif /* bnx2x.h */ |