debug.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #include "itp.h"
  14. struct cw1200_debug_priv {
  15. struct dentry *debugfs_phy;
  16. int tx;
  17. int tx_agg;
  18. int rx;
  19. int rx_agg;
  20. int tx_multi;
  21. int tx_multi_frames;
  22. int tx_cache_miss;
  23. int tx_align;
  24. int tx_ttl;
  25. int tx_burst;
  26. int ba_cnt;
  27. int ba_acc;
  28. int ba_cnt_rx;
  29. int ba_acc_rx;
  30. #ifdef CONFIG_CW1200_ITP
  31. struct cw1200_itp itp;
  32. #endif /* CONFIG_CW1200_ITP */
  33. };
  34. int cw1200_debug_init(struct cw1200_common *priv);
  35. void cw1200_debug_release(struct cw1200_common *priv);
  36. static inline void cw1200_debug_txed(struct cw1200_common *priv)
  37. {
  38. ++priv->debug->tx;
  39. }
  40. static inline void cw1200_debug_txed_agg(struct cw1200_common *priv)
  41. {
  42. ++priv->debug->tx_agg;
  43. }
  44. static inline void cw1200_debug_txed_multi(struct cw1200_common *priv,
  45. int count)
  46. {
  47. ++priv->debug->tx_multi;
  48. priv->debug->tx_multi_frames += count;
  49. }
  50. static inline void cw1200_debug_rxed(struct cw1200_common *priv)
  51. {
  52. ++priv->debug->rx;
  53. }
  54. static inline void cw1200_debug_rxed_agg(struct cw1200_common *priv)
  55. {
  56. ++priv->debug->rx_agg;
  57. }
  58. static inline void cw1200_debug_tx_cache_miss(struct cw1200_common *priv)
  59. {
  60. ++priv->debug->tx_cache_miss;
  61. }
  62. static inline void cw1200_debug_tx_align(struct cw1200_common *priv)
  63. {
  64. ++priv->debug->tx_align;
  65. }
  66. static inline void cw1200_debug_tx_ttl(struct cw1200_common *priv)
  67. {
  68. ++priv->debug->tx_ttl;
  69. }
  70. static inline void cw1200_debug_tx_burst(struct cw1200_common *priv)
  71. {
  72. ++priv->debug->tx_burst;
  73. }
  74. static inline void cw1200_debug_ba(struct cw1200_common *priv,
  75. int ba_cnt, int ba_acc,
  76. int ba_cnt_rx, int ba_acc_rx)
  77. {
  78. priv->debug->ba_cnt = ba_cnt;
  79. priv->debug->ba_acc = ba_acc;
  80. priv->debug->ba_cnt_rx = ba_cnt_rx;
  81. priv->debug->ba_acc_rx = ba_acc_rx;
  82. }
  83. #endif /* CW1200_DEBUG_H_INCLUDED */