From owner-freebsd-wireless@FreeBSD.ORG Mon Sep 30 06:45:35 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB470EF1 for ; Mon, 30 Sep 2013 06:45:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67EF12DCB for ; Mon, 30 Sep 2013 06:45:34 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id cb5so3199271wib.5 for ; Sun, 29 Sep 2013 23:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YAkpIinuTxEtghlr6A1F8Ssf+yXXxuY/sZpUHqDdmSA=; b=rgGC+6FOuOIDTNR154JMHbxNK8GhUFnedqv0SguQXFxn88YHdkOxHG9w/yvd4gWNey p2lDMpT0AcOd37YsowIvAoBwE3J/U6CUkvwoCAmEwkzK7wJu2IyH1bL7ZBRPtjWsTd/g 5uNRBLb6n1yE9e6EYhU9PNjju0G+j4Gc9pURuQ6TeA6gh3ByBORVai14+Lz0pEapkPpx clrAs2nyc61YXCujjTFV5vgQsGiqlHQ6IwYw7yi42qLPanw8R4F9TQEXXte0XMSqRJ3D hPQFe6OPSeTI6U7pgpkqnOg0zxH2LKgqkUbJQPd4hrNwFF4vihMw4pLXB4KeqtuEDflZ f6Nw== MIME-Version: 1.0 X-Received: by 10.180.37.164 with SMTP id z4mr12539089wij.30.1380523532699; Sun, 29 Sep 2013 23:45:32 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Sun, 29 Sep 2013 23:45:32 -0700 (PDT) In-Reply-To: References: Date: Sun, 29 Sep 2013 23:45:32 -0700 X-Google-Sender-Auth: mY08diP6bc1iJvMuCAaWtRZC_9Q Message-ID: Subject: Re: Suggest improvement to ar5416_ani.c on adaptive noise immunity From: Adrian Chadd To: Winston Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 06:45:35 -0000 good catch! -adrian On 29 September 2013 22:32, Winston 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org > " >