ieee80211: Add support for S1G including PV1.

S1G adapters should be shipping soon since Silex America has a dev-kit
available, so it is about time to add support for this.

Change-Id: I0225d87f78efbcbe88476921d4fce3d56a3ce0cd
This commit is contained in:
Richard Sharpe 2021-01-02 14:40:24 -08:00 committed by Wireshark GitLab Utility
parent fc5d8db628
commit fb2a0b4a71
6 changed files with 6159 additions and 120 deletions

View File

@ -222,7 +222,10 @@ struct ieee80211_radiotap_tlv {
};
/* Channel flags. */
/* 0x00000001 through 0x00000008 undefined (reserved?) */
/* 0x00000008 undefined (reserved?) */
#define IEEE80211_CHAN_700MHZ 0x00000001 /* S1G 700 MHz spectrum channel. */
#define IEEE80211_CHAN_800MHZ 0x00000002 /* S1G 800 MHz spectrum channel. */
#define IEEE80211_CHAN_900MHZ 0x00000004 /* S1G 900 MHz spectrum channel. */
#define IEEE80211_CHAN_TURBO 0x00000010 /* Turbo channel */
#define IEEE80211_CHAN_CCK 0x00000020 /* CCK channel */
#define IEEE80211_CHAN_OFDM 0x00000040 /* OFDM channel */
@ -243,9 +246,14 @@ struct ieee80211_radiotap_tlv {
#define IEEE80211_CHAN_HT40 (IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D)
#define IEEE80211_CHAN_HT (IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40)
#define IEEE80211_CHAN_S1G \
(IEEE80211_CHAN_700MHZ | IEEE80211_CHAN_800MHZ | \
IEEE80211_CHAN_900MHZ)
#define IEEE80211_CHAN_ALL \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
IEEE80211_CHAN_700MHZ | IEEE80211_CHAN_800MHZ | \
IEEE80211_CHAN_900MHZ | \
IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \
IEEE80211_CHAN_HT)
@ -481,6 +489,31 @@ struct ieee80211_radiotap_tlv {
#define IEEE80211_RADIOTAP_L_SIG_RATE_MASK 0x000F
#define IEEE80211_RADIOTAP_L_SIG_LENGTH_MASK 0xFFF0
/* TLV Definitions, start at 32 */
#define IEEE80211_RADIOTAP_TLV_S1G 32
/* For IEEE80211_RADIOTAP_TLV_S1G */
#define IEEE80211_RADIOTAP_TLV_S1G_S1G_PPDU_FORMAT_KNOWN 0x0001
#define IEEE80211_RADIOTAP_TLV_S1G_RESPONSE_INDICATION_KNOWN 0x0002
#define IEEE80211_RADIOTAP_TLV_S1G_GUARD_INTERVAL_KNOWN 0x0004
#define IEEE80211_RADIOTAP_TLV_S1G_NSS_KNOWN 0x0008
#define IEEE80211_RADIOTAP_TLV_S1G_BANDWIDTH_KNOWN 0x0010
#define IEEE80211_RADIOTAP_TLV_S1G_MCS_KNOWN 0x0020
#define IEEE80211_RADIOTAP_TLV_S1G_COLOR_KNOWN 0x0040
#define IEEE80211_RADIOTAP_TLV_S1G_UPLINK_INDICATION_KNOWN 0x0080
#define IEEE80211_RADIOTAP_TLV_S1G_RESERVED_1 0xFF00
#define IEEE80211_RADIOTAP_TLV_S1G_S1G_PPDU_FORMAT 0x0003
#define IEEE80211_RADIOTAP_TLV_S1G_RESPONSE_INDICATION 0x000C
#define IEEE80211_RADIOTAP_TLV_S1G_RESERVED_2 0x0010
#define IEEE80211_RADIOTAP_TLV_S1G_GUARD_INTERVAL 0x0020
#define IEEE80211_RADIOTAP_TLV_S1G_NSS 0x00C0
#define IEEE80211_RADIOTAP_TLV_S1G_BANDWIDTH 0x0F00
#define IEEE80211_RADIOTAP_TLV_S1G_MCS 0xF000
#define IEEE80211_RADIOTAP_TLV_S1G_COLOR 0x0007
#define IEEE80211_RADIOTAP_TLV_S1G_UPLINK_INDICATION 0x0008
#define IEEE80211_RADIOTAP_TLV_S1G_RESERVED_3 0x00F0
#define IEEE80211_RADIOTAP_TLV_S1G_RSSI 0xFF00
#define IEEE80211_RADIOTAP_TS_FLG_32BIT 0x01
#define IEEE80211_RADIOTAP_TS_FLG_ACCURACY 0x02

View File

@ -52,6 +52,7 @@ static const struct radiotap_align_size rtap_namespace_sizes[] = {
/* [IEEE80211_RADIOTAP_HE_MU_USER = 25 notdef */ { 0, 0 },
/* [IEEE80211_RADIOTAP_0_LENGTH_PSDU = 26 */ { 1, 1 },
/* [IEEE80211_RADIOTAP_L_SIG = 27 */ { 2, 4 },
/* [IEEE80211_RADIOTAP_TLV = 28 */ { 4, 10 },
/*
* add more here as they are defined in
* include/net/ieee80211_radiotap.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -88,15 +88,22 @@ gboolean is_broadcast_bssid(const address *bssid);
*/
#define FCF_PROT_VERSION(x) ((x) & 0x3)
#define PV0 0x0
#define PV1 0x1
#define PC2 0x2
#define PV3 0x3
/*
* Extract the frame type from the frame control field.
*/
#define FCF_FRAME_TYPE(x) (((x) & 0xC) >> 2)
#define FCF_PV1_TYPE(x) (((x) >> 2) & 0x7)
/*
* Extract the frame subtype from the frame control field.
*/
#define FCF_FRAME_SUBTYPE(x) (((x) & 0xF0) >> 4)
#define FCF_PV1_SUBTYPE(x) (((x) >> 5) & 0x7)
/*
* Extract the control frame extension from the frame control field.
@ -200,6 +207,7 @@ gboolean is_broadcast_bssid(const address *bssid);
* 0x160 - 0x16A are for control frame extension where type = 1 and subtype =6.
*/
#define CTRL_TRIGGER 0x12 /* HE Trigger */
#define CTRL_TACK 0x13 /* S1G TWT Ack */
#define CTRL_BEAMFORM_RPT_POLL 0x14 /* Beamforming Report */
#define CTRL_VHT_NDP_ANNC 0x15 /* VHT NDP Announcement */
#define CTRL_POLL 0x162 /* Poll */
@ -247,6 +255,37 @@ gboolean is_broadcast_bssid(const address *bssid);
#define EXTENSION_DMG_BEACON 0x30 /* Extension DMG beacon */
#define EXTENSION_S1G_BEACON 0x31 /* Extension S1G beacon */
/*
* PV1 frame types
*/
#define PV1_QOS_DATA_1MAC 0x00 /* QoS data, one SID, one MAC */
#define PV1_MANAGEMENT 0x01 /* PV1 Management frame */
#define PV1_CONTROL 0x02 /* PV1 Control frame */
#define PV1_QOS_DATA_2MAC 0x03 /* QoS data, two MAC addresses */
/*
* PV1 frame subtypes
*/
#define PV1_CONTROL_STACK 0x00 /* Control STACK */
#define PV1_CONTROL_BAT 0x01 /* Control BAT */
#define PV1_MANAGEMENT_ACTION 0x00
#define PV1_MANAGEMENT_ACTION_NO_ACK 0x01
#define PV1_MANAGEMENT_PROBE_RESPONSE 0x02
#define PV1_MANAGEMENT_RESOURCE_ALLOC 0x03
/*
* PV1 SID constants
*/
#define SID_AID_MASK 0x1FFF
#define SID_A3_PRESENT 0x2000
#define SID_A4_PRESENT 0x4000
#define SID_A_MSDU 0x8000
#define TBTT_INFO(x) (((x) & 0x3) >> 0)
#define TBTT_INFO_COUNT(x) (((x) & (0xf<<4)) >> 4)
#define TBTT_INFO_LENGTH(x) (((x) & (0xff<<8)) >> 8)
typedef struct _wlan_stats {
guint8 channel;
guint8 ssid_len;

View File

@ -882,6 +882,7 @@ struct ieee_802_11_phdr {
*/
#define PHDR_802_11_SOUNDING_PSDU 0 /* sounding PPDU */
#define PHDR_802_11_DATA_NOT_CAPTURED 1 /* data not captured, (e.g. multi-user PPDU) */
#define PHDR_802_11_0_LENGTH_PSDU_S1G_NDP 2 /* S1G NDP CMAC */
#define PHDR_802_11_0_LENGTH_PSDU_VENDOR_SPECIFIC 0xff
/* Packet "pseudo-header" for the output from CoSine L2 debug output. */