qdf_net_stats.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: qdf_net_stats_public API
  20. * This file defines the net dev stats abstraction.
  21. */
  22. #if !defined(__QDF_NET_STATS_H)
  23. #define __QDF_NET_STATS_H
  24. #include <qdf_types.h>
  25. #include <i_qdf_net_stats.h>
  26. #include <qdf_net_types.h>
  27. /**
  28. * qdf_net_stats_add_rx_pkts() - Add RX pkts in n/w stats
  29. * @stats: Network stats instance
  30. * @value: Value to be added
  31. *
  32. * Return: None.
  33. */
  34. static inline
  35. void qdf_net_stats_add_rx_pkts(qdf_net_dev_stats *stats, uint32_t value)
  36. {
  37. __qdf_net_stats_add_rx_pkts(stats, value);
  38. }
  39. /**
  40. * qdf_net_stats_get_rx_pkts() - Get RX pkts in net stats
  41. * @stats: Network stats instance
  42. *
  43. * Return: Rx packets received on N/W interface
  44. */
  45. static inline
  46. unsigned long qdf_net_stats_get_rx_pkts(qdf_net_dev_stats *stats)
  47. {
  48. return __qdf_net_stats_get_rx_pkts(stats);
  49. }
  50. /**
  51. * qdf_net_stats_add_rx_bytes() - Add RX bytes in n/w stats
  52. * @stats: Network stats instance
  53. * @value: Value to be added
  54. *
  55. * Return: None.
  56. */
  57. static inline
  58. void qdf_net_stats_add_rx_bytes(qdf_net_dev_stats *stats, uint32_t value)
  59. {
  60. __qdf_net_stats_add_rx_bytes(stats, value);
  61. }
  62. /**
  63. * qdf_net_stats_get_rx_bytes() - Get RX bytes in net stats
  64. * @stats: Network stats instance
  65. *
  66. * Return: Rx bytes received on N/W interface
  67. */
  68. static inline
  69. unsigned long qdf_net_stats_get_rx_bytes(qdf_net_dev_stats *stats)
  70. {
  71. return __qdf_net_stats_get_rx_bytes(stats);
  72. }
  73. /**
  74. * qdf_net_stats_inc_rx_errors() - inc RX errors n/w stats
  75. * @stats: Network stats instance
  76. *
  77. * Return: None.
  78. */
  79. static inline
  80. void qdf_net_stats_inc_rx_errors(qdf_net_dev_stats *stats)
  81. {
  82. __qdf_net_stats_inc_rx_errors(stats);
  83. }
  84. /**
  85. * qdf_net_stats_get_rx_errors() - Get RX errors in net stats
  86. * @stats: Network stats instance
  87. *
  88. * Return: Rx packet errors on N/W interface
  89. */
  90. static inline
  91. unsigned long qdf_net_stats_get_rx_errors(qdf_net_dev_stats *stats)
  92. {
  93. return __qdf_net_stats_get_rx_errors(stats);
  94. }
  95. /**
  96. * qdf_net_stats_inc_rx_dropped() - inc RX dropped n/w stats
  97. * @stats: Network stats instance
  98. *
  99. * Return: None.
  100. */
  101. static inline
  102. void qdf_net_stats_inc_rx_dropped(qdf_net_dev_stats *stats)
  103. {
  104. __qdf_net_stats_inc_rx_dropped(stats);
  105. }
  106. /**
  107. * qdf_net_stats_get_rx_dropped() - Get RX dropped in net stats
  108. * @stats: Network stats instance
  109. *
  110. * Return: Rx packet dropped on N/W interface
  111. */
  112. static inline
  113. unsigned long qdf_net_stats_get_rx_dropped(qdf_net_dev_stats *stats)
  114. {
  115. return __qdf_net_stats_get_rx_dropped(stats);
  116. }
  117. /**
  118. * qdf_net_stats_add_tx_pkts() - Add Tx packets in n/w stats
  119. * @stats: Network stats instance
  120. * @value: Value to be added
  121. *
  122. * Return: None.
  123. */
  124. static inline
  125. void qdf_net_stats_add_tx_pkts(qdf_net_dev_stats *stats, uint32_t value)
  126. {
  127. __qdf_net_stats_add_tx_pkts(stats, value);
  128. }
  129. /**
  130. * qdf_net_stats_get_tx_pkts() - Get Tx packets in net stats
  131. * @stats: Network stats instance
  132. *
  133. * Return: Tx packets transmitted on N/W interface
  134. */
  135. static inline
  136. unsigned long qdf_net_stats_get_tx_pkts(qdf_net_dev_stats *stats)
  137. {
  138. return __qdf_net_stats_get_tx_pkts(stats);
  139. }
  140. /**
  141. * qdf_net_stats_add_tx_bytes() - Add Tx bytes in n/w stats
  142. * @stats: Network stats instance
  143. * @value: Value to be added
  144. *
  145. * Return: None.
  146. */
  147. static inline
  148. void qdf_net_stats_add_tx_bytes(qdf_net_dev_stats *stats, uint32_t value)
  149. {
  150. __qdf_net_stats_add_tx_bytes(stats, value);
  151. }
  152. /**
  153. * qdf_net_stats_get_tx_bytes() - Get Tx bytes in net stats
  154. * @stats: Network stats instance
  155. *
  156. * Return: Tx bytes transmitted on N/W interface
  157. */
  158. static inline
  159. unsigned long qdf_net_stats_get_tx_bytes(qdf_net_dev_stats *stats)
  160. {
  161. return __qdf_net_stats_get_tx_bytes(stats);
  162. }
  163. /**
  164. * qdf_net_stats_inc_tx_errors() - inc Tx errors n/w stats
  165. * @stats: Network stats instance
  166. *
  167. * Return: None.
  168. */
  169. static inline
  170. void qdf_net_stats_inc_tx_errors(qdf_net_dev_stats *stats)
  171. {
  172. __qdf_net_stats_inc_tx_errors(stats);
  173. }
  174. /**
  175. * qdf_net_stats_get_tx_errors() - Get Tx errors in net stats
  176. * @stats: Network stats instance
  177. *
  178. * Return: Tx errors on N/W interface
  179. */
  180. static inline
  181. unsigned long qdf_net_stats_get_tx_errors(qdf_net_dev_stats *stats)
  182. {
  183. return __qdf_net_stats_get_tx_errors(stats);
  184. }
  185. /**
  186. * qdf_net_stats_inc_tx_dropped() - inc Tx dropped n/w stats
  187. * @stats: Network stats instance
  188. *
  189. * Return: None.
  190. */
  191. static inline
  192. void qdf_net_stats_inc_tx_dropped(qdf_net_dev_stats *stats)
  193. {
  194. __qdf_net_stats_inc_tx_dropped(stats);
  195. }
  196. /**
  197. * qdf_net_stats_get_tx_dropped() - Get Tx dropped in net stats
  198. * @stats: Network stats instance
  199. *
  200. * Return: Tx dropped on N/W interface
  201. */
  202. static inline
  203. unsigned long qdf_net_stats_get_tx_dropped(qdf_net_dev_stats *stats)
  204. {
  205. return __qdf_net_stats_get_tx_dropped(stats);
  206. }
  207. #endif /*__QDF_NET_STATS_H*/