summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-05-24 18:25:40 +0000
committeradrian <adrian@FreeBSD.org>2011-05-24 18:25:40 +0000
commit3ab4bcdcc6db40f7bb2d378e854e26bed712d67f (patch)
treeff2aeb586a392365e250e7f359d0589b6578dd78 /sys/dev/ath
parent55c5ca796aaf95e3f0962d0e2eb21b3f182bfd79 (diff)
downloadFreeBSD-src-3ab4bcdcc6db40f7bb2d378e854e26bed712d67f.zip
FreeBSD-src-3ab4bcdcc6db40f7bb2d378e854e26bed712d67f.tar.gz
The ANI control for the AR5416 and later chips was calling ar5212AniControl(),
which did AR5212 specific initialisation. This would cause some slight silliness when enabling/disabling ANI. Just to be completely correct - and to ensure the phy error mask/RX filter register isn't incorrectly played with - make the ANI control function a method, have it set appropriately for AR5212/AR5416, and call that from the ANI control interface.
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212.h3
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_attach.c3
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_misc.c4
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_attach.c3
4 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h
index e226816..5bdfcb4 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212.h
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h
@@ -320,6 +320,9 @@ struct ath_hal_5212 {
struct ar5212AniState *ah_curani; /* cached last reference */
struct ar5212AniState ah_ani[AH_MAXCHAN]; /* per-channel state */
+ /* AR5416 uses some of the AR5212 ANI code; these are the ANI methods */
+ HAL_BOOL (*ah_aniControl) (struct ath_hal *, HAL_ANI_CMD cmd, int param);
+
/*
* Transmit power state. Note these are maintained
* here so they can be retrieved by diagnostic tools.
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
index 4b0fcbe..5f85522 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
@@ -203,6 +203,9 @@ ar5212AniSetup(struct ath_hal *ah)
ar5212AniAttach(ah, &tmp, &tmp, AH_TRUE);
} else
ar5212AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
+
+ /* Set overridable ANI methods */
+ AH5212(ah)->ah_aniControl = ar5212AniControl;
}
/*
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
index 0d6adc1..d5b96a5 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
@@ -990,7 +990,7 @@ ar5212SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
HAL_ANI_SPUR_IMMUNITY_LEVEL,
};
return capability < N(cmds) ?
- ar5212AniControl(ah, cmds[capability], setting) :
+ AH5212(ah)->ah_aniControl(ah, cmds[capability], setting) :
AH_FALSE;
}
case HAL_CAP_TSF_ADJUST: /* hardware has beacon tsf adjust */
@@ -1053,7 +1053,7 @@ ar5212GetDiagState(struct ath_hal *ah, int request,
case HAL_DIAG_ANI_CMD:
if (argsize != 2*sizeof(uint32_t))
return AH_FALSE;
- ar5212AniControl(ah, ((const uint32_t *)args)[0],
+ AH5212(ah)->ah_aniControl(ah, ((const uint32_t *)args)[0],
((const uint32_t *)args)[1]);
return AH_TRUE;
case HAL_DIAG_ANI_PARAMS:
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
index 6779bf9..fd4a905 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
@@ -200,6 +200,9 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc,
/* Enable all ANI functions to begin with */
AH5416(ah)->ah_ani_function = HAL_ANI_ALL;
+
+ /* Set overridable ANI methods */
+ AH5212(ah)->ah_aniControl = ar5416AniControl;
}
uint32_t
OpenPOWER on IntegriCloud