2 * Copyright 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package android.hardware.wifi@1.0;
19 import IWifiChipEventCallback;
25 import IWifiRttController;
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.
34 * Set of interface types with the maximum number of interfaces that can have
35 * one of the specified type for a given ChipIfaceCombination. See
36 * ChipIfaceCombination for examples.
38 struct ChipIfaceCombinationLimit {
39 vec<IfaceType> types; // Each IfaceType may occur at most once
44 * Set of interfaces that can operate concurrently when in a given mode. See
49 * At most two STA interfaces are supported
50 * [], [STA], [STA+STA]
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]
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]
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]
66 struct ChipIfaceCombination {
67 vec<ChipIfaceCombinationLimit> limits;
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.
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
80 * ChipIfaceCombinations is satisfied. This means that if a chip has two
81 * 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].
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
92 * interfaces should not impact the existence of interfaces that satisfy both
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
101 * interfaces should not be removed/recreated.
103 * If a chip does not support this kind of reconfiguration in this mode then
104 * the combinations should be separated into two separate modes. Before
105 * 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.
110 * Id that can be used to put the chip in this mode.
115 * A list of the possible interface combinations that the chip can have
116 * while in this mode.
118 vec<ChipIfaceCombination> availableCombinations;
122 * Get the id assigned to this chip.
124 * @return id Assigned chip Id.
126 getId() generates (ChipId id);
129 * Requests notifications of significant events on this chip. Multiple calls
130 * to this will register multiple callbacks each of which will receive all
133 * @param callback An instance of the |IWifiChipEventCallback| HIDL interface
136 oneway registerEventCallback(IWifiChipEventCallback callback);
139 * Get the set of operation modes that the chip supports.
141 * @return modes List of modes supported by the device.
143 getAvailableModes() generates (vec<ChipMode> modes);
146 * Reconfigure the Chip.
147 * Must trigger |IWifiChipEventCallback.onChipReconfigured| on sucess,
148 * or |IWifiChipEventCallback.onChipReconfigureFailure| on failure.
150 * @param modeId The mode that the chip should switch to, corresponding to the
151 * id property of the target ChipMode.
153 oneway configureChip(ChipModeId modeId);
156 * Get the current mode that the chip is in.
158 * @return modeId The mode that the chip is currently configured to,
159 * corresponding to the id property of the target ChipMode.
161 getMode() generates (ChipModeId modeId);
164 * Request information about the chip.
165 * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess,
166 * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure.
168 oneway requestChipDebugInfo();
171 * Request vendor debug info from the driver.
172 * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success,
173 * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure.
175 oneway requestDriverDebugDump();
178 * Request vendor debug info from the firmware.
179 * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on
180 * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure.
182 oneway requestFirmwareDebugDump();
185 * Create an AP iface on the chip.
187 * Depending on the mode the chip is configured in, the interface creation
188 * may fail if we've already reached the maximum allowed
189 * (specified in |ChipIfaceCombination|) number of ifaces of the AP type.
191 * @return iface HIDL interface object representing the iface if
192 * successful, null otherwise.
194 createApIface() generates (IWifiApIface iface);
197 * List all the AP iface names configured on the chip.
198 * The corresponding |IWifiApIface| object for any iface are
199 * retrieved using |getApIface| method.
201 * @return ifnames List of all AP iface names on the chip.
203 getApIfaceNames() generates (vec<string> ifnames);
206 * Gets a HIDL interface object for the AP Iface corresponding
207 * to the provided ifname.
209 * @param ifname Name of the iface.
210 * @return iface HIDL interface object representing the iface if
211 * it exists, null otherwise.
213 getApIface(string ifname) generates (IWifiApIface iface);
216 * Create a NAN iface on the chip.
218 * Depending on the mode the chip is configured in, the interface creation
219 * may fail if we've already reached the maximum allowed
220 * (specified in |ChipIfaceCombination|) number of ifaces of the NAN type.
222 * @return iface HIDL interface object representing the iface if
223 * successful, null otherwise.
225 createNanIface() generates (IWifiNanIface iface);
228 * List all the NAN iface names configured on the chip.
229 * The corresponding |IWifiNanIface| object for any iface are
230 * retrieved using |getNanIface| method.
232 * @return ifnames List of all NAN iface names on the chip.
234 getNanIfaceNames() generates (vec<string> ifnames);
237 * Gets a HIDL interface object for the NAN Iface corresponding
238 * to the provided ifname.
240 * @param ifname Name of the iface.
241 * @return iface HIDL interface object representing the iface if
242 * it exists, null otherwise.
244 getNanIface(string ifname) generates (IWifiNanIface iface);
247 * Create a P2P iface on the chip.
249 * Depending on the mode the chip is configured in, the interface creation
250 * may fail if we've already reached the maximum allowed
251 * (specified in |ChipIfaceCombination|) number of ifaces of the P2P type.
253 * @return iface HIDL interface object representing the iface if
254 * successful, null otherwise.
256 createP2pIface() generates (IWifiP2pIface iface);
259 * List all the P2P iface names configured on the chip.
260 * The corresponding |IWifiP2pIface| object for any iface are
261 * retrieved using |getP2pIface| method.
263 * @return ifnames List of all P2P iface names on the chip.
265 getP2pIfaceNames() generates (vec<string> ifnames);
268 * Gets a HIDL interface object for the P2P Iface corresponding
269 * to the provided ifname.
271 * @param ifname Name of the iface.
272 * @return iface HIDL interface object representing the iface if
273 * it exists, null otherwise.
275 getP2pIface(string ifname) generates (IWifiP2pIface iface);
278 * Create an STA iface on the chip.
280 * Depending on the mode the chip is configured in, the interface creation
281 * may fail if we've already reached the maximum allowed
282 * (specified in |ChipIfaceCombination|) number of ifaces of the STA type.
284 * @return iface HIDL interface object representing the iface if
285 * successful, null otherwise.
287 createStaIface() generates (IWifiStaIface iface);
290 * List all the STA iface names configured on the chip.
291 * The corresponding |IWifiStaIface| object for any iface are
292 * retrieved using |getStaIface| method.
294 * @return ifnames List of all STA iface names on the chip.
296 getStaIfaceNames() generates (vec<string> ifnames);
299 * Gets a HIDL interface object for the STA Iface corresponding
300 * to the provided ifname.
302 * @param ifname Name of the iface.
303 * @return iface HIDL interface object representing the iface if
304 * it exists, null otherwise.
306 getStaIface(string ifname) generates (IWifiStaIface iface);
309 * Create a RTTController instance.
311 * RTT controller can be either:
312 * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
313 * object in |iface| param, OR
314 * b) Let the implementation decide the iface to use for RTT operations by
315 * passing null in |iface| param.
317 * @param boundIface HIDL interface object representing the iface if
318 * the responder must be bound to a specific iface, null otherwise.
320 createRttController(IWifiIface boundIface) generates (IWifiRttController rtt);