[net80211] add in ToA/ToD based location mbuf tags for some experimenting.

This commit is contained in:
Adrian Chadd 2016-09-09 04:47:48 +00:00
parent 90d3a30a16
commit c028fb5098
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305638
2 changed files with 46 additions and 0 deletions

View File

@ -529,6 +529,42 @@ ieee80211_get_rx_params(struct mbuf *m, struct ieee80211_rx_stats *rxs)
return (0);
}
/*
* Add TOA parameters to the given mbuf.
*/
int
ieee80211_add_toa_params(struct mbuf *m, const struct ieee80211_toa_params *p)
{
struct m_tag *mtag;
struct ieee80211_toa_params *rp;
mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_TOA_PARAMS,
sizeof(struct ieee80211_toa_params), M_NOWAIT);
if (mtag == NULL)
return (0);
rp = (struct ieee80211_toa_params *)(mtag + 1);
memcpy(rp, p, sizeof(*rp));
m_tag_prepend(m, mtag);
return (1);
}
int
ieee80211_get_toa_params(struct mbuf *m, struct ieee80211_toa_params *p)
{
struct m_tag *mtag;
struct ieee80211_toa_params *rp;
mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_TOA_PARAMS,
NULL);
if (mtag == NULL)
return (0);
rp = (struct ieee80211_toa_params *)(mtag + 1);
if (p != NULL)
memcpy(p, rp, sizeof(*p));
return (1);
}
/*
* Transmit a frame to the parent interface.
*/

View File

@ -331,6 +331,8 @@ void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int);
#define NET80211_TAG_RECV_PARAMS 2
#define NET80211_TAG_TOA_PARAMS 3
struct ieee80211com;
int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *);
int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *);
@ -656,6 +658,14 @@ int ieee80211_add_rx_params(struct mbuf *m,
const struct ieee80211_rx_stats *rxs);
int ieee80211_get_rx_params(struct mbuf *m,
struct ieee80211_rx_stats *rxs);
struct ieee80211_toa_params {
int request_id;
};
int ieee80211_add_toa_params(struct mbuf *m,
const struct ieee80211_toa_params *p);
int ieee80211_get_toa_params(struct mbuf *m,
struct ieee80211_toa_params *p);
#endif /* _KERNEL */
/*