blob: 0f0d41bb6b01a2bfc85dfa6baa46ec5e096da08a [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|,
222 * |SupplicantStatusCode.FAILURE_UNKNOWN|
223 * @return macAddr MAC address of the device.
224 */
225 getMacAddress()
226 generates (SupplicantStatus status, MacAddress macAddr);
227
228 /**
229 * Send driver command to start RX filter.
230 *
231 * @return status Status of the operation.
232 * Possible status codes:
233 * |SupplicantStatusCode.SUCCESS|,
234 * |SupplicantStatusCode.FAILURE_UNKNOWN|
235 */
236 startRxFilter() generates (SupplicantStatus status);
237
238 /**
239 * Send driver command to stop RX filter.
240 *
241 * @return status Status of the operation.
242 * Possible status codes:
243 * |SupplicantStatusCode.SUCCESS|,
244 * |SupplicantStatusCode.FAILURE_UNKNOWN|
245 */
246 stopRxFilter() generates (SupplicantStatus status);
247
248 /**
249 * Send driver command to add the specified RX filter.
250 *
251 * @param type Type of filter.
252 * @return status Status of the operation.
253 * Possible status codes:
254 * |SupplicantStatusCode.SUCCESS|,
255 * |SupplicantStatusCode.FAILURE_UNKNOWN|
256 */
257 addRxFilter(RxFilterType type)
258 generates (SupplicantStatus status);
259
260 /**
261 * Send driver command to remove the specified RX filter.
262 *
263 * @param type Type of filter.
264 * @return status Status of the operation.
265 * Possible status codes:
266 * |SupplicantStatusCode.SUCCESS|,
267 * |SupplicantStatusCode.FAILURE_UNKNOWN|
268 */
269 removeRxFilter(RxFilterType type)
270 generates (SupplicantStatus status);
271
272 /**
273 * Send driver command to set Bluetooth coexistence mode.
274 *
275 * @param mode Mode of Bluetooth coexistence.
276 * @return status Status of the operation.
277 * Possible status codes:
278 * |SupplicantStatusCode.SUCCESS|,
279 * |SupplicantStatusCode.FAILURE_UNKNOWN|
280 */
281 setBtCoexistenceMode(BtCoexistenceMode mode)
282 generates (SupplicantStatus status);
283
284 /**
285 * Send driver command to set Bluetooth coexistence scan mode.
286 * When this mode is on, some of the low-level scan parameters
287 * used by the driver are changed to reduce interference
288 * with A2DP streaming.
289 *
290 * @param enable true to enable, false to disable.
291 * @return status Status of the operation.
292 * Possible status codes:
293 * |SupplicantStatusCode.SUCCESS|,
294 * |SupplicantStatusCode.FAILURE_UNKNOWN|
295 */
296 setBtCoexistenceScanModeEnabled(bool enable)
297 generates (SupplicantStatus status);
298
299 /**
300 * Send driver command to set suspend optimizations for power save.
301 *
302 * @param enable true to enable, false to disable.
303 * @return status Status of the operation.
304 * Possible status codes:
305 * |SupplicantStatusCode.SUCCESS|,
306 * |SupplicantStatusCode.FAILURE_UNKNOWN|
307 */
308 setSuspendModeEnabled(bool enable)
309 generates (SupplicantStatus status);
310
311 /**
312 * Send driver command to set country code.
313 *
314 * @param code 2 byte country code (as defined in ISO 3166) to set.
315 * @return status Status of the operation.
316 * Possible status codes:
317 * |SupplicantStatusCode.SUCCESS|,
318 * |SupplicantStatusCode.FAILURE_UNKNOWN|
319 */
320 setCountryCode(int8_t[2] code)
321 generates (SupplicantStatus status);
Roshan Pius08e6bba2017-01-10 14:10:19 -0800322
323 /**
324 * Initiate WPS setup in registrar role to learn the current AP configuration.
325 *
326 * @param bssid BSSID of the AP.
327 * @param pin Pin of the AP.
328 * @return status Status of the operation.
329 * Possible status codes:
330 * |SupplicantStatusCode.SUCCESS|,
331 * |SupplicantStatusCode.FAILURE_UNKNOWN|
332 */
333 startWpsRegistrar(Bssid bssid, string pin)
334 generates (SupplicantStatus status);
335
336 /**
337 * Initiate WPS Push Button setup.
338 * The PBC operation requires that a button is also pressed at the
339 * AP/Registrar at about the same time (2 minute window).
340 *
341 * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
342 * @return status Status of the operation.
343 * Possible status codes:
344 * |SupplicantStatusCode.SUCCESS|,
345 * |SupplicantStatusCode.FAILURE_UNKNOWN|
346 */
347 startWpsPbc(Bssid bssid) generates (SupplicantStatus status);
348
349 /**
350 * Initiate WPS Pin Keypad setup.
351 *
352 * @param pin 8 digit pin to be used.
353 * @return status Status of the operation.
354 * Possible status codes:
355 * |SupplicantStatusCode.SUCCESS|,
356 * |SupplicantStatusCode.FAILURE_UNKNOWN|
357 */
358 startWpsPinKeypad(string pin) generates (SupplicantStatus status);
359
360 /**
361 * Initiate WPS Pin Display setup.
362 *
363 * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
364 * @return status Status of the operation.
365 * Possible status codes:
366 * |SupplicantStatusCode.SUCCESS|,
367 * |SupplicantStatusCode.FAILURE_UNKNOWN|
368 * @return generatedPin 8 digit pin generated.
369 */
370 startWpsPinDisplay(Bssid bssid)
371 generates (SupplicantStatus status, string generatedPin);
372
373 /**
374 * Cancel any ongoing WPS operations.
375 *
376 * @return status Status of the operation.
377 * Possible status codes:
378 * |SupplicantStatusCode.SUCCESS|,
379 * |SupplicantStatusCode.FAILURE_UNKNOWN|
380 */
381 cancelWps() generates (SupplicantStatus status);
Roshan Pius39f588f2016-10-31 14:51:27 -0700382};