blob: 2d8536b97bb9ff3455f821cf012163adf944a572 [file] [log] [blame] [edit]
// 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 wlantap;
using wlan_device;
struct WlantapPhyConfig {
wlan_device.PhyInfo phy_info;
string name;
};
// See wlan_rx_info_t
struct WlanRxInfo {
uint32 rx_flags;
uint32 valid_fields;
uint16 phy;
uint32 data_rate;
wlan_device.Channel chan;
uint8 mcs;
int8 rssi_dbm;
int16 rcpi_dbmh;
int16 snr_dbh;
};
// See wlan_tx_info_t
struct WlanTxInfo {
uint32 tx_flags;
uint32 valid_fields;
uint16 phy;
uint8 cbw;
uint32 data_rate;
uint8 mcs;
};
struct WlanTxPacket {
vector<uint8> data;
WlanTxInfo info;
};
// See wlan_bss_config_t
struct WlanBssConfig {
array<uint8>:6 bssid;
uint8 bss_type;
bool remote;
};
// See wlan_key_config_t
struct WlanKeyConfig {
uint8 protection;
array<uint8>:3 cipher_oui;
uint8 cipher_type;
uint8 key_type;
array<uint8>:6 peer_addr;
uint8 key_idx;
vector<uint8>:32 key;
};
interface WlantapPhy {
// wlanmac_ifc_t callbacks
1: Rx(uint16 wlanmac_id, vector<uint8> data, WlanRxInfo info);
2: Status(uint16 wlanmac_id, uint32 st);
// wlanmac_protocol_ops_t
3: -> Tx(TxArgs args);
4: -> SetChannel(SetChannelArgs args);
5: -> ConfigureBss(ConfigureBssArgs args);
// TODO: ConfigureBeacon
7: -> SetKey(SetKeyArgs args);
8: -> WlanmacStart(WlanmacStartArgs args);
};
struct TxArgs {
uint16 wlanmac_id;
WlanTxPacket packet;
};
struct SetChannelArgs {
uint16 wlanmac_id;
wlan_device.Channel chan;
};
struct ConfigureBssArgs {
uint16 wlanmac_id;
WlanBssConfig config;
};
struct SetKeyArgs {
uint16 wlanmac_id;
WlanKeyConfig config;
};
struct WlanmacStartArgs {
uint16 wlanmac_id;
};