// Copyright 2017 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.mlme;
using fuchsia.wlan.stats;
using fuchsia.wlan.minstrel;

// Custom primitives for communicating between the wlan service and the MLME drivers.
// The primitives defined here are not part of the official 802.11 MLME SAP interface specification,
// but follow the same principle for the sake of consistency.


// SIGNAL_REPORT.indication

struct SignalReportIndication {
    int8 rssi_dbm;
};

// EAPOL.indication

struct EapolIndication {
    array<uint8>:6 src_addr;
    array<uint8>:6 dst_addr;
    vector<uint8> data;
};

enum MacRole {
    CLIENT = 1;
    AP = 2;
    MESH = 3;
};


// BandInfo groups capabilities defined per band.
// This grouping is the industry's de factor standard.
struct BandCapabilities {
    Band band_id;
    vector<uint16> basic_rates;
    uint16 base_frequency;
    vector<uint8> channels;

    CapabilityInfo cap;
    HtCapabilities? ht_cap;
    VhtCapabilities? vht_cap;
};

struct DeviceInfo {
    array<uint8>:6 mac_addr;
    MacRole role;
    vector<BandCapabilities> bands;
};

// STATS_QUERY.response

struct StatsQueryResponse {
    fuchsia.wlan.stats.IfaceStats stats;
};

struct MinstrelListResponse {
    fuchsia.wlan.minstrel.Peers peers;
};

struct MinstrelStatsRequest {
    array<uint8>:6 mac_addr;
};

struct MinstrelStatsResponse {
    fuchsia.wlan.minstrel.Peer? peer;
};

// Method ordinals are defined in wlan_mlme.fidl to prevent error prone overlaps with official
// MLME primitives.