Project : madwifi
Revision : 2328
Author : scottr (Scott Raynel)
Date : 2007-05-14 03:03:40 +0200 (Mon, 14 May 2007)
Log Message :
Make minstrel respect athdebug +rate.
Affected Files:
* trunk/ath_rate/minstrel/minstrel.c updated
Modified: trunk/ath_rate/minstrel/minstrel.c
===================================================================
--- trunk/ath_rate/minstrel/minstrel.c 2007-05-12 12:27:13 UTC (rev 2327)
+++ trunk/ath_rate/minstrel/minstrel.c 2007-05-14 01:03:40 UTC (rev 2328)
@@ -116,14 +116,14 @@
#include "minstrel.h"
-/* XXX: Use standard debug functions */
-#define MINSTREL_DEBUG 10
+#define MINSTREL_DEBUG
#ifdef MINSTREL_DEBUG
enum {
ATH_DEBUG_RATE = 0x00000010 /* rate control */
};
-#define DPRINTF(sc, _fmt, ...) do { \
- /* printk(_fmt, __VA_ARGS__); */ \
+#define DPRINTF(sc, _fmt, ...) do { \
+ if (sc->sc_debug & ATH_DEBUG_RATE) \
+ printk(_fmt, __VA_ARGS__); \
} while (0)
#else
#define DPRINTF(sc, _fmt, ...)
@@ -453,11 +453,11 @@
final_rate = sc->sc_hwmap[ds->ds_txstat.ts_rate &
~HAL_TXSTAT_ALTRATE].ieeerate;
final_ndx = rate_to_ndx(sn, final_rate);
if (final_ndx >= sn->num_rates) {
- printk(KERN_ERR "final ndx too high\n");
+ DPRINTF(sc,"%s: final ndx too high\n", __func__);
final_ndx = 0;
}
if (final_ndx < 0) {
- printk(KERN_ERR "final ndx too low\n");
+ DPRINTF(sc, "%s: final ndx too low\n", __func__);
final_ndx = 0;
}
@@ -580,7 +580,7 @@
for (i = 0; i < num_sample_rates; i++)
p += sprintf(p, "%2d ",
(int)sn->rs_sampleTable[i][column_index])
;
- printk("%s\n", rates);
+ DPRINTF(sc, "%s\n", rates);
};
#endif
}
@@ -607,7 +607,7 @@
sn->is_sampling = 0;
if (rt == NULL) {
- printk(KERN_WARNING "no rates yet! mode %u\n", sc->sc_curmode);
+ DPRINTF(sc, "no rates yet! mode %u\n", sc->sc_curmode);
return;
}
sn->static_rate_ndx = -1;
@@ -699,9 +699,9 @@
}
#if 0
- printk(KERN_ERR "Retry table for this node\n");
+ DPRINTF(sc, "%s: Retry table for this node\n", __func__);
for (x = 0; x < ni->ni_rates.rs_nrates; x++)
- printk(KERN_ERR "%2d %2d %6d \n",x, sn->retry_count[x],
sn->perfect_tx_time[x]);
+ DPRINTF(sc, "%2d %2d %6d \n",x, sn->retry_count[x],
sn->perfect_tx_time[x]);
#endif
/* Set the initial rate */
@@ -745,10 +745,10 @@
unsigned int interval = ath_timer_interval;
if (dev == NULL)
- printk(KERN_INFO "'dev' is null in this timer \n");
+ DPRINTF(sc, "%s: 'dev' is null in this timer \n", __func__);
if (sc == NULL)
- printk(KERN_INFO "'sc' is null in this timer\n");
+ DPRINTF(sc, "%s: 'sc' is null in this timer\n", __func__);
ic = &sc->sc_ic;
@@ -772,7 +772,7 @@
timer = &(ssc->timer);
if (timer == NULL)
- printk(KERN_INFO "timer is null - leave it\n");
+ DPRINTF(sc, "%s: timer is null - leave it\n", __func__);
timer->expires = jiffies + ((HZ * interval) / 1000);
add_timer(timer);
@@ -915,6 +915,7 @@
(struct ieee80211_node_table *) &vap->iv_ic->ic_sta;
unsigned int x = 0;
unsigned int this_tp, this_prob, this_eprob;
+ struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
/* Assume each node needs 1500 bytes */
@@ -923,7 +924,7 @@
p += sprintf(p, "out of room for node %s\n\n",
ether_sprintf(ni->ni_macaddr));
break;
}
- printk("out of memeory to write tall of the nodes\n");
+ DPRINTF(sc, "%s: out of memeory to write tall of the
nodes\n", __func__);
break;
}
an = ATH_NODE(ni);
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|