| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.wlan.ieee80211; |
| |
| alias Ssid = vector<uint8>:MAX_SSID_BYTE_LEN; |
| |
| // CSsid is intended for use only in source code using C bindings where |
| // the Ssid alias does not exist. |
| type CSsid = struct { |
| len uint8; |
| data array<uint8, MAX_SSID_BYTE_LEN>; |
| }; |
| |
| /// The HT capabilities element, as defined in 9.4.2.56. |
| @available(removed=8) |
| @packed |
| type HtCapabilitiesFields = struct { |
| ht_capability_info uint16; |
| ampdu_params uint8; |
| supported_mcs_set array<uint8, 16>; |
| ht_ext_capabilities uint16; |
| tx_beamforming_capabilities uint32; |
| asel_capabilities uint8; |
| }; |
| |
| /// The VHT capabilities element, as defined in 9.4.2.158. |
| @available(removed=8) |
| @packed |
| type VhtCapabilitiesFields = struct { |
| vht_capability_info uint32; |
| supported_vht_mcs_and_nss_set uint64; |
| }; |
| |
| // IEEE Std 802.11-2016 9.4.2.56 |
| type HtCapabilities = struct { |
| bytes array<uint8, HT_CAP_LEN>; |
| }; |
| |
| // IEEE Std 802.11-2016 9.4.2.57 |
| type HtOperation = struct { |
| bytes array<uint8, HT_OP_LEN>; |
| }; |
| |
| // IEEE Std 802.11-2016 9.4.2.158 |
| type VhtCapabilities = struct { |
| bytes array<uint8, VHT_CAP_LEN>; |
| }; |
| |
| // IEEE Std 802.11-2016 9.4.2.159 |
| type VhtOperation = struct { |
| bytes array<uint8, VHT_OP_LEN>; |
| }; |
| |
| /// IEEE Std 802.11-2020 9.4.2.173 |
| @available(added=13) |
| type WlanAccessCategory = strict enum { |
| BACKGROUND = 1; |
| BEST_EFFORT = 2; |
| VIDEO = 3; |
| VOICE = 4; |
| }; |
| |
| /// Identifies a frequency band in metadata of various operations. |
| /// |
| /// Examples of this enum in use are labeling scan results or reporting |
| /// a driver capabilities from various frequency bands. |
| /// |
| /// NOTE: This enum is similar to the Band ID field defined in |
| /// IEEE Std 802.11-2016 9.4.1.46, but its values are not the same. |
| /// |
| /// TODO(https://fxbug.dev/376442944): Create a spec-compliant Band ID type |
| /// and migrate the platform to use it. |
| @available(added=26) |
| type WlanBand = flexible enum : uint8 { |
| TWO_GHZ = 0; |
| FIVE_GHZ = 1; |
| }; |
| |
| @available(added=27) |
| type KeyType = flexible enum : uint8 { |
| PAIRWISE = 1; |
| GROUP = 2; |
| IGTK = 3; |
| PEER = 4; |
| }; |
| |
| /// IEEE Std 802.11-2020 6.3.19.1.2 |
| @available(added=27) |
| type SetKeyDescriptor = table { |
| /// The key value as bytes. |
| /// 802.11 specifies a bit string for this field, but we represent it as a byte array for |
| /// convenience. |
| /// Required. |
| 1: key vector<uint8>:MAX_KEY_LEN; |
| /// Index for rotating keys, e.g. group keys. |
| /// This value is always 0 for key types which aren't rotating, e.g. pairwise keys. |
| /// Required. |
| 2: key_id uint16; |
| /// Whether this key is a pairwise, group or peer key. |
| /// Required. |
| 3: key_type KeyType; |
| /// The peer MAC address for pairwise and peer keys. |
| /// For group keys this value is always the broadcast address. |
| /// Required. |
| 4: peer_addr MacAddr; |
| /// Receive Sequence Counter for group keys only. |
| /// In all other cases the RSC will be 0. |
| /// Optional. |
| 5: rsc uint64; |
| /// IEEE Cipher suite selector. See IEEE Std 802.11-2016, 9.4.2.25.2, Table 9-131 |
| /// Required. |
| 6: cipher_oui array<uint8, 3>; |
| /// The cipher type. |
| /// Required. |
| 7: cipher_type CipherSuiteType; |
| }; |