540-ath9k_fix_queue_debug.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. --- a/drivers/net/wireless/ath/ath9k/debug.c
  2. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  3. @@ -450,14 +450,15 @@ static const struct file_operations fops
  4. .llseek = default_llseek,
  5. };
  6. +#define PR_QNUM(_n) sc->tx.txq_map[_n]->axq_qnum
  7. #define PR(str, elem) \
  8. do { \
  9. len += snprintf(buf + len, size - len, \
  10. "%s%13u%11u%10u%10u\n", str, \
  11. - sc->debug.stats.txstats[WME_AC_BE].elem, \
  12. - sc->debug.stats.txstats[WME_AC_BK].elem, \
  13. - sc->debug.stats.txstats[WME_AC_VI].elem, \
  14. - sc->debug.stats.txstats[WME_AC_VO].elem); \
  15. + sc->debug.stats.txstats[PR_QNUM(WME_AC_BE)].elem, \
  16. + sc->debug.stats.txstats[PR_QNUM(WME_AC_BK)].elem, \
  17. + sc->debug.stats.txstats[PR_QNUM(WME_AC_VI)].elem, \
  18. + sc->debug.stats.txstats[PR_QNUM(WME_AC_VO)].elem); \
  19. if (len >= size) \
  20. goto done; \
  21. } while(0)
  22. @@ -466,10 +467,10 @@ static const struct file_operations fops
  23. do { \
  24. len += snprintf(buf + len, size - len, \
  25. "%s%13u%11u%10u%10u\n", str, \
  26. - (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BE].elem), \
  27. - (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BK].elem), \
  28. - (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VI].elem), \
  29. - (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VO].elem)); \
  30. + (unsigned int)(sc->tx.txq_map[WME_AC_BE]->elem), \
  31. + (unsigned int)(sc->tx.txq_map[WME_AC_BK]->elem), \
  32. + (unsigned int)(sc->tx.txq_map[WME_AC_VI]->elem), \
  33. + (unsigned int)(sc->tx.txq_map[WME_AC_VO]->elem)); \
  34. if (len >= size) \
  35. goto done; \
  36. } while(0)
  37. @@ -478,10 +479,10 @@ do { \
  38. do { \
  39. len += snprintf(buf + len, size - len, \
  40. "%s%13i%11i%10i%10i\n", str, \
  41. - list_empty(&sc->tx.txq[ATH_TXQ_AC_BE].elem), \
  42. - list_empty(&sc->tx.txq[ATH_TXQ_AC_BK].elem), \
  43. - list_empty(&sc->tx.txq[ATH_TXQ_AC_VI].elem), \
  44. - list_empty(&sc->tx.txq[ATH_TXQ_AC_VO].elem)); \
  45. + list_empty(&sc->tx.txq_map[WME_AC_BE]->elem), \
  46. + list_empty(&sc->tx.txq_map[WME_AC_BK]->elem), \
  47. + list_empty(&sc->tx.txq_map[WME_AC_VI]->elem), \
  48. + list_empty(&sc->tx.txq_map[WME_AC_VO]->elem)); \
  49. if (len >= size) \
  50. goto done; \
  51. } while (0)
  52. @@ -528,10 +529,10 @@ static ssize_t read_file_xmit(struct fil
  53. PR("hw-tx-proc-desc: ", txprocdesc);
  54. len += snprintf(buf + len, size - len,
  55. "%s%11p%11p%10p%10p\n", "txq-memory-address:",
  56. - &(sc->tx.txq[ATH_TXQ_AC_BE]),
  57. - &(sc->tx.txq[ATH_TXQ_AC_BK]),
  58. - &(sc->tx.txq[ATH_TXQ_AC_VI]),
  59. - &(sc->tx.txq[ATH_TXQ_AC_VO]));
  60. + &(sc->tx.txq_map[WME_AC_BE]),
  61. + &(sc->tx.txq_map[WME_AC_BK]),
  62. + &(sc->tx.txq_map[WME_AC_VI]),
  63. + &(sc->tx.txq_map[WME_AC_VO]));
  64. if (len >= size)
  65. goto done;
  66. @@ -751,9 +752,9 @@ static ssize_t read_file_misc(struct fil
  67. }
  68. void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
  69. - struct ath_tx_status *ts)
  70. + struct ath_tx_status *ts, struct ath_txq *txq)
  71. {
  72. - int qnum = skb_get_queue_mapping(bf->bf_mpdu);
  73. + int qnum = txq->axq_qnum;
  74. TX_STAT_INC(qnum, tx_pkts_all);
  75. sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len;
  76. --- a/drivers/net/wireless/ath/ath9k/debug.h
  77. +++ b/drivers/net/wireless/ath/ath9k/debug.h
  78. @@ -175,7 +175,7 @@ int ath9k_init_debug(struct ath_hw *ah);
  79. void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
  80. void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
  81. - struct ath_tx_status *ts);
  82. + struct ath_tx_status *ts, struct ath_txq *txq);
  83. void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs);
  84. #else
  85. @@ -192,7 +192,8 @@ static inline void ath_debug_stat_interr
  86. static inline void ath_debug_stat_tx(struct ath_softc *sc,
  87. struct ath_buf *bf,
  88. - struct ath_tx_status *ts)
  89. + struct ath_tx_status *ts,
  90. + struct ath_txq *txq)
  91. {
  92. }
  93. --- a/drivers/net/wireless/ath/ath9k/xmit.c
  94. +++ b/drivers/net/wireless/ath/ath9k/xmit.c
  95. @@ -1913,7 +1913,7 @@ static void ath_tx_complete_buf(struct a
  96. else
  97. complete(&sc->paprd_complete);
  98. } else {
  99. - ath_debug_stat_tx(sc, bf, ts);
  100. + ath_debug_stat_tx(sc, bf, ts, txq);
  101. ath_tx_complete(sc, skb, tx_flags,
  102. bf->bf_state.bfs_ftype, txq);
  103. }