2 ****************************************************************************************
4 * @file lmac_mac_types.h
6 * @brief MAC related definitions.
8 * Adapted from mac_types.h to used lmac_types.h instead of standard types
9 * eg: perl -pi -e '$_ =~ s/uint(\d{1,2})_t/u$1_l/g; \
10 * $_ =~ s/int(\d{1,2})_t/s$1_l/g; \
11 * $_ =~ s/CO_BIT/BIT/g;' lmac_mac.h
13 * Copyright (C) ESWIN 2015-2020
15 ****************************************************************************************
21 #include "lmac_types.h"
28 /// IBSS STA interface
32 /// Mesh Point interface
40 /// MAC address length in bytes.
41 #define MAC_ADDR_LEN 6
43 /// MAC address structure.
46 /// Array of 16-bit words that make up the MAC address.
47 u16_l array[MAC_ADDR_LEN/2];
50 /// SSID maximum length.
51 #define MAC_SSID_LEN 32
56 /// Actual length of the SSID.
58 /// Array containing the SSID name.
59 u8_l array[MAC_SSID_LEN];
65 INFRASTRUCTURE_MODE = 1,
81 /// Operating Channel Bandwidth
82 enum mac_chan_bandwidth
98 /// max number of channels in the 2.4 GHZ band
99 #define MAC_DOMAINCHANNEL_24G_MAX 14
101 /// max number of channels in the 5 GHZ band
102 #define MAC_DOMAINCHANNEL_5G_MAX 28
107 /// Cannot initiate radiation on this channel
109 /// Channel is not allowed
110 CHAN_DISABLED = BIT(1),
111 /// Radar detection required on this channel
115 /// Primary Channel definition
118 /// Frequency of the channel (in MHz)
120 /// RF band (@ref mac_chan_band)
122 /// Additional information (@ref mac_chan_flags)
124 /// Max transmit power allowed on this channel (dBm)
128 /// Operating Channel
131 /// Band (@ref mac_chan_band)
133 /// Channel type (@ref mac_chan_bandwidth)
135 /// Frequency for Primary 20MHz channel (in MHz)
137 /// Frequency center of the contiguous channel or center of Primary 80+80 (in MHz)
139 /// Frequency center of the non-contiguous secondary 80+80 (in MHz)
141 /// Max transmit power allowed on this channel (dBm)
143 /// Additional information (@ref mac_chan_flags)
147 /// Cipher suites (order is important as it is used by MACHW)
148 enum mac_cipher_suite
151 MAC_CIPHER_WEP40 = 0,
157 MAC_CIPHER_WEP104 = 3,
159 MAC_CIPHER_WPI_SMS4 = 4,
160 /// 00-0F-AC 6 (aka AES_CMAC)
161 MAC_CIPHER_BIP_CMAC_128 = 5,
163 // following cipher are not supported by MACHW
171 MAC_CIPHER_BIP_GMAC_128,
173 MAC_CIPHER_BIP_GMAC_256,
175 MAC_CIPHER_BIP_CMAC_256,
177 MAC_CIPHER_INVALID = 0xFF
180 /// Authentication and Key Management suite
185 /// Pre RSN (WEP or WPA)
196 MAC_AKM_8021X_SHA256,
206 MAC_AKM_8021X_SUITE_B,
208 MAC_AKM_8021X_SUITE_B_192,
214 MAC_AKM_FT_FILS_SHA256,
216 MAC_AKM_FT_FILS_SHA384,
226 /// Scan result element, parsed from beacon or probe response frames.
227 struct mac_scan_result
229 /// Scan result is valid
232 struct mac_addr bssid;
234 struct mac_ssid ssid;
235 /// Network type (@ref mac_bss_type).
238 struct mac_chan_def *chan;
239 /// Network beacon period (in TU).
241 /// Capability information
243 /// Supported AKM (bit-field of @ref mac_akm_suite)
245 /// Group cipher (bit-field of @ref mac_cipher_suite)
247 /// Group cipher (bit-field of @ref mac_cipher_suite)
248 u16_l pairwise_cipher;
249 /// RSSI of the scanned BSS (in dBm)
251 /// Multi-BSSID index (0 if this is the reference (i.e. transmitted) BSSID)
252 u8_l multi_bssid_index;
253 /// Maximum BSSID indicator
254 u8_l max_bssid_indicator;
257 /// Legacy rate 802.11 definitions
258 enum mac_legacy_rates
265 MAC_RATE_5_5MBPS = 11,
271 MAC_RATE_11MBPS = 22,
273 MAC_RATE_12MBPS = 24,
275 MAC_RATE_18MBPS = 36,
277 MAC_RATE_24MBPS = 48,
279 MAC_RATE_36MBPS = 72,
281 MAC_RATE_48MBPS = 96,
283 MAC_RATE_54MBPS = 108
286 /// BSS Membership Selector definitions
287 enum mac_bss_membership
290 MAC_BSS_MEMBERSHIP_HT_PHY = 127,
292 MAC_BSS_MEMBERSHIP_VHT_PHY = 126,
295 /// MAC rateset maximum length
296 #define MAC_RATESET_LEN 12
298 /// Structure containing the legacy rateset of a station
301 /// Number of legacy rates supported
303 /// Array of legacy rates
304 u8_l array[MAC_RATESET_LEN];
307 /// MAC Security Key maximum length
308 #define MAC_SEC_KEY_LEN 32 // TKIP keys 256 bits (max length) with MIC keys
310 /// Structure defining a security key
313 /// Key material length
316 u32_l array[MAC_SEC_KEY_LEN/4];
319 /// Access Category enumeration
330 /// Number of access categories
334 /// Traffic ID enumeration
337 /// TID_0. Mapped to @ref AC_BE as per 802.11 standard.
339 /// TID_1. Mapped to @ref AC_BK as per 802.11 standard.
341 /// TID_2. Mapped to @ref AC_BK as per 802.11 standard.
343 /// TID_3. Mapped to @ref AC_BE as per 802.11 standard.
345 /// TID_4. Mapped to @ref AC_VI as per 802.11 standard.
347 /// TID_5. Mapped to @ref AC_VI as per 802.11 standard.
349 /// TID_6. Mapped to @ref AC_VO as per 802.11 standard.
351 /// TID_7. Mapped to @ref AC_VO as per 802.11 standard.
353 /// Non standard Management TID used internally
355 /// Number of TID supported
359 /// MCS bitfield maximum size (in bytes)
360 #define MAX_MCS_LEN 16 // 16 * 8 = 128
362 /// MAC HT capability information element
363 struct mac_htcapability
365 /// HT capability information
367 /// A-MPDU parameters
370 u8_l mcs_rate[MAX_MCS_LEN];
371 /// HT extended capability information
372 u16_l ht_extended_capa;
373 /// Beamforming capability information
374 u32_l tx_beamforming_capa;
375 /// Antenna selection capability information
379 /// MAC VHT capability information element
380 struct mac_vhtcapability
382 /// VHT capability information
386 /// RX highest data rate
390 /// TX highest data rate
394 /// Length (in bytes) of the MAC HE capability field
395 #define MAC_HE_MAC_CAPA_LEN 6
396 /// Length (in bytes) of the PHY HE capability field
397 #define MAC_HE_PHY_CAPA_LEN 11
398 /// Maximum length (in bytes) of the PPE threshold data
399 #define MAC_HE_PPE_THRES_MAX_LEN 25
401 /// Structure listing the per-NSS, per-BW supported MCS combinations
402 struct mac_he_mcs_nss_supp
404 /// per-NSS supported MCS in RX, for BW <= 80MHz
406 /// per-NSS supported MCS in TX, for BW <= 80MHz
408 /// per-NSS supported MCS in RX, for BW = 160MHz
410 /// per-NSS supported MCS in TX, for BW = 160MHz
412 /// per-NSS supported MCS in RX, for BW = 80+80MHz
414 /// per-NSS supported MCS in TX, for BW = 80+80MHz
418 /// MAC HE capability information element
419 struct mac_hecapability
421 /// MAC HE capabilities
422 u8_l mac_cap_info[MAC_HE_MAC_CAPA_LEN];
423 /// PHY HE capabilities
424 u8_l phy_cap_info[MAC_HE_PHY_CAPA_LEN];
425 /// Supported MCS combinations
426 struct mac_he_mcs_nss_supp mcs_supp;
427 /// PPE Thresholds data
428 u8_l ppe_thres[MAC_HE_PPE_THRES_MAX_LEN];
434 /// Bit indicating that a STA has QoS (WMM) capability
435 STA_QOS_CAPA = BIT(0),
436 /// Bit indicating that a STA has HT capability
437 STA_HT_CAPA = BIT(1),
438 /// Bit indicating that a STA has VHT capability
439 STA_VHT_CAPA = BIT(2),
440 /// Bit indicating that a STA has MFP capability
441 STA_MFP_CAPA = BIT(3),
442 /// Bit indicating that the STA included the Operation Notification IE
443 STA_OPMOD_NOTIF = BIT(4),
444 /// Bit indicating that a STA has HE capability
445 STA_HE_CAPA = BIT(5),
446 /// Bit Inidcating supprot for short Preamble in ERP
447 STA_SHORT_PREAMBLE_CAPA = BIT(6),
451 enum mac_connection_flags
453 /// Flag indicating whether the control port is controlled by host or not
454 CONTROL_PORT_HOST = BIT(0),
455 /// Flag indicating whether the control port frame shall be sent unencrypted
456 CONTROL_PORT_NO_ENC = BIT(1),
457 /// Flag indicating whether HT and VHT shall be disabled or not
459 /// Flag indicating whether WPA or WPA2 authentication is in use
460 WPA_WPA2_IN_USE = BIT(3),
461 /// Flag indicating whether MFP is in use
463 REASSOCIATION = BIT(5),
467 #endif // LMAC_MAC_H_