svn commit: r217684 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210
ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002
Adrian Chadd
adrian at FreeBSD.org
Fri Jan 21 05:21:01 UTC 2011
Author: adrian
Date: Fri Jan 21 05:21:00 2011
New Revision: 217684
URL: http://svn.freebsd.org/changeset/base/217684
Log:
ANI changes #1 - split out the ANI polling from the RxMonitor hook.
The rxmonitor hook is called on each received packet. This can get very,
very busy as the tx/rx/chanbusy registers are thus read each time a packet
is received.
Instead, shuffle out the true per-packet processing which is needed and move
the rest of the ANI processing into a periodic event which runs every 100ms
by default.
Modified:
head/sys/dev/ath/ath_hal/ah.h
head/sys/dev/ath/ath_hal/ar5210/ar5210.h
head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
head/sys/dev/ath/ath_hal/ar5211/ar5211.h
head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c
head/sys/dev/ath/ath_hal/ar5212/ar5212.h
head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c
head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
head/sys/dev/ath/ath_hal/ar5416/ar5416.h
head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
head/sys/dev/ath/if_ath.c
head/sys/dev/ath/if_athioctl.h
head/sys/dev/ath/if_athvar.h
Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ah.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -709,6 +709,8 @@ struct ath_hal {
void __ahdecl(*ah_rxMonitor)(struct ath_hal *,
const HAL_NODE_STATS *,
const struct ieee80211_channel *);
+ void __ahdecl(*ah_aniPoll)(struct ath_hal *,
+ const struct ieee80211_channel *);
void __ahdecl(*ah_procMibEvent)(struct ath_hal *,
const HAL_NODE_STATS *);
Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -277,7 +277,8 @@ extern HAL_INT ar5210SetInterrupts(struc
extern const HAL_RATE_TABLE *ar5210GetRateTable(struct ath_hal *, u_int mode);
extern HAL_BOOL ar5210AniControl(struct ath_hal *, HAL_ANI_CMD, int );
-extern void ar5210AniPoll(struct ath_hal *, const HAL_NODE_STATS *,
+extern void ar5210AniPoll(struct ath_hal *, const struct ieee80211_channel *);
+extern void ar5210RxMonitor(struct ath_hal *, const HAL_NODE_STATS *,
const struct ieee80211_channel *);
extern void ar5210MibEvent(struct ath_hal *, const HAL_NODE_STATS *);
#endif /* _ATH_AR5210_H_ */
Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -89,7 +89,8 @@ static const struct ath_hal_private ar52
.ah_setRxFilter = ar5210SetRxFilter,
.ah_setupRxDesc = ar5210SetupRxDesc,
.ah_procRxDesc = ar5210ProcRxDesc,
- .ah_rxMonitor = ar5210AniPoll,
+ .ah_rxMonitor = ar5210RxMonitor,
+ .ah_aniPoll = ar5210AniPoll,
.ah_procMibEvent = ar5210MibEvent,
/* Misc Functions */
Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -561,12 +561,17 @@ ar5210AniControl(struct ath_hal *ah, HAL
}
void
-ar5210AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats,
+ar5210RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats,
const struct ieee80211_channel *chan)
{
}
void
+ar5210AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+}
+
+void
ar5210MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats)
{
}
Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -305,7 +305,8 @@ extern HAL_INT ar5211SetInterrupts(struc
extern const HAL_RATE_TABLE *ar5211GetRateTable(struct ath_hal *, u_int mode);
extern HAL_BOOL ar5211AniControl(struct ath_hal *, HAL_ANI_CMD, int );
-extern void ar5211AniPoll(struct ath_hal *, const HAL_NODE_STATS *,
+extern void ar5211RxMonitor(struct ath_hal *, const HAL_NODE_STATS *,
const struct ieee80211_channel *);
+extern void ar5211AniPoll(struct ath_hal *, const struct ieee80211_channel *);
extern void ar5211MibEvent(struct ath_hal *, const HAL_NODE_STATS *);
#endif /* _ATH_AR5211_H_ */
Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -89,7 +89,8 @@ static const struct ath_hal_private ar52
.ah_setRxFilter = ar5211SetRxFilter,
.ah_setupRxDesc = ar5211SetupRxDesc,
.ah_procRxDesc = ar5211ProcRxDesc,
- .ah_rxMonitor = ar5211AniPoll,
+ .ah_rxMonitor = ar5211RxMonitor,
+ .ah_aniPoll = ar5211AniPoll,
.ah_procMibEvent = ar5211MibEvent,
/* Misc Functions */
Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -564,7 +564,12 @@ ar5211AniControl(struct ath_hal *ah, HAL
}
void
-ar5211AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats,
+ar5211AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+}
+
+void
+ar5211RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats,
const struct ieee80211_channel *chan)
{
}
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -606,8 +606,9 @@ struct ath_rx_status;
extern void ar5212AniPhyErrReport(struct ath_hal *ah,
const struct ath_rx_status *rs);
extern void ar5212ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *);
-extern void ar5212AniPoll(struct ath_hal *, const HAL_NODE_STATS *,
+extern void ar5212RxMonitor(struct ath_hal *, const HAL_NODE_STATS *,
const struct ieee80211_channel *);
+extern void ar5212AniPoll(struct ath_hal *, const struct ieee80211_channel *);
extern void ar5212AniReset(struct ath_hal *, const struct ieee80211_channel *,
HAL_OPMODE, int);
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -912,21 +912,26 @@ updateMIBStats(struct ath_hal *ah, struc
aniState->cckPhyErrCount = cckPhyErrCnt;
}
+void
+ar5212RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats,
+ const struct ieee80211_channel *chan)
+{
+ struct ath_hal_5212 *ahp = AH5212(ah);
+ ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi;
+}
+
/*
* Do periodic processing. This routine is called from the
* driver's rx interrupt handler after processing frames.
*/
void
-ar5212AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats,
- const struct ieee80211_channel *chan)
+ar5212AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
{
struct ath_hal_5212 *ahp = AH5212(ah);
struct ar5212AniState *aniState = ahp->ah_curani;
const struct ar5212AniParams *params;
int32_t listenTime;
- ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi;
-
/* XXX can aniState be null? */
if (aniState == AH_NULL)
return;
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -85,7 +85,8 @@ static const struct ath_hal_private ar52
.ah_setRxFilter = ar5212SetRxFilter,
.ah_setupRxDesc = ar5212SetupRxDesc,
.ah_procRxDesc = ar5212ProcRxDesc,
- .ah_rxMonitor = ar5212AniPoll,
+ .ah_rxMonitor = ar5212RxMonitor,
+ .ah_aniPoll = ar5212AniPoll,
.ah_procMibEvent = ar5212ProcessMibIntr,
/* Misc Functions */
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -113,8 +113,9 @@ extern HAL_BOOL ar5416AniControl(struct
extern HAL_BOOL ar5416AniSetParams(struct ath_hal *,
const struct ar5212AniParams *, const struct ar5212AniParams *);
extern void ar5416ProcessMibIntr(struct ath_hal *, const HAL_NODE_STATS *);
-extern void ar5416AniPoll(struct ath_hal *, const HAL_NODE_STATS *,
+extern void ar5416RxMonitor(struct ath_hal *, const HAL_NODE_STATS *,
const struct ieee80211_channel *);
+extern void ar5416AniPoll(struct ath_hal *, const struct ieee80211_channel *);
extern void ar5416AniReset(struct ath_hal *, const struct ieee80211_channel *,
HAL_OPMODE, int);
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -181,6 +181,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
case HAL_ANI_NOISE_IMMUNITY_LEVEL: {
u_int level = param;
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_NOISE_IMMUNITY_LEVEL: set level = %d\n", __func__, level);
if (level >= params->maxNoiseImmunityLevel) {
HALDEBUG(ah, HAL_DEBUG_ANY,
"%s: immunity level out of range (%u > %u)\n",
@@ -213,6 +214,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
static const TABLE m2CountThrLow = { 63, 48 };
u_int on = param ? 1 : 0;
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: %s\n", __func__, on ? "enabled" : "disabled");
OS_REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
AR_PHY_SFCORR_LOW_M1_THRESH_LOW, m1ThreshLow[on]);
OS_REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
@@ -253,6 +255,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
static const TABLE weakSigThrCck = { 8, 6 };
u_int high = param ? 1 : 0;
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_CCK_WEAK_SIGNAL_THR: %s\n", __func__, high ? "high" : "low");
OS_REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT,
AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, weakSigThrCck[high]);
if (high)
@@ -265,6 +268,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
case HAL_ANI_FIRSTEP_LEVEL: {
u_int level = param;
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_FIRSTEP_LEVEL: level = %d\n", __func__, level);
if (level >= params->maxFirstepLevel) {
HALDEBUG(ah, HAL_DEBUG_ANY,
"%s: firstep level out of range (%u > %u)\n",
@@ -283,6 +287,7 @@ ar5416AniControl(struct ath_hal *ah, HAL
case HAL_ANI_SPUR_IMMUNITY_LEVEL: {
u_int level = param;
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_SPUR_IMMUNITY_LEVEL: level = %d\n", __func__, level);
if (level >= params->maxSpurImmunityLevel) {
HALDEBUG(ah, HAL_DEBUG_ANY,
"%s: spur immunity level out of range (%u > %u)\n",
@@ -793,21 +798,26 @@ updateMIBStats(struct ath_hal *ah, struc
aniState->cckPhyErrCount = cckPhyErrCnt;
}
+void
+ar5416RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats,
+ const struct ieee80211_channel *chan)
+{
+ struct ath_hal_5212 *ahp = AH5212(ah);
+ ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi;
+}
+
/*
* Do periodic processing. This routine is called from the
* driver's rx interrupt handler after processing frames.
*/
void
-ar5416AniPoll(struct ath_hal *ah, const HAL_NODE_STATS *stats,
- const struct ieee80211_channel *chan)
+ar5416AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
{
struct ath_hal_5212 *ahp = AH5212(ah);
struct ar5212AniState *aniState = ahp->ah_curani;
const struct ar5212AniParams *params;
int32_t listenTime;
- ahp->ah_stats.ast_nodestats.ns_avgbrssi = stats->ns_avgbrssi;
-
/* XXX can aniState be null? */
if (aniState == AH_NULL)
return;
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -105,7 +105,8 @@ ar5416InitState(struct ath_hal_5416 *ahp
ah->ah_stopPcuReceive = ar5416StopPcuReceive;
ah->ah_setupRxDesc = ar5416SetupRxDesc;
ah->ah_procRxDesc = ar5416ProcRxDesc;
- ah->ah_rxMonitor = ar5416AniPoll,
+ ah->ah_rxMonitor = ar5416RxMonitor,
+ ah->ah_aniPoll = ar5416AniPoll,
ah->ah_procMibEvent = ar5416ProcessMibIntr,
/* Misc Functions */
Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -721,6 +721,10 @@ ar9280SetAntennaSwitch(struct ath_hal *a
ahp->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK;
break;
}
+
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: settings=%d, tx/rx chainmask=%d/%d\n",
+ __func__, settings, ahp->ah_tx_chainmask, ahp->ah_rx_chainmask);
+
return AH_TRUE;
#undef ANTENNA0_CHAINMASK
#undef ANTENNA1_CHAINMASK
Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/if_ath.c Fri Jan 21 05:21:00 2011 (r217684)
@@ -274,6 +274,9 @@ SYSCTL_INT(_hw_ath, OID_AUTO, shortcal,
static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */
SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval,
0, "reset chip calibration results (secs)");
+static int ath_anicalinterval = 100; /* ANI calibration - 100 msec */
+SYSCTL_INT(_hw_ath, OID_AUTO, anical, CTLFLAG_RW, &ath_anicalinterval,
+ 0, "ANI calibration (msecs)");
static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */
SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf,
@@ -1550,6 +1553,9 @@ ath_init(void *arg)
sc->sc_lastlongcal = 0;
sc->sc_resetcal = 1;
sc->sc_lastcalreset = 0;
+ sc->sc_lastani = 0;
+ sc->sc_lastshortcal = 0;
+ sc->sc_doresetcal = AH_FALSE;
/*
* Setup the hardware after reset: the key cache
@@ -5415,11 +5421,23 @@ ath_calibrate(void *arg)
struct ifnet *ifp = sc->sc_ifp;
struct ieee80211com *ic = ifp->if_l2com;
HAL_BOOL longCal, isCalDone;
+ HAL_BOOL aniCal, shortCal = AH_FALSE;
int nextcal;
if (ic->ic_flags & IEEE80211_F_SCAN) /* defer, off channel */
goto restart;
longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
+ aniCal = (ticks - sc->sc_lastani >= ath_anicalinterval*hz/1000);
+ if (sc->sc_doresetcal)
+ shortCal = (ticks - sc->sc_lastshortcal >= ath_shortcalinterval*hz/1000);
+
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: shortCal=%d; longCal=%d; aniCal=%d\n", __func__, shortCal, longCal, aniCal);
+ if (aniCal) {
+ sc->sc_stats.ast_ani_cal++;
+ sc->sc_lastani = ticks;
+ ath_hal_ani_poll(ah, sc->sc_curchan);
+ }
+
if (longCal) {
sc->sc_stats.ast_per_cal++;
sc->sc_lastlongcal = ticks;
@@ -5440,21 +5458,29 @@ ath_calibrate(void *arg)
if (sc->sc_resetcal) {
(void) ath_hal_calreset(ah, sc->sc_curchan);
sc->sc_lastcalreset = ticks;
+ sc->sc_lastshortcal = ticks;
sc->sc_resetcal = 0;
+ sc->sc_doresetcal = AH_TRUE;
}
}
- if (ath_hal_calibrateN(ah, sc->sc_curchan, longCal, &isCalDone)) {
- if (longCal) {
- /*
- * Calibrate noise floor data again in case of change.
- */
- ath_hal_process_noisefloor(ah);
+
+ /* Only call if we're doing a short/long cal, not for ANI calibration */
+ if (shortCal || longCal) {
+ if (ath_hal_calibrateN(ah, sc->sc_curchan, longCal, &isCalDone)) {
+ if (longCal) {
+ /*
+ * Calibrate noise floor data again in case of change.
+ */
+ ath_hal_process_noisefloor(ah);
+ }
+ } else {
+ DPRINTF(sc, ATH_DEBUG_ANY,
+ "%s: calibration of channel %u failed\n",
+ __func__, sc->sc_curchan->ic_freq);
+ sc->sc_stats.ast_per_calfail++;
}
- } else {
- DPRINTF(sc, ATH_DEBUG_ANY,
- "%s: calibration of channel %u failed\n",
- __func__, sc->sc_curchan->ic_freq);
- sc->sc_stats.ast_per_calfail++;
+ if (shortCal)
+ sc->sc_lastshortcal = ticks;
}
if (!isCalDone) {
restart:
@@ -5466,16 +5492,23 @@ restart:
* work when operating as an AP to improve operation right
* after startup.
*/
- nextcal = (1000*ath_shortcalinterval)/hz;
+ sc->sc_lastshortcal = ticks;
+ nextcal = ath_shortcalinterval*hz/1000;
if (sc->sc_opmode != HAL_M_HOSTAP)
nextcal *= 10;
+ sc->sc_doresetcal = AH_TRUE;
} else {
+ /* nextcal should be the shortest time for next event */
nextcal = ath_longcalinterval*hz;
if (sc->sc_lastcalreset == 0)
sc->sc_lastcalreset = sc->sc_lastlongcal;
else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz)
sc->sc_resetcal = 1; /* setup reset next trip */
+ sc->sc_doresetcal = AH_FALSE;
}
+ /* ANI calibration may occur more often than short/long/resetcal */
+ if (ath_anicalinterval > 0)
+ nextcal = MIN(nextcal, ath_anicalinterval*hz/1000);
if (nextcal != 0) {
DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n",
@@ -7516,4 +7549,6 @@ ath_sysctl_stats_attach(struct ath_softc
&sc->sc_stats.ast_tx_nofrag, 0, "tx dropped 'cuz no ath frag buffer");
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_be_missed", CTLFLAG_RD,
&sc->sc_stats.ast_be_missed, 0, "number of -missed- beacons");
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ani_cal", CTLFLAG_RD,
+ &sc->sc_stats.ast_ani_cal, 0, "number of ANI polls");
}
Modified: head/sys/dev/ath/if_athioctl.h
==============================================================================
--- head/sys/dev/ath/if_athioctl.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/if_athioctl.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -119,7 +119,8 @@ struct ath_stats {
u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */
u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */
u_int32_t ast_be_missed; /* missed beacons */
- u_int32_t ast_pad[13];
+ u_int32_t ast_ani_cal; /* ANI calibrations performed */
+ u_int32_t ast_pad[12];
};
#define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)
Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h Fri Jan 21 05:19:47 2011 (r217683)
+++ head/sys/dev/ath/if_athvar.h Fri Jan 21 05:21:00 2011 (r217684)
@@ -333,6 +333,9 @@ struct ath_softc {
struct callout sc_cal_ch; /* callout handle for cals */
int sc_lastlongcal; /* last long cal completed */
int sc_lastcalreset;/* last cal reset done */
+ int sc_lastani; /* last ANI poll */
+ int sc_lastshortcal; /* last short calibration */
+ HAL_BOOL sc_doresetcal; /* Yes, we're doing a reset cal atm */
HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */
u_int sc_tdmadbaprep; /* TDMA DBA prep time */
u_int sc_tdmaswbaprep;/* TDMA SWBA prep time */
@@ -503,6 +506,8 @@ void ath_intr(void *);
((*(_ah)->ah_setDefAntenna)((_ah), (_ant)))
#define ath_hal_rxmonitor(_ah, _arg, _chan) \
((*(_ah)->ah_rxMonitor)((_ah), (_arg), (_chan)))
+#define ath_hal_ani_poll(_ah, _chan) \
+ ((*(_ah)->ah_aniPoll)((_ah), (_chan)))
#define ath_hal_mibevent(_ah, _stats) \
((*(_ah)->ah_procMibEvent)((_ah), (_stats)))
#define ath_hal_setslottime(_ah, _us) \
More information about the svn-src-all
mailing list