Index: sys/net80211/ieee80211_freebsd.c =================================================================== --- sys/net80211/ieee80211_freebsd.c (revision 283556) +++ sys/net80211/ieee80211_freebsd.c (working copy) @@ -474,6 +474,40 @@ return 1; } +int +ieee80211_add_xmit_params(struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + struct m_tag *mtag; + struct ieee80211_tx_params *tx; + + mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS, + sizeof(struct ieee80211_tx_params), M_NOWAIT); + if (mtag == NULL) + return (0); + + tx = (struct ieee80211_tx_params *)(mtag+1); + memcpy(tx, params, sizeof(struct ieee80211_bpf_params)); + m_tag_prepend(m, mtag); + return (1); +} + +int +ieee80211_get_xmit_params(struct mbuf *m, + struct ieee80211_bpf_params *params) +{ + struct m_tag *mtag; + struct ieee80211_tx_params *tx; + + mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS, + NULL); + if (mtag == NULL) + return (-1); + tx = (struct ieee80211_tx_params *)(mtag + 1); + memcpy(params, tx, sizeof(struct ieee80211_bpf_params)); + return (0); +} + void ieee80211_process_callback(struct ieee80211_node *ni, struct mbuf *m, int status) Index: sys/net80211/ieee80211_freebsd.h =================================================================== --- sys/net80211/ieee80211_freebsd.h (revision 283556) +++ sys/net80211/ieee80211_freebsd.h (working copy) @@ -325,6 +325,9 @@ void (*func)(struct ieee80211_node *, void *, int), void *arg); void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); +#define NET80211_TAG_XMIT_PARAMS 1 +/* See below; this is after the bpf_params definition */ + struct ieee80211com; int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *); int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *); @@ -605,6 +608,14 @@ uint8_t ibp_rate3; /* series 4 IEEE tx rate */ }; +struct ieee80211_tx_params { + struct ieee80211_bpf_params params; +}; +int ieee80211_add_xmit_params(struct mbuf *m, + const struct ieee80211_bpf_params *); +int ieee80211_get_xmit_params(struct mbuf *m, + struct ieee80211_bpf_params *); + /* * Malloc API. Other BSD operating systems have slightly * different malloc/free namings (eg DragonflyBSD.) Index: sys/net80211/ieee80211_output.c =================================================================== --- sys/net80211/ieee80211_output.c (revision 283556) +++ sys/net80211/ieee80211_output.c (working copy) @@ -508,6 +508,18 @@ { struct ieee80211com *ic = vap->iv_ic; + /* + * Attempt to add bpf transmit parameters. + * + * For now it's ok to fail; the raw_xmit api still takes + * them as an option. + * + * Later on when ic_raw_xmit() has params removed, + * they'll have to be added - so fail the transmit if + * they can't be. + */ + (void) ieee80211_add_xmit_params(m, params); + return (ic->ic_raw_xmit(ni, m, params)); }