From owner-freebsd-wireless@FreeBSD.ORG Mon Sep 30 05:32:28 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 EBEDA8F5 for ; Mon, 30 Sep 2013 05:32:28 +0000 (UTC) (envelope-from tx2023@gmail.com) Received: from mail-pb0-x236.google.com (mail-pb0-x236.google.com [IPv6:2607:f8b0:400e:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C88712B35 for ; Mon, 30 Sep 2013 05:32:28 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id ro12so5082900pbb.41 for ; Sun, 29 Sep 2013 22:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vfPjsFrQthGGnzXu9PdlE9NGegsd1LQqwBarY7RCGp4=; b=K0J5HsxVRzpyumjxnV/sdpNqSgevzvb/ekI4FVfpsMpqdwaK9BpJ8R7siTgZclru03 6Pc/mRHUw6knxM1GS0pdVrDJwScs/HXt6BRyrKS05FrXk/HRuQ6COPQ4OUkgS1mfNwAO 2AV+iTBReKR5l2pEaCAMzI1jRKkgHpG6f3hV9dTY1PypjSbNihgwV07n+uTUGOv2FpU7 jlF6NUntDio1iQVYdJH9SilGuLmfHdWxrEapgUi0F9WYDzAN5gCmJDIhDjAdnM/gjAt1 sPPlzQXikB9egncOIqZ5ZQRJTf40sveyyfNgBrq/5Lm2y+B1gtBr7JEVo86knBdbRsKj LrFw== MIME-Version: 1.0 X-Received: by 10.68.33.34 with SMTP id o2mr21633455pbi.128.1380519148326; Sun, 29 Sep 2013 22:32:28 -0700 (PDT) Received: by 10.68.13.226 with HTTP; Sun, 29 Sep 2013 22:32:28 -0700 (PDT) In-Reply-To: References: Date: Mon, 30 Sep 2013 13:32:28 +0800 Message-ID: Subject: Fwd: Suggest improvement to ar5416_ani.c on adaptive noise immunity From: Winston 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 05:32:29 -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ w