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
This commit is contained in:
parent
c130439940
commit
6437e6da3d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190672
@ -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 */
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user