phyport_defs.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved.
  4. *
  5. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License (GPL) Version 2 as
  9. * published by the Free Software Foundation
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. */
  16. #ifndef __PHYPORT_DEFS_H__
  17. #define __PHYPORT_DEFS_H__
  18. #define BNA_TXF_ID_MAX 64
  19. #define BNA_RXF_ID_MAX 64
  20. /*
  21. * Statistics
  22. */
  23. /*
  24. * TxF Frame Statistics
  25. */
  26. struct bna_stats_txf {
  27. u64 ucast_octets;
  28. u64 ucast;
  29. u64 ucast_vlan;
  30. u64 mcast_octets;
  31. u64 mcast;
  32. u64 mcast_vlan;
  33. u64 bcast_octets;
  34. u64 bcast;
  35. u64 bcast_vlan;
  36. u64 errors;
  37. u64 filter_vlan; /* frames filtered due to VLAN */
  38. u64 filter_mac_sa; /* frames filtered due to SA check */
  39. };
  40. /*
  41. * RxF Frame Statistics
  42. */
  43. struct bna_stats_rxf {
  44. u64 ucast_octets;
  45. u64 ucast;
  46. u64 ucast_vlan;
  47. u64 mcast_octets;
  48. u64 mcast;
  49. u64 mcast_vlan;
  50. u64 bcast_octets;
  51. u64 bcast;
  52. u64 bcast_vlan;
  53. u64 frame_drops;
  54. };
  55. /*
  56. * FC Tx Frame Statistics
  57. */
  58. struct bna_stats_fc_tx {
  59. u64 txf_ucast_octets;
  60. u64 txf_ucast;
  61. u64 txf_ucast_vlan;
  62. u64 txf_mcast_octets;
  63. u64 txf_mcast;
  64. u64 txf_mcast_vlan;
  65. u64 txf_bcast_octets;
  66. u64 txf_bcast;
  67. u64 txf_bcast_vlan;
  68. u64 txf_parity_errors;
  69. u64 txf_timeout;
  70. u64 txf_fid_parity_errors;
  71. };
  72. /*
  73. * FC Rx Frame Statistics
  74. */
  75. struct bna_stats_fc_rx {
  76. u64 rxf_ucast_octets;
  77. u64 rxf_ucast;
  78. u64 rxf_ucast_vlan;
  79. u64 rxf_mcast_octets;
  80. u64 rxf_mcast;
  81. u64 rxf_mcast_vlan;
  82. u64 rxf_bcast_octets;
  83. u64 rxf_bcast;
  84. u64 rxf_bcast_vlan;
  85. };
  86. /*
  87. * RAD Frame Statistics
  88. */
  89. struct cna_stats_rad {
  90. u64 rx_frames;
  91. u64 rx_octets;
  92. u64 rx_vlan_frames;
  93. u64 rx_ucast;
  94. u64 rx_ucast_octets;
  95. u64 rx_ucast_vlan;
  96. u64 rx_mcast;
  97. u64 rx_mcast_octets;
  98. u64 rx_mcast_vlan;
  99. u64 rx_bcast;
  100. u64 rx_bcast_octets;
  101. u64 rx_bcast_vlan;
  102. u64 rx_drops;
  103. };
  104. /*
  105. * BPC Tx Registers
  106. */
  107. struct cna_stats_bpc_tx {
  108. u64 tx_pause[8];
  109. u64 tx_zero_pause[8]; /* Pause cancellation */
  110. u64 tx_first_pause[8]; /* Pause initiation rather
  111. *than retention */
  112. };
  113. /*
  114. * BPC Rx Registers
  115. */
  116. struct cna_stats_bpc_rx {
  117. u64 rx_pause[8];
  118. u64 rx_zero_pause[8]; /* Pause cancellation */
  119. u64 rx_first_pause[8]; /* Pause initiation rather
  120. *than retention */
  121. };
  122. /*
  123. * MAC Rx Statistics
  124. */
  125. struct cna_stats_mac_rx {
  126. u64 frame_64; /* both rx and tx counter */
  127. u64 frame_65_127; /* both rx and tx counter */
  128. u64 frame_128_255; /* both rx and tx counter */
  129. u64 frame_256_511; /* both rx and tx counter */
  130. u64 frame_512_1023; /* both rx and tx counter */
  131. u64 frame_1024_1518; /* both rx and tx counter */
  132. u64 frame_1518_1522; /* both rx and tx counter */
  133. u64 rx_bytes;
  134. u64 rx_packets;
  135. u64 rx_fcs_error;
  136. u64 rx_multicast;
  137. u64 rx_broadcast;
  138. u64 rx_control_frames;
  139. u64 rx_pause;
  140. u64 rx_unknown_opcode;
  141. u64 rx_alignment_error;
  142. u64 rx_frame_length_error;
  143. u64 rx_code_error;
  144. u64 rx_carrier_sense_error;
  145. u64 rx_undersize;
  146. u64 rx_oversize;
  147. u64 rx_fragments;
  148. u64 rx_jabber;
  149. u64 rx_drop;
  150. };
  151. /*
  152. * MAC Tx Statistics
  153. */
  154. struct cna_stats_mac_tx {
  155. u64 tx_bytes;
  156. u64 tx_packets;
  157. u64 tx_multicast;
  158. u64 tx_broadcast;
  159. u64 tx_pause;
  160. u64 tx_deferral;
  161. u64 tx_excessive_deferral;
  162. u64 tx_single_collision;
  163. u64 tx_muliple_collision;
  164. u64 tx_late_collision;
  165. u64 tx_excessive_collision;
  166. u64 tx_total_collision;
  167. u64 tx_pause_honored;
  168. u64 tx_drop;
  169. u64 tx_jabber;
  170. u64 tx_fcs_error;
  171. u64 tx_control_frame;
  172. u64 tx_oversize;
  173. u64 tx_undersize;
  174. u64 tx_fragments;
  175. };
  176. /*
  177. * Complete statistics
  178. */
  179. struct bna_stats {
  180. struct cna_stats_mac_rx mac_rx_stats;
  181. struct cna_stats_bpc_rx bpc_rx_stats;
  182. struct cna_stats_rad rad_stats;
  183. struct bna_stats_fc_rx fc_rx_stats;
  184. struct cna_stats_mac_tx mac_tx_stats;
  185. struct cna_stats_bpc_tx bpc_tx_stats;
  186. struct bna_stats_fc_tx fc_tx_stats;
  187. struct bna_stats_rxf rxf_stats[BNA_TXF_ID_MAX];
  188. struct bna_stats_txf txf_stats[BNA_RXF_ID_MAX];
  189. };
  190. #endif