162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#include <net/ieee80211_radiotap.h>
362306a36Sopenharmony_ci
462306a36Sopenharmony_cistruct tx_radiotap_hdr {
562306a36Sopenharmony_ci	struct ieee80211_radiotap_header hdr;
662306a36Sopenharmony_ci	u8 rate;
762306a36Sopenharmony_ci	u8 txpower;
862306a36Sopenharmony_ci	u8 rts_retries;
962306a36Sopenharmony_ci	u8 data_retries;
1062306a36Sopenharmony_ci} __packed;
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define TX_RADIOTAP_PRESENT (				\
1362306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RATE) |		\
1462306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DBM_TX_POWER) |	\
1562306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RTS_RETRIES) |		\
1662306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DATA_RETRIES)  |	\
1762306a36Sopenharmony_ci	0)
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define IEEE80211_FC_VERSION_MASK    0x0003
2062306a36Sopenharmony_ci#define IEEE80211_FC_TYPE_MASK       0x000c
2162306a36Sopenharmony_ci#define IEEE80211_FC_TYPE_MGT        0x0000
2262306a36Sopenharmony_ci#define IEEE80211_FC_TYPE_CTL        0x0004
2362306a36Sopenharmony_ci#define IEEE80211_FC_TYPE_DATA       0x0008
2462306a36Sopenharmony_ci#define IEEE80211_FC_SUBTYPE_MASK    0x00f0
2562306a36Sopenharmony_ci#define IEEE80211_FC_TOFROMDS_MASK   0x0300
2662306a36Sopenharmony_ci#define IEEE80211_FC_TODS_MASK       0x0100
2762306a36Sopenharmony_ci#define IEEE80211_FC_FROMDS_MASK     0x0200
2862306a36Sopenharmony_ci#define IEEE80211_FC_NODS            0x0000
2962306a36Sopenharmony_ci#define IEEE80211_FC_TODS            0x0100
3062306a36Sopenharmony_ci#define IEEE80211_FC_FROMDS          0x0200
3162306a36Sopenharmony_ci#define IEEE80211_FC_DSTODS          0x0300
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_cistruct rx_radiotap_hdr {
3462306a36Sopenharmony_ci	struct ieee80211_radiotap_header hdr;
3562306a36Sopenharmony_ci	u8 flags;
3662306a36Sopenharmony_ci	u8 rate;
3762306a36Sopenharmony_ci	u8 antsignal;
3862306a36Sopenharmony_ci} __packed;
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci#define RX_RADIOTAP_PRESENT (			\
4162306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_FLAGS) |	\
4262306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_RATE) |	\
4362306a36Sopenharmony_ci	(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) |\
4462306a36Sopenharmony_ci	0)
4562306a36Sopenharmony_ci
46