From nobody@FreeBSD.org  Mon Jun  3 19:07:13 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 37080115
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jun 2013 19:07:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 294D41083
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jun 2013 19:07:13 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r53J7Ct1001402
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Jun 2013 19:07:12 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r53J7CkP001401;
	Mon, 3 Jun 2013 19:07:12 GMT
	(envelope-from nobody)
Message-Id: <201306031907.r53J7CkP001401@oldred.freebsd.org>
Date: Mon, 3 Jun 2013 19:07:12 GMT
From: adrian chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ath] [AR9285] RX antenna diversity is not functioning correctly; breaks single-antenna designs
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         179269
>Category:       kern
>Synopsis:       [ath] [AR9285] RX antenna diversity is not functioning correctly; breaks single-antenna designs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 03 19:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Jun  3 19:20:00 UTC 2013
>Originator:     adrian chadd
>Release:        FreeBSD-10
>Organization:
>Environment:
>Description:
This is applicable to -9 and -8 as well.

The AR9285 is a 1x1 design with a twist on "classic" style antenna diversity. The MAC can choose:

* RX on antenna 1 or 2;
* RX on both, by using a "mixer configuration" to mix the signals from both antennas a specific way;
* RX on both, by selecting either antenna 1 or 2 (ie, classic diversity) based on signal level;
* RX on both, by using the above mixer configuration (well two - main and alternate) and selecting one based on signal level

Now, by default, we're only doing RX on a single antenna. The AR_DEF_ANTENNA register controls the static antenna selection if fast diversity isn't enabled.

However! The AR5416 HAL does this:

        /*
         * Preserve the antenna on a channel change
         */
        saveDefAntenna = OS_REG_READ(ah, AR_DEF_ANTENNA);
        if (saveDefAntenna == 0)                /* XXX magic constants */
                saveDefAntenna = 1;

. which means RX will only occur on antenna #2 if antenna diversity is disabled.

So in one antenna solutions (antenna #1 / Main is connected) the unit will TX through the antenna, but RX through the unconnected port.

>How-To-Repeat:

* AR9285
* Connect an antenna to antenna #1
* do NOT connect an antenna to antenna #2
* Try being a station for a while
>Fix:
This workaround (for the AR5416, I guess) needs to be made conditional.

Fast and slow antenna diversity should be enabled as well. I'll go through the code and figure out why that isn't enabled.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Mon Jun 3 19:11:23 UTC 2013 
Responsible-Changed-Why:  
Punt to maintainer 


http://www.freebsd.org/cgi/query-pr.cgi?pr=179269 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/179269: commit references a PR
Date: Mon,  3 Jun 2013 19:14:42 +0000 (UTC)

 Author: adrian
 Date: Mon Jun  3 19:14:29 2013
 New Revision: 251340
 URL: http://svnweb.freebsd.org/changeset/base/251340
 
 Log:
   Fix receive on the AR9285 (Kite) with only one antenna connected.
   
   The main problem here is that fast and driver RX diversity isn't actually
   configured; I need to figure out why that is.  That said, this makes
   the single-antenna connected AR9285 and AR2427 (AR9285 w/ no 11n) work
   correctly.
   
   PR:		kern/179269
 
 Modified:
   head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
 
 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
 ==============================================================================
 --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Mon Jun  3 19:13:44 2013	(r251339)
 +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Mon Jun  3 19:14:29 2013	(r251340)
 @@ -136,7 +136,20 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
  	 * Preserve the antenna on a channel change
  	 */
  	saveDefAntenna = OS_REG_READ(ah, AR_DEF_ANTENNA);
 -	if (saveDefAntenna == 0)		/* XXX magic constants */
 +
 +	/*
 +	 * Don't do this for the AR9285 - it breaks RX for single
 +	 * antenna designs when diversity is disabled.
 +	 *
 +	 * I'm not sure what this was working around; it may be
 +	 * something to do with the AR5416.  Certainly this register
 +	 * isn't supposed to be used by the MIMO chips for anything
 +	 * except for defining the default antenna when an external
 +	 * phase array / smart antenna is connected.
 +	 *
 +	 * See PR: kern/179269 .
 +	 */
 +	if ((! AR_SREV_KITE(ah)) && saveDefAntenna == 0)	/* XXX magic constants */
  		saveDefAntenna = 1;
  
  	/* Save hardware flag before chip reset clears the register */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
