From amura@tomato.sakura.ne.jp  Sun Nov 15 12:11:25 2009
Return-Path: <amura@tomato.sakura.ne.jp>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17DA2106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Nov 2009 12:11:25 +0000 (UTC)
	(envelope-from amura@tomato.sakura.ne.jp)
Received: from tomato.sakura.ne.jp (tomato.sakura.ne.jp [210.188.226.72])
	by mx1.freebsd.org (Postfix) with ESMTP id D1E778FC21
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Nov 2009 12:11:24 +0000 (UTC)
Received: from looxu.amura.dyndns.org (118x237x137x5.ap118.gyao.ne.jp [118.237.137.5])
	(authenticated bits=0)
	by tomato.sakura.ne.jp (8.14.2/8.14.2/[SAKURA-WEB]/20080708) with ESMTP id nAFBIb8k014489
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Nov 2009 20:18:37 +0900 (JST)
	(envelope-from amura@tomato.sakura.ne.jp)
Received: by looxu.amura.dyndns.org (Postfix, from userid 1001)
	id 681E42E01E; Sat, 14 Nov 2009 07:49:39 +0900 (JST)
Message-Id: <20091113224939.681E42E01E@looxu.amura.dyndns.org>
Date: Sat, 14 Nov 2009 07:49:39 +0900 (JST)
From: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
Reply-To: MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] ath is not worked on my notebook PC
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         140567
>Category:       kern
>Synopsis:       [ath] [patch] ath is not worked on my notebook PC
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 15 12:20:00 UTC 2009
>Closed-Date:    
>Last-Modified:  Mon Oct 10 12:38:31 UTC 2011
>Originator:     MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
>Release:        FreeBSD 8.0-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD looxu.amura.dyndns.org 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #0 r199241M: Sat Nov 14 05:41:55 JST 2009 root@looxu.amura.dyndns.org:/usr/src/sys/i386/compile/LOOXU i386


	
>Description:
My notebook PC "Fujitsu LOOX U C40" has Athreos 9280 chip.
Athreos 9280 is supported by FreeBSD's ath driver, but not worked collectly.

Dmesg with AH_DEBUG option and hw.ath.hal.debug=0xffffff is attached
this report.

>How-To-Repeat:

Add below kernel options into configulation file, and create kernel.
Then boot with created kernel on Fujitsu LOOX U.

device    wlan
options   IEEE80211_AMPDU_AGE
options   IEEE80211_SUPPORT_MESH
device    wlan_wep
device    wlan_ccmp
device    wlan_tkip
device    wlan_amrr
device    ath
device    ath_hal
options   AH_SUPPORT_AR5416
device    ath_rate_sample

>Fix:

I wrote a patch for sys/dev/ath/ath_hal/ah_regdomain.c.
With this patch, ath is worked on my notebook.

--- dmesg begins here ---
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-PRERELEASE #0 r199241M: Sat Nov 14 05:41:55 JST 2009
root@looxu.amura.dyndns.org:/usr/src/sys/i386/compile/LOOXU i386
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU Z530   @ 1.60GHz (1596.01-MHz 686-class CPU)
Origin = "GenuineIntel"  Id = 0x106c2  Stepping = 2
Features=0xbfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x40c3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,xTPR,PDCM,<b22>>
AMD Features=0x100000<NX>
AMD Features2=0x1<LAHF>
TSC: P-state invariant
real memory  = 1073741824 (1024 MB)
avail memory = 1025724416 (978 MB)
ACPI APIC Table: <FUJ    FJNB1EE >
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads
cpu0 (BSP): APIC ID:  0
cpu1 (AP/HT): APIC ID:  1
  .. snip ..
pci8: <ACPI PCI bus> on pcib3
ath0: <Atheros 9280> mem 0xfd500000-0xfd50ffff irq 17 at device 0.0 on pci8
ath0: [ITHREAD]
ar9280Attach: sc 0xc4111000 st 0x1 sh 0xc3f2d000
ar5416SetPowerMode: AWAKE -> AWAKE (set chip )
ar9280Attach: ID 0x852ff VERSION 0x2 TYPE 0x5 REVISION 0x2
ath_hal_v14EepromAttach Eeprom Magic = 0xa55a
ath_hal_v14EepromAttach Eeprom Version 14.16
v14EepromReadCTLInfo Numctls = 21
ar5416SetPowerMode: AWAKE -> AWAKE (set chip )
ar9280RfAttach: attach AR9280 radio
enableAniMIBCounters: Enable mib counters: OfdmPhyErrBase 0x0 cckPhyErrBase 0x0
ar9280Attach: return
getchannels: cc 0 regDmn 0xf0 mode 0xffffff ecm
isEepromValid: invalid regulatory domain/country code 0x6b
getregstate: invalid EEPROM contents
ath0: ath_getchannels: unable to collect channel list from hal, status 12
ar5416Detach:
Detaching Ani
Disable MIB counters
ar5212SetPowerMode: AWAKE -> AWAKE (set chip )
ar5416SetPowerMode: AWAKE -> FULL-SLEEP (set chip )
device_attach: ath0 attach returned 22
--- dmesg ends here ---

