From owner-freebsd-wireless@FreeBSD.ORG Mon Sep 30 02:35:09 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A283715D for ; Mon, 30 Sep 2013 02:35:09 +0000 (UTC) (envelope-from tx2023@gmail.com) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 808A424A6 for ; Mon, 30 Sep 2013 02:35:09 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id ld10so5207652pab.36 for ; Sun, 29 Sep 2013 19:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=6BWRzsxSGDHANs/lst6T91F5klm2Re7Dky4syhqhzmA=; b=uXIoEc2PrfTxarKplcW1hiE6IzA1wXobZo8sgQN2pYmOJZEHPVvdaEko1tUeJFfjtR HpuICtw8jaJj1kjf76U09+B0giPuZ7Wh3IHzOYdNXppz8Tl23Van5FwLxYGUd1JoOP5v cs1BaiRTjKnAtKmajsyIkIVCLaSniJ9F+bdgXchuPDPGRxRGHR5zss2G4ujdCRZ/O9om Yo2TByJKXMDX6pq9RNgWLdqk5P1ySV22X4LT0KdBWzjJY1W3ve186MaEvpfKAmVMwbF2 yfQ1H7XtXVfWJrz82Q0S3mnQ6JW/4X3p8q3uMEIOWVEYiKcQeZhp0+CGdqOrafW2hdin 1IJg== MIME-Version: 1.0 X-Received: by 10.66.141.199 with SMTP id rq7mr25713582pab.9.1380508509159; Sun, 29 Sep 2013 19:35:09 -0700 (PDT) Sender: tx2023@gmail.com Received: by 10.68.13.226 with HTTP; Sun, 29 Sep 2013 19:35:09 -0700 (PDT) Date: Mon, 30 Sep 2013 10:35:09 +0800 X-Google-Sender-Auth: Rz6Kqw7-mufqV0I3Kos0eZAfQC4 Message-ID: Subject: Suggest improvement to ar5416_ani.c on adaptive noise immunity From: Winston h01i To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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 02:35:09 -0000 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~