From owner-svn-src-all@FreeBSD.ORG Fri Mar 25 10:55:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 965421065672; Fri, 25 Mar 2011 10:55:25 +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 6A27E8FC17; Fri, 25 Mar 2011 10:55:25 +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 p2PAtPU1076069; Fri, 25 Mar 2011 10:55:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2PAtPCr076066; Fri, 25 Mar 2011 10:55:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103251055.p2PAtPCr076066@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 Mar 2011 10:55:25 +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: r219985 - in head/sys/dev/ath: . ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2011 10:55:25 -0000 Author: adrian Date: Fri Mar 25 10:55:25 2011 New Revision: 219985 URL: http://svn.freebsd.org/changeset/base/219985 Log: After discussing with Bernhard, the "right" way in net80211 to check the channel width is ni->ni_chw, which is set to the negotiated channel width. ni->ni_htflags is the capability, rather than the negotiated value. Teach both the TX path and the sample rate module about this. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri Mar 25 10:53:13 2011 (r219984) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri Mar 25 10:55:25 2011 (r219985) @@ -484,7 +484,7 @@ update_stats(struct ath_softc *sc, struc const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); int tt, tries_so_far; - int is_ht40 = (an->an_node.ni_htcap & IEEE80211_HTCAP_CHWIDTH40); + int is_ht40 = (an->an_node.ni_chw == 40); if (!IS_RATE_DEFINED(sn, rix0)) return; @@ -799,7 +799,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, continue; printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix), calc_usecs_unicast_packet(sc, 1600, rix, 0,0, - (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40))); + (ni->ni_chw == 40))); } printf("\n"); } @@ -829,7 +829,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, sn->stats[y][rix].perfect_tx_time = calc_usecs_unicast_packet(sc, size, rix, 0, 0, - (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)); + (ni->ni_chw == 40)); sn->stats[y][rix].average_tx_time = sn->stats[y][rix].perfect_tx_time; } Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Fri Mar 25 10:53:13 2011 (r219984) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Mar 25 10:55:25 2011 (r219985) @@ -129,9 +129,14 @@ ath_rateseries_setup(struct ath_softc *s if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) series[i].RateFlags |= HAL_RATESERIES_RTS_CTS; -#if 0 - if (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) + /* + * Transmit 40MHz frames only if the node has negotiated + * it rather than whether the node is capable of it or not. + * It's subtly different in the hostap case. + */ + if (ni->ni_chw == 40) series[i].RateFlags |= HAL_RATESERIES_2040; +#if 0 /* * The hardware only supports short-gi in 40mhz mode - * if later hardware supports it in 20mhz mode, be sure