From owner-svn-src-head@freebsd.org Tue Apr 26 01:29:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6338B1DB92; Tue, 26 Apr 2016 01:29:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7397414F2; Tue, 26 Apr 2016 01:29:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q1T3aN088229; Tue, 26 Apr 2016 01:29:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1T31A088228; Tue, 26 Apr 2016 01:29:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260129.u3Q1T31A088228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298604 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:29:04 -0000 Author: adrian Date: Tue Apr 26 01:29:03 2016 New Revision: 298604 URL: https://svnweb.freebsd.org/changeset/base/298604 Log: [net80211] add STBC capability flags to iv_flags_ht. This is in preparation for exposing configuring STBC flags up to ifconfig so STBC TX/RX can be configured at runtime. * Set the FHT_STBC flags for TX/RX if the HT capabilitiex exist * Clear the RX STBC HT capability flag when creating a HTCAP IE, so we only announce it if it's configured in the FHT flags. Tested: * AR9331 (carambola2), AP/STA modes Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue Apr 26 01:26:11 2016 (r298603) +++ head/sys/net80211/ieee80211_ht.c Tue Apr 26 01:29:03 2016 (r298604) @@ -293,6 +293,11 @@ ieee80211_ht_vattach(struct ieee80211vap vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; if (vap->iv_htcaps & IEEE80211_HTC_AMSDU) vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; + + if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; + if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; } /* NB: disable default legacy WDS, too many issues right now */ if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) @@ -2778,6 +2783,13 @@ ieee80211_add_htcap_body(uint8_t *frm, s if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) caps &= ~IEEE80211_HTCAP_SHORTGI40; + + /* adjust STBC based on receive capabilities */ + if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) + caps &= ~IEEE80211_HTCAP_RXSTBC; + + /* XXX TODO: adjust LDPC based on receive capabilities */ + ADDSHORT(frm, caps); /* HT parameters */