Suggest improvement to ar5416_ani.c on adaptive noise immunity

Adrian Chadd adrian at freebsd.org
Mon Sep 30 06:45:35 UTC 2013


good catch!


-adrian


On 29 September 2013 22:32, Winston <tx2023 at gmail.com> wrote:

> I was reading the source code in the ar5416_ani.c file and I would
> like to suggest an improvement.
>
>
> http://svnweb.freebsd.org/base/projects/bmake/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c?view=markup
>
>
> Code:
> ---------
> 966    params = aniState->params;
> 967    if (aniState->listenTime > 5*params->period) {
> 968            /*
> 969            * Check to see if need to lower immunity if
> 970            * 5 aniPeriods have passed
> 971            */
> 972            updateMIBStats(ah, aniState);
> 973            if (aniState->ofdmPhyErrCount <= aniState->listenTime *
> 974                params->ofdmTrigLow/1000 &&
> 975                aniState->cckPhyErrCount <= aniState->listenTime *
> 976                params->cckTrigLow/1000)
> 977                    ar5416AniLowerImmunity(ah);
> 978            HALDEBUG(ah, HAL_DEBUG_ANI, "%s: lower immunity\n",
> 979                __func__);
> 980            ar5416AniRestart(ah, aniState);
> 981    } else if (aniState->listenTime > params->period) {
> ---------
> I think lines 977 to 979 should be grouped together by curly braces.
>
> The reason is that currently line 978 is outside of the "if" block
> starting in line 973.
>
> Link to Atheros HAL: Ambient Noise Immunity (ANI):
> https://wiki.freebsd.org/dev/ath_hal%284%29/AutomaticNoiseImmunity
> ************
>
> http://forums.FreeBSD.org/showthread.php?t=42136
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> w
> _______________________________________________
> freebsd-wireless at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe at freebsd.org
> "
>


More information about the freebsd-wireless mailing list