blob: f1dbd96f49fc63accf5f586b074e8ba5775cca58 [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 fuchsia.hardware.wlanphyimpl;
using fuchsia.wlan.common;
using fuchsia.wlan.ieee80211 as ieee80211;
using zx;
/// Parameters to create an interface.
type WlanPhyImplCreateIfaceReq = resource struct {
/// The station role for this interface. A device may support multiple roles,
/// but an interface is instantiated with a single role.
role fuchsia.wlan.common.WlanMacRole;
/// A handle to the direct MLME channel, if supported by the driver.
mlme_channel zx.Handle:CHANNEL;
/// Whether this iface creation request come with an initial station address.
has_init_sta_addr bool;
/// The initial station address set from configuration layer.
init_sta_addr ieee80211.MacAddr;
};
const WLANPHY_ALPHA2_LEN uint8 = 2;
type WlanPhyCountry = struct {
/// ISO Alpha-2 takes two octet alphabet characters.
/// This needs to be expanded if at least one WLAN device driver or firmware
/// requires more than two octets.
alpha2 array<uint8, WLANPHY_ALPHA2_LEN>;
};
type WlanPhyPsMode = struct {
ps_mode fuchsia.wlan.common.PowerSaveType;
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
protocol WlanPhyImpl {
/// MAC roles supported for ifaces on the physical device.
GetSupportedMacRoles() -> (struct {
s zx.Status;
supported_mac_roles_list
array<fuchsia.wlan.common.WlanMacRole, fuchsia.wlan.common.MAX_SUPPORTED_MAC_ROLES>;
supported_mac_roles_count uint8;
});
/// Create a new interface with the specified role, returning the interface id.
/// Some common error codes are:
/// ZX_ERR_NO_RESOURCES: maximum number of interfaces have already been created
/// ZX_ERR_NOT_SUPPORTED: device does not support the specified role
CreateIface(resource struct {
req WlanPhyImplCreateIfaceReq;
}) -> (struct {
s zx.Status;
iface_id uint16;
});
/// Destroy the interface with the matching id.
DestroyIface(struct {
iface_id uint16;
}) -> (struct {
s zx.Status;
});
/// Set country with a WlanPhyCountry
SetCountry(struct {
country WlanPhyCountry;
}) -> (struct {
s zx.Status;
});
/// Set device to a world-safe country
ClearCountry() -> (struct {
s zx.Status;
});
/// Read currently configured country. Implementations are advised to read the
/// country directly from the firmware, where possible.
GetCountry() -> (struct {
s zx.Status;
country WlanPhyCountry;
});
/// Set Power Save mode On/Off on device. In most implementations this
/// likely to be set in Firmware.
SetPowerSaveMode(struct {
ps_mode WlanPhyPsMode;
}) -> (struct {
s zx.Status;
});
/// Get current Power Save Mode from device. In most implementation this
/// likely to be retrieved from Firmware.
GetPowerSaveMode() -> (struct {
s zx.Status;
ps_mode WlanPhyPsMode;
});
};