debug.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * DebugFS code for ST-Ericsson CW1200 mac80211 driver
  3. *
  4. * Copyright (c) 2011, ST-Ericsson
  5. * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef CW1200_DEBUG_H_INCLUDED
  12. #define CW1200_DEBUG_H_INCLUDED
  13. struct cw1200_debug_priv {
  14. struct dentry *debugfs_phy;
  15. int tx;
  16. int tx_agg;
  17. int rx;
  18. int rx_agg;
  19. int tx_multi;
  20. int tx_multi_frames;
  21. int tx_cache_miss;
  22. int tx_align;
  23. int tx_ttl;
  24. int tx_burst;
  25. int ba_cnt;
  26. int ba_acc;
  27. int ba_cnt_rx;
  28. int ba_acc_rx;
  29. };
  30. int cw1200_debug_init(struct cw1200_common *priv);
  31. void cw1200_debug_release(struct cw1200_common *priv);
  32. static inline void cw1200_debug_txed(struct cw1200_common *priv)
  33. {
  34. ++priv->debug->tx;
  35. }
  36. static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
  37. {
  38. ++priv->debug->tx_agg;
  39. }
  40. static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
  41. int count)
  42. {
  43. ++priv->debug->tx_multi;
  44. priv->debug->tx_multi_frames += count;
  45. }
  46. static inline void cw1200_debug_rxed(struct cw1200_common *priv)
  47. {
  48. ++priv->debug->rx;
  49. }
  50. static inline void cw1200_debug_rxed_agg(struct cw1200_common *priv)
  51. {
  52. ++priv->debug->rx_agg;
  53. }
  54. static inline void cw1200_debug_tx_cache_miss(struct cw1200_common *priv)
  55. {
  56. ++priv->debug->tx_cache_miss;
  57. }
  58. static inline void cw1200_debug_tx_align(struct cw1200_common *priv)
  59. {
  60. ++priv->debug->tx_align;
  61. }
  62. static inline void cw1200_debug_tx_ttl(struct cw1200_common *priv)
  63. {
  64. ++priv->debug->tx_ttl;
  65. }
  66. static inline void cw1200_debug_tx_burst(struct cw1200_common *priv)
  67. {
  68. ++priv->debug->tx_burst;
  69. }
  70. static inline void cw1200_debug_ba(struct cw1200_common *priv,
  71. int ba_cnt, int ba_acc,
  72. int ba_cnt_rx, int ba_acc_rx)
  73. {
  74. priv->debug->ba_cnt = ba_cnt;
  75. priv->debug->ba_acc = ba_acc;
  76. priv->debug->ba_cnt_rx = ba_cnt_rx;
  77. priv->debug->ba_acc_rx = ba_acc_rx;
  78. }
  79. #endif /* CW1200_DEBUG_H_INCLUDED */