From nobody@FreeBSD.org  Tue Oct 29 03:56:10 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 877DC2CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Oct 2013 03:56:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 74A622505
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Oct 2013 03:56:10 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9T3uAMS019708
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Oct 2013 03:56:10 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9T3uAQN019696;
	Tue, 29 Oct 2013 03:56:10 GMT
	(envelope-from nobody)
Message-Id: <201310290356.r9T3uAQN019696@oldred.freebsd.org>
Date: Tue, 29 Oct 2013 03:56:10 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [net80211] [iwn] Some APs seem to announce HT but no HT rates
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183428
>Category:       kern
>Synopsis:       [net80211] [iwn] Some APs seem to announce HT but no HT rates
>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:   Tue Oct 29 04:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Thu Oct 31 02:30:00 UTC 2013
>Originator:     Adrian Chadd
>Release:        -HEAD
>Organization:
>Environment:
>Description:
I just came across an 802.11n AP that doesn't announce 802.11n rates.

The net80211 code dutifully sets the channel up as an 11n channel and populates the HT rate set as empty.

So, amrr gets very confused when this occurs. And so does iwn.

There's two things to fix:

* amrr should not treat the node as 11n if there are no 11n rates;
* iwn should not assume that if the channel is 11n, that the rate is an MCS rate.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Oct 29 04:54:27 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183428: commit references a PR
Date: Thu, 31 Oct 2013 02:05:01 +0000 (UTC)

 Author: adrian
 Date: Thu Oct 31 02:04:53 2013
 New Revision: 257412
 URL: http://svnweb.freebsd.org/changeset/base/257412
 
 Log:
   Don't treat the node as an 11n node if 11n rates are disabled.
   
   For now, the AMRR code only knows about _either_ MCS or non-MCS rates.
   It doesn't know how to downgrade (ie, doing 11b CCK rates if MCS0 isn't
   reliable.)
   
   PR:		kern/183428
 
 Modified:
   head/sys/net80211/ieee80211_amrr.c
 
 Modified: head/sys/net80211/ieee80211_amrr.c
 ==============================================================================
 --- head/sys/net80211/ieee80211_amrr.c	Thu Oct 31 02:03:30 2013	(r257411)
 +++ head/sys/net80211/ieee80211_amrr.c	Thu Oct 31 02:04:53 2013	(r257412)
 @@ -131,6 +131,12 @@ amrr_deinit(struct ieee80211vap *vap)
  	free(vap->iv_rs, M_80211_RATECTL);
  }
  
 +/*
 + * Return whether 11n rates are possible.
 + *
 + * Some 11n devices may return HT information but no HT rates.
 + * Thus, we shouldn't treat them as an 11n node.
 + */
  static int
  amrr_node_is_11n(struct ieee80211_node *ni)
  {
 @@ -139,6 +145,8 @@ amrr_node_is_11n(struct ieee80211_node *
  		return (0);
  	if (ni->ni_chan == IEEE80211_CHAN_ANYC)
  		return (0);
 +	if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates == 0)
 +		return (0);
  	return (IEEE80211_IS_CHAN_HT(ni->ni_chan));
  }
  
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/183428: commit references a PR
Date: Thu, 31 Oct 2013 02:21:56 +0000 (UTC)

 Author: adrian
 Date: Thu Oct 31 02:21:48 2013
 New Revision: 257415
 URL: http://svnweb.freebsd.org/changeset/base/257415
 
 Log:
   Don't base the rate table selection based on the channel mode;
   it needs to check whether there are rate entries in there or not.
   
   PR:		kern/183428
 
 Modified:
   head/sys/dev/iwn/if_iwn.c
 
 Modified: head/sys/dev/iwn/if_iwn.c
 ==============================================================================
 --- head/sys/dev/iwn/if_iwn.c	Thu Oct 31 02:14:28 2013	(r257414)
 +++ head/sys/dev/iwn/if_iwn.c	Thu Oct 31 02:21:48 2013	(r257415)
 @@ -4312,6 +4312,7 @@ iwn_set_link_quality(struct iwn_softc *s
  	struct iwn_cmd_link_quality linkq;
  	uint8_t txant;
  	int i, rate, txrate;
 +	int is_11n;
  
  	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
  
 @@ -4326,15 +4327,25 @@ iwn_set_link_quality(struct iwn_softc *s
  	linkq.ampdu_threshold = 3;
  	linkq.ampdu_limit = htole16(4000);	/* 4ms */
  
 +	/*
 +	 * Are we using 11n rates? Ensure the channel is
 +	 * 11n _and_ we have some 11n rates, or don't
 +	 * try.
 +	 */
 +	if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates > 0)
 +		is_11n = 1;
 +	else
 +		is_11n = 0;
 +
  	/* Start at highest available bit-rate. */
 -	if (IEEE80211_IS_CHAN_HT(ni->ni_chan))
 +	if (is_11n)
  		txrate = ni->ni_htrates.rs_nrates - 1;
  	else
  		txrate = rs->rs_nrates - 1;
  	for (i = 0; i < IWN_MAX_TX_RETRIES; i++) {
  		uint32_t plcp;
  
 -		if (IEEE80211_IS_CHAN_HT(ni->ni_chan))
 +		if (is_11n)
  			rate = IEEE80211_RATE_MCS | txrate;
  		else
  			rate = RV(rs->rs_rates[txrate]);
 _______________________________________________
 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:
