blob: 4a1800ba9b6c850c0eb77fd6e0077f598804c8d2 [file] [log] [blame]
// Copyright 2018 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.device;
using fuchsia.wlan.common;
using fuchsia.wlan.mlme;
enum SupportedPhy {
DSSS = 1;
CCK = 2;
OFDM = 3;
HT = 4;
VHT = 5;
};
enum MacRole {
CLIENT = 1;
AP = 2;
MESH = 3;
};
enum Capability {
SHORT_PREAMBLE = 1;
SPECTRUM_MGMT = 2;
SHORT_SLOT_TIME = 3;
RADIO_MSMT = 4;
SIMULTANEOUS_CLIENT_AP = 5;
};
struct HtCapabilities {
uint16 ht_capability_info;
uint8 ampdu_params;
array<uint8>:16 supported_mcs_set;
uint16 ht_ext_capabilities;
uint32 tx_beamforming_capabilities;
uint8 asel_capabilities;
};
struct VhtCapabilities {
uint32 vht_capability_info;
uint64 supported_vht_mcs_and_nss_set;
};
struct ChannelList {
uint16 base_freq;
vector<uint8>:200 channels;
};
// IEEE Std 802.11-2016 defines 12 values in dot11SupportedDataRatesRxTable
const uint8 MAX_NUM_RATES = 12;
// BandInfo groups capabilities defined per band.
// This grouping is the industry's de factor standard.
struct BandInfo {
fuchsia.wlan.common.Band band_id;
fuchsia.wlan.mlme.HtCapabilities? ht_caps;
fuchsia.wlan.mlme.VhtCapabilities? vht_caps;
vector<uint8>:MAX_NUM_RATES rates;
ChannelList supported_channels;
};
struct PhyInfo {
// The following fields are not set by the phy itself, but by the service that monitors them.
// The phy id. This is not a stable identifier, but will not change while this phy's device node
// remains.
uint16 id;
// The topological path of the phy in the device tree.
string? dev_path;
// The hardware MAC address for the phy. May not be the same as the MAC address used to
// communicate with external systems.
array<uint8>:6 hw_mac_address;
vector<SupportedPhy>:8 supported_phys;
vector<fuchsia.wlan.common.DriverFeature>:8 driver_features;
vector<MacRole>:8 mac_roles;
vector<Capability>:8 caps;
vector<BandInfo>:8 bands;
};
struct QueryResponse {
int32 status;
PhyInfo info;
};
struct CreateIfaceRequest {
MacRole role;
// TODO(WLAN-927): Make `sme_channel` mandatory once all drivers support the channel.
handle<channel>? sme_channel;
bytes:6? init_mac_addr;
};
struct CreateIfaceResponse {
int32 status;
uint16 iface_id;
};
struct DestroyIfaceRequest {
uint16 id;
};
struct DestroyIfaceResponse {
int32 status;
};
/// The country code for a target WLAN PHY device.
/// alpha2 is ISO 3166-1 code to indicate a country. eg. AF for Afghanistan.
struct CountryCode {
array<byte>:2 alpha2;
};
protocol Phy {
Query() -> (QueryResponse resp);
CreateIface(CreateIfaceRequest req) -> (CreateIfaceResponse resp);
DestroyIface(DestroyIfaceRequest req) -> (DestroyIfaceResponse resp);
SetCountry(CountryCode req) -> (int32 status);
GetCountry() -> (CountryCode resp) error int32;
ClearCountry() -> (int32 status);
};
// Temporary interface for bridging between the devhost-owned channel model and
// the driver-owned channel model of connection management.
/// This protocol is used to connect to the real Phy protocol underlying this device.
[ForDeprecatedCBindings]
protocol Connector {
Connect(request<Phy> request);
};