From owner-svn-src-all@FreeBSD.ORG Fri Apr 3 18:00:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7859A1065675; Fri, 3 Apr 2009 18:00:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8CD8FC38; Fri, 3 Apr 2009 18:00:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33I0Jen029066; Fri, 3 Apr 2009 18:00:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33I0JlC029063; Fri, 3 Apr 2009 18:00:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904031800.n33I0JlC029063@svn.freebsd.org> From: Sam Leffler Date: Fri, 3 Apr 2009 18:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190672 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 03 Apr 2009 18:00:20 -0000 Author: sam Date: Fri Apr 3 18:00:19 2009 New Revision: 190672 URL: http://svn.freebsd.org/changeset/base/190672 Log: o update dwds mcast handling after hoisting ieee80211_encap: frames need to be encapsulated before dispatching to the driver o eliminate M_WDS now that we call ieee80211_encap directly and can supply the wds vap to indicate a 4-address frame should be created Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_freebsd.h Fri Apr 3 18:00:19 2009 (r190672) @@ -211,7 +211,6 @@ struct mbuf *ieee80211_getmgtframe(uint8 /* tx path usage */ #define M_ENCAP M_PROTO1 /* 802.11 encap done */ -#define M_WDS M_PROTO2 /* WDS frame */ #define M_EAPOL M_PROTO3 /* PAE/EAPOL frame */ #define M_PWR_SAV M_PROTO4 /* bypass PS handling */ #define M_MORE_DATA M_PROTO5 /* more data frames to follow */ @@ -219,7 +218,7 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ #define M_80211_TX \ - (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|\ + (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_EAPOL|M_PWR_SAV|\ M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_output.c Fri Apr 3 18:00:19 2009 (r190672) @@ -919,12 +919,11 @@ ieee80211_encap(struct ieee80211vap *vap hdrsize = sizeof(struct ieee80211_frame); /* * 4-address frames need to be generated for: - * o packets sent through a WDS vap (M_WDS || IEEE80211_M_WDS) + * o packets sent through a WDS vap (IEEE80211_M_WDS) * o packets relayed by a station operating with dynamic WDS * (IEEE80211_M_STA+IEEE80211_F_DWDS and src address) */ - is4addr = (m->m_flags & M_WDS) || - vap->iv_opmode == IEEE80211_M_WDS || /* XXX redundant? */ + is4addr = vap->iv_opmode == IEEE80211_M_WDS || (vap->iv_opmode == IEEE80211_M_STA && (vap->iv_flags & IEEE80211_F_DWDS) && !IEEE80211_ADDR_EQ(eh.ether_shost, vap->iv_myaddr)); Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_wds.c Fri Apr 3 18:00:19 2009 (r190672) @@ -250,9 +250,7 @@ ieee80211_dwds_mcast(struct ieee80211vap if (ifp == m->m_pkthdr.rcvif) continue; /* - * Duplicate the frame and send it. We don't need - * to classify or lookup the tx node; this was already - * done by the caller so we can just re-use the info. + * Duplicate the frame and send it. */ mcopy = m_copypacket(m, M_DONTWAIT); if (mcopy == NULL) { @@ -267,6 +265,7 @@ ieee80211_dwds_mcast(struct ieee80211vap m_freem(mcopy); continue; } + /* calculate priority so drivers can find the tx queue */ if (ieee80211_classify(ni, mcopy)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_WDS, @@ -278,7 +277,16 @@ ieee80211_dwds_mcast(struct ieee80211vap ieee80211_free_node(ni); continue; } - mcopy->m_flags |= M_MCAST | M_WDS; + /* + * Encapsulate the packet in prep for transmission. + */ + mcopy = ieee80211_encap(vap, ni, mcopy); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + ieee80211_free_node(ni); + continue; + } + mcopy->m_flags |= M_MCAST; mcopy->m_pkthdr.rcvif = (void *) ni; err = parent->if_transmit(parent, mcopy);