diff options
-rw-r--r-- | wifi/1.6/Android.bp | 7 | ||||
-rw-r--r-- | wifi/1.6/IWifiChip.hal | 90 | ||||
-rw-r--r-- | wifi/1.6/IWifiNanIface.hal | 43 | ||||
-rw-r--r-- | wifi/1.6/IWifiNanIfaceEventCallback.hal | 48 | ||||
-rw-r--r-- | wifi/1.6/IWifiRttController.hal | 100 | ||||
-rw-r--r-- | wifi/1.6/IWifiRttControllerEventCallback.hal | 33 | ||||
-rw-r--r-- | wifi/1.6/IWifiStaIface.hal | 44 | ||||
-rw-r--r-- | wifi/1.6/types.hal | 670 |
8 files changed, 1035 insertions, 0 deletions
diff --git a/wifi/1.6/Android.bp b/wifi/1.6/Android.bp index d293c73a79..14cb2e0466 100644 --- a/wifi/1.6/Android.bp +++ b/wifi/1.6/Android.bp @@ -14,6 +14,13 @@ hidl_interface { root: "android.hardware", srcs: [ "IWifi.hal", + "IWifiChip.hal", + "IWifiNanIface.hal", + "IWifiNanIfaceEventCallback.hal", + "IWifiRttController.hal", + "IWifiRttControllerEventCallback.hal", + "IWifiStaIface.hal", + "types.hal", ], interfaces: [ "android.hardware.wifi@1.0", diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal new file mode 100644 index 0000000000..301bd82ca5 --- /dev/null +++ b/wifi/1.6/IWifiChip.hal @@ -0,0 +1,90 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::IWifiIface; +import @1.0::WifiStatus; +import @1.5::WifiBand; +import @1.5::IWifiChip; +import @1.5::WifiIfaceMode; +import IWifiRttController; + +/** + * Interface that represents a chip that must be configured as a single unit. + */ +interface IWifiChip extends @1.5::IWifiChip { + + /** + * Create a RTTController instance. + * + * RTT controller can be either: + * a) Bound to a specific iface by passing in the corresponding |IWifiIface| + * object in |iface| param, OR + * b) Let the implementation decide the iface to use for RTT operations by + * passing null in |iface| param. + * + * @param boundIface HIDL interface object representing the iface if + * the responder must be bound to a specific iface, null otherwise. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| + */ + createRttController_1_6(IWifiIface boundIface) + generates (WifiStatus status, IWifiRttController rtt); + + /** + * Retrieve list of usable Wifi channels for the specified band & + * operational modes. + * + * The list of usable Wifi channels in a given band depends on factors + * like current country code, operational mode (e.g. STA, SAP, WFD-CLI, + * WFD-GO, TDLS, NAN) and other restrictons due to DFS, cellular coexistence + * and conncurency state of the device. + * + * @param band |WifiBand| for which list of usable channels is requested. + * @param ifaceModeMask Bitmask of the modes represented by |WifiIfaceMode| + * Bitmask respresents all the modes that the caller is interested + * in (e.g. STA, SAP, CLI, GO, TDLS, NAN). E.g. If the caller is + * interested in knowing usable channels for P2P CLI, P2P GO & NAN, + * ifaceModeMask would be set to + * IFACE_MODE_P2P_CLIENT|IFACE_MODE_P2P_GO|IFACE_MODE_NAN. + * @param filterMask Bitmask of filters represented by + * |UsableChannelFilter|. Specifies whether driver should filter + * channels based on additional criteria. If no filter is specified + * driver should return usable channels purely based on regulatory + * constraints. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.FAILURE_UNKNOWN| + * @return channels List of channels represented by |WifiUsableChannel| + * Each entry represents a channel frequency, bandwidth and + * bitmask of modes (e.g. STA, SAP, CLI, GO, TDLS, NAN) that are + * allowed on that channel. E.g. If only STA mode can be supported + * on an indoor channel, only the IFACE_MODE_STA bit would be set + * for that channel. If 5GHz SAP cannot be supported, then none of + * the 5GHz channels will have IFACE_MODE_SOFTAP bit set. + * Note: Bits do not represent concurrency state. Each bit only + * represents whether particular mode is allowed on that channel. + */ + getUsableChannels_1_6(WifiBand band, bitfield<WifiIfaceMode> ifaceModeMask, + bitfield<UsableChannelFilter> filterMask) + generates (WifiStatus status, vec<WifiUsableChannel> channels); +}; diff --git a/wifi/1.6/IWifiNanIface.hal b/wifi/1.6/IWifiNanIface.hal new file mode 100644 index 0000000000..b92a880364 --- /dev/null +++ b/wifi/1.6/IWifiNanIface.hal @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::WifiStatus; +import @1.5::IWifiNanIface; +import IWifiNanIfaceEventCallback; + +/** + * Interface used to represent a single NAN (Neighbour Aware Network) iface. + * + * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness + * Networking (NAN) Technical Specification". + */ +interface IWifiNanIface extends @1.5::IWifiNanIface { + /** + * Requests notifications of significant events on this iface. Multiple calls + * to this must register multiple callbacks each of which must receive all + * events. + * + * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface + * object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback_1_6(IWifiNanIfaceEventCallback callback) generates (WifiStatus status); +}; diff --git a/wifi/1.6/IWifiNanIfaceEventCallback.hal b/wifi/1.6/IWifiNanIfaceEventCallback.hal new file mode 100644 index 0000000000..05b8ddfa52 --- /dev/null +++ b/wifi/1.6/IWifiNanIfaceEventCallback.hal @@ -0,0 +1,48 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::CommandIdShort; +import @1.0::WifiNanStatus; +import @1.5::IWifiNanIfaceEventCallback; + +/** + * NAN Response and Asynchronous Event Callbacks. + * + * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness + * Networking (NAN) Technical Specification". + */ +interface IWifiNanIfaceEventCallback extends @1.5::IWifiNanIfaceEventCallback { + /** + * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by + * both Initiator and Responder. + * + * Note: supersedes the @1.0::IWifiNanIfaceEventCallback.eventDataPathConfirm() method which is + * deprecated as of HAL version 1.2. + * + * @param event: NanDataPathConfirmInd containing event details. + */ + oneway eventDataPathConfirm_1_6(NanDataPathConfirmInd event); + + /** + * Asynchronous callback indicating a data-path (NDP) schedule has been updated (e.g. channels + * have been changed). + * + * @param event: NanDataPathScheduleUpdateInd containing event details. + */ + oneway eventDataPathScheduleUpdate_1_6(NanDataPathScheduleUpdateInd event); +}; diff --git a/wifi/1.6/IWifiRttController.hal b/wifi/1.6/IWifiRttController.hal new file mode 100644 index 0000000000..0db1d2c72b --- /dev/null +++ b/wifi/1.6/IWifiRttController.hal @@ -0,0 +1,100 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::CommandId; +import @1.0::WifiStatus; +import @1.4::IWifiRttController; +import IWifiRttControllerEventCallback; +/** + * Interface used to perform RTT(Round trip time) operations. + */ +interface IWifiRttController extends @1.4::IWifiRttController { + /** + * Requests notifications of significant events on this rtt controller. + * Multiple calls to this must register multiple callbacks each of which must + * receive all events. + * + * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL + * interface object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback_1_6(IWifiRttControllerEventCallback callback) + generates (WifiStatus status); + + /** + * API to request RTT measurement. + * + * @param cmdId command Id to use for this invocation. + * @param rttConfigs Vector of |RttConfig| parameters. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + rangeRequest_1_6(CommandId cmdId, vec<RttConfig> rttConfigs) generates (WifiStatus status); + + /** + * Get RTT responder information e.g. WiFi channel to enable responder on. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return info Instance of |RttResponderInfo|. + */ + getResponderInfo_1_6() generates (WifiStatus status, RttResponder info); + + /** + * Enable RTT responder mode. + * + * @param cmdId command Id to use for this invocation. + * @parm channelHint Hint of the channel information where RTT responder must + * be enabled on. + * @param maxDurationInSeconds Timeout of responder mode. + * @param info Instance of |RttResponderInfo|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableResponder_1_6(CommandId cmdId, WifiChannelInfo channelHint, + uint32_t maxDurationInSeconds, RttResponder info) generates (WifiStatus status); + + /** + * RTT capabilities of the device. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return capabilities Instance of |RttCapabilities|. + */ + getCapabilities_1_6() generates (WifiStatus status, RttCapabilities capabilities); +}; diff --git a/wifi/1.6/IWifiRttControllerEventCallback.hal b/wifi/1.6/IWifiRttControllerEventCallback.hal new file mode 100644 index 0000000000..0857b66038 --- /dev/null +++ b/wifi/1.6/IWifiRttControllerEventCallback.hal @@ -0,0 +1,33 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.4::IWifiRttControllerEventCallback; +import @1.0::CommandId; + +/** + * RTT Response and Event Callbacks. + */ +interface IWifiRttControllerEventCallback extends @1.4::IWifiRttControllerEventCallback { + /* + * Invoked when an RTT result is available. + * + * @param cmdId command Id corresponding to the original request. + * @param results Vector of |RttResult| instances. + */ + oneway onResults_1_6(CommandId cmdId, vec<RttResult> results); +}; diff --git a/wifi/1.6/IWifiStaIface.hal b/wifi/1.6/IWifiStaIface.hal new file mode 100644 index 0000000000..c26e1a0981 --- /dev/null +++ b/wifi/1.6/IWifiStaIface.hal @@ -0,0 +1,44 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::WifiStatus; +import @1.5::IWifiStaIface; + +/** + * Interface used to represent a single STA iface. + * + * IWifiChip.createStaIface() must return a @1.6::IWifiStaIface when supported. + */ +interface IWifiStaIface extends @1.5::IWifiStaIface { + /** + * Retrieve the latest link layer stats. + * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if + * link layer stats collection hasn't been explicitly enabled. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return stats Instance of |LinkLayerStats|. + */ + getLinkLayerStats_1_6() generates (WifiStatus status, StaLinkLayerStats stats); +}; diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal new file mode 100644 index 0000000000..f1d9d458ee --- /dev/null +++ b/wifi/1.6/types.hal @@ -0,0 +1,670 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.6; + +import @1.0::MacAddress; +import @1.0::NanDataPathConfirmInd; +import @1.0::Rssi; +import @1.0::RttBw; +import @1.0::RttPeerType; +import @1.0::RttStatus; +import @1.0::RttType; +import @1.0::StaLinkLayerIfaceStats; +import @1.0::StaLinkLayerRadioStats; +import @1.0::TimeSpanInPs; +import @1.0::TimeStampInUs; +import @1.0::TimeStampInMs; +import @1.0::WifiChannelInMhz; +import @1.0::WifiChannelWidthInMhz; +import @1.0::WifiInformationElement; +import @1.0::WifiRateNss; +import @1.4::RttPreamble; +import @1.4::WifiRatePreamble; +import @1.5::StaLinkLayerIfaceContentionTimeStats; +import @1.5::WifiIfaceMode; + +/** + * Channel operating width in Mhz. + */ +enum WifiChannelWidthInMhz : @1.0::WifiChannelWidthInMhz { + /** + * 320 MHz + */ + WIDTH_320 = 7, +}; + +/** + * RTT Measurement Bandwidth. + */ +enum RttBw : @1.0::RttBw { + BW_320MHZ = 0x40, +}; + +/** + * RTT Measurement Preamble. + */ +enum RttPreamble : @1.4::RttPreamble { + /** + * Preamble type for 11be + */ + EHT = 0x10, +}; + +/** + * Wifi Rate Preamble + */ +enum WifiRatePreamble : @1.4::WifiRatePreamble { + /** + * Preamble type for 11be + */ + EHT = 6, +}; + +/** + * Channel information. + */ +struct WifiChannelInfo { + /** + * Channel width (20, 40, 80, 80+80, 160, 320). + */ + WifiChannelWidthInMhz width; + /** + * Primary 20 MHz channel. + */ + WifiChannelInMhz centerFreq; + /** + * Center frequency (MHz) first segment. + */ + WifiChannelInMhz centerFreq0; + /** + * Center frequency (MHz) second segment. + */ + WifiChannelInMhz centerFreq1; +}; + +/** + * RTT configuration. + */ +struct RttConfig { + /** + * Peer device mac address. + */ + MacAddress addr; + + /** + * 1-sided or 2-sided RTT. + */ + RttType type; + + /** + * Optional - peer device hint (STA, P2P, AP). + */ + RttPeerType peer; + + /** + * Required for STA-AP mode, optional for P2P, NBD etc. + */ + WifiChannelInfo channel; + + /** + * Time interval between bursts (units: 100 ms). + * Applies to 1-sided and 2-sided RTT multi-burst requests. + * Range: 0-31, 0: no preference by initiator (2-sided RTT). + */ + uint32_t burstPeriod; + + /** + * Total number of RTT bursts to be executed. It will be + * specified in the same way as the parameter "Number of + * Burst Exponent" found in the FTM frame format. It + * applies to both: 1-sided RTT and 2-sided RTT. Valid + * values are 0 to 15 as defined in 802.11mc std. + * 0 means single shot + * The implication of this parameter on the maximum + * number of RTT results is the following: + * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst) + * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1) + */ + uint32_t numBurst; + + /** + * Num of frames per burst. + * Minimum value = 1, Maximum value = 31 + * For 2-sided this equals the number of FTM frames + * to be attempted in a single burst. This also + * equals the number of FTM frames that the + * initiator will request that the responder send + * in a single frame. + */ + uint32_t numFramesPerBurst; + + /** + * Number of retries for a failed RTT frame. + * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerRttFrame; + + /** + * Following fields are only valid for 2-side RTT. + * + * + * Maximum number of retries that the initiator can + * retry an FTMR frame. + * Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerFtmr; + + /** + * Whether to request location civic info or not. + */ + bool mustRequestLci; + + /** + * Whether to request location civic records or not. + */ + bool mustRequestLcr; + + /** + * Applies to 1-sided and 2-sided RTT. Valid values will + * be 2-11 and 15 as specified by the 802.11mc std for + * the FTM parameter burst duration. In a multi-burst + * request, if responder overrides with larger value, + * the initiator will return failure. In a single-burst + * request if responder overrides with larger value, + * the initiator will sent TMR_STOP to terminate RTT + * at the end of the burst_duration it requested. + */ + uint32_t burstDuration; + + /** + * RTT preamble to be used in the RTT frames. + */ + RttPreamble preamble; + + /** + * RTT BW to be used in the RTT frames. + */ + RttBw bw; +}; + +/** + * RTT Responder information + */ +struct RttResponder { + WifiChannelInfo channel; + + RttPreamble preamble; +}; + +struct WifiChannelStats { + /** + * Channel information. + */ + WifiChannelInfo channel; + /** + * Total time for which the radio is awake on this channel. + */ + uint32_t onTimeInMs; + /** + * Total time for which CCA is held busy on this channel. + */ + uint32_t ccaBusyTimeInMs; +}; + +struct StaLinkLayerRadioStats { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::StaLinkLayerRadioStats V1_0; + + /** + * Total time for which the radio is awake due to NAN scan since boot or crash. + */ + uint32_t onTimeInMsForNanScan; + + /** + * Total time for which the radio is awake due to background scan since boot or crash. + */ + uint32_t onTimeInMsForBgScan; + + /** + * Total time for which the radio is awake due to roam scan since boot or crash. + */ + uint32_t onTimeInMsForRoamScan; + + /** + * Total time for which the radio is awake due to PNO scan since boot or crash. + */ + uint32_t onTimeInMsForPnoScan; + + /** + * Total time for which the radio is awake due to Hotspot 2.0 scans and GAS exchange since boot + * or crash. + */ + uint32_t onTimeInMsForHs20Scan; + + /** + * List of channel stats associated with this radio + */ + vec<WifiChannelStats> channelStats; + + /** + * Radio ID: An implementation specific value identifying the radio interface for which the + * stats are produced. Framework must not interpret this value. It must use this value for + * persistently identifying the statistics between calls, + * e.g. if the HAL provides them in different order. + */ + int32_t radioId; +}; + +/** + * Per peer statistics. The types of peer include the Access Point (AP), the Tunneled Direct Link + * Setup (TDLS), the Group Owner (GO), the Neighbor Awareness Networking (NAN), etc. + */ +struct StaPeerInfo { + /** + * Station count: The total number of stations currently associated with the peer. + */ + uint16_t staCount; + /** + * Channel utilization: The percentage of time (normalized to 255, i.e., x% corresponds to + * (int) x * 255 / 100) that the medium is sensed as busy measured by either physical or + * virtual carrier sense (CS) mechanism. + */ + uint16_t chanUtil; + /** + * Per rate statistics + */ + vec<StaRateStat> rateStats; +}; + +/** + * Iface statistics for the current connection. + */ +struct StaLinkLayerIfaceStats { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::StaLinkLayerIfaceStats V1_0; + + /** + * Duty cycle for the iface. + * if this iface is being served using time slicing on a radio with one or more ifaces + * (i.e MCC), then the duty cycle assigned to this iface in %. + * If not using time slicing (i.e SCC or DBS), set to 100. + */ + uint8_t timeSliceDutyCycleInPercent; + + /** + * WME Best Effort (BE) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeBeContentionTimeStats; + + /** + * WME Background (BK) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeBkContentionTimeStats; + + /** + * WME Video (VI) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeViContentionTimeStats; + + /** + * WME Voice (VO) Access Category (AC) contention time statistics. + */ + StaLinkLayerIfaceContentionTimeStats wmeVoContentionTimeStats; + + /** + * Per peer statistics. + */ + vec<StaPeerInfo> peers; +}; + +/** + * Link layer stats retrieved via |getLinkLayerStats|. + */ +struct StaLinkLayerStats { + StaLinkLayerIfaceStats iface; + + vec<StaLinkLayerRadioStats> radios; + + /** + * TimeStamp for each stats sample. + * This is the absolute milliseconds from boot when these stats were + * sampled. + */ + TimeStampInMs timeStampInMs; +}; + +/** + * Wifi rate info. + */ +struct WifiRateInfo { + /** + * Preamble used for RTT measurements. + */ + WifiRatePreamble preamble; + + /** + * Number of spatial streams. + */ + WifiRateNss nss; + + /** + * Bandwidth of channel. + */ + WifiChannelWidthInMhz bw; + + /** + * OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps. + * HT/VHT/HE/EHT it would be mcs index. + */ + uint8_t rateMcsIdx; + + /** + * Bitrate in units of 100 Kbps. + */ + uint32_t bitRateInKbps; +}; + +/** + * Per rate statistics. The rate is characterized by the combination of preamble, number of spatial + * streams, transmission bandwidth, and modulation and coding scheme (MCS). + */ +struct StaRateStat{ + /** + * Wifi rate information: preamble, number of spatial streams, bandwidth, MCS, etc. + */ + WifiRateInfo rateInfo; + /** + * Number of successfully transmitted data packets (ACK received) + */ + uint32_t txMpdu; + /** + * Number of received data packets + */ + uint32_t rxMpdu; + /** + * Number of data packet losses (no ACK) + */ + uint32_t mpduLost; + /** + * Number of data packet retries + */ + uint32_t retries; +}; + +/** + * RTT results. + */ +struct RttResult { + /** + * Peer device mac address. + */ + MacAddress addr; + + /** + * Burst number in a multi-burst request. + */ + uint32_t burstNum; + + /** + * Total RTT measurement frames attempted. + */ + uint32_t measurementNumber; + + /** + * Total successful RTT measurement frames. + */ + uint32_t successNumber; + + /** + * Maximum number of "FTM frames per burst" supported by + * the responder STA. Applies to 2-sided RTT only. + * If reponder overrides with larger value: + * - for single-burst request initiator will truncate the + * larger value and send a TMR_STOP after receiving as + * many frames as originally requested. + * - for multi-burst request, initiator will return + * failure right away. + */ + uint8_t numberPerBurstPeer; + + /** + * Ranging status. + */ + RttStatus status; + + /** + * When status == RTT_STATUS_FAIL_BUSY_TRY_LATER, + * this will be the time provided by the responder as to + * when the request can be tried again. Applies to 2-sided + * RTT only. In sec, 1-31sec. + */ + uint8_t retryAfterDuration; + + /** + * RTT type. + */ + RttType type; + + /** + * Average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB. + */ + Rssi rssi; + + /** + * Rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional). + */ + Rssi rssiSpread; + + /** + * 1-sided RTT: TX rate of RTT frame. + * 2-sided RTT: TX rate of initiator's Ack in response to FTM frame. + */ + WifiRateInfo txRate; + + /** + * 1-sided RTT: TX rate of Ack from other side. + * 2-sided RTT: TX rate of FTM frame coming from responder. + */ + WifiRateInfo rxRate; + + /** + * Round trip time in picoseconds + */ + TimeSpanInPs rtt; + + /** + * Rtt standard deviation in picoseconds. + */ + TimeSpanInPs rttSd; + + /** + * Difference between max and min rtt times recorded in picoseconds. + */ + TimeSpanInPs rttSpread; + + /** + * Distance in mm (optional). + */ + int32_t distanceInMm; + + /** + * Standard deviation in mm (optional). + */ + int32_t distanceSdInMm; + + /** + * Difference between max and min distance recorded in mm (optional). + */ + int32_t distanceSpreadInMm; + + /** + * Time of the measurement (in microseconds since boot). + */ + TimeStampInUs timeStampInUs; + + /** + * in ms, actual time taken by the FW to finish one burst + * measurement. Applies to 1-sided and 2-sided RTT. + */ + uint32_t burstDurationInMs; + + /** + * Number of bursts allowed by the responder. Applies + * to 2-sided RTT only. + */ + uint32_t negotiatedBurstNum; + + /** + * for 11mc only. + */ + WifiInformationElement lci; + + /** + * for 11mc only. + */ + WifiInformationElement lcr; +}; + +/** + * NAN data path channel information provided to the framework. + */ +struct NanDataPathChannelInfo { + /** + * Channel frequency in MHz. + */ + WifiChannelInMhz channelFreq; + /** + * Channel bandwidth in MHz. + */ + WifiChannelWidthInMhz channelBandwidth; + /** + * Number of spatial streams used in the channel. + */ + uint32_t numSpatialStreams; +}; + +/** + * NAN Data path confirmation Indication structure. + * Event indication is received on both initiator and responder side when negotiation for a + * data-path finish: on success or failure. + */ +struct NanDataPathConfirmInd { + /** + * Baseline information as defined in HAL 1.0. + */ + @1.0::NanDataPathConfirmInd V1_0; + /** + * The channel(s) on which the NDP is scheduled to operate. + * Updates to the operational channels are provided using the |eventDataPathScheduleUpdate| + * event. + */ + vec<NanDataPathChannelInfo> channelInfo; +}; + +/** + * NAN data path channel information update indication structure. + * Event indication is received by all NDP owners whenever the channels on which the NDP operates + * are updated. + * Note: multiple NDPs may share the same schedule, the indication specifies all NDPs to which it + * applies. + */ +struct NanDataPathScheduleUpdateInd { + /** + * The discovery address (NMI) of the peer to which the NDP is connected. + */ + MacAddress peerDiscoveryAddress; + /** + * The updated channel(s) information. + */ + vec<NanDataPathChannelInfo> channelInfo; + /** + * The list of NDPs to which this update applies. + */ + vec<uint32_t> ndpInstanceIds; +}; + +/** + * Wifi usable channel information. + */ +struct WifiUsableChannel { + /** + * Wifi channel freqeuncy in MHz. + */ + WifiChannelInMhz channel; + + /** + * Wifi channel bandwidth in MHz. + */ + WifiChannelWidthInMhz channelBandwidth; + + /** + * Iface modes feasible on this channel. + */ + bitfield<WifiIfaceMode> ifaceModeMask; +}; + +/** + * RTT Capabilities. + */ +struct RttCapabilities { + /** + * if 1-sided rtt data collection is supported. + */ + bool rttOneSidedSupported; + + /** + * if ftm rtt data collection is supported. + */ + bool rttFtmSupported; + + /** + * if initiator supports LCI request. Applies to 2-sided RTT. + */ + bool lciSupported; + + /** + * if initiator supports LCR request. Applies to 2-sided RTT. + */ + bool lcrSupported; + + /** + * if 11mc responder mode is supported. + */ + bool responderSupported; + + /** + * Bit mask indicates what preamble is supported by initiator. + * Combination of |RttPreamble| values. + */ + bitfield<RttPreamble> preambleSupport; + + /** + * Bit mask indicates what BW is supported by initiator. + * Combination of |RttBw| values. + */ + bitfield<RttBw> bwSupport; + + /** + * Draft 11mc spec version supported by chip. + * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc. + */ + uint8_t mcVersion; +}; |