202-debug_variables.patch 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. --- a/ath/if_ath.c
  2. +++ b/ath/if_ath.c
  3. @@ -453,8 +453,8 @@ MODULE_PARM_DESC(autocreate, "Create ath
  4. MODULE_PARM_DESC(ratectl, "Rate control algorithm [amrr|minstrel|onoe|sample], "
  5. "defaults to '" DEF_RATE_CTL "'");
  6. -static int ath_debug = 0;
  7. #ifdef AR_DEBUG
  8. +static int ath_debug = 0;
  9. #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
  10. MODULE_PARM(ath_debug, "i");
  11. #else
  12. @@ -465,8 +465,8 @@ static void ath_printrxbuf(const struct
  13. static void ath_printtxbuf(const struct ath_buf *, int);
  14. #endif /* defined(AR_DEBUG) */
  15. -static int ieee80211_debug = 0;
  16. #ifdef AR_DEBUG
  17. +static int ieee80211_debug = 0;
  18. #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
  19. MODULE_PARM(ieee80211_debug, "i");
  20. #else
  21. @@ -1565,7 +1565,9 @@ ath_vap_delete(struct ieee80211vap *vap)
  22. void
  23. ath_suspend(struct net_device *dev)
  24. {
  25. +#ifdef AR_DEBUG
  26. struct ath_softc *sc = dev->priv;
  27. +#endif
  28. DPRINTF(sc, ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
  29. ath_stop(dev);
  30. @@ -1574,7 +1576,9 @@ ath_suspend(struct net_device *dev)
  31. void
  32. ath_resume(struct net_device *dev)
  33. {
  34. +#ifdef AR_DEBUG
  35. struct ath_softc *sc = dev->priv;
  36. +#endif
  37. DPRINTF(sc, ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
  38. ath_init(dev);
  39. @@ -4019,7 +4023,9 @@ static void
  40. ath_key_update_begin(struct ieee80211vap *vap)
  41. {
  42. struct net_device *dev = vap->iv_ic->ic_dev;
  43. +#ifdef AR_DEBUG
  44. struct ath_softc *sc = dev->priv;
  45. +#endif
  46. DPRINTF(sc, ATH_DEBUG_KEYCACHE, "Begin\n");
  47. /*
  48. @@ -4040,7 +4046,9 @@ static void
  49. ath_key_update_end(struct ieee80211vap *vap)
  50. {
  51. struct net_device *dev = vap->iv_ic->ic_dev;
  52. +#ifdef AR_DEBUG
  53. struct ath_softc *sc = dev->priv;
  54. +#endif
  55. DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n");
  56. netif_wake_queue(dev);
  57. @@ -6218,7 +6226,9 @@ ath_recv_mgmt(struct ieee80211vap * vap,
  58. struct sk_buff *skb, int subtype, int rssi, u_int64_t rtsf)
  59. {
  60. struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
  61. +#ifdef AR_DEBUG
  62. struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data;
  63. +#endif
  64. struct ieee80211_node * ni = ni_or_null;
  65. u_int64_t hw_tsf, beacon_tsf;
  66. u_int32_t hw_tu, beacon_tu, intval;
  67. @@ -8382,7 +8392,9 @@ ath_tx_timeout(struct net_device *dev)
  68. static void
  69. ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
  70. {
  71. +#ifdef AR_DEBUG
  72. struct ath_hal *ah = sc->sc_ah;
  73. +#endif
  74. struct ath_buf *bf;
  75. /*
  76. * NB: this assumes output has been stopped and
  77. @@ -11002,6 +11014,7 @@ ath_announce(struct net_device *dev)
  78. strncat(m, b, MLEN);
  79. }
  80. strncat(m, "\n", MLEN);
  81. +#ifdef AR_DEBUG
  82. if (1 /* bootverbose */) {
  83. unsigned int i;
  84. for (i = 0; i <= WME_AC_VO; i++) {
  85. @@ -11014,6 +11027,7 @@ ath_announce(struct net_device *dev)
  86. sc->sc_cabq->axq_qnum);
  87. IPRINTF(sc, "Use hw queue %u for beacons\n", sc->sc_bhalq);
  88. }
  89. +#endif
  90. #undef HAL_MODE_DUALBAND
  91. }
  92. --- a/ath/if_ath_radar.c
  93. +++ b/ath/if_ath_radar.c
  94. @@ -156,7 +156,9 @@ static struct radar_pattern_specificatio
  95. #endif
  96. };
  97. +#ifdef AR_DEBUG
  98. static u_int32_t interval_to_frequency(u_int32_t pri);
  99. +#endif
  100. /* Returns true if radar detection is enabled. */
  101. int ath_radar_is_enabled(struct ath_softc *sc)
  102. @@ -229,7 +231,9 @@ int ath_radar_update(struct ath_softc *s
  103. {
  104. struct ath_hal *ah = sc->sc_ah;
  105. +#ifdef AR_DEBUG
  106. struct net_device *dev = sc->sc_dev;
  107. +#endif
  108. struct ieee80211com *ic = &sc->sc_ic;
  109. int required = 0;
  110. @@ -366,6 +370,7 @@ static struct ath_rp *pulse_prev(struct
  111. #define MR_FAIL_MIN_PERIOD 4
  112. #define MR_FAIL_MAX_PERIOD 5
  113. +#ifdef AR_DEBUG
  114. static const char* get_match_result_desc(u_int32_t code) {
  115. switch (code) {
  116. case MR_MATCH:
  117. @@ -384,6 +389,7 @@ static const char* get_match_result_desc
  118. return "unknown";
  119. }
  120. }
  121. +#endif
  122. static int32_t match_radar(
  123. u_int32_t matched,
  124. @@ -775,7 +781,10 @@ static HAL_BOOL rp_analyse_short_pulse(
  125. struct ath_softc *sc, struct ath_rp *last_pulse,
  126. u_int32_t *index, u_int32_t *pri, u_int32_t *matching_pulses,
  127. u_int32_t *missed_pulses, u_int32_t *noise_pulses)
  128. -{ struct net_device *dev = sc->sc_dev;
  129. +{
  130. +#ifdef AR_DEBUG
  131. + struct net_device *dev = sc->sc_dev;
  132. +#endif
  133. int i;
  134. int best_index = -1;
  135. unsigned int best_matched = 0;
  136. @@ -1217,6 +1226,7 @@ static HAL_BOOL rp_analyse_short_pulse(
  137. return (-1 != best_index) ? AH_TRUE : AH_FALSE;
  138. }
  139. +#ifdef AR_DEBUG
  140. static u_int32_t interval_to_frequency(u_int32_t interval)
  141. {
  142. /* Calculate BRI from PRI */
  143. @@ -1224,6 +1234,7 @@ static u_int32_t interval_to_frequency(u
  144. /* Round to nearest multiple of 50 */
  145. return frequency + ((frequency % 50) >= 25 ? 50 : 0) - (frequency % 50);
  146. }
  147. +#endif
  148. #ifdef ATH_RADAR_LONG_PULSE
  149. static const char* get_longpulse_desc(int lp) {
  150. @@ -1580,7 +1591,9 @@ void ath_rp_done(struct ath_softc *sc)
  151. void ath_rp_record(struct ath_softc *sc, u_int64_t tsf, u_int8_t rssi,
  152. u_int8_t width, HAL_BOOL is_simulated)
  153. {
  154. +#ifdef AR_DEBUG
  155. struct net_device *dev = sc->sc_dev;
  156. +#endif
  157. struct ath_rp *pulse;
  158. DPRINTF(sc, ATH_DEBUG_DOTHPULSES, "%s: ath_rp_record: "
  159. --- a/ath_rate/minstrel/minstrel.c
  160. +++ b/ath_rate/minstrel/minstrel.c
  161. @@ -931,7 +931,9 @@ ath_proc_read_nodes(struct ieee80211vap
  162. (struct ieee80211_node_table *) &vap->iv_ic->ic_sta;
  163. unsigned int x = 0;
  164. unsigned int this_tp, this_prob, this_eprob;
  165. +#ifdef AR_DEBUG
  166. struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
  167. +#endif
  168. IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
  169. TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
  170. --- a/net80211/ieee80211_scan_ap.c
  171. +++ b/net80211/ieee80211_scan_ap.c
  172. @@ -731,6 +731,7 @@ pick_channel(struct ieee80211_scan_state
  173. sort(chans, ss_last, sizeof(*chans), pc_cmp, pc_swap);
  174. +#ifdef IEEE80211_DEBUG
  175. for (i = 0; i < ss_last; i++) {
  176. int chan = ieee80211_chan2ieee(ic, chans[i].chan);
  177. @@ -742,6 +743,7 @@ pick_channel(struct ieee80211_scan_state
  178. !!IEEE80211_ARE_CHANS_SAME_MODE(chans[i].chan,
  179. ic->ic_bsschan));
  180. }
  181. +#endif
  182. best = NULL;
  183. best_rssi = 0xff; /* If signal is bigger than 0xff, we'd be melting. */