From nobody@FreeBSD.org  Mon May  7 11:31:40 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 500D01065674
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 May 2012 11:31:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 21B228FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 May 2012 11:31:40 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q47BVdBD071929
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 7 May 2012 11:31:39 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q47BVd3N071928;
	Mon, 7 May 2012 11:31:39 GMT
	(envelope-from nobody)
Message-Id: <201205071131.q47BVd3N071928@red.freebsd.org>
Date: Mon, 7 May 2012 11:31:39 GMT
From: Ryan <ryan@jptech.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: The txmaxpow and txpower values I see from ifconfig appear wrong.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167675
>Category:       bin
>Synopsis:       The txmaxpow and txpower values I see from ifconfig(8) appear wrong.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 07 11:40:11 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon May 07 18:43:30 UTC 2012
>Originator:     Ryan
>Release:        8.1 i386
>Organization:
none
>Environment:
FreeBSD pfSense.localdomain 8.1-RELEASE-p6 FreeBSD 8.1-RELEASE-p6 #0: Mon Dec 12 18:59:41 EST 2011     root@FreeBSD_8.0_pfSense_2.0-snaps.pfsense.org:/usr/obj./usr/pfSensesrc/src/sys/pfSense_wrap.8.i386  i386
>Description:
I have a Compex WLM54G-26 wireless card (1)(2).  It uses an AR2413 chipset.  The following is partial output from "ifconfig".

regdomain FCC country CA indoor
txpowmax 50.0
txpower 30

The values given for "txpowmax" and "txpower" seem incorrect to me.  They do not appear to be using consistent units.  I'm making the assumption they should be showing dBm.  It's my understanding that net80211 stores these values as integers equal to 2xdBm, so it may be possible "txpowmax" is not being converted properly somewhere, but testing that assertion is beyond my ability at the moment.

Also, the WLM54G-26 is a 26dBm card.  Assuming "txpower" is displaying dBm, a value of "30" should not be possible.  If I change the regulatory domain, the value of "txpower" appears to be what I would expect.

regdomain 0 country US anywhere
txpowmax 50.0
txpower 26

However, both the CA and the US country codes fall under the "fcc" domain in "/etc/regdomain.xml", so I'm not sure why it has any impact.  Please note, I'm assuming "txpower" should match the output power of my card and I may be misunderstanding the values I should expect to see.

I originally started asking about this on the pfSense forums (3).  I also posted to the freebsd-wireless mailing list (4).

Also of note, I am not using a vanilla version of FreeBSD.  I am using pfSense 2.0.1 on an ALIX.2D13.

Ryan

1: http://www.compex.com.sg/fullDescription.aspx?pID=28

2: http://www.compex.com.sg/Datasheets/WLM54G-26_DSv2.1.3.pdf

3: http://forum.pfsense.org/index.php/topic,48814.0.html

4: http://freebsd.1045724.n5.nabble.com/Where-can-I-find-information-about-the-txpower-and-txpowmax-values-from-ifconfig-td5689298.html
>How-To-Repeat:
Run "ifconfig -v ath0_wlan0".
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
