blob: d7904043253de8f13231455b403904eb6a5eefa2 [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 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800140 DEBUG_MEMORY_FIRMWARE_DUMP = 1 << 0,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700141 /**
142 * Memory dump of Driver.
143 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800144 DEBUG_MEMORY_DRIVER_DUMP = 1 << 1,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700145 /**
146 * Connectivity events reported via debug ring buffer.
147 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800148 DEBUG_RING_BUFFER_CONNECT_EVENT = 1 << 2,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700149 /**
150 * Power events reported via debug ring buffer.
151 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800152 DEBUG_RING_BUFFER_POWER_EVENT = 1 << 3,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700153 /**
154 * Wakelock events reported via debug ring buffer.
155 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800156 DEBUG_RING_BUFFER_WAKELOCK_EVENT = 1 << 4,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700157 /**
158 * Vendor data reported via debug ring buffer.
159 * This mostly contains firmware event logs.
160 */
Roshan Piusa2d369d2016-12-15 22:38:00 -0800161 DEBUG_RING_BUFFER_VENDOR_DATA = 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 Pius203cb032016-12-14 17:41:20 -0800166 /**
167 * Error alerts.
168 */
169 DEBUG_ERROR_ALERTS = 1 << 7
Roshan Piusfe9ad362016-10-19 16:45:12 -0700170 };
171
172 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700173 * Get the id assigned to this chip.
174 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700175 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700176 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700177 * |WifiStatusCode.SUCCESS|,
178 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700179 * @return id Assigned chip Id.
180 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700181 getId() generates (WifiStatus status, ChipId id);
Roshan Piusadcfba42016-10-05 10:19:06 -0700182
183 /**
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700184 * Requests notifications of significant events on this chip. Multiple calls
Roshan Piuse3a02b02016-10-19 12:31:01 -0700185 * to this must register multiple callbacks each of which must receive all
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700186 * events.
Roshan Pius6f31d922016-10-04 15:08:05 -0700187 *
188 * @param callback An instance of the |IWifiChipEventCallback| HIDL interface
189 * object.
Roshan Piusa52dc732016-10-10 11:53:07 -0700190 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700191 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700192 * |WifiStatusCode.SUCCESS|,
193 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700194 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700195 registerEventCallback(IWifiChipEventCallback callback) generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700196
197 /**
Roshan Piusfe9ad362016-10-19 16:45:12 -0700198 * Get the capabilities supported by this chip.
199 *
200 * @return status WifiStatus of the operation.
201 * Possible status codes:
202 * |WifiStatusCode.SUCCESS|,
203 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
204 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
205 * |WifiStatusCode.ERROR_UNKNOWN|
206 * @return capabilities Bitset of |ChipCapabilityMask| values.
207 */
208 getCapabilities() generates (WifiStatus status, uint32_t capabilities);
209
210 /**
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700211 * Get the set of operation modes that the chip supports.
Roshan Pius6f31d922016-10-04 15:08:05 -0700212 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700213 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700214 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700215 * |WifiStatusCode.SUCCESS|,
216 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Pius6f31d922016-10-04 15:08:05 -0700217 * @return modes List of modes supported by the device.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700218 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700219 getAvailableModes() generates (WifiStatus status, vec<ChipMode> modes);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700220
221 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700222 * Reconfigure the Chip.
Roshan Piusa52dc732016-10-10 11:53:07 -0700223 * Any existing |IWifiIface| objects must be marked invalid after this call.
224 * If this fails then the chips is now in an undefined state and
225 * configureChip must be called again.
226 * Must trigger |IWifiChipEventCallback.onChipReconfigured| on success.
227 * Must trigger |IWifiEventCallback.onFailure| on failure.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700228 *
Roshan Pius18680b72016-10-12 08:25:48 -0700229 * @param modeId The mode that the chip must switch to, corresponding to the
Roshan Pius6f31d922016-10-04 15:08:05 -0700230 * id property of the target ChipMode.
Roshan Piusa52dc732016-10-10 11:53:07 -0700231 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700232 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700233 * |WifiStatusCode.SUCCESS|,
234 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
235 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
236 * |WifiStatusCode.ERROR_UNKNOWN|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700237 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700238 configureChip(ChipModeId modeId) generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700239
240 /**
241 * Get the current mode that the chip is in.
Roshan Pius6f31d922016-10-04 15:08:05 -0700242 *
243 * @return modeId The mode that the chip is currently configured to,
244 * corresponding to the id property of the target ChipMode.
Roshan Piusa52dc732016-10-10 11:53:07 -0700245 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700246 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700247 * |WifiStatusCode.SUCCESS|,
248 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700249 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700250 getMode() generates (WifiStatus status, ChipModeId modeId);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700251
252 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700253 * Request information about the chip.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700254 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700255 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700256 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700257 * |WifiStatusCode.SUCCESS|,
258 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
259 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
260 * |WifiStatusCode.ERROR_UNKNOWN|
261 * @return chipDebugInfo Instance of |ChipDebugInfo|.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700262 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700263 requestChipDebugInfo() generates (WifiStatus status, ChipDebugInfo chipDebugInfo);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700264
265 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700266 * Request vendor debug info from the driver.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700267 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700268 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700269 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700270 * |WifiStatusCode.SUCCESS|,
271 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
272 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
273 * |WifiStatusCode.ERROR_UNKNOWN|
274 * @param blob Vector of bytes retrieved from the driver.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700275 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700276 requestDriverDebugDump() generates (WifiStatus status, vec<uint8_t> blob);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700277
278 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700279 * Request vendor debug info from the firmware.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700280 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700281 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700282 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700283 * |WifiStatusCode.SUCCESS|,
284 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
285 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
286 * |WifiStatusCode.ERROR_UNKNOWN|
287 * @param blob Vector of bytes retrieved from the driver.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700288 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700289 requestFirmwareDebugDump() generates (WifiStatus status, vec<uint8_t> blob);
Roshan Piusadcfba42016-10-05 10:19:06 -0700290
291 /**
292 * Create an AP iface on the chip.
293 *
294 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa2d369d2016-12-15 22:38:00 -0800295 * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum
Roshan Piusa52dc732016-10-10 11:53:07 -0700296 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP
297 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700298 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700299 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700300 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700301 * |WifiStatusCode.SUCCESS|,
302 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
303 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700304 * @return iface HIDL interface object representing the iface if
305 * successful, null otherwise.
306 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700307 createApIface() generates (WifiStatus status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700308
309 /**
310 * List all the AP iface names configured on the chip.
311 * The corresponding |IWifiApIface| object for any iface are
312 * retrieved using |getApIface| method.
313 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700314 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700315 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700316 * |WifiStatusCode.SUCCESS|,
317 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700318 * @return ifnames List of all AP iface names on the chip.
319 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700320 getApIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700321
322 /**
323 * Gets a HIDL interface object for the AP Iface corresponding
324 * to the provided ifname.
325 *
326 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700327 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700328 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700329 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800330 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
331 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700332 * @return iface HIDL interface object representing the iface if
333 * it exists, null otherwise.
334 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700335 getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700336
337 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800338 * Removes the AP Iface with the provided ifname.
339 * Any further calls on the corresponding |IWifiApIface| HIDL interface
340 * object must fail.
341 *
342 * @param ifname Name of the iface.
343 * @return status WifiStatus of the operation.
344 * Possible status codes:
345 * |WifiStatusCode.SUCCESS|,
346 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
347 * |WifiStatusCode.ERROR_INVALID_ARGS|
348 */
349 removeApIface(string ifname) generates (WifiStatus status);
350
351 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700352 * Create a NAN iface on the chip.
353 *
354 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa2d369d2016-12-15 22:38:00 -0800355 * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum
Roshan Piusa52dc732016-10-10 11:53:07 -0700356 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the NAN
357 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700358 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700359 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700360 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700361 * |WifiStatusCode.SUCCESS|,
362 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
363 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700364 * @return iface HIDL interface object representing the iface if
365 * successful, null otherwise.
366 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700367 createNanIface() generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700368
369 /**
370 * List all the NAN iface names configured on the chip.
371 * The corresponding |IWifiNanIface| object for any iface are
372 * retrieved using |getNanIface| method.
373 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700374 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700375 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700376 * |WifiStatusCode.SUCCESS|,
377 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700378 * @return ifnames List of all NAN iface names on the chip.
379 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700380 getNanIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700381
382 /**
383 * Gets a HIDL interface object for the NAN Iface corresponding
384 * to the provided ifname.
385 *
386 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700387 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700388 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700389 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800390 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
391 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700392 * @return iface HIDL interface object representing the iface if
393 * it exists, null otherwise.
394 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700395 getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700396
397 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800398 * Removes the NAN Iface with the provided ifname.
399 * Any further calls on the corresponding |IWifiNanIface| HIDL interface
400 * object must fail.
401 *
402 * @param ifname Name of the iface.
403 * @return status WifiStatus of the operation.
404 * Possible status codes:
405 * |WifiStatusCode.SUCCESS|,
406 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
407 * |WifiStatusCode.ERROR_INVALID_ARGS|
408 */
409 removeNanIface(string ifname) generates (WifiStatus status);
410
411 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700412 * Create a P2P iface on the chip.
413 *
414 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa2d369d2016-12-15 22:38:00 -0800415 * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum
Roshan Piusa52dc732016-10-10 11:53:07 -0700416 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the P2P
417 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700418 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700419 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700420 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700421 * |WifiStatusCode.SUCCESS|,
422 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
423 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700424 * @return iface HIDL interface object representing the iface if
425 * successful, null otherwise.
426 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700427 createP2pIface() generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700428
429 /**
430 * List all the P2P iface names configured on the chip.
431 * The corresponding |IWifiP2pIface| object for any iface are
432 * retrieved using |getP2pIface| method.
433 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700434 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700435 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700436 * |WifiStatusCode.SUCCESS|,
437 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700438 * @return ifnames List of all P2P iface names on the chip.
439 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700440 getP2pIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700441
442 /**
443 * Gets a HIDL interface object for the P2P Iface corresponding
444 * to the provided ifname.
445 *
446 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700447 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700448 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700449 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800450 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
451 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700452 * @return iface HIDL interface object representing the iface if
453 * it exists, null otherwise.
454 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700455 getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700456
457 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800458 * Removes the P2P Iface with the provided ifname.
459 * Any further calls on the corresponding |IWifiP2pIface| HIDL interface
460 * object must fail.
461 *
462 * @param ifname Name of the iface.
463 * @return status WifiStatus of the operation.
464 * Possible status codes:
465 * |WifiStatusCode.SUCCESS|,
466 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
467 * |WifiStatusCode.ERROR_INVALID_ARGS|
468 */
469 removeP2pIface(string ifname) generates (WifiStatus status);
470
471 /**
Roshan Piusadcfba42016-10-05 10:19:06 -0700472 * Create an STA iface on the chip.
473 *
474 * Depending on the mode the chip is configured in, the interface creation
Roshan Piusa2d369d2016-12-15 22:38:00 -0800475 * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum
Roshan Piusa52dc732016-10-10 11:53:07 -0700476 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the STA
477 * type.
Roshan Piusadcfba42016-10-05 10:19:06 -0700478 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700479 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700480 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700481 * |WifiStatusCode.SUCCESS|,
482 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
483 * |WifiStatusCode.ERROR_NOT_SUPPORTED|
Roshan Piusadcfba42016-10-05 10:19:06 -0700484 * @return iface HIDL interface object representing the iface if
485 * successful, null otherwise.
486 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700487 createStaIface() generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700488
489 /**
490 * List all the STA iface names configured on the chip.
491 * The corresponding |IWifiStaIface| object for any iface are
492 * retrieved using |getStaIface| method.
493 *
Roshan Piusa52dc732016-10-10 11:53:07 -0700494 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700495 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700496 * |WifiStatusCode.SUCCESS|,
497 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700498 * @return ifnames List of all STA iface names on the chip.
499 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700500 getStaIfaceNames() generates (WifiStatus status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700501
502 /**
503 * Gets a HIDL interface object for the STA Iface corresponding
504 * to the provided ifname.
505 *
506 * @param ifname Name of the iface.
Roshan Piusa52dc732016-10-10 11:53:07 -0700507 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700508 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700509 * |WifiStatusCode.SUCCESS|,
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800510 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
511 * |WifiStatusCode.ERROR_INVALID_ARGS|
Roshan Piusadcfba42016-10-05 10:19:06 -0700512 * @return iface HIDL interface object representing the iface if
513 * it exists, null otherwise.
514 */
Roshan Piusa52dc732016-10-10 11:53:07 -0700515 getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface);
Roshan Piusfcbf9232016-10-06 11:08:17 -0700516
517 /**
Roshan Pius8b55e6f2016-12-09 12:05:12 -0800518 * Removes the STA Iface with the provided ifname.
519 * Any further calls on the corresponding |IWifiStaIface| HIDL interface
520 * object must fail.
521 *
522 * @param ifname Name of the iface.
523 * @return status WifiStatus of the operation.
524 * Possible status codes:
525 * |WifiStatusCode.SUCCESS|,
526 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
527 * |WifiStatusCode.ERROR_INVALID_ARGS|
528 */
529 removeStaIface(string ifname) generates (WifiStatus status);
530
531 /**
Roshan Piusfcbf9232016-10-06 11:08:17 -0700532 * Create a RTTController instance.
533 *
534 * RTT controller can be either:
535 * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
536 * object in |iface| param, OR
537 * b) Let the implementation decide the iface to use for RTT operations by
538 * passing null in |iface| param.
539 *
540 * @param boundIface HIDL interface object representing the iface if
541 * the responder must be bound to a specific iface, null otherwise.
Roshan Piusa52dc732016-10-10 11:53:07 -0700542 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700543 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -0700544 * |WifiStatusCode.SUCCESS|,
545 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusfcbf9232016-10-06 11:08:17 -0700546 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700547 createRttController(IWifiIface boundIface)
Roshan Piusa52dc732016-10-10 11:53:07 -0700548 generates (WifiStatus status, IWifiRttController rtt);
Roshan Piuse3a02b02016-10-19 12:31:01 -0700549
550 /**
551 * WiFi debug ring buffer life cycle is as follow:
552 * - At initialization time, framework must call |getDebugRingBuffersStatus|.
553 * to obtain the names and list of supported ring buffers.
554 * The driver may expose several different rings each holding a different
555 * type of data (connection events, power events, etc).
556 * - When WiFi operations start framework must call
557 * |startLoggingToDebugRingBuffer| to trigger log collection for a specific
558 * ring. The vebose level for each ring buffer can be specified in this API.
559 * - During wifi operations, driver must periodically report per ring data to
560 * framework by invoking the
Roshan Pius48185b22016-12-15 19:10:30 -0800561 * |IWifiChipEventCallback.onDebugRingBufferDataAvailable| callback.
Roshan Piuse3a02b02016-10-19 12:31:01 -0700562 * - When capturing a bug report, framework must indicate to driver that all
563 * the data has to be uploaded urgently by calling
564 * |forceDumpToDebugRingBuffer|.
565 *
566 * The data uploaded by driver must be stored by framework in separate files,
567 * with one stream of file per ring. Framework must store the files in pcapng
568 * format, allowing for easy merging and parsing with network analyzer tools.
569 * TODO: Since we're not longer dumping out the raw data, storing in separate
570 * pcapng files for parsing later must not work anymore.
571 */
572 /**
573 * API to get the status of all ring buffers supported by driver.
574 *
575 * @return status WifiStatus of the operation.
576 * Possible status codes:
577 * |WifiStatusCode.SUCCESS|,
578 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700579 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700580 * |WifiStatusCode.NOT_AVAILABLE|,
581 * |WifiStatusCode.UNKNOWN|
582 * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the
583 * status of each ring bufffer on the device.
584 */
585 getDebugRingBuffersStatus() generates (WifiStatus status,
586 vec<WifiDebugRingBufferStatus> ringBuffers);
587
588 /**
589 * API to trigger the debug data collection.
590 *
591 * @param ringName represent the name of the ring for which data collection
592 * shall start. This can be retrieved via the corresponding
593 * |WifiDebugRingBufferStatus|.
594 * @parm maxIntervalInSec Maximum interval in seconds for driver to invoke
595 * |onDebugRingBufferData|, ignore if zero.
596 * @parm minDataSizeInBytes: Minimum data size in buffer for driver to invoke
597 * |onDebugRingBufferData|, ignore if zero.
598 * @return status WifiStatus of the operation.
599 * Possible status codes:
600 * |WifiStatusCode.SUCCESS|,
601 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700602 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700603 * |WifiStatusCode.NOT_AVAILABLE|,
604 * |WifiStatusCode.UNKNOWN|
605 */
606 startLoggingToDebugRingBuffer(string ringName,
607 WifiDebugRingBufferVerboseLevel verboseLevel,
608 uint32_t maxIntervalInSec,
609 uint32_t minDataSizeInBytes)
610 generates (WifiStatus status);
611
612 /**
613 * API to force dump data into the corresponding ring buffer.
614 * This is to be invoked during bugreport collection.
615 *
616 * @param ringName represent the name of the ring for which data collection
617 * shall be forced. This can be retrieved via the corresponding
618 * |WifiDebugRingBufferStatus|.
619 * @return status WifiStatus of the operation.
620 * Possible status codes:
621 * |WifiStatusCode.SUCCESS|,
622 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
Roshan Piusfe9ad362016-10-19 16:45:12 -0700623 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
624 * |WifiStatusCode.ERROR_NOT_STARTED|,
Roshan Piuse3a02b02016-10-19 12:31:01 -0700625 * |WifiStatusCode.NOT_AVAILABLE|,
626 * |WifiStatusCode.UNKNOWN|
627 */
628 forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status);
Roshan Piuse0724f92016-10-20 09:33:26 -0700629
630 /**
631 * API to retrieve the wifi wake up reason stats for debugging.
632 * The driver is expected to start maintaining these stats once the chip
633 * is configured using |configureChip|. These stats must be reset whenever
634 * the chip is reconfigured or the HAL is stopped.
635 *
636 * @return status WifiStatus of the operation.
637 * Possible status codes:
638 * |WifiStatusCode.SUCCESS|,
639 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
640 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
641 * |WifiStatusCode.NOT_AVAILABLE|,
642 * |WifiStatusCode.UNKNOWN|
643 * @return stats Instance of |WifiDebugHostWakeReasonStats|.
644 */
645 getDebugHostWakeReasonStats()
646 generates (WifiStatus status, WifiDebugHostWakeReasonStats stats);
Roshan Pius203cb032016-12-14 17:41:20 -0800647
648 /**
649 * API to enable/disable alert notifications from the chip.
650 * These alerts must be used to notify framework of any fatal error events
651 * that the chip encounters via |IWifiChipEventCallback.onDebugErrorAlert| method.
652 * Must fail if |ChipCapabilityMask.DEBUG_ERROR_ALERTS| is not set.
653 *
654 * @param enable true to enable, false to disable.
655 * @return status WifiStatus of the operation.
656 * Possible status codes:
657 * |WifiStatusCode.SUCCESS|,
658 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
659 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
660 * |WifiStatusCode.NOT_AVAILABLE|,
661 * |WifiStatusCode.UNKNOWN|
662 */
663 enableDebugErrorAlerts(bool enable) generates (WifiStatus status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700664};