Author: sam
Date: Tue Jan 13 05:50:22 2009
New Revision: 187129
URL: http://svn.freebsd.org/changeset/base/187129

Log:
  On some platforms touching the bb registers when the phy is powered
  down will cause a fault.  Check the phy power state before possibly
  reading from the bb, this can happen as ar5212Reset intentionally
  calls ar5212GetRfgain before bringing the bb out of reset (but we
  do it here and not in the caller to guard against other possible uses).

Modified:
  head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c     Tue Jan 13 05:13:20 
2009        (r187128)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c     Tue Jan 13 05:50:22 
2009        (r187129)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5212_rfgain.c,v 1.2 2008/11/19 21:23:01 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -280,7 +280,8 @@ ar5212GetRfgain(struct ath_hal *ah)
        GAIN_VALUES *gv = &ahp->ah_gainValues;
        uint32_t rddata, probeType;
 
-       if (!gv->active)
+       /* NB: beware of touching the BB when PHY is powered down */
+       if (!gv->active || !ahp->ah_phyPowerOn)
                return HAL_RFGAIN_INACTIVE;
 
        if (ahp->ah_rfgainState == HAL_RFGAIN_READ_REQUESTED) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to