From owner-svn-src-all@freebsd.org Thu Sep 17 04:45:30 2015 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 9CE549CE8AA; Thu, 17 Sep 2015 04:45:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 80FCC1BDF; Thu, 17 Sep 2015 04:45:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8H4jUYc087528; Thu, 17 Sep 2015 04:45:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8H4jU2C087527; Thu, 17 Sep 2015 04:45:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201509170445.t8H4jU2C087527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 17 Sep 2015 04:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287901 - head/sys/dev/usb/wlan 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.20 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: Thu, 17 Sep 2015 04:45:30 -0000 Author: adrian Date: Thu Sep 17 04:45:29 2015 New Revision: 287901 URL: https://svnweb.freebsd.org/changeset/base/287901 Log: Bring over the QoS logic from the Linux r92su driver. * the tx descriptor TID is priority, not TID. * the tx descriptor queue id mapping is separate from the TID/priority; rather than just "BE". TODO: * go and re-re-re-verify the queue mappings; the linux and openbsd mappings aren't exactly the same. I need to verify all of this before I try to flip on 11n RX. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu Sep 17 04:43:07 2015 (r287900) +++ head/sys/dev/usb/wlan/if_rsu.c Thu Sep 17 04:45:29 2015 (r287901) @@ -425,6 +425,7 @@ rsu_attach(device_t self) IEEE80211_C_BGSCAN | /* Background scan. */ #endif IEEE80211_C_SHPREAMBLE | /* Short preamble supported. */ + IEEE80211_C_WME | /* WME/QoS */ IEEE80211_C_SHSLOT | /* Short slot time supported. */ IEEE80211_C_WPA; /* WPA/RSN. */ @@ -1752,10 +1753,11 @@ rsu_tx_start(struct rsu_softc *sc, struc struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; uint8_t type; - uint8_t tid = 0; + int prio = 0; uint8_t which; int hasqos; int xferlen; + int qid; RSU_ASSERT_LOCKED(sc); @@ -1776,6 +1778,23 @@ rsu_tx_start(struct rsu_softc *sc, struc } wh = mtod(m0, struct ieee80211_frame *); } + /* If we have QoS then use it */ + /* XXX TODO: mbuf WME/PRI versus TID? */ + if (IEEE80211_QOS_HAS_SEQ(wh)) { + /* Has QoS */ + prio = M_WME_GETAC(m0); + which = rsu_wme_ac_xfer_map[prio]; + hasqos = 1; + } else { + /* Non-QoS TID */ + /* XXX TODO: tid=0 for non-qos TID? */ + which = rsu_wme_ac_xfer_map[WME_AC_BE]; + hasqos = 0; + prio = 0; + } + + qid = rsu_ac2qid[prio]; +#if 0 switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: @@ -1786,7 +1805,7 @@ rsu_tx_start(struct rsu_softc *sc, struc break; } hasqos = 0; - +#endif /* Fill Tx descriptor. */ txd = (struct r92s_tx_desc *)data->buf; memset(txd, 0, sizeof(*txd)); @@ -1797,8 +1816,7 @@ rsu_tx_start(struct rsu_softc *sc, struc R92S_TXDW0_OWN | R92S_TXDW0_FSG | R92S_TXDW0_LSG); txd->txdw1 |= htole32( - SM(R92S_TXDW1_MACID, R92S_MACID_BSS) | - SM(R92S_TXDW1_QSEL, R92S_TXDW1_QSEL_BE)); + SM(R92S_TXDW1_MACID, R92S_MACID_BSS) | SM(R92S_TXDW1_QSEL, qid)); if (!hasqos) txd->txdw1 |= htole32(R92S_TXDW1_NONQOS); #ifdef notyet @@ -1826,9 +1844,9 @@ rsu_tx_start(struct rsu_softc *sc, struc txd->txdw2 |= htole32(R92S_TXDW2_BMCAST); /* * Firmware will use and increment the sequence number for the - * specified TID. + * specified priority. */ - txd->txdw3 |= htole32(SM(R92S_TXDW3_SEQ, tid)); + txd->txdw3 |= htole32(SM(R92S_TXDW3_SEQ, prio)); if (ieee80211_radiotap_active_vap(vap)) { struct rsu_tx_radiotap_header *tap = &sc->sc_txtap;