Turn off Interference Mitigation/Ambient Noise Imunity when the HAL is not in Station...
authormentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 11 Nov 2007 01:47:55 +0000 (01:47 +0000)
committermentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 11 Nov 2007 01:47:55 +0000 (01:47 +0000)
It strikes me that we should always reset the hardware through a common function, though.

Ticket: http://madwifi.org/ticket/705
Original Patch: Signed-off-by: Tjalling Hattink <tjalling.hattink@ti-wmc.nl>

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2843 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c
ath/if_ath_hal_wrappers.h
ath/if_athvar.h

index 6e16801f513c1b380785a00289989211b28df76d..288966a4b8afbc5dd4d18bd953dfff141316bd10 100644 (file)
@@ -869,6 +869,11 @@ ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag)
         */
        sc->sc_hasveol = ath_hal_hasveol(ah);
 
+       /* Interference mitigation/ambient noise immunity (ANI).
+        * In modes other than HAL_M_STA, it causes receive sensitivity 
+        * problems for OFDM. */
+       sc->sc_hasintmit = ath_hal_hasintmit(ah);
+
        /* get mac address from hardware */
        ath_hal_getmac(ah, ic->ic_myaddr);
        if (sc->sc_hasbmask) {
@@ -2018,6 +2023,10 @@ ath_init(struct net_device *dev)
 
        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);
+
        /*
         * This is needed only to setup initial state
         * but it's best done after a reset.
@@ -2273,6 +2282,10 @@ ath_reset(struct net_device *dev)
        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(dev), __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",
@@ -7960,6 +7973,9 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
                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 */
 
index 741d72ee7434b269ec9552c5f8a8d0da5e35e14b..c8b02d8aab9c51425b838cd8201671f64ee85009 100644 (file)
@@ -271,4 +271,19 @@ static inline HAL_BOOL ath_hal_xrsupported(struct ath_hal *ah)
        return ath_hal_getcapability(ah, HAL_CAP_XR, 0, NULL) == HAL_OK;
 }
 
+static inline HAL_BOOL ath_hal_hasintmit(struct ath_hal *ah)
+{
+       return (ath_hal_getcapability(ah, HAL_CAP_INTMIT, 0, NULL) == HAL_OK); 
+}
+
+static inline HAL_BOOL ath_hal_getintmit(struct ath_hal *ah, u_int32_t *dst)
+{
+       return (ath_hal_getcapability(ah, HAL_CAP_INTMIT, 1, dst) == HAL_OK);
+}
+
+static inline HAL_BOOL ath_hal_setintmit(struct ath_hal *ah, u_int32_t v)
+{
+       return (ath_hal_setcapability(ah, HAL_CAP_INTMIT, 1, v, NULL) == HAL_OK);
+}
+
 #endif                         /* #ifndef _IF_ATH_HAL_WRAPPERS_H_ */
index 1300dc9d83295f072b9ce24defc5f1968bdd3d0b..17392972e2d93e6bfa1d41e4b05c089a678d4ce9 100644 (file)
@@ -582,8 +582,9 @@ struct ath_softc {
                        sc_hasclrkey:1,         /* CLR key supported */
                        sc_devstopped:1,        /* stopped due to of no tx bufs */
                        sc_stagbeacons:1,       /* use staggered beacons */
-                       sc_dfswait:1,           /* waiting on channel for radar detect */
-                       sc_ackrate:1;           /* send acks at high bitrate */
+                       sc_dfswait:1,           /* waiting on channel for radar detect */
+                       sc_ackrate:1,           /* send acks at high bitrate */
+                       sc_hasintmit:1;         /* Interference mitigation */
        /* rate tables */
        const HAL_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX];
        const HAL_RATE_TABLE *sc_currates;      /* current rate table */