--- ah_regdomain.c.patch begins here ---
Index: sys/dev/ath/ath_hal/ah_regdomain.c
===================================================================
--- sys/dev/ath/ath_hal/ah_regdomain.c	(revision 199241)
+++ sys/dev/ath/ath_hal/ah_regdomain.c	(working copy)
@@ -170,6 +170,7 @@
 
 	WOR9_WORLD	= 0x69,		/* World9 (WO9 SKU) */	
 	WORA_WORLD	= 0x6A,		/* WorldA (WOA SKU) */	
+	WORB_WORLD	= 0x6B,		/* WorldB (WOB SKU) */
 
 	MKK3_MKKB	= 0x80,		/* Japan UNI-1 even + MKKB */
 	MKK3_MKKA2	= 0x81,		/* Japan UNI-1 even + MKKA2 */
@@ -432,6 +433,7 @@
 	{EU1_WORLD,	EU1_WORLD,	EU1_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
 	{WOR9_WORLD,	WOR9_WORLD,	WOR9_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
 	{WORA_WORLD,	WORA_WORLD,	WORA_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
+	{WORB_WORLD,	WORB_WORLD,	WORB_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
 };
 
 /* 
@@ -1681,6 +1683,30 @@
 				      WG1_2467_2467),
 	 .chan11g_turbo		= BM1(T3_2437_2437)},
 
+	{.regDmnEnum		= WORB_WORLD,
+	 .conformanceTestLimit	= NO_CTL,
+	 .dfsMask		= DFS_FCC3 | DFS_ETSI,
+	 .pscan			= PSCAN_WWR,
+	 .flags			= DISALLOW_ADHOC_11A,
+	 .chan11a		= BM3(W1_5260_5320,
+				      W1_5180_5240,
+				      W1_5500_5700),
+	 .chan11b		= BM7(W1_2412_2412,
+				      W1_2437_2442,
+				      W1_2462_2462,
+				      W1_2472_2472,
+				      W1_2417_2432,
+				      W1_2447_2457,
+				      W1_2467_2467),
+	 .chan11g		= BM7(WG1_2412_2412,
+				      WG1_2437_2442,
+				      WG1_2462_2462,
+				      WG1_2472_2472,
+				      WG1_2417_2432,
+				      WG1_2447_2457,
+				      WG1_2467_2467),
+	 .chan11g_turbo		= BM1(T3_2437_2437)},
+
 	{.regDmnEnum		= NULL1,
 	 .conformanceTestLimit	= NO_CTL,
 	}
--- ah_regdomain.c.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Nov 15 20:45:59 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
State-Changed-From-To: open->patched 
State-Changed-By: arundel 
State-Changed-When: Mon Sep 6 22:55:01 UTC 2010 
State-Changed-Why:  
This issue was fixed in HEAD (r199491) and stable/8 (r199800). Still missing in 
stable/7. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
Responsible-Changed-From-To: freebsd-net->rpaulo 
Responsible-Changed-By: arundel 
Responsible-Changed-When: Tue Sep 7 09:05:59 UTC 2010 
Responsible-Changed-Why:  
Assign to committer as MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
Responsible-Changed-From-To: rpaulo->adrian 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Dec 4 16:16:54 UTC 2010 
Responsible-Changed-Why:  
rpaulo has return his commit bit for safekeeing.  Adrian, if you are working 
on MFCs of ath to -7, put this on your list; otherwise, just return it to the 
pool.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
Responsible-Changed-From-To: adrian->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Sat Apr 9 03:09:44 UTC 2011 
Responsible-Changed-Why:  
bump to freebsd-wireless 


http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
State-Changed-From-To: patched->closed 
State-Changed-By: adrian 
State-Changed-When: Mon Oct 10 12:37:48 UTC 2011 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
State-Changed-From-To: closed->patched 
State-Changed-By: adrian 
State-Changed-When: Mon Oct 10 12:38:25 UTC 2011 
State-Changed-Why:  
oops 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140567 
>Unformatted:
