blob: 051a08859ccdbed0120e93c9811cd586a0d30ffc [file] [log] [blame]
Mitchell Wills5443a9f2016-08-18 11:44:58 -07001/*
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
17package android.hardware.wifi@1.0;
18
19import IWifiChipEventCallback;
Roshan Piusfcbf9232016-10-06 11:08:17 -070020import IWifiIface;
Roshan Piusadcfba42016-10-05 10:19:06 -070021import IWifiApIface;
22import IWifiNanIface;
23import IWifiP2pIface;
24import IWifiStaIface;
Roshan Piusfcbf9232016-10-06 11:08:17 -070025import IWifiRttController;
Mitchell Wills5443a9f2016-08-18 11:44:58 -070026
27/**
28 * Interface that represents a chip that must be configured as a single unit.
29 * The HAL/driver/firmware will be responsible for determining which phy is used
30 * to perform operations like NAN, RTT, etc.
31 */
32interface IWifiChip {
Mitchell Wills5443a9f2016-08-18 11:44:58 -070033 /**
34 * Set of interface types with the maximum number of interfaces that can have
Roshan Pius271f2c22016-10-04 17:01:01 -070035 * one of the specified type for a given ChipIfaceCombination. See
36 * ChipIfaceCombination for examples.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070037 */
Roshan Pius271f2c22016-10-04 17:01:01 -070038 struct ChipIfaceCombinationLimit {
Roshan Pius7b777472016-10-07 13:15:59 -070039 vec<IfaceType> types; // Each IfaceType must occur at most once.
Mitchell Wills5443a9f2016-08-18 11:44:58 -070040 uint32_t maxIfaces;
41 };
42
43 /**
44 * Set of interfaces that can operate concurrently when in a given mode. See
45 * ChipMode below.
46 *
47 * For example:
48 * [{STA} <= 2]
49 * At most two STA interfaces are supported
50 * [], [STA], [STA+STA]
51 *
52 * [{STA} <= 1, {NAN} <= 1, {AP} <= 1]
53 * Any combination of STA, NAN, AP
54 * [], [STA], [NAN], [AP], [STA+NAN], [STA+AP], [NAN+AP], [STA+NAN+AP]
55 *
56 * [{STA} <= 1, {NAN,P2P} <= 1]
57 * Optionally a STA and either NAN or P2P
58 * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P]
59 * Not included [NAN+P2P], [STA+NAN+P2P]
60 *
61 * [{STA} <= 1, {STA,NAN} <= 1]
62 * Optionally a STA and either a second STA or a NAN
63 * [], [STA], [STA+NAN], [STA+STA], [NAN]
64 * Not included [STA+STA+NAN]
65 */
Roshan Pius271f2c22016-10-04 17:01:01 -070066 struct ChipIfaceCombination {
67 vec<ChipIfaceCombinationLimit> limits;
Mitchell Wills5443a9f2016-08-18 11:44:58 -070068 };
69
70 /**
71 * A mode that the chip can be put in. A mode defines a set of constraints on
72 * the interfaces that can exist while in that mode. Modes define a unit of
73 * configuration where all interfaces must be torn down to switch to a
74 * different mode. Some HALs may only have a single mode, but an example where
75 * multiple modes would be required is if a chip has different firmwares with
76 * different capabilities.
77 *
78 * When in a mode, it must be possible to perform any combination of creating
79 * and removing interfaces as long as at least one of the
Roshan Pius271f2c22016-10-04 17:01:01 -070080 * ChipIfaceCombinations is satisfied. This means that if a chip has two
Mitchell Wills5443a9f2016-08-18 11:44:58 -070081 * available combinations, [{STA} <= 1] and [{AP} <= 1] then it is expected
82 * that exactly one STA interface or one AP interface can be created, but it
83 * is not expected that both a STA and AP interface could be created. If it
84 * was then there would be a single available combination
85 * [{STA} <=1, {AP} <= 1].
86 *
87 * When switching between two available combinations it is expected that
Roshan Piuse3a02b02016-10-19 12:31:01 -070088 * interfaces only supported by the initial combination must be removed until
Mitchell Wills5443a9f2016-08-18 11:44:58 -070089 * the target combination is also satisfied. At that point new interfaces
90 * satisfying only the target combination can be added (meaning the initial
91 * combination limits will no longer satisfied). The addition of these new
Roshan Pius7b777472016-10-07 13:15:59 -070092 * interfaces must not impact the existence of interfaces that satisfy both
Mitchell Wills5443a9f2016-08-18 11:44:58 -070093 * combinations.
94 *
95 * For example, a chip with available combinations:
96 * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP} <= 1}]
97 * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an
98 * AP interface in place of one of the STAs then first one of the STA
99 * interfaces must be removed and then the AP interface can be created after
100 * the STA had been torn down. During this process the remaining STA and NAN
Roshan Pius7b777472016-10-07 13:15:59 -0700101 * interfaces must not be removed/recreated.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700102 *
103 * If a chip does not support this kind of reconfiguration in this mode then
Roshan Pius7b777472016-10-07 13:15:59 -0700104 * the combinations must be separated into two separate modes. Before
Roshan Piuse3a02b02016-10-19 12:31:01 -0700105 * switching modes all interfaces must be torn down, the mode switch must be
106 * enacted and when it completes the new interfaces must be brought up.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700107 */
108 struct ChipMode {
109 /**
110 * Id that can be used to put the chip in this mode.
111 */
112 ChipModeId id;
113
114 /**
115 * A list of the possible interface combinations that the chip can have
116 * while in this mode.
117 */
Roshan Pius271f2c22016-10-04 17:01:01 -0700118 vec<ChipIfaceCombination> availableCombinations;
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700119 };
120
121 /**
Roshan Piusa52dc732016-10-10 11:53:07 -0700122 * Information about the version of the driver and firmware running this chip.
123 *
124 * The information in these ASCII strings are vendor specific and does not
125 * need to follow any particular format. It may be dumped as part of the bug
126 * report.
127 */
128 struct ChipDebugInfo {
129 string driverDescription;
130 string firmwareDescription;
131 };
132
133 /**
Roshan Piusfe9ad362016-10-19 16:45:12 -0700134 * Capabilities exposed by this chip.
135 */
136 enum ChipCapabilityMask : uint32_t {
137 /**
138 * Memory dump of Firmware.
139 */
140 DEBUG_MEMORY_FIRMWARE_DUMP_SUPPORTED = 1 << 0,
141 /**
142 * Memory dump of Driver.
143 */
144 DEBUG_MEMORY_DRIVER_DUMP_SUPPORTED = 1 << 1,
145 /**
146 * Connectivity events reported via debug ring buffer.
147 */
148 DEBUG_RING_BUFFER_CONNECT_EVENT_SUPPORTED = 1 << 2,
149 /**
150 * Power events reported via debug ring buffer.
151 */
152 DEBUG_RING_BUFFER_POWER_EVENT_SUPPORTED = 1 << 3,
153 /**
154 * Wakelock events reported via debug ring buffer.
155 */
156 DEBUG_RING_BUFFER_WAKELOCK_EVENT_SUPPORTED = 1 << 4,
157 /**
158 * Vendor data reported via debug ring buffer.
159 * This mostly contains firmware event logs.
160 */
161 DEBUG_RING_BUFFER_VENDOR_DATA_SUPPORTED = 1 << 5,
Roshan Piuse0724f92016-10-20 09:33:26 -0700162 /**
163 * Host wake reasons stats collection.
164 */
165 DEBUG_HOST_WAKE_REASON_STATS = 1 << 6,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700166 };
167
168 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700169 * Get the id assigned to this chip.
170 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700171 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700172 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700173 * |WifiStatusCode.SUCCESS|,
174 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700175 * @return id Assigned chip Id.
176 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700177 getId() generates (WifiStatus status, ChipId id);
Roshan Piusadcfba42016-10-05 10:19:06 -0700178
179 /**
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700180 * Requests notifications of significant events on this chip. Multiple calls
Roshan Piuse3a02b02016-10-19 12:31:01 -0700181 * to this must register multiple callbacks each of which must receive all
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700182 * events.
Roshan Pius6f31d922016-10-04 15:08:05 -0700183 *
184 * @param callback An instance of the |IWifiChipEventCallback| HIDL interface
185 * object.
Roshan Piusa52dc732016-10-10 11:53:07 -0700186 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700187 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700188 * |WifiStatusCode.SUCCESS|,
189 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700190 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700191 registerEventCallback(IWifiChipEventCallback callback) generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700192
193 /**
Roshan Piusfe9ad362016-10-19 16:45:12 -0700194 * Get the capabilities supported by this chip.
195 *
196 * @return status WifiStatus of the operation.
197 * Possible status codes:
198 * |WifiStatusCode.SUCCESS|,
199 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
200 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
201 * |WifiStatusCode.ERROR_UNKNOWN|
202 * @return capabilities Bitset of |ChipCapabilityMask| values.
203 */
204 getCapabilities() generates (WifiStatus status, uint32_t capabilities);
205
206 /**
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700207 * Get the set of operation modes that the chip supports.
Roshan Pius6f31d922016-10-04 15:08:05 -0700208 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700209 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700210 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700211 * |WifiStatusCode.SUCCESS|,
212 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Pius6f31d922016-10-04 15:08:05 -0700213 * @return modes List of modes supported by the device.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700214 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700215 getAvailableModes() generates (WifiStatus status, vec<ChipMode> modes);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700216
217 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700218 * Reconfigure the Chip.
Roshan Piusa52dc732016-10-10 11:53:07 -0700219 * Any existing |IWifiIface| objects must be marked invalid after this call.
220 * If this fails then the chips is now in an undefined state and
221 * configureChip must be called again.
222 * Must trigger |IWifiChipEventCallback.onChipReconfigured| on success.
223 * Must trigger |IWifiEventCallback.onFailure| on failure.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700224 *
Roshan Pius18680b72016-10-12 08:25:48 -0700225 * @param modeId The mode that the chip must switch to, corresponding to the
Roshan Pius6f31d922016-10-04 15:08:05 -0700226 * id property of the target ChipMode.
Roshan Piusa52dc732016-10-10 11:53:07 -0700227 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700228 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700229 * |WifiStatusCode.SUCCESS|,
230 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
231 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
232 * |WifiStatusCode.ERROR_UNKNOWN|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700233 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700234 configureChip(ChipModeId modeId) generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700235
236 /**
237 * Get the current mode that the chip is in.
Roshan Pius6f31d922016-10-04 15:08:05 -0700238 *
239 * @return modeId The mode that the chip is currently configured to,
240 * corresponding to the id property of the target ChipMode.
Roshan Piusa52dc732016-10-10 11:53:07 -0700241 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700242 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700243 * |WifiStatusCode.SUCCESS|,
244 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700245 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700246 getMode() generates (WifiStatus status, ChipModeId modeId);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700247
248 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700249 * Request information about the chip.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700250 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700251 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700252 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700253 * |WifiStatusCode.SUCCESS|,
254 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
255 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
256 * |WifiStatusCode.ERROR_UNKNOWN|
257 * @return chipDebugInfo Instance of |ChipDebugInfo|.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700258 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700259 requestChipDebugInfo() generates (WifiStatus status, ChipDebugInfo chipDebugInfo);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700260
261 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700262 * Request vendor debug info from the driver.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700263 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700264 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700265 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700266 * |WifiStatusCode.SUCCESS|,
267 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
268 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
269 * |WifiStatusCode.ERROR_UNKNOWN|
270 * @param blob Vector of bytes retrieved from the driver.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700271 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700272 requestDriverDebugDump() generates (WifiStatus status, vec<uint8_t> blob);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700273
274 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700275 * Request vendor debug info from the firmware.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700276 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700277 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700278 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700279 * |WifiStatusCode.SUCCESS|,
280 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
281 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
282 * |WifiStatusCode.ERROR_UNKNOWN|
283 * @param blob Vector of bytes retrieved from the driver.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700284 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700285 requestFirmwareDebugDump() generates (WifiStatus status, vec<uint8_t> blob);
Roshan Piusadcfba42016-10-05 10:19:06 -0700286
287 /**
288 * Create an AP iface on the chip.
289 *
290 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700291 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
292 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP
293 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700294 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700295 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700296 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700297 * |WifiStatusCode.SUCCESS|,
298 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
299 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700300 * @return iface HIDL interface object representing the iface if
301 * successful, null otherwise.
302 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700303 createApIface() generates (WifiStatus status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700304
305 /**
306 * List all the AP iface names configured on the chip.
307 * The corresponding |IWifiApIface| object for any iface are
308 * retrieved using |getApIface| method.
309 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700310 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700311 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700312 * |WifiStatusCode.SUCCESS|,
313 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700314 * @return ifnames List of all AP iface names on the chip.
315 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700316 getApIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700317
318 /**
319 * Gets a HIDL interface object for the AP Iface corresponding
320 * to the provided ifname.
321 *
322 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700323 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700324 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700325 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800326 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
327 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700328 * @return iface HIDL interface object representing the iface if
329 * it exists, null otherwise.
330 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700331 getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700332
333 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800334 * Removes the AP Iface with the provided ifname.
335 * Any further calls on the corresponding |IWifiApIface| HIDL interface
336 * object must fail.
337 *
338 * @param ifname Name of the iface.
339 * @return status WifiStatus of the operation.
340 * Possible status codes:
341 * |WifiStatusCode.SUCCESS|,
342 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
343 * |WifiStatusCode.ERROR_INVALID_ARGS|
344 */
345 removeApIface(string ifname) generates (WifiStatus status);
346
347 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700348 * Create a NAN iface on the chip.
349 *
350 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700351 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
352 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the NAN
353 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700354 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700355 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700356 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700357 * |WifiStatusCode.SUCCESS|,
358 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
359 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700360 * @return iface HIDL interface object representing the iface if
361 * successful, null otherwise.
362 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700363 createNanIface() generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700364
365 /**
366 * List all the NAN iface names configured on the chip.
367 * The corresponding |IWifiNanIface| object for any iface are
368 * retrieved using |getNanIface| method.
369 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700370 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700371 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700372 * |WifiStatusCode.SUCCESS|,
373 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700374 * @return ifnames List of all NAN iface names on the chip.
375 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700376 getNanIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700377
378 /**
379 * Gets a HIDL interface object for the NAN Iface corresponding
380 * to the provided ifname.
381 *
382 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700383 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700384 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700385 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800386 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
387 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700388 * @return iface HIDL interface object representing the iface if
389 * it exists, null otherwise.
390 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700391 getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700392
393 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800394 * Removes the NAN Iface with the provided ifname.
395 * Any further calls on the corresponding |IWifiNanIface| HIDL interface
396 * object must fail.
397 *
398 * @param ifname Name of the iface.
399 * @return status WifiStatus of the operation.
400 * Possible status codes:
401 * |WifiStatusCode.SUCCESS|,
402 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
403 * |WifiStatusCode.ERROR_INVALID_ARGS|
404 */
405 removeNanIface(string ifname) generates (WifiStatus status);
406
407 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700408 * Create a P2P iface on the chip.
409 *
410 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700411 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
412 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the P2P
413 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700414 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700415 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700416 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700417 * |WifiStatusCode.SUCCESS|,
418 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
419 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700420 * @return iface HIDL interface object representing the iface if
421 * successful, null otherwise.
422 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700423 createP2pIface() generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700424
425 /**
426 * List all the P2P iface names configured on the chip.
427 * The corresponding |IWifiP2pIface| object for any iface are
428 * retrieved using |getP2pIface| method.
429 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700430 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700431 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700432 * |WifiStatusCode.SUCCESS|,
433 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700434 * @return ifnames List of all P2P iface names on the chip.
435 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700436 getP2pIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700437
438 /**
439 * Gets a HIDL interface object for the P2P Iface corresponding
440 * to the provided ifname.
441 *
442 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700443 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700444 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700445 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800446 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
447 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700448 * @return iface HIDL interface object representing the iface if
449 * it exists, null otherwise.
450 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700451 getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700452
453 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800454 * Removes the P2P Iface with the provided ifname.
455 * Any further calls on the corresponding |IWifiP2pIface| HIDL interface
456 * object must fail.
457 *
458 * @param ifname Name of the iface.
459 * @return status WifiStatus of the operation.
460 * Possible status codes:
461 * |WifiStatusCode.SUCCESS|,
462 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
463 * |WifiStatusCode.ERROR_INVALID_ARGS|
464 */
465 removeP2pIface(string ifname) generates (WifiStatus status);
466
467 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700468 * Create an STA iface on the chip.
469 *
470 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700471 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
472 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the STA
473 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700474 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700475 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700476 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700477 * |WifiStatusCode.SUCCESS|,
478 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
479 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700480 * @return iface HIDL interface object representing the iface if
481 * successful, null otherwise.
482 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700483 createStaIface() generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700484
485 /**
486 * List all the STA iface names configured on the chip.
487 * The corresponding |IWifiStaIface| object for any iface are
488 * retrieved using |getStaIface| method.
489 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700490 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700491 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700492 * |WifiStatusCode.SUCCESS|,
493 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700494 * @return ifnames List of all STA iface names on the chip.
495 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700496 getStaIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700497
498 /**
499 * Gets a HIDL interface object for the STA Iface corresponding
500 * to the provided ifname.
501 *
502 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700503 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700504 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700505 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800506 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
507 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700508 * @return iface HIDL interface object representing the iface if
509 * it exists, null otherwise.
510 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700511 getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusfcbf9232016-10-06 11:08:17 -0700512
513 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800514 * Removes the STA Iface with the provided ifname.
515 * Any further calls on the corresponding |IWifiStaIface| HIDL interface
516 * object must fail.
517 *
518 * @param ifname Name of the iface.
519 * @return status WifiStatus of the operation.
520 * Possible status codes:
521 * |WifiStatusCode.SUCCESS|,
522 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
523 * |WifiStatusCode.ERROR_INVALID_ARGS|
524 */
525 removeStaIface(string ifname) generates (WifiStatus status);
526
527 /**
Roshan Piusfcbf9232016-10-06 11:08:17 -0700528 * Create a RTTController instance.
529 *
530 * RTT controller can be either:
531 * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
532 * object in |iface| param, OR
533 * b) Let the implementation decide the iface to use for RTT operations by
534 * passing null in |iface| param.
535 *
536 * @param boundIface HIDL interface object representing the iface if
537 * the responder must be bound to a specific iface, null otherwise.
Roshan Piusa52dc732016-10-10 11:53:07 -0700538 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700539 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700540 * |WifiStatusCode.SUCCESS|,
541 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusfcbf9232016-10-06 11:08:17 -0700542 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700543 createRttController(IWifiIface boundIface)
Roshan Piusa52dc732016-10-10 11:53:07 -0700544 generates (WifiStatus status, IWifiRttController rtt);
Roshan Piuse3a02b02016-10-19 12:31:01 -0700545
546 /**
547 * WiFi debug ring buffer life cycle is as follow:
548 * - At initialization time, framework must call |getDebugRingBuffersStatus|.
549 * to obtain the names and list of supported ring buffers.
550 * The driver may expose several different rings each holding a different
551 * type of data (connection events, power events, etc).
552 * - When WiFi operations start framework must call
553 * |startLoggingToDebugRingBuffer| to trigger log collection for a specific
554 * ring. The vebose level for each ring buffer can be specified in this API.
555 * - During wifi operations, driver must periodically report per ring data to
556 * framework by invoking the
557 * |IWifiChipEventCallback.onDebugRingBuffer<Type>EntriesAvailable| callback.
558 * - When capturing a bug report, framework must indicate to driver that all
559 * the data has to be uploaded urgently by calling
560 * |forceDumpToDebugRingBuffer|.
561 *
562 * The data uploaded by driver must be stored by framework in separate files,
563 * with one stream of file per ring. Framework must store the files in pcapng
564 * format, allowing for easy merging and parsing with network analyzer tools.
565 * TODO: Since we're not longer dumping out the raw data, storing in separate
566 * pcapng files for parsing later must not work anymore.
567 */
568 /**
569 * API to get the status of all ring buffers supported by driver.
570 *
571 * @return status WifiStatus of the operation.
572 * Possible status codes:
573 * |WifiStatusCode.SUCCESS|,
574 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700575 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700576 * |WifiStatusCode.NOT_AVAILABLE|,
577 * |WifiStatusCode.UNKNOWN|
578 * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the
579 * status of each ring bufffer on the device.
580 */
581 getDebugRingBuffersStatus() generates (WifiStatus status,
582 vec<WifiDebugRingBufferStatus> ringBuffers);
583
584 /**
585 * API to trigger the debug data collection.
586 *
587 * @param ringName represent the name of the ring for which data collection
588 * shall start. This can be retrieved via the corresponding
589 * |WifiDebugRingBufferStatus|.
590 * @parm maxIntervalInSec Maximum interval in seconds for driver to invoke
591 * |onDebugRingBufferData|, ignore if zero.
592 * @parm minDataSizeInBytes: Minimum data size in buffer for driver to invoke
593 * |onDebugRingBufferData|, ignore if zero.
594 * @return status WifiStatus of the operation.
595 * Possible status codes:
596 * |WifiStatusCode.SUCCESS|,
597 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700598 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700599 * |WifiStatusCode.NOT_AVAILABLE|,
600 * |WifiStatusCode.UNKNOWN|
601 */
602 startLoggingToDebugRingBuffer(string ringName,
603 WifiDebugRingBufferVerboseLevel verboseLevel,
604 uint32_t maxIntervalInSec,
605 uint32_t minDataSizeInBytes)
606 generates (WifiStatus status);
607
608 /**
609 * API to force dump data into the corresponding ring buffer.
610 * This is to be invoked during bugreport collection.
611 *
612 * @param ringName represent the name of the ring for which data collection
613 * shall be forced. This can be retrieved via the corresponding
614 * |WifiDebugRingBufferStatus|.
615 * @return status WifiStatus of the operation.
616 * Possible status codes:
617 * |WifiStatusCode.SUCCESS|,
618 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700619 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
620 * |WifiStatusCode.ERROR_NOT_STARTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700621 * |WifiStatusCode.NOT_AVAILABLE|,
622 * |WifiStatusCode.UNKNOWN|
623 */
624 forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status);
Roshan Piuse0724f92016-10-20 09:33:26 -0700625
626 /**
627 * API to retrieve the wifi wake up reason stats for debugging.
628 * The driver is expected to start maintaining these stats once the chip
629 * is configured using |configureChip|. These stats must be reset whenever
630 * the chip is reconfigured or the HAL is stopped.
631 *
632 * @return status WifiStatus of the operation.
633 * Possible status codes:
634 * |WifiStatusCode.SUCCESS|,
635 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
636 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
637 * |WifiStatusCode.NOT_AVAILABLE|,
638 * |WifiStatusCode.UNKNOWN|
639 * @return stats Instance of |WifiDebugHostWakeReasonStats|.
640 */
641 getDebugHostWakeReasonStats()
642 generates (WifiStatus status, WifiDebugHostWakeReasonStats stats);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700643};