| // Copyright 2021 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.internal; |
| |
| using fuchsia.wlan.common; |
| using fuchsia.wlan.ieee80211 as ieee80211; |
| |
| type BssType = strict enum { |
| // The UNKNOWN value is added to this type instead of created a new |
| // enum like `DetectedBssType` so that language bindings can avoid the use |
| // of verbose constants like DETECTED_BSS_TYPE_INFRASTRUCTURE. The tradeoff |
| // is to handle UNKNOWN when specifying the BSS type of a new AP. |
| UNKNOWN = 0; |
| |
| INFRASTRUCTURE = 1; |
| INDEPENDENT = 2; |
| MESH = 3; |
| PERSONAL = 4; |
| }; |
| |
| type BssConfig = struct { |
| bssid ieee80211.MacAddr; |
| bss_type BssType; |
| remote bool; |
| }; |
| |
| // IEEE Std 802.11-2016, 9.4.1.4 |
| alias CapabilityInfo = uint16; |
| |
| // IEEE Std 802.11-2016 defines 12 values in dot11SupportedDataRatesRxTable. |
| // It is never necessary to report more than 12 basic rates. |
| // |
| // This constant is strictly meant to bound the number of supported basic rates |
| // communicated between WLAN components. |
| @namespaced |
| const MAX_SUPPORTED_BASIC_RATES uint8 = 12; |
| |
| // IEEE Std 802.11-2016 defines 12 values in dot11SupportedDataRatesRxTable and |
| // 2 values for BSS Membership Selector in Table 9-78. The number of valid basic rates |
| // specified in the Beacon frame received from an AP is therefore bounded by 14. |
| // |
| // This constant is strictly meant to bound the number of basic rates communicated |
| // between WLAN components during association. |
| @namespaced |
| const MAX_ASSOC_BASIC_RATES uint8 = 14; |
| |
| // IEEE Std 802.11-2016 6.3.3.3.2 |
| type BssDescription = struct { |
| bssid ieee80211.MacAddr; |
| |
| bss_type BssType; |
| beacon_period uint16; // in TU |
| capability_info CapabilityInfo; |
| |
| /// All info elements present in the beacon or probe response frame. |
| ies bytes; |
| |
| // List up non-standard, Fuchsia only parameters |
| channel fuchsia.wlan.common.WlanChannel; |
| // The running average of received signal strength indicator in units of dBm. This value is |
| // updated periodically when the client is associated to an AP. |
| rssi_dbm int8; // dBm |
| // The running average of snr in units of dB. This value is updated periodically when the |
| // client is associated to an AP. |
| snr_db int8; |
| }; |
| |
| type WmmStatusResponse = struct { |
| apsd bool; |
| ac_be_params WmmAcParams; |
| ac_bk_params WmmAcParams; |
| ac_vi_params WmmAcParams; |
| ac_vo_params WmmAcParams; |
| }; |
| |
| /// WFA WMM v1.2, 2.2.2 |
| type WmmAcParams = struct { |
| /// Lower bound of contention window in exponential form |
| /// `cw_min = 2^(ecw_min) - 1`. The unit for contention window is "slot time", which |
| /// is different for each standard (e.g. 9 microseconds, 13 microseconds, etc.) |
| ecw_min uint8; |
| /// Upper bound of contention window in exponential form |
| /// `cw_max = 2^(ecw_max) - 1`. The unit for contention window is "slot time", which |
| /// is different for each standard (e.g. 9 microseconds, 13 microseconds, etc.) |
| ecw_max uint8; |
| /// Arbitration Interframe Spacing Number (control wait time between sending each frame) |
| aifsn uint8; |
| /// TXOP limit in unit of 32 microseconds |
| txop_limit uint16; |
| /// Whether admission control is mandatory |
| acm bool; |
| }; |
| |
| type SignalReportIndication = struct { |
| rssi_dbm int8; |
| snr_db int8; |
| }; |
| |
| // IEEE 802.11-2016 9.4.2.19 |
| // Unlike a normal channel switch announcement, a ChannelSwitchInfo is sent at the time the channel |
| // changes and does not include a delay field. |
| type ChannelSwitchInfo = struct { |
| new_channel uint8; |
| // The operating class/country may also be modified by an extended channel switch request, but |
| // we do not currently support this. |
| }; |