blob: c9d9ee61e2d6fbb7394596a7652ea7edc3b91fad [file] [log] [blame]
Roshan Pius39f588f2016-10-31 14:51:27 -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.supplicant@1.0;
18
19import ISupplicantIface;
20import ISupplicantStaIfaceCallback;
21
22/**
Roshan Pius8c6a8772016-11-03 09:37:57 -070023 * Interface exposed by the supplicant for each station mode network
Roshan Pius39f588f2016-10-31 14:51:27 -070024 * interface (e.g wlan0) it controls.
25 */
26interface ISupplicantStaIface extends ISupplicantIface {
27 /**
Roshan Piusb76dbbe2016-11-09 09:55:42 -080028 * Access Network Query Protocol info ID elements
29 * for IEEE Std 802.11u-2011.
30 */
Roshan Piuse3f25f12016-12-08 13:20:05 -080031 enum AnqpInfoId : uint16_t {
Roshan Piusb76dbbe2016-11-09 09:55:42 -080032 VENUE_NAME = 258,
33 ROAMING_CONSORTIUM = 261,
34 IP_ADDR_TYPE_AVAILABILITY = 262,
35 NAI_REALM = 263,
36 ANQP_3GPP_CELLULAR_NETWORK = 264,
37 DOMAIN_NAME = 268
38 };
39
40 /**
41 * Access Network Query Protocol subtype elements
42 * for Hotspot 2.0.
43 */
44 enum Hs20AnqpSubtypes : uint32_t {
Roshan Piuse3f25f12016-12-08 13:20:05 -080045 OPERATOR_FRIENDLY_NAME = 3,
Roshan Piusb76dbbe2016-11-09 09:55:42 -080046 WAN_METRICS = 4,
47 CONNECTION_CAPABILITY = 5,
48 OSU_PROVIDERS_LIST = 8,
49 };
50
51 /**
Roshan Pius3f050c12016-12-14 08:06:58 -080052 * Enum describing the types of RX filter supported
53 * via driver commands.
54 */
55 enum RxFilterType : uint8_t {
56 V4_MULTICAST = 0,
57 V6_MULTICAST = 1
58 };
59
60 /**
61 * Enum describing the modes of BT coexistence supported
62 * via driver commands.
63 */
64 enum BtCoexistenceMode : uint8_t {
65 ENABLED = 0,
66 DISABLED = 1,
67 SENSE = 2
68 };
69
70 /**
Roshan Pius39f588f2016-10-31 14:51:27 -070071 * Register for callbacks from this interface.
72 *
73 * These callbacks are invoked for events that are specific to this interface.
74 * Registration of multiple callback objects is supported. These objects must
75 * be automatically deleted when the corresponding client process is dead or
76 * if this interface is removed.
77 *
78 * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL
79 * interface object.
80 * @return status Status of the operation.
81 * Possible status codes:
82 * |SupplicantStatusCode.SUCCESS|,
83 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
84 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
85 */
86 registerCallback(ISupplicantStaIfaceCallback callback)
87 generates (SupplicantStatus status);
88
89 /**
90 * Reconnect to the currently active network, even if we are already
91 * connected.
92 *
93 * @return status Status of the operation.
94 * Possible status codes:
95 * |SupplicantStatusCode.SUCCESS|,
96 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
97 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
98 * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
99 */
100 reassociate() generates (SupplicantStatus status);
101
102 /**
103 * Reconnect to the currently active network, if we are currently
104 * disconnected.
105 *
106 * @return status Status of the operation.
107 * Possible status codes:
108 * |SupplicantStatusCode.SUCCESS|,
109 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
110 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
111 * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|,
112 * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED|
113 */
114 reconnect() generates (SupplicantStatus status);
115
116 /**
117 * Disconnect from the current active network.
118 *
119 * @return status Status of the operation.
120 * Possible status codes:
121 * |SupplicantStatusCode.SUCCESS|,
122 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
123 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
124 * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
125 */
126 disconnect() generates (SupplicantStatus status);
127
128 /**
129 * Turn on/off power save mode for the interface.
130 *
131 * @param enable Indicate if power save is to be turned on/off.
132 * @return status Status of the operation.
133 * Possible status codes:
134 * |SupplicantStatusCode.SUCCESS|,
135 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
136 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
137 * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
138 */
139 setPowerSave(bool enable) generates (SupplicantStatus status);
140
141 /**
Roshan Pius3f050c12016-12-14 08:06:58 -0800142 * Initiate TDLS discover with the provided peer MAC address.
Roshan Pius39f588f2016-10-31 14:51:27 -0700143 *
144 * @param macAddress MAC address of the peer.
145 * @return status Status of the operation.
146 * Possible status codes:
147 * |SupplicantStatusCode.SUCCESS|,
148 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
149 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
150 */
151 initiateTdlsDiscover(MacAddress macAddress)
152 generates (SupplicantStatus status);
153
154 /**
Roshan Pius3f050c12016-12-14 08:06:58 -0800155 * Initiate TDLS setup with the provided peer MAC address.
Roshan Pius39f588f2016-10-31 14:51:27 -0700156 *
157 * @param macAddress MAC address of the peer.
158 * @return status Status of the operation.
159 * Possible status codes:
160 * |SupplicantStatusCode.SUCCESS|,
161 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
162 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
163 */
164 initiateTdlsSetup(MacAddress macAddress)
165 generates (SupplicantStatus status);
166
167 /**
Roshan Pius3f050c12016-12-14 08:06:58 -0800168 * Initiate TDLS teardown with the provided peer MAC address.
Roshan Pius39f588f2016-10-31 14:51:27 -0700169 *
170 * @param macAddress MAC address of the peer.
171 * @return status Status of the operation.
172 * Possible status codes:
173 * |SupplicantStatusCode.SUCCESS|,
174 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
175 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
176 */
177 initiateTdlsTeardown(MacAddress macAddress)
178 generates (SupplicantStatus status);
Roshan Piusb76dbbe2016-11-09 09:55:42 -0800179
180 /**
181 * Initiate ANQP (for IEEE 802.11u Interworking/Hotspot 2.0) queries with the
182 * specified access point.
183 * The ANQP data fetched must be returned in the
184 * |ISupplicantStaIfaceCallback.onAnqpQueryDone| callback.
185 *
186 * @param macAddress MAC address of the access point.
187 * @param infoElements List of information elements to query for.
188 * @param subtypes List of HS20 subtypes to query for.
189 * @return status Status of the operation.
190 * Possible status codes:
191 * |SupplicantStatusCode.SUCCESS|,
192 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
193 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
194 */
195 initiateAnqpQuery(MacAddress macAddress,
196 vec<AnqpInfoId> infoElements,
197 vec<Hs20AnqpSubtypes> subTypes)
198 generates (SupplicantStatus status);
199
200 /**
201 * Initiate the Hotspot 2.0 icon query with the specified accesss point.
202 * The icon data fetched must be returned in the
203 * |ISupplicantStaIfaceCallback.onHs20IconQueryDone| callback.
204 *
205 * @param macAddress MAC address of the access point.
206 * @param fileName Name of the file to request from the access point.
207 * @return status Status of the operation.
208 * Possible status codes:
209 * |SupplicantStatusCode.SUCCESS|,
210 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
211 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
212 */
213 initiateHs20IconQuery(MacAddress macAddress, string fileName)
214 generates (SupplicantStatus status);
Roshan Pius3f050c12016-12-14 08:06:58 -0800215
216 /**
217 * Send driver command to get MAC address of the device.
218 *
219 * @return status Status of the operation.
220 * Possible status codes:
221 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800222 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
223 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800224 * @return macAddr MAC address of the device.
225 */
226 getMacAddress()
227 generates (SupplicantStatus status, MacAddress macAddr);
228
229 /**
230 * Send driver command to start RX filter.
231 *
232 * @return status Status of the operation.
233 * Possible status codes:
234 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800235 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
236 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800237 */
238 startRxFilter() generates (SupplicantStatus status);
239
240 /**
241 * Send driver command to stop RX filter.
242 *
243 * @return status Status of the operation.
244 * Possible status codes:
245 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800246 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
247 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800248 */
249 stopRxFilter() generates (SupplicantStatus status);
250
251 /**
252 * Send driver command to add the specified RX filter.
253 *
254 * @param type Type of filter.
255 * @return status Status of the operation.
256 * Possible status codes:
257 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800258 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
259 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800260 */
261 addRxFilter(RxFilterType type)
262 generates (SupplicantStatus status);
263
264 /**
265 * Send driver command to remove the specified RX filter.
266 *
267 * @param type Type of filter.
268 * @return status Status of the operation.
269 * Possible status codes:
270 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800271 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
272 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800273 */
274 removeRxFilter(RxFilterType type)
275 generates (SupplicantStatus status);
276
277 /**
278 * Send driver command to set Bluetooth coexistence mode.
279 *
280 * @param mode Mode of Bluetooth coexistence.
281 * @return status Status of the operation.
282 * Possible status codes:
283 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800284 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
285 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800286 */
287 setBtCoexistenceMode(BtCoexistenceMode mode)
288 generates (SupplicantStatus status);
289
290 /**
291 * Send driver command to set Bluetooth coexistence scan mode.
292 * When this mode is on, some of the low-level scan parameters
293 * used by the driver are changed to reduce interference
294 * with A2DP streaming.
295 *
296 * @param enable true to enable, false to disable.
297 * @return status Status of the operation.
298 * Possible status codes:
299 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800300 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
301 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800302 */
303 setBtCoexistenceScanModeEnabled(bool enable)
304 generates (SupplicantStatus status);
305
306 /**
307 * Send driver command to set suspend optimizations for power save.
308 *
309 * @param enable true to enable, false to disable.
310 * @return status Status of the operation.
311 * Possible status codes:
312 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800313 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
314 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800315 */
316 setSuspendModeEnabled(bool enable)
317 generates (SupplicantStatus status);
318
319 /**
320 * Send driver command to set country code.
321 *
322 * @param code 2 byte country code (as defined in ISO 3166) to set.
323 * @return status Status of the operation.
324 * Possible status codes:
325 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800326 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
327 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius3f050c12016-12-14 08:06:58 -0800328 */
329 setCountryCode(int8_t[2] code)
330 generates (SupplicantStatus status);
Roshan Pius08e6bba2017-01-10 14:10:19 -0800331
332 /**
333 * Initiate WPS setup in registrar role to learn the current AP configuration.
334 *
335 * @param bssid BSSID of the AP.
336 * @param pin Pin of the AP.
337 * @return status Status of the operation.
338 * Possible status codes:
339 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800340 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
341 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius08e6bba2017-01-10 14:10:19 -0800342 */
343 startWpsRegistrar(Bssid bssid, string pin)
344 generates (SupplicantStatus status);
345
346 /**
347 * Initiate WPS Push Button setup.
348 * The PBC operation requires that a button is also pressed at the
349 * AP/Registrar at about the same time (2 minute window).
350 *
351 * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
352 * @return status Status of the operation.
353 * Possible status codes:
354 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800355 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
356 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius08e6bba2017-01-10 14:10:19 -0800357 */
358 startWpsPbc(Bssid bssid) generates (SupplicantStatus status);
359
360 /**
361 * Initiate WPS Pin Keypad setup.
362 *
363 * @param pin 8 digit pin to be used.
364 * @return status Status of the operation.
365 * Possible status codes:
366 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800367 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
368 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius08e6bba2017-01-10 14:10:19 -0800369 */
370 startWpsPinKeypad(string pin) generates (SupplicantStatus status);
371
372 /**
373 * Initiate WPS Pin Display setup.
374 *
375 * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
376 * @return status Status of the operation.
377 * Possible status codes:
378 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800379 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
380 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius08e6bba2017-01-10 14:10:19 -0800381 * @return generatedPin 8 digit pin generated.
382 */
383 startWpsPinDisplay(Bssid bssid)
384 generates (SupplicantStatus status, string generatedPin);
385
386 /**
387 * Cancel any ongoing WPS operations.
388 *
389 * @return status Status of the operation.
390 * Possible status codes:
391 * |SupplicantStatusCode.SUCCESS|,
Roshan Pius4984f9a2017-01-13 08:58:23 -0800392 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
393 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
Roshan Pius08e6bba2017-01-10 14:10:19 -0800394 */
395 cancelWps() generates (SupplicantStatus status);
Roshan Pius4984f9a2017-01-13 08:58:23 -0800396
397 /**
398 * Use external processing for SIM/USIM operations
399 *
400 * @param useExternalSim true to use external, false otherwise.
401 * @return status Status of the operation.
402 * Possible status codes:
403 * |SupplicantStatusCode.SUCCESS|,
404 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
405 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
406 */
407 setExternalSim(bool useExternalSim) generates (SupplicantStatus status);
Roshan Pius39f588f2016-10-31 14:51:27 -0700408};