From owner-svn-src-head@FreeBSD.ORG  Mon Feb 21 15:49:59 2011
Return-Path: <owner-svn-src-head@FreeBSD.ORG>
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD03F106566B;
	Mon, 21 Feb 2011 15:49:59 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A16F38FC0A;
	Mon, 21 Feb 2011 15:49:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1LFnxPe075014;
	Mon, 21 Feb 2011 15:49:59 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1LFnx0H075012;
	Mon, 21 Feb 2011 15:49:59 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201102211549.p1LFnx0H075012@svn.freebsd.org>
From: Adrian Chadd <adrian@FreeBSD.org>
Date: Mon, 21 Feb 2011 15:49:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r218916 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	<svn-src-head.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-head>,
	<mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Feb 2011 15:49:59 -0000

Author: adrian
Date: Mon Feb 21 15:49:59 2011
New Revision: 218916
URL: http://svn.freebsd.org/changeset/base/218916

Log:
  Default to the lowest negotiated rate for mgmt/multicast traffic in 11n mode
  
  The current code transmits management and multicast frames at MCS 0.
  What it should do is check whether the negotiated basic set is zero (and
  the MCS set is not) before making this decision.
  
  For now, simply default to the lowest negotiated rate, rather than
  MCS 0. This fixes the behaviour with at least the DLINK DIR-825, which
  ACKs but silently ignores block-ack (BA) response frames.

Modified:
  head/sys/net80211/ieee80211_proto.c

Modified: head/sys/net80211/ieee80211_proto.c
==============================================================================
--- head/sys/net80211/ieee80211_proto.c	Mon Feb 21 14:28:31 2011	(r218915)
+++ head/sys/net80211/ieee80211_proto.c	Mon Feb 21 15:49:59 2011	(r218916)
@@ -207,6 +207,21 @@ ieee80211_proto_vattach(struct ieee80211
 		const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i];
 
 		vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE;
+
+		/*
+		 * Setting the management rate to MCS 0 assumes that the
+		 * BSS Basic rate set is empty and the BSS Basic MCS set
+		 * is not.
+		 *
+		 * Since we're not checking this, default to the lowest
+		 * defined rate for this mode.
+		 *
+		 * At least one 11n AP (DLINK DIR-825) is reported to drop
+		 * some MCS management traffic (eg BA response frames.)
+		 *
+		 * See also: 9.6.0 of the 802.11n-2009 specification.
+		 */
+#ifdef	NOTYET
 		if (i == IEEE80211_MODE_11NA || i == IEEE80211_MODE_11NG) {
 			vap->iv_txparms[i].mgmtrate = 0 | IEEE80211_RATE_MCS;
 			vap->iv_txparms[i].mcastrate = 0 | IEEE80211_RATE_MCS;
@@ -216,6 +231,9 @@ ieee80211_proto_vattach(struct ieee80211
 			vap->iv_txparms[i].mcastrate = 
 			    rs->rs_rates[0] & IEEE80211_RATE_VAL;
 		}
+#endif
+		vap->iv_txparms[i].mgmtrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
+		vap->iv_txparms[i].mcastrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
 		vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT;
 	}
 	vap->iv_roaming = IEEE80211_ROAMING_AUTO;