diff options
author | sam <sam@FreeBSD.org> | 2008-10-26 00:55:38 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-10-26 00:55:38 +0000 |
commit | 8de9c505655e093127ac7177cab3ba86dbb5240b (patch) | |
tree | 8900192634d6807ea2393bc5dc813744914a3360 /sys/net80211 | |
parent | aac2357719169a3bd30d6d7950775881b785543f (diff) | |
download | FreeBSD-src-8de9c505655e093127ac7177cab3ba86dbb5240b.zip FreeBSD-src-8de9c505655e093127ac7177cab3ba86dbb5240b.tar.gz |
introduce M_ENCAP flag to mark packets encapsulated w/ an 802.11 header
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.h | 3 | ||||
-rw-r--r-- | sys/net80211/ieee80211_output.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index bdcbe5d..1f1826f 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -239,6 +239,7 @@ void ieee80211_vap_destroy(struct ieee80211vap *); 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 */ @@ -247,7 +248,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_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) + (M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU subframe */ diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index d67d932..713dc6b 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -507,6 +507,7 @@ ieee80211_mgmt_output(struct ieee80211_node *ni, struct mbuf *m, int type, "encrypting frame (%s)", __func__); wh->i_fc[1] |= IEEE80211_FC1_WEP; } + m->m_flags |= M_ENCAP; /* mark encapsulated */ KASSERT(type != IEEE80211_FC0_SUBTYPE_PROBE_RESP, ("probe response?")); M_WME_SETAC(m, params->ibp_pri); @@ -614,6 +615,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni) wh->i_fc[1] |= IEEE80211_FC1_PWR_MGT; } m->m_len = m->m_pkthdr.len = hdrlen; + m->m_flags |= M_ENCAP; /* mark encapsulated */ M_WME_SETAC(m, WME_AC_BE); @@ -1151,6 +1153,8 @@ ieee80211_encap(struct ieee80211_node *ni, struct mbuf *m) key != NULL ? key->wk_cipher->ic_header : 0, vap->iv_fragthreshold)) goto bad; + m->m_flags |= M_ENCAP; /* mark encapsulated */ + IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) IEEE80211_NODE_STAT(ni, tx_mcast); @@ -1770,6 +1774,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ, IEEE80211_NONQOS_TID, sa, da, bssid); /* XXX power management? */ + m->m_flags |= M_ENCAP; /* mark encapsulated */ M_WME_SETAC(m, WME_AC_BE); @@ -2359,6 +2364,7 @@ ieee80211_send_proberesp(struct ieee80211vap *vap, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP, IEEE80211_NONQOS_TID, vap->iv_myaddr, da, bss->ni_bssid); /* XXX power management? */ + m->m_flags |= M_ENCAP; /* mark encapsulated */ M_WME_SETAC(m, WME_AC_BE); |