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