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 | /** |
Roshan Pius | 9a9869a | 2017-01-11 16:42:16 -0800 | [diff] [blame^] | 84 | * Support for keep alive packet offload. |
| 85 | */ |
| 86 | KEEP_ALIVE = 1 << 12, |
| 87 | /** |
Roshan Pius | a2d369d | 2016-12-15 22:38:00 -0800 | [diff] [blame] | 88 | * Support for tracking connection packets' fate. |
| 89 | */ |
Roshan Pius | 9a9869a | 2017-01-11 16:42:16 -0800 | [diff] [blame^] | 90 | DEBUG_PACKET_FATE = 1 << 13 |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 94 | * Requests notifications of significant events on this iface. Multiple calls |
| 95 | * to this must register multiple callbacks each of which must receive all |
| 96 | * events. |
| 97 | * |
| 98 | * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface |
| 99 | * object. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 100 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 101 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 102 | * |WifiStatusCode.SUCCESS|, |
| 103 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 104 | */ |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 105 | registerEventCallback(IWifiStaIfaceEventCallback callback) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 106 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Get the capabilities supported by this STA iface. |
| 110 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 111 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 112 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 113 | * |WifiStatusCode.SUCCESS|, |
| 114 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 115 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 116 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 117 | * @return capabilities Bitset of |StaIfaceCapabilityMask| values. |
| 118 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 119 | getCapabilities() generates (WifiStatus status, uint32_t capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 120 | |
| 121 | /** |
| 122 | * Used to query additional information about the chip's APF capabilities. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 123 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 124 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 125 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 126 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 127 | * |WifiStatusCode.SUCCESS|, |
| 128 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 129 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 130 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 131 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 132 | * @return capabilities Instance of |StaApfPacketFilterCapabilities|. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 133 | */ |
| 134 | getApfPacketFilterCapabilities() |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 135 | generates (WifiStatus status, StaApfPacketFilterCapabilities capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 136 | |
| 137 | /** |
| 138 | * Installs an APF program on this iface, replacing an existing |
| 139 | * program if present. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 140 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 141 | * |
| 142 | * @param cmdId command Id to use for this invocation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 143 | * @param APF Program to be set. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 144 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 145 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 146 | * |WifiStatusCode.SUCCESS|, |
| 147 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 148 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 149 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 150 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 151 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 152 | */ |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 153 | installApfPacketFilter(CommandId cmdId, vec<uint8_t> program) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 154 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 155 | |
| 156 | /** |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 157 | * Used to query additional information about the chip's Background Scan capabilities. |
| 158 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 159 | * |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 160 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 161 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 162 | * |WifiStatusCode.SUCCESS|, |
| 163 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 164 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 165 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 166 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 167 | * @return capabilities Instance of |StaBackgroundScanCapabilities|. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 168 | */ |
| 169 | getBackgroundScanCapabilities() |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 170 | generates (WifiStatus status, StaBackgroundScanCapabilities capabilities); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 171 | |
| 172 | /** |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 173 | * Used to query the list of valid frequencies (depending on country code set) |
| 174 | * for the provided band. These channels may be specifed in the |
| 175 | * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan |
| 176 | * request. |
| 177 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
| 178 | * |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 179 | * @param band Band for which the frequency list is being generated. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 180 | * @return status WifiStatus of the operation. |
| 181 | * Possible status codes: |
| 182 | * |WifiStatusCode.SUCCESS|, |
| 183 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 184 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 185 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 186 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 187 | * @return frequencies vector of valid frequencies for the provided band. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 188 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 189 | getValidFrequenciesForBackgroundScan(StaBackgroundScanBand band) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 190 | generates (WifiStatus status, vec<WifiChannelInMhz> frequencies); |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 191 | |
| 192 | /** |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 193 | * Start a background scan using the given cmdId as an identifier. Only one |
| 194 | * active background scan need be supported. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 195 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 196 | * |
| 197 | * When this is called all requested buckets must be scanned, starting the |
| 198 | * beginning of the cycle. |
| 199 | * |
| 200 | * For example: |
| 201 | * If there are two buckets specified |
| 202 | * - Bucket 1: period=10s |
| 203 | * - Bucket 2: period=20s |
| 204 | * - Bucket 3: period=30s |
| 205 | * Then the following scans must occur |
| 206 | * - t=0 buckets 1, 2, and 3 are scanned |
| 207 | * - t=10 bucket 1 is scanned |
| 208 | * - t=20 bucket 1 and 2 are scanned |
| 209 | * - t=30 bucket 1 and 3 are scanned |
| 210 | * - t=40 bucket 1 and 2 are scanned |
| 211 | * - t=50 bucket 1 is scanned |
| 212 | * - t=60 buckets 1, 2, and 3 are scanned |
| 213 | * - and the patter repeats |
| 214 | * |
| 215 | * If any scan does not occur or is incomplete (error, interrupted, etc) then |
| 216 | * a cached scan result must still be recorded with the |
| 217 | * WIFI_SCAN_FLAG_INTERRUPTED flag set. |
| 218 | * |
| 219 | * @param cmdId command Id to use for this invocation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 220 | * @params Background scan parameters. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 221 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 222 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 223 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 224 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 225 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 226 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 227 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 228 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 229 | startBackgroundScan(CommandId cmdId, StaBackgroundScanParameters params) |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 230 | generates (WifiStatus status); |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 231 | |
| 232 | /** |
| 233 | * Stop the background scan started. |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 234 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 235 | * |
| 236 | * @param cmdId command Id corresponding to the request. |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 237 | * @return status WifiStatus of the operation. |
Roshan Pius | 1f9073c | 2016-10-10 10:32:22 -0700 | [diff] [blame] | 238 | * Possible status codes: |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 239 | * |WifiStatusCode.SUCCESS|, |
| 240 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 241 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 242 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 243 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 244 | * |WifiStatusCode.ERROR_UNKNOWN| |
Roshan Pius | 7b77747 | 2016-10-07 13:15:59 -0700 | [diff] [blame] | 245 | */ |
Roshan Pius | a52dc73 | 2016-10-10 11:53:07 -0700 | [diff] [blame] | 246 | stopBackgroundScan(CommandId cmdId) generates (WifiStatus status); |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 247 | |
| 248 | /** |
| 249 | * Enable link layer stats collection. |
| 250 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 251 | * |
| 252 | * Radio statistics (once started) must not stop until disabled. |
| 253 | * Iface statistics (once started) reset and start afresh after each |
| 254 | * connection until disabled. |
| 255 | * |
| 256 | * @param debug Set for field debug mode. Driver must collect all |
| 257 | * statistics regardless of performance impact. |
| 258 | * @return status WifiStatus of the operation. |
| 259 | * Possible status codes: |
| 260 | * |WifiStatusCode.SUCCESS|, |
| 261 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 262 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 263 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 264 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 265 | */ |
| 266 | enableLinkLayerStatsCollection(bool debug) |
| 267 | generates (WifiStatus status); |
| 268 | |
| 269 | /** |
| 270 | * Disable link layer stats collection. |
| 271 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 272 | * |
| 273 | * @return status WifiStatus of the operation. |
| 274 | * Possible status codes: |
| 275 | * |WifiStatusCode.SUCCESS|, |
| 276 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 277 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 278 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 279 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 280 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 281 | */ |
| 282 | disableLinkLayerStatsCollection() generates (WifiStatus status); |
| 283 | |
| 284 | /** |
| 285 | * Retrieve the latest link layer stats. |
| 286 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if |
| 287 | * link layer stats collection hasn't been explicitly enabled. |
| 288 | * |
| 289 | * @return status WifiStatus of the operation. |
| 290 | * Possible status codes: |
| 291 | * |WifiStatusCode.SUCCESS|, |
| 292 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 293 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 294 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
Roshan Pius | 18680b7 | 2016-10-12 08:25:48 -0700 | [diff] [blame] | 295 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 296 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 297 | * @return stats Instance of |LinkLayerStats|. |
| 298 | */ |
Roshan Pius | 5e25466 | 2016-10-26 10:10:48 -0700 | [diff] [blame] | 299 | getLinkLayerStats() generates (WifiStatus status, StaLinkLayerStats stats); |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 300 | |
| 301 | /** |
Roshan Pius | d476754 | 2016-12-06 10:04:05 -0800 | [diff] [blame] | 302 | * Start RSSI monitoring on the currently connected access point. |
| 303 | * Once the monitoring is enabled, |
| 304 | * |IWifiStaIfaceEventCallback.onRssiThresholdBreached| callback must be |
| 305 | * invoked to indicate if the RSSI goes above |maxRssi| or below |minRssi|. |
| 306 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 307 | * |
| 308 | * @param cmdId command Id to use for this invocation. |
| 309 | * @param maxRssi Maximum RSSI threshold. |
| 310 | * @param minRssi Minimum RSSI threshold. |
| 311 | * @return status WifiStatus of the operation. |
| 312 | * Possible status codes: |
| 313 | * |WifiStatusCode.SUCCESS|, |
| 314 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 315 | * |WifiStatusCode.ERROR_ARGS_INVALID|, |
| 316 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 317 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 318 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 319 | */ |
| 320 | startRssiMonitoring(CommandId cmdId, Rssi maxRssi, Rssi minRssi) |
| 321 | generates (WifiStatus status); |
| 322 | |
| 323 | /** |
| 324 | * Stop RSSI monitoring. |
| 325 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 326 | * |
| 327 | * @param cmdId command Id corresponding to the request. |
| 328 | * @return status WifiStatus of the operation. |
| 329 | * Possible status codes: |
| 330 | * |WifiStatusCode.SUCCESS|, |
| 331 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 332 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 333 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 334 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 335 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 336 | */ |
| 337 | stopRssiMonitoring(CommandId cmdId) generates (WifiStatus status); |
| 338 | |
| 339 | /** |
Roshan Pius | 26801cb | 2016-12-13 14:25:45 -0800 | [diff] [blame] | 340 | * Get roaming control capabilities. |
| 341 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 342 | * |
| 343 | * @return status WifiStatus of the operation. |
| 344 | * Possible status codes: |
| 345 | * |WifiStatusCode.SUCCESS|, |
| 346 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 347 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 348 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 349 | * @return caps Instance of |StaRoamingCapabilities|. |
| 350 | */ |
| 351 | getRoamingCapabilities() |
| 352 | generates (WifiStatus status, StaRoamingCapabilities caps); |
| 353 | |
| 354 | /** |
| 355 | * Configure roaming control parameters. |
| 356 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 357 | * |
| 358 | * @param config Instance of |StaRoamingConfig|. |
| 359 | * @return status WifiStatus of the operation. |
| 360 | * Possible status codes: |
| 361 | * |WifiStatusCode.SUCCESS|, |
| 362 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 363 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 364 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 365 | */ |
| 366 | configureRoaming(StaRoamingConfig config) generates (WifiStatus status); |
| 367 | |
| 368 | /** |
| 369 | * Set the roaming control state with the parameters configured |
| 370 | * using |configureRoaming|. Depending on the roaming state set, the |
| 371 | * driver/firmware would enable/disable control over roaming decisions. |
| 372 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 373 | * |
| 374 | * @param state State of the roaming control. |
| 375 | * @return status WifiStatus of the operation. |
| 376 | * Possible status codes: |
| 377 | * |WifiStatusCode.SUCCESS|, |
| 378 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 379 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 380 | * |WifiStatusCode.ERROR_BUSY|, |
| 381 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 382 | */ |
| 383 | setRoamingState(StaRoamingState state) generates (WifiStatus status); |
| 384 | |
| 385 | /** |
Roshan Pius | af727c0 | 2017-01-11 15:37:25 -0800 | [diff] [blame] | 386 | * Enable/Disable Neighbour discovery offload functionality in the firmware. |
| 387 | * |
| 388 | * @param enable true to enable, false to disable. |
| 389 | * @return status WifiStatus of the operation. |
| 390 | * Possible status codes: |
| 391 | * |WifiStatusCode.SUCCESS|, |
| 392 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 393 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 394 | */ |
| 395 | enableNdOffload(bool enable) generates (WifiStatus status); |
| 396 | |
| 397 | /** |
Roshan Pius | 9a9869a | 2017-01-11 16:42:16 -0800 | [diff] [blame^] | 398 | * Start sending the specified keep alive packets periodically. |
| 399 | * |
| 400 | * @param cmdId command Id to use for this invocation. |
| 401 | * @param ipPacketData IP packet contents to be transmitted. |
| 402 | * @param etherType 16 bit ether type to be set in the ethernet frame |
| 403 | * transmitted. |
| 404 | * @param srcAddress Source MAC address of the packet. |
| 405 | * @param dstAddress Destination MAC address of the packet. |
| 406 | * @param periodInMs Interval at which this packet must be transmitted. |
| 407 | * @return status WifiStatus of the operation. |
| 408 | * Possible status codes: |
| 409 | * |WifiStatusCode.SUCCESS|, |
| 410 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 411 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 412 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 413 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 414 | */ |
| 415 | startSendingKeepAlivePackets( |
| 416 | CommandId cmdId, vec<uint8_t> ipPacketData, uint16_t etherType, |
| 417 | MacAddress srcAddress, MacAddress dstAddress, uint32_t periodInMs) |
| 418 | generates (WifiStatus status); |
| 419 | |
| 420 | /** |
| 421 | * Stop sending the specified keep alive packets. |
| 422 | * |
| 423 | * @param cmdId command Id corresponding to the request. |
| 424 | * @return status WifiStatus of the operation. |
| 425 | * Possible status codes: |
| 426 | * |WifiStatusCode.SUCCESS|, |
| 427 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 428 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 429 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 430 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 431 | */ |
| 432 | stopSendingKeepAlivePackets(CommandId cmdId) generates (WifiStatus status); |
| 433 | |
| 434 | /** |
Roshan Pius | fe9ad36 | 2016-10-19 16:45:12 -0700 | [diff] [blame] | 435 | * API to start packet fate monitoring. |
| 436 | * - Once stared, monitoring must remain active until HAL is unloaded. |
| 437 | * - When HAL is unloaded, all packet fate buffers must be cleared. |
| 438 | * - The packet fates are used to monitor the state of packets transmitted/ |
| 439 | * received during association. |
| 440 | * |
| 441 | * @return status WifiStatus of the operation. |
| 442 | * Possible status codes: |
| 443 | * |WifiStatusCode.SUCCESS|, |
| 444 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 445 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 446 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 447 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 448 | */ |
| 449 | startDebugPacketFateMonitoring() generates (WifiStatus status); |
| 450 | |
| 451 | /** |
| 452 | * API to stop packet fate monitoring. |
| 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 | */ |
| 463 | stopDebugPacketFateMonitoring() generates (WifiStatus status); |
| 464 | |
| 465 | /** |
| 466 | * API to retrieve fates of outbound packets. |
| 467 | * - HAL implementation must return the fates of |
| 468 | * all the frames transmitted for the most recent association. |
| 469 | * The fate reports must follow the same order as their respective |
| 470 | * packets. |
| 471 | * - HAL implementation may choose (but is not required) to include |
| 472 | * reports for management frames. |
| 473 | * - Packets reported by firmware, but not recognized by driver, |
| 474 | * must be included. However, the ordering of the corresponding |
| 475 | * reports is at the discretion of HAL implementation. |
| 476 | * - Framework must be able to call this API multiple times for the same |
| 477 | * association. |
| 478 | * |
| 479 | * @return status WifiStatus of the operation. |
| 480 | * Possible status codes: |
| 481 | * |WifiStatusCode.SUCCESS|, |
| 482 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 483 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 484 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 485 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 486 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 487 | * @return fates Vector of |WifiDebugTxPacketFateReport| instances corresponding |
| 488 | * to the packet fates. |
| 489 | */ |
| 490 | getDebugTxPacketFates() |
| 491 | generates (WifiStatus status, vec<WifiDebugTxPacketFateReport> fates); |
| 492 | |
| 493 | /** |
| 494 | * API to retrieve fates of inbound packets. |
| 495 | * - HAL implementation must return the fates of |
| 496 | * all the frames received for the most recent association. |
| 497 | * The fate reports must follow the same order as their respective |
| 498 | * packets. |
| 499 | * - HAL implementation may choose (but is not required) to include |
| 500 | * reports for management frames. |
| 501 | * - Packets reported by firmware, but not recognized by driver, |
| 502 | * must be included. However, the ordering of the corresponding |
| 503 | * reports is at the discretion of HAL implementation. |
| 504 | * - Framework must be able to call this API multiple times for the same |
| 505 | * association. |
| 506 | * |
| 507 | * @return status WifiStatus of the operation. |
| 508 | * Possible status codes: |
| 509 | * |WifiStatusCode.SUCCESS|, |
| 510 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 511 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 512 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 513 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 514 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 515 | * @return fates Vector of |WifiDebugRxPacketFateReport| instances corresponding |
| 516 | * to the packet fates. |
| 517 | */ |
| 518 | getDebugRxPacketFates() |
| 519 | generates (WifiStatus status, vec<WifiDebugRxPacketFateReport> fates); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 520 | }; |