summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-04-03 18:00:19 +0000
committersam <sam@FreeBSD.org>2009-04-03 18:00:19 +0000
commitcde6991b73026c367b500f4d6e6fa8a7e0af8c79 (patch)
treeb75baac72f8f261f1c00f28dd32416ab67f18c9b /sys/net80211
parentfc57d2304cd44754bbc7ea651ea68ed2be68285e (diff)
downloadFreeBSD-src-cde6991b73026c367b500f4d6e6fa8a7e0af8c79.zip
FreeBSD-src-cde6991b73026c367b500f4d6e6fa8a7e0af8c79.tar.gz
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
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_freebsd.h3
-rw-r--r--sys/net80211/ieee80211_output.c5
-rw-r--r--sys/net80211/ieee80211_wds.c16
3 files changed, 15 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h
index 3b5d1bb..db6648d 100644
--- a/sys/net80211/ieee80211_freebsd.h
+++ b/sys/net80211/ieee80211_freebsd.h
@@ -211,7 +211,6 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
/* 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_t **frm, int headroom, int pktlen);
#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 */
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 4ad1f8c..1272d88 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -919,12 +919,11 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni,
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));
diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c
index 7ba62b8..27b995a 100644
--- a/sys/net80211/ieee80211_wds.c
+++ b/sys/net80211/ieee80211_wds.c
@@ -250,9 +250,7 @@ ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m)
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 *vap0, struct mbuf *m)
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 *vap0, struct mbuf *m)
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);
OpenPOWER on IntegriCloud