From owner-freebsd-wireless@FreeBSD.ORG Wed Sep 7 16:04:17 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45B9D106564A for ; Wed, 7 Sep 2011 16:04:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 079168FC14 for ; Wed, 7 Sep 2011 16:04:16 +0000 (UTC) Received: by mail-yx0-f182.google.com with SMTP id 36so614875yxk.13 for ; Wed, 07 Sep 2011 09:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=1LttYzNAJ1+yysMp31JFBlqfUYvyMOmPl9Wm14NQhcg=; b=RQ+CXRuex31yPzek0QvuasX8Kv+WVFySnwRSok0hXB4QwUqKvRIsEyn9z2ynuxlJPj DG93ydNAwLSc/I5ZpuzYqyq9Pjwlv6r5ao5iKOV6qDlq1YmJf+jKgUd2hAG9jW/k8gwT HH9CdXSfHKt78d7vGccpbq5SrACn0fktbn8A4= MIME-Version: 1.0 Received: by 10.236.144.193 with SMTP id n41mr12312488yhj.78.1315411437457; Wed, 07 Sep 2011 09:03:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.103.6 with HTTP; Wed, 7 Sep 2011 09:03:57 -0700 (PDT) In-Reply-To: <663133681.20110907193747@serebryakov.spb.ru> References: <663133681.20110907193747@serebryakov.spb.ru> Date: Thu, 8 Sep 2011 00:03:57 +0800 X-Google-Sender-Auth: 35jAaCXjUYSRnpNXy7PW2fPf-bE Message-ID: From: Adrian Chadd To: Lev Serebryakov Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org Subject: Re: AP performance (again): txpower regulation X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 07 Sep 2011 16:04:17 -0000 Hi, Well. Let's begin by looking at the code (in sys/dev/ath/ath_hal/ar5212) and see what TX power parameters are programmed in. The function is ar5212_xmit.c:ar5212SetTransmitPower(). The registers you need to care about are the ones set in there. You can use athpeek to find out what's going on: cynthia:ar5212 adrian$ fgrep AR_PHY_POWER *h ar5212phy.h:#define AR_PHY_POWER_TX_RATE1 0x9934 ar5212phy.h:#define AR_PHY_POWER_TX_RATE2 0x9938 ar5212phy.h:#define AR_PHY_POWER_TX_RATE_MAX 0x993c ar5212phy.h:#define AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE 0x00000040 ar5212phy.h:#define AR_PHY_POWER_TX_RATE3 0xA234 ar5212phy.h:#define AR_PHY_POWER_TX_RATE4 0xA238 then: athpeek 0x9934 athpeek 0x9938 athpeek 0x993c athpeek 0xa234 athpeek 0xa238 The RATE1 to RATE4 registers should change as you change the interface TX power. If they don't, we've got a problem. Each register is broken up into 4 8 bit fields, each containing a 6 bit tx power value in 0.5 dBm. (ie a value of 10 == 5 dBm.) There's some code in the AR5212 HAL to handle EEPROM TX power offsets; it's possible that it's causing some issues here. Also, make sure you don't have TPC enabled. (sysctl dev.ath.0.tpc). I'd love to sit down and try to get TPC working, but I lack all the test kit required. Good luck! Adrian