blob: 3c085c345c8143cd3b46534b1024d4e39dc4655d [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|,
326 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700327 * @return iface HIDL interface object representing the iface if
328 * it exists, null otherwise.
329 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700330 getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700331
332 /**
333 * Create a NAN iface on the chip.
334 *
335 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700336 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
337 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the NAN
338 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700339 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700340 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700341 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700342 * |WifiStatusCode.SUCCESS|,
343 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
344 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700345 * @return iface HIDL interface object representing the iface if
346 * successful, null otherwise.
347 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700348 createNanIface() generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700349
350 /**
351 * List all the NAN iface names configured on the chip.
352 * The corresponding |IWifiNanIface| object for any iface are
353 * retrieved using |getNanIface| method.
354 *
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|
Roshan Piusadcfba42016-10-05 10:19:06 -0700359 * @return ifnames List of all NAN iface names on the chip.
360 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700361 getNanIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700362
363 /**
364 * Gets a HIDL interface object for the NAN Iface corresponding
365 * to the provided ifname.
366 *
367 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700368 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700369 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700370 * |WifiStatusCode.SUCCESS|,
371 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700372 * @return iface HIDL interface object representing the iface if
373 * it exists, null otherwise.
374 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700375 getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700376
377 /**
378 * Create a P2P iface on the chip.
379 *
380 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700381 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
382 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the P2P
383 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700384 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700385 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700386 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700387 * |WifiStatusCode.SUCCESS|,
388 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
389 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700390 * @return iface HIDL interface object representing the iface if
391 * successful, null otherwise.
392 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700393 createP2pIface() generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700394
395 /**
396 * List all the P2P iface names configured on the chip.
397 * The corresponding |IWifiP2pIface| object for any iface are
398 * retrieved using |getP2pIface| method.
399 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700400 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700401 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700402 * |WifiStatusCode.SUCCESS|,
403 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700404 * @return ifnames List of all P2P iface names on the chip.
405 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700406 getP2pIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700407
408 /**
409 * Gets a HIDL interface object for the P2P Iface corresponding
410 * to the provided ifname.
411 *
412 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700413 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700414 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700415 * |WifiStatusCode.SUCCESS|,
416 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700417 * @return iface HIDL interface object representing the iface if
418 * it exists, null otherwise.
419 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700420 getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700421
422 /**
423 * Create an STA iface on the chip.
424 *
425 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa52dc732016-10-10 11:53:07 -0700426 * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum
427 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the STA
428 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700429 *
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|,
434 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700435 * @return iface HIDL interface object representing the iface if
436 * successful, null otherwise.
437 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700438 createStaIface() generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700439
440 /**
441 * List all the STA iface names configured on the chip.
442 * The corresponding |IWifiStaIface| object for any iface are
443 * retrieved using |getStaIface| method.
444 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700445 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700446 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700447 * |WifiStatusCode.SUCCESS|,
448 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700449 * @return ifnames List of all STA iface names on the chip.
450 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700451 getStaIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700452
453 /**
454 * Gets a HIDL interface object for the STA Iface corresponding
455 * to the provided ifname.
456 *
457 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700458 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700459 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700460 * |WifiStatusCode.SUCCESS|,
461 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700462 * @return iface HIDL interface object representing the iface if
463 * it exists, null otherwise.
464 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700465 getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusfcbf9232016-10-06 11:08:17 -0700466
467 /**
468 * Create a RTTController instance.
469 *
470 * RTT controller can be either:
471 * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
472 * object in |iface| param, OR
473 * b) Let the implementation decide the iface to use for RTT operations by
474 * passing null in |iface| param.
475 *
476 * @param boundIface HIDL interface object representing the iface if
477 * the responder must be bound to a specific iface, null otherwise.
Roshan Piusa52dc732016-10-10 11:53:07 -0700478 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700479 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700480 * |WifiStatusCode.SUCCESS|,
481 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusfcbf9232016-10-06 11:08:17 -0700482 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700483 createRttController(IWifiIface boundIface)
Roshan Piusa52dc732016-10-10 11:53:07 -0700484 generates (WifiStatus status, IWifiRttController rtt);
Roshan Piuse3a02b02016-10-19 12:31:01 -0700485
486 /**
487 * WiFi debug ring buffer life cycle is as follow:
488 * - At initialization time, framework must call |getDebugRingBuffersStatus|.
489 * to obtain the names and list of supported ring buffers.
490 * The driver may expose several different rings each holding a different
491 * type of data (connection events, power events, etc).
492 * - When WiFi operations start framework must call
493 * |startLoggingToDebugRingBuffer| to trigger log collection for a specific
494 * ring. The vebose level for each ring buffer can be specified in this API.
495 * - During wifi operations, driver must periodically report per ring data to
496 * framework by invoking the
497 * |IWifiChipEventCallback.onDebugRingBuffer<Type>EntriesAvailable| callback.
498 * - When capturing a bug report, framework must indicate to driver that all
499 * the data has to be uploaded urgently by calling
500 * |forceDumpToDebugRingBuffer|.
501 *
502 * The data uploaded by driver must be stored by framework in separate files,
503 * with one stream of file per ring. Framework must store the files in pcapng
504 * format, allowing for easy merging and parsing with network analyzer tools.
505 * TODO: Since we're not longer dumping out the raw data, storing in separate
506 * pcapng files for parsing later must not work anymore.
507 */
508 /**
509 * API to get the status of all ring buffers supported by driver.
510 *
511 * @return status WifiStatus of the operation.
512 * Possible status codes:
513 * |WifiStatusCode.SUCCESS|,
514 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700515 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700516 * |WifiStatusCode.NOT_AVAILABLE|,
517 * |WifiStatusCode.UNKNOWN|
518 * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the
519 * status of each ring bufffer on the device.
520 */
521 getDebugRingBuffersStatus() generates (WifiStatus status,
522 vec<WifiDebugRingBufferStatus> ringBuffers);
523
524 /**
525 * API to trigger the debug data collection.
526 *
527 * @param ringName represent the name of the ring for which data collection
528 * shall start. This can be retrieved via the corresponding
529 * |WifiDebugRingBufferStatus|.
530 * @parm maxIntervalInSec Maximum interval in seconds for driver to invoke
531 * |onDebugRingBufferData|, ignore if zero.
532 * @parm minDataSizeInBytes: Minimum data size in buffer for driver to invoke
533 * |onDebugRingBufferData|, ignore if zero.
534 * @return status WifiStatus of the operation.
535 * Possible status codes:
536 * |WifiStatusCode.SUCCESS|,
537 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700538 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700539 * |WifiStatusCode.NOT_AVAILABLE|,
540 * |WifiStatusCode.UNKNOWN|
541 */
542 startLoggingToDebugRingBuffer(string ringName,
543 WifiDebugRingBufferVerboseLevel verboseLevel,
544 uint32_t maxIntervalInSec,
545 uint32_t minDataSizeInBytes)
546 generates (WifiStatus status);
547
548 /**
549 * API to force dump data into the corresponding ring buffer.
550 * This is to be invoked during bugreport collection.
551 *
552 * @param ringName represent the name of the ring for which data collection
553 * shall be forced. This can be retrieved via the corresponding
554 * |WifiDebugRingBufferStatus|.
555 * @return status WifiStatus of the operation.
556 * Possible status codes:
557 * |WifiStatusCode.SUCCESS|,
558 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700559 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
560 * |WifiStatusCode.ERROR_NOT_STARTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700561 * |WifiStatusCode.NOT_AVAILABLE|,
562 * |WifiStatusCode.UNKNOWN|
563 */
564 forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status);
Roshan Piuse0724f92016-10-20 09:33:26 -0700565
566 /**
567 * API to retrieve the wifi wake up reason stats for debugging.
568 * The driver is expected to start maintaining these stats once the chip
569 * is configured using |configureChip|. These stats must be reset whenever
570 * the chip is reconfigured or the HAL is stopped.
571 *
572 * @return status WifiStatus of the operation.
573 * Possible status codes:
574 * |WifiStatusCode.SUCCESS|,
575 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
576 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
577 * |WifiStatusCode.NOT_AVAILABLE|,
578 * |WifiStatusCode.UNKNOWN|
579 * @return stats Instance of |WifiDebugHostWakeReasonStats|.
580 */
581 getDebugHostWakeReasonStats()
582 generates (WifiStatus status, WifiDebugHostWakeReasonStats stats);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700583};