blob: d545c9af7268b84a5a2ff77563598c6e50caca81 [file] [log] [blame]
// Copyright 2019 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 ddk.hw.wlan.wlaninfo;
using ddk.hw.wlan.ieee80211;
/// Role of a WLAN device.
enum WlanInfoMacRole : uint8 {
/// Device operating as a non-AP station (i.e., a client of an AP).
CLIENT = 0x1;
/// Device operating as an access point.
AP = 0x2;
/// Device operating as a mesh node.
MESH = 0x4;
};
enum WlanInfoPhyType {
/// IEEE 802.11 for 1, 2 Mbps.
DSSS = 0x01;
/// IEEE 802.11 for 5.5, 11 Mbps. ERP-CCK.
CCK = 0x02;
/// IEEE 802.11g, 1, 2, 5,5, 11, 12, 24 Mbps + [6, 54] Mbps.
ERP = 0x04;
// FIDL enums don't allow two definitions of the same number, please use
// WLAN_INFO_PHY_TYPE_OFDM.
// TODO(http://fxbug.dev/74579): Clean this up.
// IEEE 802.11a/g.
//OFDM = 0x4;
/// IEEE 802.11n.
HT = 0x08;
/// IEEE 802.11ac.
VHT = 0x10;
/// IEEE 802.11ax.
HEW = 0x20;
};
const uint32 WLAN_INFO_PHY_TYPE_OFDM = 0x4;
enum WlanInfoDriverFeature : uint32 {
/// Device or driver implements scanning.
SCAN_OFFLOAD = 0x00000001;
/// Device or driver implements rate selection.
RATE_SELECTION = 0x00000002;
/// Device is not a physical device.
SYNTH = 0x00000004;
/// Driver supports transmission reports, and will use the
/// wlanmac_ifc.report_tx_status() callback to report the status of each queued
/// transmission.
TX_STATUS_REPORT = 0x00000008;
/// Set this flag to indicate whether SME should trust this device or driver to
/// handle DFS channels correctly in an active scan (e.g. it makes sure DFS
/// channel is safe to transmit before doing so).
DFS = 0x00000010;
/// Driver responds to probe requests in hardware.
PROBE_RESP_OFFLOAD = 0x00000020;
/// Driver supports running the SAE handshake in SME.
SAE_SME_AUTH = 0x00000040;
/// Driver implements the SAE handshake.
SAE_DRIVER_AUTH = 0x00000080;
/// Driver supports management frame protection and IGTK installation.
MFP = 0x00000100;
};
/// IEEE Std 802.11-206 Section 9.4.1.4 Capability Information Field
enum WlanInfoHardwareCapability : uint32 {
/// Short packet preamble.
SHORT_PREAMBLE = 0x0020;
/// Spectrum management.
SPECTRUM_MGMT = 0x0100;
// QoS capable.
QOS = 0x0200;
/// Short slot times after packet collision.
SHORT_SLOT_TIME = 0x0400;
/// Radio measurement.
RADIO_MSMT = 0x1000;
// Supports simutaneous client-ap use
// TODO(fxbug.dev/54923): Move SIMULTANEOUS_CLIENT_AP to a different Fuchsia specific capability enum.
// This enum should only be used for IEEE 802.11 fields. This type should also be reduced
// to uint16_t once this is done.
SIMULTANEOUS_CLIENT_AP = 0x10000;
};
/// This is a simplified expression of channel starting frequencies. Expand this
/// list as Fuchsia evolves.
enum WlanInfoBand {
/// Channel starting frequency: 2.407 GHz.
TWO_GHZ = 0;
/// Channel starting frequency: 5.000 GHz.
FIVE_GHZ = 1;
/// The number of defined bands.
COUNT = 2;
};
const uint32 WLAN_INFO_BAND_2GHZ = 0;
const uint32 WLAN_INFO_BAND_5GHZ = 1;
/// The maximum number of supported channels in a WlanInfoChannelList.
const uint32 WLAN_INFO_CHANNEL_LIST_MAX_CHANNELS = 64;
/// A list of channels in a band. Channels are numbered as in IEEE Std 802.11-2016,
/// 17.3.8.4.2, where each channel is defined as:
///
/// (base_freq + 5 * n) MHz
///
/// where n is between 1 and 200 (inclusive). Here n represents the channel number.
///
/// Example:
/// Standard 2.4GHz channels:
/// base_freq = 2407 MHz
/// n = 1-14
struct WlanInfoChannelList {
/// The base frequency in this band.
uint16 base_freq;
/// A list of channel center frequencies, as multiples of 5 MHz above base_freq.
array<uint8>:WLAN_INFO_CHANNEL_LIST_MAX_CHANNELS channels;
};
/// The maximum number of rates in WlanInfoBandInfo.
// IEEE Std 802.11-2016 defines 12 values in dot11SupportedDataRatesRxTable
const uint32 WLAN_INFO_BAND_INFO_MAX_RATES = 12;
/// Information about a particular WLAN band. Capabilities are grouped by band, by
/// de facto industry standard.
struct WlanInfoBandInfo {
/// The supported band.
WlanInfoBand band;
/// HT PHY capabilities, if supported.
bool ht_supported;
ddk.hw.wlan.ieee80211.Ieee80211HtCapabilities ht_caps;
/// VHT PHY capabilities, if supported.
bool vht_supported;
ddk.hw.wlan.ieee80211.Ieee80211VhtCapabilities vht_caps;
/// Rates supported in this band, in units of 500 kbit/s (as defined in
/// IEEE Std 802.11-2016, 9.4.2.3). For example, 1 Mbit/s is represented as 0x02.
array<uint8>:WLAN_INFO_BAND_INFO_MAX_RATES rates;
/// Channels supported in this band.
WlanInfoChannelList supported_channels;
};
/// The maximum number of bands supported in a WlanInfo struct. For now this is 2
/// to keep the struct a small, fixed size.
const uint32 WLAN_INFO_MAX_BANDS = 2;