svn commit: r190672 - head/sys/net80211
Sam Leffler
sam at FreeBSD.org
Fri Apr 3 11:00:20 PDT 2009
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);
More information about the svn-src-head
mailing list