From owner-svn-src-all@freebsd.org Fri Oct 23 00:48:01 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 9E7BEA1CAED; Fri, 23 Oct 2015 00:48:01 +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 70EDC15E4; Fri, 23 Oct 2015 00:48:01 +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 t9N0m0e3032953; Fri, 23 Oct 2015 00:48:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9N0m0jV032952; Fri, 23 Oct 2015 00:48:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510230048.t9N0m0jV032952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 23 Oct 2015 00:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289779 - head/sys/dev/otus 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: Fri, 23 Oct 2015 00:48:01 -0000 Author: adrian Date: Fri Oct 23 00:48:00 2015 New Revision: 289779 URL: https://svnweb.freebsd.org/changeset/base/289779 Log: otus(4): begin supporting raw transmit parameters in otus_tx() * Add a comment about the parameters I should support, stolen shamelessly from iwn(4); * Implement the rate bit for the raw transmit path; * Print out the host-order versions of each of the transmit bits, so I have a hope in heck of debugging why things are going wrong. This still doesn't fix 5GHz in the office but that's likely due to a lot of other configuration parameters being 2GHz-specific. That'll come next. Tested: * AR9170 + AR9103 (2/5GHz) 2x2, 5GHz association Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Thu Oct 22 23:41:56 2015 (r289778) +++ head/sys/dev/otus/if_otus.c Fri Oct 23 00:48:00 2015 (r289779) @@ -173,7 +173,8 @@ void otus_cmd_rxeof(struct otus_softc * void otus_sub_rxeof(struct otus_softc *, uint8_t *, int, struct mbufq *); static int otus_tx(struct otus_softc *, struct ieee80211_node *, - struct mbuf *, struct otus_data *); + struct mbuf *, struct otus_data *, + const struct ieee80211_bpf_params *); int otus_ioctl(struct ifnet *, u_long, caddr_t); int otus_set_multi(struct otus_softc *); static void otus_updateedca(struct otus_softc *sc); @@ -509,7 +510,7 @@ _otus_start(struct otus_softc *sc) ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (otus_tx(sc, ni, m, bf) != 0) { + if (otus_tx(sc, ni, m, bf, NULL) != 0) { OTUS_DPRINTF(sc, OTUS_DEBUG_XMIT, "%s: failed to transmit\n", __func__); if_inc_counter(ni->ni_vap->iv_ifp, @@ -554,10 +555,7 @@ otus_raw_xmit(struct ieee80211_node *ni, goto error; } - /* - * XXX TODO: support TX bpf params - */ - if (otus_tx(sc, ni, m, bf) != 0) { + if (otus_tx(sc, ni, m, bf, params) != 0) { error = EIO; goto error; } @@ -2178,10 +2176,20 @@ otus_tx_update_ratectl(struct otus_softc /* * XXX TODO: support tx bpf parameters for configuration! + * + * Relevant pieces: + * + * ac = params->ibp_pri & 3; + * rate = params->ibp_rate0; + * params->ibp_flags & IEEE80211_BPF_NOACK + * params->ibp_flags & IEEE80211_BPF_RTS + * params->ibp_flags & IEEE80211_BPF_CTS + * tx->rts_ntries = params->ibp_try1; + * tx->data_ntries = params->ibp_try0; */ static int otus_tx(struct otus_softc *sc, struct ieee80211_node *ni, struct mbuf *m, - struct otus_data *data) + struct otus_data *data, const struct ieee80211_bpf_params *params) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; @@ -2230,7 +2238,9 @@ otus_tx(struct otus_softc *sc, struct ie } /* Pickup a rate index. */ - if (IEEE80211_IS_MULTICAST(wh->i_addr1) || + if (params != NULL) { + rate = otus_rate_to_hw_rate(sc, params->ibp_rate0); + } else if (IEEE80211_IS_MULTICAST(wh->i_addr1) || (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) { /* Get lowest rate */ rate = otus_rate_to_hw_rate(sc, 0); @@ -2245,6 +2255,9 @@ otus_tx(struct otus_softc *sc, struct ie phyctl = 0; macctl = AR_TX_MAC_BACKOFF | AR_TX_MAC_HW_DUR | AR_TX_MAC_QID(qid); + /* + * XXX TODO: params for NOACK, ACK, RTS, CTS, etc + */ if (IEEE80211_IS_MULTICAST(wh->i_addr1) || (hasqos && ((qos & IEEE80211_QOS_ACKPOLICY) == IEEE80211_QOS_ACKPOLICY_NOACK))) @@ -2293,7 +2306,7 @@ otus_tx(struct otus_softc *sc, struct ie OTUS_DPRINTF(sc, OTUS_DEBUG_XMIT, "%s: tx: m=%p; data=%p; len=%d mac=0x%04x phy=0x%08x rate=0x%02x, ni_txrate=%d\n", - __func__, m, data, head->len, head->macctl, head->phyctl, + __func__, m, data, le16toh(head->len), macctl, phyctl, (int) rate, (int) ni->ni_txrate); /* Submit transfer */