debug.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * DebugFS code for ST-Ericsson CW1200 mac80211 driver
  4. *
  5. * Copyright (c) 2011, ST-Ericsson
  6. * Author: Dmitry Tarnyagin <[email protected]>
  7. */
  8. #ifndef CW1200_DEBUG_H_INCLUDED
  9. #define CW1200_DEBUG_H_INCLUDED
  10. struct cw1200_debug_priv {
  11. struct dentry *debugfs_phy;
  12. int tx;
  13. int tx_agg;
  14. int rx;
  15. int rx_agg;
  16. int tx_multi;
  17. int tx_multi_frames;
  18. int tx_cache_miss;
  19. int tx_align;
  20. int tx_ttl;
  21. int tx_burst;
  22. int ba_cnt;
  23. int ba_acc;
  24. int ba_cnt_rx;
  25. int ba_acc_rx;
  26. };
  27. int cw1200_debug_init(struct cw1200_common *priv);
  28. void cw1200_debug_release(struct cw1200_common *priv);
  29. static inline void cw1200_debug_txed(struct cw1200_common *priv)
  30. {
  31. ++priv->debug->tx;
  32. }
  33. static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
  34. {
  35. ++priv->debug->tx_agg;
  36. }
  37. static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
  38. int count)
  39. {
  40. ++priv->debug->tx_multi;
  41. priv->debug->tx_multi_frames += count;
  42. }
  43. static inline void cw1200_debug_rxed(struct cw1200_common *priv)
  44. {
  45. ++priv->debug->rx;
  46. }
  47. static inline void cw1200_debug_rxed_agg(struct cw1200_common *priv)
  48. {
  49. ++priv->debug->rx_agg;
  50. }
  51. static inline void cw1200_debug_tx_cache_miss(struct cw1200_common *priv)
  52. {
  53. ++priv->debug->tx_cache_miss;
  54. }
  55. static inline void cw1200_debug_tx_align(struct cw1200_common *priv)
  56. {
  57. ++priv->debug->tx_align;
  58. }
  59. static inline void cw1200_debug_tx_ttl(struct cw1200_common *priv)
  60. {
  61. ++priv->debug->tx_ttl;
  62. }
  63. static inline void cw1200_debug_tx_burst(struct cw1200_common *priv)
  64. {
  65. ++priv->debug->tx_burst;
  66. }
  67. static inline void cw1200_debug_ba(struct cw1200_common *priv,
  68. int ba_cnt, int ba_acc,
  69. int ba_cnt_rx, int ba_acc_rx)
  70. {
  71. priv->debug->ba_cnt = ba_cnt;
  72. priv->debug->ba_acc = ba_acc;
  73. priv->debug->ba_cnt_rx = ba_cnt_rx;
  74. priv->debug->ba_acc_rx = ba_acc_rx;
  75. }
  76. #endif /* CW1200_DEBUG_H_INCLUDED */