Changeset 3639
- Timestamp:
- 05/17/08 06:41:01 (3 months ago)
- Files:
-
- madwifi/trunk/ath/if_ath.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
madwifi/trunk/ath/if_ath.c
r3635 r3639 617 617 * problems for OFDM. */ 618 618 sc->sc_hasintmit = ath_hal_hasintmit(ah); 619 if (!sc->sc_hasintmit) { 620 if (intmit) { 621 WPRINTF(sc, "Interference mitigation was requested, " 622 "but is not supported by the " 623 "HAL/hardware.\n"); 624 intmit = 0; 625 } 626 sc->sc_useintmit = 0; 619 sc->sc_useintmit = (intmit && sc->sc_hasintmit); 620 if (!sc->sc_hasintmit && intmit) { 621 WPRINTF(sc, "Interference mitigation was requested, but is not" 622 "supported by the HAL/hardware.\n"); 623 intmit = 0; /* Stop use in future ath_attach(). */ 627 624 } 628 625 else { 629 ath_hal_setintmit(ah, (sc->sc_useintmit = intmit));626 ath_hal_setintmit(ah, sc->sc_useintmit); 630 627 IPRINTF(sc, "Interference mitigation is supported. Currently %s.\n", 631 628 (sc->sc_useintmit ? "enabled" : "disabled")); … … 1603 1600 } 1604 1601 1605 /* NB: I NTMITwas not implemented so that it could be enabled/disabled,1602 /* NB: Int. mit. was not implemented so that it could be enabled/disabled, 1606 1603 * and actually in 0.9.30.13 HAL it really can't even be disabled because 1607 1604 * it will start adjusting registers even when we turn off the capability … … 1609 1606 * 1610 1607 * NB: This helper function basically clobbers all the related registers 1611 * if we have disabled INTMITcap, allowing us to turn it on and off and1608 * if we have disabled int. mit. cap, allowing us to turn it on and off and 1612 1609 * work around the bug preventing it from being disabled. */ 1613 1610 static inline void ath_override_intmit_if_disabled(struct ath_softc *sc) { 1614 /* Restore int mit registers if we turned off intmit!*/1611 /* Restore int. mit. registers if they were turned off. */ 1615 1612 if (sc->sc_hasintmit && !sc->sc_useintmit) 1616 1613 ath_hal_restore_default_intmit(sc->sc_ah); 1617 /* Sanity check... remove later*/1614 /* Sanity check... remove later. */ 1618 1615 if (!sc->sc_useintmit) { 1619 1616 ath_hal_verify_default_intmit(sc->sc_ah); 1620 /* If we don't have INTMITand we don't have DFS on channel,1621 * it is safe to filter error packets !*/1617 /* If we don't have int. mit. and we don't have DFS on channel, 1618 * it is safe to filter error packets. */ 1622 1619 if (!ath_radar_is_dfs_required(sc, &sc->sc_curchan)) { 1623 ath_hal_setrxfilter(sc->sc_ah, 1620 ath_hal_setrxfilter(sc->sc_ah, 1624 1621 ath_hal_getrxfilter(sc->sc_ah) & 1625 ~HAL_RX_FILTER_PHYERR);1622 ~HAL_RX_FILTER_PHYERR); 1626 1623 } 1627 1624 } 1628 1625 else { 1629 /* Make sure that we have errors in rx filter cause ANI needs1626 /* Make sure that we have errors in RX filter because ANI needs 1630 1627 * them. */ 1631 1628 ath_hal_setrxfilter(sc->sc_ah, … … 1691 1688 } 1692 1689 1693 if (sc->sc_hasintmit) {1694 u_int32_t intmit_on = 0;1695 ath_hal_getintmit(sc->sc_ah, &intmit_on);1696 if (intmit_on != sc->sc_useintmit) {1697 WPRINTF(sc, "Int. Mit. HAL capability out of sync. Got %d!\n", intmit);1698 ath_hal_setintmit(sc->sc_ah, (sc->sc_hasintmit && sc->sc_useintmit));1699 }1700 }1701 1690 #ifdef ATH_CAP_TPC 1702 1691 if (sc->sc_hastpc && (hal_tpc != ath_hal_gettpc(sc->sc_ah))) { … … 1705 1694 } 1706 1695 #endif 1707 /* XXX: Any other features they clobber? */ 1696 #if 0 /* Setting via HAL does not work, so it is done manually below. */ 1697 if (sc->sc_hasintmit) 1698 ath_hal_setintmit(sc->sc_ah, sc->sc_useintmit); 1699 #endif 1708 1700 ath_override_intmit_if_disabled(sc); 1709 1701 if (sc->sc_softled) 1710 1702 ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); 1711 ath_update_txpow(sc); /* update tx power state */ 1703 ath_update_txpow(sc); /* Update TX power state. */ 1704 ath_setdefantenna(sc, sc->sc_defant); 1705 /* XXX: Any other clobbered features? */ 1706 1712 1707 ath_radar_update(sc); 1713 ath_setdefantenna(sc, sc->sc_defant);1714 1708 ath_rp_flush(sc); 1715 1709 … … 10699 10693 u_int tab_3_val[3]; 10700 10694 int ret = 0; 10701 int oldval = 0;10702 10695 10703 10696 ctl->data = &val; … … 10922 10915 break; 10923 10916 case ATH_INTMIT: 10924 oldval = sc->sc_useintmit; 10925 sc->sc_useintmit = (sc->sc_hasintmit && val); 10917 if (!sc->sc_hasintmit) { 10918 ret = -EOPNOTSUPP; 10919 break; 10920 } 10921 if (sc->sc_useintmit == val) 10922 break; 10923 sc->sc_useintmit = val; 10926 10924 sc->sc_needmib = ath_hal_hwphycounters(ah) && 10927 sc->sc_hasintmit &&10928 10925 sc->sc_useintmit; 10929 10926 /* Update the HAL and MIB interrupt mask bits */ 10930 ath_hal_setintmit(ah, val ? 1 : 0);10927 ath_hal_setintmit(ah, !!val); 10931 10928 sc->sc_imask = (sc->sc_imask & ~HAL_INT_MIB) | 10932 10929 (sc->sc_needmib ? HAL_INT_MIB : 0); … … 10934 10931 /* Only do a reset if device is valid and UP 10935 10932 * and we just made a change to the settings. */ 10936 if ((oldval != sc->sc_useintmit) && 10937 NULL != sc->sc_dev && !sc->sc_invalid && 10938 (sc->sc_dev->flags & IFF_RUNNING) && 10939 sc->sc_hasintmit) 10933 if (sc->sc_dev && !sc->sc_invalid && 10934 (sc->sc_dev->flags & IFF_RUNNING)) 10940 10935 ath_reset(sc->sc_dev); 10941 10936 /* NB: Run this step to cleanup if HAL doesn't
