blob: bb88a0ff6c1753d35969397ab9cab7c81408eb49 [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.ieee80211 as ieee80211;
using zx;
/// IEEE Std 802.11-206 Section 9.4.1.4 Capability Information Field
type Capability = strict enum : uint32 {
SHORT_PREAMBLE = 0x0020;
SPECTRUM_MGMT = 0x0100;
QOS = 0x0200;
SHORT_SLOT_TIME = 0x0400;
RADIO_MSMT = 0x01000;
// 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;
};
// IEEE Std 802.11-2016 defines 12 values in dot11SupportedDataRatesRxTable
const MAX_NUM_RATES uint8 = 12;
// BandInfo groups capabilities defined per band.
// This grouping is the industry's de factor standard.
type BandInfo = struct {
band fuchsia.wlan.common.WlanBand;
ht_caps box<ieee80211.HtCapabilities>;
vht_caps box<ieee80211.VhtCapabilities>;
rates vector<uint8>:MAX_NUM_RATES;
operating_channels vector<uint8>:ieee80211.MAX_UNIQUE_CHANNEL_NUMBERS;
};
type CreateIfaceRequest = resource struct {
role fuchsia.wlan.common.WlanMacRole;
// TODO(fxbug.dev/29547): Make `mlme_channel` mandatory once all drivers support the channel.
mlme_channel zx.handle:<CHANNEL, optional>;
init_sta_addr ieee80211.MacAddr;
};
type CreateIfaceResponse = struct {
status int32;
iface_id uint16;
};
type DestroyIfaceRequest = struct {
id uint16;
};
type DestroyIfaceResponse = struct {
status int32;
};
/// The country code for a target WLAN PHY device.
/// alpha2 is ISO 3166-1 code to indicate a country. eg. AF for Afghanistan.
type CountryCode = struct {
alpha2 array<byte, 2>;
};
protocol Phy {
GetSupportedMacRoles() -> (struct {
supported_mac_roles
vector<fuchsia.wlan.common.WlanMacRole>:fuchsia.wlan.common.MAX_SUPPORTED_MAC_ROLES;
}) error zx.status;
CreateIface(resource struct {
req CreateIfaceRequest;
}) -> (struct {
resp CreateIfaceResponse;
});
DestroyIface(struct {
req DestroyIfaceRequest;
}) -> (struct {
resp DestroyIfaceResponse;
});
SetCountry(struct {
req CountryCode;
}) -> (struct {
status int32;
});
GetCountry() -> (struct {
resp CountryCode;
}) error int32;
ClearCountry() -> (struct {
status int32;
});
SetPsMode(struct {
req fuchsia.wlan.common.PowerSaveType;
}) -> (struct {
status int32;
});
GetPsMode() -> (struct {
resp fuchsia.wlan.common.PowerSaveType;
}) error int32;
};
// 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.
@for_deprecated_c_bindings
protocol Connector {
Connect(resource struct {
request server_end:Phy;
});
};