From owner-svn-src-all@freebsd.org Sun May 1 05:01:11 2016 Return-Path: Delivered-To: svn-src-all@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 E956EB266CC; Sun, 1 May 2016 05:01:11 +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 A8DAF1B0A; Sun, 1 May 2016 05:01:11 +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 u4151AM9009502; Sun, 1 May 2016 05:01:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4151AcX009501; Sun, 1 May 2016 05:01:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605010501.u4151AcX009501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 1 May 2016 05:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298875 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 01 May 2016 05:01:12 -0000 Author: adrian Date: Sun May 1 05:01:10 2016 New Revision: 298875 URL: https://svnweb.freebsd.org/changeset/base/298875 Log: [iwn] fill in the TX command rate info flags consistently. The Linux driver sets the rate_n_flags regardless of whether it's being sent using firmware rate control or local rate control. This includes the antenna configuration. Thanks to Kyle Evans for pointing this out to me and doing some investigation/testing on his end. Tested: * Intel 7260 STA, 2G and 5G networks Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sun May 1 02:39:39 2016 (r298874) +++ head/sys/dev/iwm/if_iwm.c Sun May 1 05:01:10 2016 (r298875) @@ -2572,9 +2572,7 @@ iwm_tx_rateidx_lookup(struct iwm_softc * } /* - * Fill in various bit for management frames, and leave them - * unfilled for data frames (firmware takes care of that). - * Return the selected TX rate. + * Fill in the rate related information for a transmit command. */ static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in, @@ -2606,28 +2604,28 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, st IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); - /* XXX no rate_n_flags? */ - return &iwm_rates[ridx]; - } - - /* - * For non-data, use the lowest supported rate for the given - * operational mode. - * - * Note: there may not be any rate control information available. - * This driver currently assumes if we're transmitting data - * frames, use the rate control table. Grr. - * - * XXX TODO: use the configured rate for the traffic type! - */ - if (ic->ic_curmode == IEEE80211_MODE_11A) { + } else { /* - * XXX this assumes the mode is either 11a or not 11a; - * definitely won't work for 11n. + * For non-data, use the lowest supported rate for the given + * operational mode. + * + * Note: there may not be any rate control information available. + * This driver currently assumes if we're transmitting data + * frames, use the rate control table. Grr. + * + * XXX TODO: use the configured rate for the traffic type! + * XXX TODO: this should be per-vap, not curmode; as we later + * on we'll want to handle off-channel stuff (eg TDLS). */ - ridx = IWM_RIDX_OFDM; - } else { - ridx = IWM_RIDX_CCK; + if (ic->ic_curmode == IEEE80211_MODE_11A) { + /* + * XXX this assumes the mode is either 11a or not 11a; + * definitely won't work for 11n. + */ + ridx = IWM_RIDX_OFDM; + } else { + ridx = IWM_RIDX_CCK; + } } rinfo = &iwm_rates[ridx]; @@ -2642,7 +2640,6 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, st rate_flags = 1 << IWM_RATE_MCS_ANT_POS; if (IWM_RIDX_IS_CCK(ridx)) rate_flags |= IWM_RATE_MCS_CCK_MSK; - /* XXX hard-coded tx rate */ tx->rate_n_flags = htole32(rate_flags | rinfo->plcp); return rinfo;