Date: Mon, 30 May 2011 15:06:57 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r222498 - head/sys/dev/ath Message-ID: <201105301506.p4UF6vnG082248@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Mon May 30 15:06:57 2011 New Revision: 222498 URL: http://svn.freebsd.org/changeset/base/222498 Log: Enable setting the short-GI bit when TX'ing HT rates but only if the hardware supports it. Since ni->ni_htcap in hostap mode is what the remote end has advertised, not what has been negotiated/decided, we need to check ourselves what the current channel width is and what the hardware supports before enabling short-GI. It's important that short-GI isn't enabled when it isn't negotiated and when the hardware doesn't support it (ie, short-gi for 20mhz channels on any chip < AR9287.) I've quickly verified this on the AR9285 in 11n mode. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon May 30 14:57:00 2011 (r222497) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon May 30 15:06:57 2011 (r222498) @@ -136,15 +136,23 @@ ath_rateseries_setup(struct ath_softc *s */ 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 - * to add the relevant check here. + * Set short-GI only if the node has advertised it + * the channel width is suitable, and we support it. + * We don't currently have a "negotiated" set of bits - + * ni_htcap is what the remote end sends, not what this + * node is capable of. */ - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + if (ni->ni_chw == 40 && + ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 && + ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + series[i].RateFlags |= HAL_RATESERIES_HALFGI; + + if (ni->ni_chw == 20 && + ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 && + ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) series[i].RateFlags |= HAL_RATESERIES_HALFGI; -#endif series[i].Rate = rt->info[rix[i]].rateCode;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105301506.p4UF6vnG082248>