Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.hardware.wifi@1.0; |
| 18 | |
| 19 | import IWifiIface; |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 20 | import IWifiStaIfaceEventCallback; |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Interface used to represent a single STA iface. |
| 24 | */ |
| 25 | interface IWifiStaIface extends IWifiIface { |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Mask of capabilities suported by this Iface. |
| 28 | */ |
| 29 | enum StaIfaceCapabilityMask : uint32_t { |
| 30 | /** |
| 31 | * If set indicates that the APF APIs are supported. |
| 32 | * APF (Android Packet Filter) is a BPF like packet filtering |
| 33 | * bytecode executed by the firmware. |
| 34 | */ |
| 35 | APF = 1 << 0, |
| 36 | /** |
| 37 | * If set indicates that the Background Scan APIs are supported. |
| 38 | * Background scan allow the host to send a number of buckets down to the |
| 39 | * firmware. Each bucket contains a set of channels, a period, and some |
| 40 | * parameters about how and when to report results. |
| 41 | */ |
| 42 | BACKGROUND_SCAN = 1 << 1, |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 43 | /** |
| 44 | * If set indicates that the link layer stats APIs are supported. |
| 45 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 46 | LINK_LAYER_STATS = 1 << 2, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 47 | /** |
Roshan Pius | d476754 | 2016-12-06 10:04:05 -0800 | [diff] [blame] | 48 | * If set indicates that the RSSI monitor APIs are supported. |
| 49 | */ |
| 50 | RSSI_MONITOR = 1 << 3, |
| 51 | /** |
Roshan Pius | 26801cb | 2016-12-13 14:25:45 -0800 | [diff] [blame] | 52 | * If set indicates that the roaming API's are supported. |
| 53 | */ |
| 54 | CONTROL_ROAMING = 1 << 4, |
| 55 | /** |
| 56 | * If set indicates support for Probe IE white listing. |
| 57 | */ |
| 58 | PROBE_IE_WHITELIST = 1 << 5, |
| 59 | /** |
| 60 | * If set indicates support for MAC & Probe Sequence Number randomization. |
| 61 | */ |
| 62 | SCAN_RAND = 1 << 6, |
| 63 | /** |
Roshan Pius | a2d369d | 2016-12-15 22:38:00 -0800 | [diff] [blame] | 64 | * Support for 5 GHz Band. |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 65 | */ |
Roshan Pius | a2d369d | 2016-12-15 22:38:00 -0800 | [diff] [blame] | 66 | STA_5G = 1 << 7, |
| 67 | /** |
| 68 | * Support for GAS/ANQP queries. |
| 69 | */ |
| 70 | HOTSPOT = 1 << 8, |
| 71 | /** |
| 72 | * Support for Preferred Network Offload. |
| 73 | */ |
| 74 | PNO = 1 << 9, |
| 75 | /** |
| 76 | * Support for Tunneled Direct Link Setup. |
| 77 | */ |
| 78 | TDLS = 1 << 10, |
| 79 | /** |
| 80 | * Support for Tunneled Direct Link Setup off channel. |
| 81 | */ |
| 82 | TDLS_OFFCHANNEL = 1 << 11, |
| 83 | /** |
| 84 | * Support for tracking connection packets' fate. |
| 85 | */ |
| 86 | DEBUG_PACKET_FATE = 1 << 12 |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 90 | * Requests notifications of significant events on this iface. Multiple calls |
| 91 | * to this must register multiple callbacks each of which must receive all |
| 92 | * events. |
| 93 | * |
| 94 | * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface |
| 95 | * object. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 96 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 97 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 98 | * |WifiStatusCode.SUCCESS|, |
| 99 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 100 | */ |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 101 | registerEventCallback(IWifiStaIfaceEventCallback callback) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 102 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 103 | |
| 104 | /** |
| 105 | * Get the capabilities supported by this STA iface. |
| 106 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 107 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 108 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 109 | * |WifiStatusCode.SUCCESS|, |
| 110 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 111 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 112 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 113 | * @return capabilities Bitset of |StaIfaceCapabilityMask| values. |
| 114 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 115 | getCapabilities() generates (WifiStatus status, uint32_t capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 116 | |
| 117 | /** |
| 118 | * Used to query additional information about the chip's APF capabilities. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 119 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 120 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 121 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 122 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 123 | * |WifiStatusCode.SUCCESS|, |
| 124 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 125 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 126 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 127 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 128 | * @return capabilities Instance of |StaApfPacketFilterCapabilities|. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 129 | */ |
| 130 | getApfPacketFilterCapabilities() |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 131 | generates (WifiStatus status, StaApfPacketFilterCapabilities capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 132 | |
| 133 | /** |
| 134 | * Installs an APF program on this iface, replacing an existing |
| 135 | * program if present. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 136 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 137 | * |
| 138 | * @param cmdId command Id to use for this invocation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 139 | * @param APF Program to be set. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 140 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 141 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 142 | * |WifiStatusCode.SUCCESS|, |
| 143 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 144 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 145 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 146 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 147 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 148 | */ |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 149 | installApfPacketFilter(CommandId cmdId, vec<uint8_t> program) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 150 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 151 | |
| 152 | /** |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 153 | * Used to query additional information about the chip's Background Scan capabilities. |
| 154 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 155 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 156 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 157 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 158 | * |WifiStatusCode.SUCCESS|, |
| 159 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 160 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 161 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 162 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 163 | * @return capabilities Instance of |StaBackgroundScanCapabilities|. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 164 | */ |
| 165 | getBackgroundScanCapabilities() |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 166 | generates (WifiStatus status, StaBackgroundScanCapabilities capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 167 | |
| 168 | /** |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 169 | * Used to query the list of valid frequencies (depending on country code set) |
| 170 | * for the provided band. These channels may be specifed in the |
| 171 | * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan |
| 172 | * request. |
| 173 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
| 174 | * |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 175 | * @param band Band for which the frequency list is being generated. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 176 | * @return status WifiStatus of the operation. |
| 177 | * Possible status codes: |
| 178 | * |WifiStatusCode.SUCCESS|, |
| 179 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 180 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 181 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 182 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 183 | * @return frequencies vector of valid frequencies for the provided band. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 184 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 185 | getValidFrequenciesForBackgroundScan(StaBackgroundScanBand band) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 186 | generates (WifiStatus status, vec<WifiChannelInMhz> frequencies); |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 187 | |
| 188 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 189 | * Start a background scan using the given cmdId as an identifier. Only one |
| 190 | * active background scan need be supported. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 191 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 192 | * |
| 193 | * When this is called all requested buckets must be scanned, starting the |
| 194 | * beginning of the cycle. |
| 195 | * |
| 196 | * For example: |
| 197 | * If there are two buckets specified |
| 198 | * - Bucket 1: period=10s |
| 199 | * - Bucket 2: period=20s |
| 200 | * - Bucket 3: period=30s |
| 201 | * Then the following scans must occur |
| 202 | * - t=0 buckets 1, 2, and 3 are scanned |
| 203 | * - t=10 bucket 1 is scanned |
| 204 | * - t=20 bucket 1 and 2 are scanned |
| 205 | * - t=30 bucket 1 and 3 are scanned |
| 206 | * - t=40 bucket 1 and 2 are scanned |
| 207 | * - t=50 bucket 1 is scanned |
| 208 | * - t=60 buckets 1, 2, and 3 are scanned |
| 209 | * - and the patter repeats |
| 210 | * |
| 211 | * If any scan does not occur or is incomplete (error, interrupted, etc) then |
| 212 | * a cached scan result must still be recorded with the |
| 213 | * WIFI_SCAN_FLAG_INTERRUPTED flag set. |
| 214 | * |
| 215 | * @param cmdId command Id to use for this invocation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 216 | * @params Background scan parameters. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 217 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 218 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 219 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 220 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 221 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 222 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 223 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 224 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 225 | startBackgroundScan(CommandId cmdId, StaBackgroundScanParameters params) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 226 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 227 | |
| 228 | /** |
| 229 | * Stop the background scan started. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 230 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 231 | * |
| 232 | * @param cmdId command Id corresponding to the request. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 233 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 234 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 235 | * |WifiStatusCode.SUCCESS|, |
| 236 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 237 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 238 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 239 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 240 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 241 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 242 | stopBackgroundScan(CommandId cmdId) generates (WifiStatus status); |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 243 | |
| 244 | /** |
| 245 | * Enable link layer stats collection. |
| 246 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 247 | * |
| 248 | * Radio statistics (once started) must not stop until disabled. |
| 249 | * Iface statistics (once started) reset and start afresh after each |
| 250 | * connection until disabled. |
| 251 | * |
| 252 | * @param debug Set for field debug mode. Driver must collect all |
| 253 | * statistics regardless of performance impact. |
| 254 | * @return status WifiStatus of the operation. |
| 255 | * Possible status codes: |
| 256 | * |WifiStatusCode.SUCCESS|, |
| 257 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 258 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 259 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 260 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 261 | */ |
| 262 | enableLinkLayerStatsCollection(bool debug) |
| 263 | generates (WifiStatus status); |
| 264 | |
| 265 | /** |
| 266 | * Disable link layer stats collection. |
| 267 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 268 | * |
| 269 | * @return status WifiStatus of the operation. |
| 270 | * Possible status codes: |
| 271 | * |WifiStatusCode.SUCCESS|, |
| 272 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 273 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 274 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 275 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 276 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 277 | */ |
| 278 | disableLinkLayerStatsCollection() generates (WifiStatus status); |
| 279 | |
| 280 | /** |
| 281 | * Retrieve the latest link layer stats. |
| 282 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if |
| 283 | * link layer stats collection hasn't been explicitly enabled. |
| 284 | * |
| 285 | * @return status WifiStatus of the operation. |
| 286 | * Possible status codes: |
| 287 | * |WifiStatusCode.SUCCESS|, |
| 288 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 289 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 290 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 291 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 292 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 293 | * @return stats Instance of |LinkLayerStats|. |
| 294 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 295 | getLinkLayerStats() generates (WifiStatus status, StaLinkLayerStats stats); |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 296 | |
| 297 | /** |
Roshan Pius | d476754 | 2016-12-06 10:04:05 -0800 | [diff] [blame] | 298 | * Start RSSI monitoring on the currently connected access point. |
| 299 | * Once the monitoring is enabled, |
| 300 | * |IWifiStaIfaceEventCallback.onRssiThresholdBreached| callback must be |
| 301 | * invoked to indicate if the RSSI goes above |maxRssi| or below |minRssi|. |
| 302 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 303 | * |
| 304 | * @param cmdId command Id to use for this invocation. |
| 305 | * @param maxRssi Maximum RSSI threshold. |
| 306 | * @param minRssi Minimum RSSI threshold. |
| 307 | * @return status WifiStatus of the operation. |
| 308 | * Possible status codes: |
| 309 | * |WifiStatusCode.SUCCESS|, |
| 310 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 311 | * |WifiStatusCode.ERROR_ARGS_INVALID|, |
| 312 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 313 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 314 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 315 | */ |
| 316 | startRssiMonitoring(CommandId cmdId, Rssi maxRssi, Rssi minRssi) |
| 317 | generates (WifiStatus status); |
| 318 | |
| 319 | /** |
| 320 | * Stop RSSI monitoring. |
| 321 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 322 | * |
| 323 | * @param cmdId command Id corresponding to the request. |
| 324 | * @return status WifiStatus of the operation. |
| 325 | * Possible status codes: |
| 326 | * |WifiStatusCode.SUCCESS|, |
| 327 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 328 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 329 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 330 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 331 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 332 | */ |
| 333 | stopRssiMonitoring(CommandId cmdId) generates (WifiStatus status); |
| 334 | |
| 335 | /** |
Roshan Pius | 26801cb | 2016-12-13 14:25:45 -0800 | [diff] [blame] | 336 | * Get roaming control capabilities. |
| 337 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 338 | * |
| 339 | * @return status WifiStatus of the operation. |
| 340 | * Possible status codes: |
| 341 | * |WifiStatusCode.SUCCESS|, |
| 342 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 343 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 344 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 345 | * @return caps Instance of |StaRoamingCapabilities|. |
| 346 | */ |
| 347 | getRoamingCapabilities() |
| 348 | generates (WifiStatus status, StaRoamingCapabilities caps); |
| 349 | |
| 350 | /** |
| 351 | * Configure roaming control parameters. |
| 352 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 353 | * |
| 354 | * @param config Instance of |StaRoamingConfig|. |
| 355 | * @return status WifiStatus of the operation. |
| 356 | * Possible status codes: |
| 357 | * |WifiStatusCode.SUCCESS|, |
| 358 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 359 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 360 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 361 | */ |
| 362 | configureRoaming(StaRoamingConfig config) generates (WifiStatus status); |
| 363 | |
| 364 | /** |
| 365 | * Set the roaming control state with the parameters configured |
| 366 | * using |configureRoaming|. Depending on the roaming state set, the |
| 367 | * driver/firmware would enable/disable control over roaming decisions. |
| 368 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 369 | * |
| 370 | * @param state State of the roaming control. |
| 371 | * @return status WifiStatus of the operation. |
| 372 | * Possible status codes: |
| 373 | * |WifiStatusCode.SUCCESS|, |
| 374 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 375 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 376 | * |WifiStatusCode.ERROR_BUSY|, |
| 377 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 378 | */ |
| 379 | setRoamingState(StaRoamingState state) generates (WifiStatus status); |
| 380 | |
| 381 | /** |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 382 | * API to start packet fate monitoring. |
| 383 | * - Once stared, monitoring must remain active until HAL is unloaded. |
| 384 | * - When HAL is unloaded, all packet fate buffers must be cleared. |
| 385 | * - The packet fates are used to monitor the state of packets transmitted/ |
| 386 | * received during association. |
| 387 | * |
| 388 | * @return status WifiStatus of the operation. |
| 389 | * Possible status codes: |
| 390 | * |WifiStatusCode.SUCCESS|, |
| 391 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 392 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 393 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 394 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 395 | */ |
| 396 | startDebugPacketFateMonitoring() generates (WifiStatus status); |
| 397 | |
| 398 | /** |
| 399 | * API to stop packet fate monitoring. |
| 400 | * |
| 401 | * @return status WifiStatus of the operation. |
| 402 | * Possible status codes: |
| 403 | * |WifiStatusCode.SUCCESS|, |
| 404 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 405 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 406 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 407 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 408 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 409 | */ |
| 410 | stopDebugPacketFateMonitoring() generates (WifiStatus status); |
| 411 | |
| 412 | /** |
| 413 | * API to retrieve fates of outbound packets. |
| 414 | * - HAL implementation must return the fates of |
| 415 | * all the frames transmitted for the most recent association. |
| 416 | * The fate reports must follow the same order as their respective |
| 417 | * packets. |
| 418 | * - HAL implementation may choose (but is not required) to include |
| 419 | * reports for management frames. |
| 420 | * - Packets reported by firmware, but not recognized by driver, |
| 421 | * must be included. However, the ordering of the corresponding |
| 422 | * reports is at the discretion of HAL implementation. |
| 423 | * - Framework must be able to call this API multiple times for the same |
| 424 | * association. |
| 425 | * |
| 426 | * @return status WifiStatus of the operation. |
| 427 | * Possible status codes: |
| 428 | * |WifiStatusCode.SUCCESS|, |
| 429 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 430 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 431 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 432 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 433 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 434 | * @return fates Vector of |WifiDebugTxPacketFateReport| instances corresponding |
| 435 | * to the packet fates. |
| 436 | */ |
| 437 | getDebugTxPacketFates() |
| 438 | generates (WifiStatus status, vec<WifiDebugTxPacketFateReport> fates); |
| 439 | |
| 440 | /** |
| 441 | * API to retrieve fates of inbound packets. |
| 442 | * - HAL implementation must return the fates of |
| 443 | * all the frames received for the most recent association. |
| 444 | * The fate reports must follow the same order as their respective |
| 445 | * packets. |
| 446 | * - HAL implementation may choose (but is not required) to include |
| 447 | * reports for management frames. |
| 448 | * - Packets reported by firmware, but not recognized by driver, |
| 449 | * must be included. However, the ordering of the corresponding |
| 450 | * reports is at the discretion of HAL implementation. |
| 451 | * - Framework must be able to call this API multiple times for the same |
| 452 | * association. |
| 453 | * |
| 454 | * @return status WifiStatus of the operation. |
| 455 | * Possible status codes: |
| 456 | * |WifiStatusCode.SUCCESS|, |
| 457 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 458 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 459 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 460 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 461 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 462 | * @return fates Vector of |WifiDebugRxPacketFateReport| instances corresponding |
| 463 | * to the packet fates. |
| 464 | */ |
| 465 | getDebugRxPacketFates() |
| 466 | generates (WifiStatus status, vec<WifiDebugRxPacketFateReport> fates); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 467 | }; |