From owner-svn-src-user@FreeBSD.ORG Fri May 31 21:54:53 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6704A461; Fri, 31 May 2013 21:54:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F22AE7D; Fri, 31 May 2013 21:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VLsrX0081587; Fri, 31 May 2013 21:54:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VLsr3w081586; Fri, 31 May 2013 21:54:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305312154.r4VLsr3w081586@svn.freebsd.org> From: Adrian Chadd Date: Fri, 31 May 2013 21:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r251199 - user/adrian/net80211_tx/sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 21:54:53 -0000 Author: adrian Date: Fri May 31 21:54:52 2013 New Revision: 251199 URL: http://svnweb.freebsd.org/changeset/base/251199 Log: Disable the deferred raw transmit path until I figure out why it isn't working. It works when using ath(4), but not when using iwn(4). I'll dig deeper into it soon but I'd like to bring over some other changes before I do that. Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_output.c Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_output.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_output.c Fri May 31 21:43:17 2013 (r251198) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_output.c Fri May 31 21:54:52 2013 (r251199) @@ -493,10 +493,32 @@ ieee80211_vap_tx_task(void *arg, int npe * need a lock to ensure they were dispatched in the correct order */ for (;;) { + struct ieee80211_tx_info *txinfo; + struct ieee80211_bpf_params *params; + struct ieee80211_node *ni; + IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - (void) ieee80211_vap_start_pkt(vap, m); + + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + + /* Fetch TX info from the mbuf if it has it */ + if (m->m_flags & M_TXINFO) + txinfo = ieee80211_get_txinfo(m); + else + txinfo = NULL; + + /* Raw packet? or normal data packet? */ + if (txinfo != NULL && txinfo->is_raw_tx) { + params = NULL; + if (txinfo->has_tx_params) { + params = &txinfo->bpf_params; + } + (void) (ic->ic_raw_xmit(ni, m, params)); + } else { + (void) ieee80211_vap_start_pkt(vap, m); + } /* mbuf is consumed here */ } } @@ -509,8 +531,51 @@ ieee80211_raw_output(struct ieee80211vap struct mbuf *m, const struct ieee80211_bpf_params *params) { struct ieee80211com *ic = vap->iv_ic; +#if 0 + struct ifnet *ifp = vap->iv_ifp; + struct ieee80211_tx_info txinfo; + + /* + * Queue the given mbuf into the VAP queue. + * + * Dispatch to the hardware will occur in the VAP transimt + * thread. + */ + bzero(&txinfo, sizeof(txinfo)); + txinfo.is_raw_tx = 1; + + if (params != NULL) { + txinfo.has_tx_params = 1; + memcpy(&txinfo.bpf_params, params, sizeof(*params)); + } + + if (! ieee80211_add_txinfo(m, &txinfo)) { + m_freem(m); + return (ENOBUFS); /* XXX correct? */ + } + + IF_LOCK(&ifp->if_snd); + + /* Enforce queue limits */ + if (_IF_QFULL(&ifp->if_snd)) { + IF_UNLOCK(&ifp->if_snd); + m_free(m); + return (ENOBUFS); /* XXX errno? */ + } + + /* XXX sanitize TX mbuf flags? */ + m->m_flags |= M_TXINFO; + _IF_ENQUEUE(&ifp->if_snd, m); + IF_UNLOCK(&ifp->if_snd); + + /* Schedule the deferred TX task */ + ieee80211_runtask(ic, &vap->iv_tx_task); + + return (0); +#else return (ic->ic_raw_xmit(ni, m, params)); +#endif } /*