18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#include <net/ieee80211_radiotap.h>
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_cistruct tx_radiotap_hdr {
58c2ecf20Sopenharmony_ci	struct ieee80211_radiotap_header hdr;
68c2ecf20Sopenharmony_ci	u8 rate;
78c2ecf20Sopenharmony_ci	u8 txpower;
88c2ecf20Sopenharmony_ci	u8 rts_retries;
98c2ecf20Sopenharmony_ci	u8 data_retries;
108c2ecf20Sopenharmony_ci} __packed;
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define TX_RADIOTAP_PRESENT (				\
138c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RATE) |		\
148c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DBM_TX_POWER) |	\
158c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RTS_RETRIES) |		\
168c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DATA_RETRIES)  |	\
178c2ecf20Sopenharmony_ci	0)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define IEEE80211_FC_VERSION_MASK    0x0003
208c2ecf20Sopenharmony_ci#define IEEE80211_FC_TYPE_MASK       0x000c
218c2ecf20Sopenharmony_ci#define IEEE80211_FC_TYPE_MGT        0x0000
228c2ecf20Sopenharmony_ci#define IEEE80211_FC_TYPE_CTL        0x0004
238c2ecf20Sopenharmony_ci#define IEEE80211_FC_TYPE_DATA       0x0008
248c2ecf20Sopenharmony_ci#define IEEE80211_FC_SUBTYPE_MASK    0x00f0
258c2ecf20Sopenharmony_ci#define IEEE80211_FC_TOFROMDS_MASK   0x0300
268c2ecf20Sopenharmony_ci#define IEEE80211_FC_TODS_MASK       0x0100
278c2ecf20Sopenharmony_ci#define IEEE80211_FC_FROMDS_MASK     0x0200
288c2ecf20Sopenharmony_ci#define IEEE80211_FC_NODS            0x0000
298c2ecf20Sopenharmony_ci#define IEEE80211_FC_TODS            0x0100
308c2ecf20Sopenharmony_ci#define IEEE80211_FC_FROMDS          0x0200
318c2ecf20Sopenharmony_ci#define IEEE80211_FC_DSTODS          0x0300
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistruct rx_radiotap_hdr {
348c2ecf20Sopenharmony_ci	struct ieee80211_radiotap_header hdr;
358c2ecf20Sopenharmony_ci	u8 flags;
368c2ecf20Sopenharmony_ci	u8 rate;
378c2ecf20Sopenharmony_ci	u8 antsignal;
388c2ecf20Sopenharmony_ci} __packed;
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define RX_RADIOTAP_PRESENT (			\
418c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_FLAGS) |	\
428c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RATE) |	\
438c2ecf20Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) |\
448c2ecf20Sopenharmony_ci	0)
458c2ecf20Sopenharmony_ci
46