2 * Copyright 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.hardware.wifi@1.0;
20 import IWifiStaIfaceEventCallback;
23 * Interface used to represent a single STA iface.
25 interface IWifiStaIface extends IWifiIface {
27 * Mask of capabilities suported by this Iface.
29 enum StaIfaceCapabilityMask : uint32_t {
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.
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.
42 BACKGROUND_SCAN = 1 << 1,
44 * If set indicates that the link layer stats APIs are supported.
46 LINK_LAYER_STATS = 1 << 2,
48 * If set indicates that the RSSI monitor APIs are supported.
50 RSSI_MONITOR = 1 << 3,
52 * If set indicates that the roaming API's are supported.
54 CONTROL_ROAMING = 1 << 4,
56 * If set indicates support for Probe IE white listing.
58 PROBE_IE_WHITELIST = 1 << 5,
60 * If set indicates support for MAC & Probe Sequence Number randomization.
64 * Support for 5 GHz Band.
68 * Support for GAS/ANQP queries.
72 * Support for Preferred Network Offload.
76 * Support for Tunneled Direct Link Setup.
80 * Support for Tunneled Direct Link Setup off channel.
82 TDLS_OFFCHANNEL = 1 << 11,
84 * Support for neighbour discovery offload.
88 * Support for keep alive packet offload.
92 * Support for tracking connection packets' fate.
94 DEBUG_PACKET_FATE = 1 << 14
98 * Requests notifications of significant events on this iface. Multiple calls
99 * to this must register multiple callbacks each of which must receive all
102 * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface
104 * @return status WifiStatus of the operation.
105 * Possible status codes:
106 * |WifiStatusCode.SUCCESS|,
107 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|
109 registerEventCallback(IWifiStaIfaceEventCallback callback)
110 generates (WifiStatus status);
113 * Get the capabilities supported by this STA iface.
115 * @return status WifiStatus of the operation.
116 * Possible status codes:
117 * |WifiStatusCode.SUCCESS|,
118 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
119 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
120 * |WifiStatusCode.ERROR_UNKNOWN|
121 * @return capabilities Bitset of |StaIfaceCapabilityMask| values.
124 generates (WifiStatus status,
125 bitfield<StaIfaceCapabilityMask> capabilities);
128 * Used to query additional information about the chip's APF capabilities.
129 * Must fail if |StaIfaceCapabilityMask.APF| is not set.
131 * @return status WifiStatus of the operation.
132 * Possible status codes:
133 * |WifiStatusCode.SUCCESS|,
134 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
135 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
136 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
137 * |WifiStatusCode.ERROR_UNKNOWN|
138 * @return capabilities Instance of |StaApfPacketFilterCapabilities|.
140 getApfPacketFilterCapabilities()
141 generates (WifiStatus status, StaApfPacketFilterCapabilities capabilities);
144 * Installs an APF program on this iface, replacing an existing
145 * program if present.
146 * Must fail if |StaIfaceCapabilityMask.APF| is not set.
148 * @param cmdId command Id to use for this invocation.
149 * @param APF Program to be set.
150 * @return status WifiStatus of the operation.
151 * Possible status codes:
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|
159 installApfPacketFilter(CommandId cmdId, vec<uint8_t> program)
160 generates (WifiStatus status);
163 * Used to query additional information about the chip's Background Scan capabilities.
164 * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set.
166 * @return status WifiStatus of the operation.
167 * Possible status codes:
168 * |WifiStatusCode.SUCCESS|,
169 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
170 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
171 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
172 * |WifiStatusCode.ERROR_UNKNOWN|
173 * @return capabilities Instance of |StaBackgroundScanCapabilities|.
175 getBackgroundScanCapabilities()
176 generates (WifiStatus status, StaBackgroundScanCapabilities capabilities);
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
183 * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set.
185 * @param band Band for which the frequency list is being generated.
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|
193 * @return frequencies vector of valid frequencies for the provided band.
195 getValidFrequenciesForBackgroundScan(StaBackgroundScanBand band)
196 generates (WifiStatus status, vec<WifiChannelInMhz> frequencies);
199 * Start a background scan using the given cmdId as an identifier. Only one
200 * active background scan need be supported.
201 * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set.
203 * When this is called all requested buckets must be scanned, starting the
204 * beginning of the cycle.
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
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.
225 * @param cmdId command Id to use for this invocation.
226 * @params Background scan parameters.
227 * @return status WifiStatus of the operation.
228 * Possible status codes:
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|
235 startBackgroundScan(CommandId cmdId, StaBackgroundScanParameters params)
236 generates (WifiStatus status);
239 * Stop the background scan started.
240 * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set.
242 * @param cmdId command Id corresponding to the request.
243 * @return status WifiStatus of the operation.
244 * Possible status codes:
245 * |WifiStatusCode.SUCCESS|,
246 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
247 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
248 * |WifiStatusCode.ERROR_NOT_STARTED|,
249 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
250 * |WifiStatusCode.ERROR_UNKNOWN|
252 stopBackgroundScan(CommandId cmdId) generates (WifiStatus status);
255 * Enable link layer stats collection.
256 * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set.
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.
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|
272 enableLinkLayerStatsCollection(bool debug)
273 generates (WifiStatus status);
276 * Disable link layer stats collection.
277 * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set.
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|,
284 * |WifiStatusCode.ERROR_NOT_STARTED|,
285 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
286 * |WifiStatusCode.ERROR_UNKNOWN|
288 disableLinkLayerStatsCollection() generates (WifiStatus status);
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.
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|,
300 * |WifiStatusCode.ERROR_NOT_STARTED|,
301 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
302 * |WifiStatusCode.ERROR_UNKNOWN|
303 * @return stats Instance of |LinkLayerStats|.
305 getLinkLayerStats() generates (WifiStatus status, StaLinkLayerStats stats);
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.
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|
326 startRssiMonitoring(CommandId cmdId, Rssi maxRssi, Rssi minRssi)
327 generates (WifiStatus status);
330 * Stop RSSI monitoring.
331 * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set.
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|
343 stopRssiMonitoring(CommandId cmdId) generates (WifiStatus status);
346 * Get roaming control capabilities.
347 * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set.
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|.
357 getRoamingCapabilities()
358 generates (WifiStatus status, StaRoamingCapabilities caps);
361 * Configure roaming control parameters.
362 * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set.
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|
372 configureRoaming(StaRoamingConfig config) generates (WifiStatus status);
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.
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|
389 setRoamingState(StaRoamingState state) generates (WifiStatus status);
392 * Enable/Disable Neighbour discovery offload functionality in the firmware.
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|
401 enableNdOffload(bool enable) generates (WifiStatus status);
404 * Start sending the specified keep alive packets periodically.
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
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|
421 startSendingKeepAlivePackets(
422 CommandId cmdId, vec<uint8_t> ipPacketData, uint16_t etherType,
423 MacAddress srcAddress, MacAddress dstAddress, uint32_t periodInMs)
424 generates (WifiStatus status);
427 * Stop sending the specified keep alive packets.
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|
438 stopSendingKeepAlivePackets(CommandId cmdId) generates (WifiStatus status);
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.
445 * @return status WifiStatus of the operation.
446 * Possible status codes:
447 * |WifiStatusCode.SUCCESS|,
448 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
449 * |WifiStatusCode.ERROR_UNKNOWN|
451 setScanningMacOui(uint8_t[3] oui) generates (WifiStatus status);
454 * API to start packet fate monitoring.
455 * - Once started, monitoring must remain active until HAL is stopped or the
456 * chip is reconfigured.
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.
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|
469 startDebugPacketFateMonitoring() generates (WifiStatus status);
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
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
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.
496 getDebugTxPacketFates()
497 generates (WifiStatus status, vec<WifiDebugTxPacketFateReport> fates);
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
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
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.
524 getDebugRxPacketFates()
525 generates (WifiStatus status, vec<WifiDebugRxPacketFateReport> fates);