blob: c9ff038160f199b8bf0de224979d13f45ab97d65 [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
88 * interfaces only supported by the initial combination will be removed until
89 * 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
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700105 * switching modes all interfaces will be torn down, the mode switch will be
106 * enacted and when it completes the new interfaces will be brought up.
107 */
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 Piusadcfba42016-10-05 10:19:06 -0700122 * Get the id assigned to this chip.
123 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700124 * @return status Status of the operation.
125 * Possible status codes:
126 * |StatusCode.SUCCESS|,
127 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700128 * @return id Assigned chip Id.
129 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700130 getId() generates (StatusCode status, ChipId id);
Roshan Piusadcfba42016-10-05 10:19:06 -0700131
132 /**
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700133 * Requests notifications of significant events on this chip. Multiple calls
134 * to this will register multiple callbacks each of which will receive all
135 * events.
Roshan Pius6f31d922016-10-04 15:08:05 -0700136 *
137 * @param callback An instance of the |IWifiChipEventCallback| HIDL interface
138 * object.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700139 * @return status Status of the operation.
140 * Possible status codes:
141 * |StatusCode.SUCCESS|,
142 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700143 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700144 registerEventCallback(IWifiChipEventCallback callback) generates (StatusCode status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700145
146 /**
147 * Get the set of operation modes that the chip supports.
Roshan Pius6f31d922016-10-04 15:08:05 -0700148 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700149 * @return status Status of the operation.
150 * Possible status codes:
151 * |StatusCode.SUCCESS|,
152 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Pius6f31d922016-10-04 15:08:05 -0700153 * @return modes List of modes supported by the device.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700154 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700155 getAvailableModes() generates (StatusCode status, vec<ChipMode> modes);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700156
157 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700158 * Reconfigure the Chip.
159 * Must trigger |IWifiChipEventCallback.onChipReconfigured| on sucess,
160 * or |IWifiChipEventCallback.onChipReconfigureFailure| on failure.
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700161 *
162 * @param modeId The mode that the chip should switch to, corresponding to the
Roshan Pius6f31d922016-10-04 15:08:05 -0700163 * id property of the target ChipMode.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700164 * @return status Status of the operation.
165 * Possible status codes:
166 * |StatusCode.SUCCESS|,
167 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700168 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700169 configureChip(ChipModeId modeId) generates (StatusCode status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700170
171 /**
172 * Get the current mode that the chip is in.
Roshan Pius6f31d922016-10-04 15:08:05 -0700173 *
174 * @return modeId The mode that the chip is currently configured to,
175 * corresponding to the id property of the target ChipMode.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700176 * @return status Status of the operation.
177 * Possible status codes:
178 * |StatusCode.SUCCESS|,
179 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700180 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700181 getMode() generates (StatusCode status, ChipModeId modeId);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700182
183 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700184 * Request information about the chip.
185 * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess,
186 * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700187 *
188 * @return status Status of the operation.
189 * Possible status codes:
190 * |StatusCode.SUCCESS|,
191 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700192 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700193 requestChipDebugInfo() generates (StatusCode status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700194
195 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700196 * Request vendor debug info from the driver.
197 * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success,
198 * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700199 *
200 * @return status Status of the operation.
201 * Possible status codes:
202 * |StatusCode.SUCCESS|,
203 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700204 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700205 requestDriverDebugDump() generates (StatusCode status);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700206
207 /**
Roshan Pius6f31d922016-10-04 15:08:05 -0700208 * Request vendor debug info from the firmware.
209 * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on
210 * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700211 *
212 * @return status Status of the operation.
213 * Possible status codes:
214 * |StatusCode.SUCCESS|,
215 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700216 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700217 requestFirmwareDebugDump() generates (StatusCode status);
Roshan Piusadcfba42016-10-05 10:19:06 -0700218
219 /**
220 * Create an AP iface on the chip.
221 *
222 * Depending on the mode the chip is configured in, the interface creation
223 * may fail if we've already reached the maximum allowed
224 * (specified in |ChipIfaceCombination|) number of ifaces of the AP type.
225 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700226 * @return status Status of the operation.
227 * Possible status codes:
228 * |StatusCode.SUCCESS|,
229 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700230 * @return iface HIDL interface object representing the iface if
231 * successful, null otherwise.
232 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700233 createApIface() generates (StatusCode status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700234
235 /**
236 * List all the AP iface names configured on the chip.
237 * The corresponding |IWifiApIface| object for any iface are
238 * retrieved using |getApIface| method.
239 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700240 * @return status Status of the operation.
241 * Possible status codes:
242 * |StatusCode.SUCCESS|,
243 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700244 * @return ifnames List of all AP iface names on the chip.
245 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700246 getApIfaceNames() generates (StatusCode status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700247
248 /**
249 * Gets a HIDL interface object for the AP Iface corresponding
250 * to the provided ifname.
251 *
252 * @param ifname Name of the iface.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700253 * @return status Status of the operation.
254 * Possible status codes:
255 * |StatusCode.SUCCESS|,
256 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700257 * @return iface HIDL interface object representing the iface if
258 * it exists, null otherwise.
259 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700260 getApIface(string ifname) generates (StatusCode status, IWifiApIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700261
262 /**
263 * Create a NAN iface on the chip.
264 *
265 * Depending on the mode the chip is configured in, the interface creation
266 * may fail if we've already reached the maximum allowed
267 * (specified in |ChipIfaceCombination|) number of ifaces of the NAN type.
268 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700269 * @return status Status of the operation.
270 * Possible status codes:
271 * |StatusCode.SUCCESS|,
272 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700273 * @return iface HIDL interface object representing the iface if
274 * successful, null otherwise.
275 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700276 createNanIface() generates (StatusCode status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700277
278 /**
279 * List all the NAN iface names configured on the chip.
280 * The corresponding |IWifiNanIface| object for any iface are
281 * retrieved using |getNanIface| method.
282 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700283 * @return status Status of the operation.
284 * Possible status codes:
285 * |StatusCode.SUCCESS|,
286 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700287 * @return ifnames List of all NAN iface names on the chip.
288 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700289 getNanIfaceNames() generates (StatusCode status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700290
291 /**
292 * Gets a HIDL interface object for the NAN Iface corresponding
293 * to the provided ifname.
294 *
295 * @param ifname Name of the iface.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700296 * @return status Status of the operation.
297 * Possible status codes:
298 * |StatusCode.SUCCESS|,
299 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700300 * @return iface HIDL interface object representing the iface if
301 * it exists, null otherwise.
302 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700303 getNanIface(string ifname) generates (StatusCode status, IWifiNanIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700304
305 /**
306 * Create a P2P iface on the chip.
307 *
308 * Depending on the mode the chip is configured in, the interface creation
309 * may fail if we've already reached the maximum allowed
310 * (specified in |ChipIfaceCombination|) number of ifaces of the P2P type.
311 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700312 * @return status Status of the operation.
313 * Possible status codes:
314 * |StatusCode.SUCCESS|,
315 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700316 * @return iface HIDL interface object representing the iface if
317 * successful, null otherwise.
318 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700319 createP2pIface() generates (StatusCode status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700320
321 /**
322 * List all the P2P iface names configured on the chip.
323 * The corresponding |IWifiP2pIface| object for any iface are
324 * retrieved using |getP2pIface| method.
325 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700326 * @return status Status of the operation.
327 * Possible status codes:
328 * |StatusCode.SUCCESS|,
329 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700330 * @return ifnames List of all P2P iface names on the chip.
331 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700332 getP2pIfaceNames() generates (StatusCode status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700333
334 /**
335 * Gets a HIDL interface object for the P2P Iface corresponding
336 * to the provided ifname.
337 *
338 * @param ifname Name of the iface.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700339 * @return status Status of the operation.
340 * Possible status codes:
341 * |StatusCode.SUCCESS|,
342 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700343 * @return iface HIDL interface object representing the iface if
344 * it exists, null otherwise.
345 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700346 getP2pIface(string ifname) generates (StatusCode status, IWifiP2pIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700347
348 /**
349 * Create an STA iface on the chip.
350 *
351 * Depending on the mode the chip is configured in, the interface creation
352 * may fail if we've already reached the maximum allowed
353 * (specified in |ChipIfaceCombination|) number of ifaces of the STA type.
354 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700355 * @return status Status of the operation.
356 * Possible status codes:
357 * |StatusCode.SUCCESS|,
358 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700359 * @return iface HIDL interface object representing the iface if
360 * successful, null otherwise.
361 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700362 createStaIface() generates (StatusCode status, IWifiStaIface iface);
Roshan Piusadcfba42016-10-05 10:19:06 -0700363
364 /**
365 * List all the STA iface names configured on the chip.
366 * The corresponding |IWifiStaIface| object for any iface are
367 * retrieved using |getStaIface| method.
368 *
Roshan Pius1f9073c2016-10-10 10:32:22 -0700369 * @return status Status of the operation.
370 * Possible status codes:
371 * |StatusCode.SUCCESS|,
372 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700373 * @return ifnames List of all STA iface names on the chip.
374 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700375 getStaIfaceNames() generates (StatusCode status, vec<string> ifnames);
Roshan Piusadcfba42016-10-05 10:19:06 -0700376
377 /**
378 * Gets a HIDL interface object for the STA Iface corresponding
379 * to the provided ifname.
380 *
381 * @param ifname Name of the iface.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700382 * @return status Status of the operation.
383 * Possible status codes:
384 * |StatusCode.SUCCESS|,
385 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusadcfba42016-10-05 10:19:06 -0700386 * @return iface HIDL interface object representing the iface if
387 * it exists, null otherwise.
388 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700389 getStaIface(string ifname) generates (StatusCode status, IWifiStaIface iface);
Roshan Piusfcbf9232016-10-06 11:08:17 -0700390
391 /**
392 * Create a RTTController instance.
393 *
394 * RTT controller can be either:
395 * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
396 * object in |iface| param, OR
397 * b) Let the implementation decide the iface to use for RTT operations by
398 * passing null in |iface| param.
399 *
400 * @param boundIface HIDL interface object representing the iface if
401 * the responder must be bound to a specific iface, null otherwise.
Roshan Pius1f9073c2016-10-10 10:32:22 -0700402 * @return status Status of the operation.
403 * Possible status codes:
404 * |StatusCode.SUCCESS|,
405 * |StatusCode.ERROR_WIFI_CHIP_INVALID|
Roshan Piusfcbf9232016-10-06 11:08:17 -0700406 */
Roshan Pius1f9073c2016-10-10 10:32:22 -0700407 createRttController(IWifiIface boundIface)
408 generates (StatusCode status, IWifiRttController rtt);
Mitchell Wills5443a9f2016-08-18 11:44:58 -0700409};