[Madwifi-devel] [RFC PATCH 0.9.3] Improve OFDM sensitivity in non-STA operating modes.
Status: Beta
Brought to you by:
otaku
From: Scott R. <sco...@gm...> - 2007-12-10 23:42:37
|
Improve OFDM sensitivity in non-STA operating modes. This patch turns off Interference Mitigation (also known as Ambient Noise Immunity) in non-STA modes in order to work around a known bug in the HAL which causes poor OFDM sensitivity. Reference ticket: * http://madwifi.org/ticket/705 Reference changeset: * http://madwifi.org/changeset/2843 Index: ath/if_athvar.h =================================================================== --- ath/if_athvar.h (revision 3013) +++ ath/if_athvar.h (working copy) @@ -571,7 +571,8 @@ sc_rtasksched:1, /* radar task is scheduled */ sc_dfswait:1, /* waiting on channel for radar detect */ sc_dfstest:1, /* Test timer in progress */ - sc_ackrate:1; /* send acks at high bitrate */ + sc_ackrate:1, /* send acks at high bitrate */ + sc_hasintmit:1; /* Has interference mitigation */ /* rate tables */ const HAL_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX]; const HAL_RATE_TABLE *sc_currates; /* current rate table */ @@ -1023,5 +1024,11 @@ ((*(_ah)->ah_radarWait)((_ah), (_chan))) #define ath_hal_get_channel_noise(_ah, _chan) \ ((*(_ah)->ah_getChanNoise)((_ah), (_chan))) +#define ath_hal_hasintmit(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 0, NULL) == HAL_OK) +#define ath_hal_getintmit(_ah, _dst) \ + ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 1, _dst) +#define ath_hal_setintmit(_ah, _v) \ + ath_hal_setcapability(ah, HAL_CAP_INTMIT, 1, _v, NULL) #endif /* _DEV_ATH_ATHVAR_H */ Index: ath/if_ath.c =================================================================== --- ath/if_ath.c (revision 3013) +++ ath/if_ath.c (working copy) @@ -829,6 +829,12 @@ */ sc->sc_hasveol = ath_hal_hasveol(ah); + /* Interference Mitigation causes problems with recevive sensitivity + * for OFDM rates when we are in non-STA modes. We will turn this + * capability off in non-STA VAPs + */ + sc->sc_hasintmit = ath_hal_hasintmit(ah); + /* get mac address from hardware */ ath_hal_getmac(ah, ic->ic_myaddr); if (sc->sc_hasbmask) { @@ -1905,6 +1911,11 @@ if (sc->sc_softled) ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + + /* Turn off Interference Mitigation in non-STA modes */ + if ((sc->sc_opmode != HAL_M_STA) && sc->sc_hasintmit) + ath_hal_setintmit(ah, 0); + /* * This is needed only to setup initial state * but it's best done after a reset. @@ -2155,6 +2166,10 @@ if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) printk("%s: %s: unable to reset hardware: '%s' (HAL status %u)\n", dev->name, __func__, ath_get_hal_status_desc(status), status); + + if ((sc->sc_opmode != HAL_M_STA) && sc->sc_hasintmit) + ath_hal_setintmit(ah, 0); + ath_update_txpow(sc); /* update tx power state */ if (ath_startrecv(sc) != 0) /* restart recv */ printk("%s: %s: unable to start recv logic\n", @@ -7792,6 +7807,9 @@ if (sc->sc_softled) ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + if (sc->sc_opmode != HAL_M_STA && sc->sc_hasintmit) + ath_hal_setintmit(ah, 0); + sc->sc_curchan = hchan; ath_update_txpow(sc); /* update tx power state */ -- Scott Raynel WAND Network Research Group Department of Computer Science University of Waikato New Zealand |