blob: 5f4e4bfd9d5d69b018c626d40865a828b41b713a [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.service;
using fuchsia.wlan.common;
using fuchsia.wlan.device;
using fuchsia.wlan.minstrel;
using fuchsia.wlan.sme;
using fuchsia.wlan.stats;
struct PhyListItem {
uint16 phy_id;
string path;
};
struct ListPhysResponse {
vector<PhyListItem> phys;
};
struct QueryPhyRequest {
uint16 phy_id;
};
struct QueryPhyResponse {
fuchsia.wlan.device.PhyInfo info;
};
struct IfaceListItem {
uint16 iface_id;
};
struct QueryIfaceResponse {
/// The role the iface is currently operating in, e.g., client role.
fuchsia.wlan.device.MacRole role;
/// The iface's global ID.
uint16 id;
/// Iface's PHY ID.
uint16 phy_id;
/// Local ID assigned by this iface's PHY.
uint16 phy_assigned_id;
/// The iface's MAC.
array<uint8>:6 mac_addr;
/// The driver features supported on this iface.
vector<fuchsia.wlan.common.DriverFeature>:32 driver_features;
};
struct ListIfacesResponse {
vector<IfaceListItem> ifaces;
};
struct CreateIfaceRequest {
uint16 phy_id;
fuchsia.wlan.device.MacRole role;
bytes:6? mac_addr;
};
struct CreateIfaceResponse {
uint16 iface_id;
};
struct DestroyIfaceRequest {
uint16 iface_id;
};
struct GetCountryResponse {
array<byte>:2 alpha2;
};
struct SetCountryRequest {
uint16 phy_id;
array<byte>:2 alpha2;
};
struct ClearCountryRequest {
uint16 phy_id;
};
protocol DeviceWatcher {
-> OnPhyAdded(uint16 phy_id);
-> OnPhyRemoved(uint16 phy_id);
-> OnIfaceAdded(uint16 iface_id);
-> OnIfaceRemoved(uint16 iface_id);
};
[Discoverable]
protocol DeviceService {
// Phy methods
ListPhys() -> (ListPhysResponse resp);
QueryPhy(QueryPhyRequest req) -> (int32 status, QueryPhyResponse? resp);
// 3-15: reserved
// Iface methods
ListIfaces() -> (ListIfacesResponse resp);
QueryIface(uint16 iface_id) -> (int32 status, QueryIfaceResponse? resp);
CreateIface(CreateIfaceRequest req) -> (int32 status, CreateIfaceResponse? resp);
// 19: reserved for StartIface
// 20: reserved for StopIface
DestroyIface(DestroyIfaceRequest req) -> (int32 status);
GetClientSme(uint16 iface_id, request<fuchsia.wlan.sme.ClientSme> sme) -> (int32 status);
GetApSme(uint16 iface_id, request<fuchsia.wlan.sme.ApSme> sme) -> (int32 status);
GetMeshSme(uint16 iface_id, request<fuchsia.wlan.sme.MeshSme> sme) -> (int32 status);
GetIfaceStats(uint16 iface_id) -> (int32 status, fuchsia.wlan.stats.IfaceStats? stats);
GetMinstrelList(uint16 iface_id) -> (int32 status, fuchsia.wlan.minstrel.Peers peers);
GetMinstrelStats(uint16 iface_id, array<uint8>:6 peer_addr)
-> (int32 status, fuchsia.wlan.minstrel.Peer? peer);
WatchDevices(request<DeviceWatcher> watcher);
GetCountry(uint16 phy_id) -> (GetCountryResponse resp) error int32;
SetCountry(SetCountryRequest req) -> (int32 status);
ClearCountry(ClearCountryRequest req) -> (int32 status);
};
[Discoverable]
protocol DeviceMonitor {
// Phy methods
ListPhys() -> (vector<uint16> phy_list);
GetDevPath(uint16 phy_id) -> (string? dev_path);
GetSupportedMacRoles(uint16 phy_id)
-> (vector<fuchsia.wlan.device.MacRole>:8? supported_mac_roles);
WatchDevices(request<DeviceWatcher> watcher);
GetCountry(uint16 phy_id) -> (GetCountryResponse resp) error int32;
SetCountry(SetCountryRequest req) -> (int32 status);
ClearCountry(ClearCountryRequest req) -> (int32 status);
// Iface methods
CreateIface(CreateIfaceRequest req) -> (int32 status, CreateIfaceResponse? resp);
DestroyIface(DestroyIfaceRequest req) -> (int32 status);
};