svn commit: r251200 - user/adrian/net80211_tx/sys/net80211
Adrian Chadd
adrian at FreeBSD.org
Fri May 31 21:55:51 UTC 2013
Author: adrian
Date: Fri May 31 21:55:50 2013
New Revision: 251200
URL: http://svnweb.freebsd.org/changeset/base/251200
Log:
Add in the missing deferred transmit pieces - this adds support for
an mbuf tag to contain the transmit parameters.
Modified:
user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c
user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h
Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Fri May 31 21:54:52 2013 (r251199)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Fri May 31 21:55:50 2013 (r251200)
@@ -472,6 +472,39 @@ ieee80211_realign(struct ieee80211vap *v
#endif /* !__NO_STRICT_ALIGNMENT */
int
+ieee80211_add_txinfo(struct mbuf *m, struct ieee80211_tx_info *txinfo)
+{
+ struct m_tag *mtag;
+ struct ieee80211_tx_info *t;
+
+ mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_TXINFO,
+ sizeof(struct ieee80211_tx_info), M_NOWAIT);
+ if (mtag == NULL)
+ return (0);
+
+ t = (struct ieee80211_tx_info *) (mtag+1);
+
+ memcpy(t, txinfo, sizeof(struct ieee80211_tx_info));
+ m_tag_prepend(m, mtag);
+ m->m_flags |= M_TXINFO;
+ return (1);
+}
+
+struct ieee80211_tx_info *
+ieee80211_get_txinfo(struct mbuf *m)
+{
+ struct m_tag *mtag;
+ struct ieee80211_tx_info *t;
+
+ mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_TXINFO, NULL);
+ if (mtag == NULL)
+ return (NULL);
+
+ t = (struct ieee80211_tx_info *) (mtag + 1);
+ return (t);
+}
+
+int
ieee80211_add_callback(struct mbuf *m,
void (*func)(struct ieee80211_node *, void *, int), void *arg)
{
Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Fri May 31 21:54:52 2013 (r251199)
+++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Fri May 31 21:55:50 2013 (r251200)
@@ -228,6 +228,7 @@ struct mbuf *ieee80211_getmgtframe(uint8
/* tx path usage */
#define M_ENCAP M_PROTO1 /* 802.11 encap done */
+#define M_TXINFO M_PROTO2 /* TX info available */
#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 */
@@ -235,7 +236,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_EAPOL|M_PWR_SAV|\
+ (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_TXINFO|M_EAPOL|M_PWR_SAV|\
M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU)
/* rx path usage */
@@ -575,4 +576,14 @@ struct ieee80211_bpf_params {
uint8_t ibp_try3; /* series 4 try count */
uint8_t ibp_rate3; /* series 4 IEEE tx rate */
};
+
+#define NET80211_TAG_TXINFO 1 /* xmit tx control info */
+struct ieee80211_tx_info {
+ uint32_t is_raw_tx:1,
+ has_tx_params;
+ struct ieee80211_bpf_params bpf_params;
+};
+int ieee80211_add_txinfo(struct mbuf *m, struct ieee80211_tx_info *txinfo);
+struct ieee80211_tx_info * ieee80211_get_txinfo(struct mbuf *m);
+
#endif /* _NET80211_IEEE80211_FREEBSD_H_ */
More information about the svn-src-user
mailing list