Date: Tue, 24 May 2011 18:25:40 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r222265 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 Message-ID: <201105241825.p4OIPeVm080775@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Tue May 24 18:25:40 2011 New Revision: 222265 URL: http://svn.freebsd.org/changeset/base/222265 Log: 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. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue May 24 17:03:46 2011 (r222264) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue May 24 18:25:40 2011 (r222265) @@ -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. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue May 24 17:03:46 2011 (r222264) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Tue May 24 18:25:40 2011 (r222265) @@ -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; } /* Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 24 17:03:46 2011 (r222264) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue May 24 18:25:40 2011 (r222265) @@ -990,7 +990,7 @@ ar5212SetCapability(struct ath_hal *ah, 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, i 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: Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue May 24 17:03:46 2011 (r222264) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue May 24 18:25:40 2011 (r222265) @@ -200,6 +200,9 @@ ar5416InitState(struct ath_hal_5416 *ahp /* 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105241825.p4OIPeVm080775>