• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * WPA Supplicant - Manager for Aidl interface objects
3  * Copyright (c) 2021, Google Inc. All rights reserved.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef WPA_SUPPLICANT_AIDL_AIDL_MANAGER_H
10 #define WPA_SUPPLICANT_AIDL_AIDL_MANAGER_H
11 
12 #include <map>
13 #include <string>
14 
15 #include <aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.h>
16 #include <aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.h>
17 #include <aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.h>
18 
19 #include "p2p_iface.h"
20 #include "p2p_network.h"
21 #include "rsn_supp/pmksa_cache.h"
22 #include "sta_iface.h"
23 #include "sta_network.h"
24 #include "supplicant.h"
25 
26 extern "C"
27 {
28 #include "utils/common.h"
29 #include "utils/includes.h"
30 #include "wpa_supplicant_i.h"
31 #include "driver_i.h"
32 }
33 
34 namespace aidl {
35 namespace android {
36 namespace hardware {
37 namespace wifi {
38 namespace supplicant {
39 
40 /**
41  * AidlManager is responsible for managing the lifetime of all
42  * aidl objects created by wpa_supplicant. This is a singleton
43  * class which is created by the supplicant core and can be used
44  * to get references to the aidl objects.
45  */
46 class AidlManager
47 {
48 public:
49 	static AidlManager *getInstance();
50 	static void destroyInstance();
51 
52 	// Methods called from wpa_supplicant core.
53 	int registerAidlService(struct wpa_global *global);
54 	int registerInterface(struct wpa_supplicant *wpa_s);
55 	int unregisterInterface(struct wpa_supplicant *wpa_s);
56 	int registerNetwork(
57 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
58 	int unregisterNetwork(
59 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
60 	int notifyStateChange(struct wpa_supplicant *wpa_s);
61 	int notifyNetworkRequest(
62 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, int type,
63 		const char *param);
64 	void notifyAnqpQueryDone(
65 		struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
66 		const struct wpa_bss_anqp *anqp);
67 	void notifyHs20IconQueryDone(
68 		struct wpa_supplicant *wpa_s, const u8 *bssid,
69 		const char *file_name, const u8 *image, u32 image_length);
70 	void notifyHs20RxSubscriptionRemediation(
71 		struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
72 	void notifyHs20RxDeauthImminentNotice(
73 		struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay,
74 		const char *url);
75 	void notifyHs20RxTermsAndConditionsAcceptance(
76 			struct wpa_supplicant *wpa_s, const char *url);
77 	void notifyDisconnectReason(struct wpa_supplicant *wpa_s);
78 	void notifyAssocReject(struct wpa_supplicant *wpa_s, const u8 *bssid,
79 		u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
80 	void notifyAuthTimeout(struct wpa_supplicant *wpa_s);
81 	void notifyBssidChanged(struct wpa_supplicant *wpa_s);
82 	void notifyWpsEventFail(
83 		struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr,
84 		uint16_t config_error, uint16_t error_indication);
85 	void notifyWpsEventSuccess(struct wpa_supplicant *wpa_s);
86 	void notifyWpsEventPbcOverlap(struct wpa_supplicant *wpa_s);
87 	void notifyP2pDeviceFound(
88 		struct wpa_supplicant *wpa_s, const u8 *addr,
89 		const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
90 		u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
91 		u8 peer_wfd_r2_device_info_len);
92 	void notifyP2pDeviceLost(
93 		struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
94 	void notifyP2pFindStopped(struct wpa_supplicant *wpa_s);
95 	void notifyP2pGoNegReq(
96 		struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
97 		u8 go_intent);
98 	void notifyP2pGoNegCompleted(
99 		struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
100 	void notifyP2pGroupFormationFailure(
101 		struct wpa_supplicant *wpa_s, const char *reason);
102 	void notifyP2pGroupStarted(
103 		struct wpa_supplicant *wpa_group_s, const struct wpa_ssid *ssid,
104 		int persistent, int client);
105 	void notifyP2pGroupRemoved(
106 		struct wpa_supplicant *wpa_group_s, const struct wpa_ssid *ssid,
107 		const char *role);
108 	void notifyP2pInvitationReceived(
109 		struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
110 		const u8 *bssid, int id, int op_freq);
111 	void notifyP2pInvitationResult(
112 		struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
113 	void notifyP2pProvisionDiscovery(
114 		struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
115 		enum p2p_prov_disc_status status, u16 config_methods,
116 		unsigned int generated_pin);
117 	void notifyP2pSdResponse(
118 		struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
119 		const u8 *tlvs, size_t tlvs_len);
120 	void notifyApStaAuthorized(
121 		struct wpa_supplicant *wpa_s, const u8 *sta,
122 		const u8 *p2p_dev_addr);
123 	void notifyApStaDeauthorized(
124 		struct wpa_supplicant *wpa_s, const u8 *sta,
125 		const u8 *p2p_dev_addr);
126 	void notifyEapError(struct wpa_supplicant *wpa_s, int error_code);
127 	void notifyDppConfigReceived(struct wpa_supplicant *wpa_s,
128 			struct wpa_ssid *config);
129 	void notifyDppConfigSent(struct wpa_supplicant *wpa_s);
130 	void notifyDppSuccess(struct wpa_supplicant *wpa_s, DppEventType code);
131 	void notifyDppFailure(struct wpa_supplicant *wpa_s,
132 			DppFailureCode code);
133 	void notifyDppFailure(struct wpa_supplicant *wpa_s,
134 			DppFailureCode code,
135 			const char *ssid, const char *channel_list, unsigned short band_list[],
136 			int size);
137 	void notifyDppProgress(struct wpa_supplicant *wpa_s,
138 			DppProgressCode code);
139 	void notifyPmkCacheAdded(struct wpa_supplicant *wpa_s,
140 			struct rsn_pmksa_cache_entry *pmksa_entry);
141 	void notifyBssTmStatus(struct wpa_supplicant *wpa_s);
142 	void notifyTransitionDisable(struct wpa_supplicant *wpa_s,
143 			struct wpa_ssid *ssid,
144 			u8 bitmap);
145 	void notifyNetworkNotFound(struct wpa_supplicant *wpa_s);
146 	void notifyFrequencyChanged(struct wpa_supplicant *wpa_s, int frequency);
147 	void notifyCertification(struct wpa_supplicant *wpa_s,
148 			int depth, const char *subject,
149 			const char *altsubject[],
150 			int num_altsubject,
151 			const char *cert_hash,
152 			const struct wpabuf *cert);
153 	void notifyAuxiliaryEvent(struct wpa_supplicant *wpa_s,
154 			AuxiliarySupplicantEventCode event_code,
155 			const char *reason_string);
156 	void notifyQosPolicyReset(struct wpa_supplicant *wpa_s);
157 	void notifyQosPolicyRequest(struct wpa_supplicant *wpa_s,
158 			struct dscp_policy_data *policies,
159 			int num_policies);
160 
161 	// Methods called from aidl objects.
162 	void notifyExtRadioWorkStart(struct wpa_supplicant *wpa_s, uint32_t id);
163 	void notifyExtRadioWorkTimeout(
164 		struct wpa_supplicant *wpa_s, uint32_t id);
165 
166 	int getP2pIfaceAidlObjectByIfname(
167 		const std::string &ifname,
168 		std::shared_ptr<ISupplicantP2pIface> *iface_object);
169 	int getStaIfaceAidlObjectByIfname(
170 		const std::string &ifname,
171 		std::shared_ptr<ISupplicantStaIface> *iface_object);
172 	int getP2pNetworkAidlObjectByIfnameAndNetworkId(
173 		const std::string &ifname, int network_id,
174 		std::shared_ptr<ISupplicantP2pNetwork> *network_object);
175 	int getStaNetworkAidlObjectByIfnameAndNetworkId(
176 		const std::string &ifname, int network_id,
177 		std::shared_ptr<ISupplicantStaNetwork> *network_object);
178 	int addSupplicantCallbackAidlObject(
179 		const std::shared_ptr<ISupplicantCallback> &callback);
180 	int addP2pIfaceCallbackAidlObject(
181 		const std::string &ifname,
182 		const std::shared_ptr<ISupplicantP2pIfaceCallback> &callback);
183 	int addStaIfaceCallbackAidlObject(
184 		const std::string &ifname,
185 		const std::shared_ptr<ISupplicantStaIfaceCallback> &callback);
186 	int addStaNetworkCallbackAidlObject(
187 		const std::string &ifname, int network_id,
188 		const std::shared_ptr<ISupplicantStaNetworkCallback> &callback);
189 
190 private:
191 	AidlManager() = default;
192 	~AidlManager() = default;
193 	AidlManager(const AidlManager &) = default;
194 	AidlManager &operator=(const AidlManager &) = default;
195 
196 	struct wpa_supplicant *getTargetP2pIfaceForGroup(
197 		struct wpa_supplicant *wpa_s);
198 	void removeSupplicantCallbackAidlObject(
199 		const std::shared_ptr<ISupplicantCallback> &callback);
200 	void removeP2pIfaceCallbackAidlObject(
201 		const std::string &ifname,
202 		const std::shared_ptr<ISupplicantP2pIfaceCallback> &callback);
203 	void removeStaIfaceCallbackAidlObject(
204 		const std::string &ifname,
205 		const std::shared_ptr<ISupplicantStaIfaceCallback> &callback);
206 	void removeStaNetworkCallbackAidlObject(
207 		const std::string &ifname, int network_id,
208 		const std::shared_ptr<ISupplicantStaNetworkCallback> &callback);
209 
210 	void callWithEachSupplicantCallback(
211 		const std::function<ndk::ScopedAStatus(
212 		std::shared_ptr<ISupplicantCallback>)> &method);
213 	void callWithEachP2pIfaceCallback(
214 		const std::string &ifname,
215 		const std::function<ndk::ScopedAStatus(
216 		std::shared_ptr<ISupplicantP2pIfaceCallback>)> &method);
217 	void callWithEachStaIfaceCallback(
218 		const std::string &ifname,
219 		const std::function<ndk::ScopedAStatus(
220 		std::shared_ptr<ISupplicantStaIfaceCallback>)> &method);
221 	void callWithEachStaNetworkCallback(
222 		const std::string &ifname, int network_id,
223 		const std::function<::ndk::ScopedAStatus(
224 		std::shared_ptr<ISupplicantStaNetworkCallback>)> &method);
225 
226 	// Singleton instance of this class.
227 	static AidlManager *instance_;
228 	// Death notifier.
229 	AIBinder_DeathRecipient* death_notifier_;
230 	// The main aidl service object.
231 	std::shared_ptr<Supplicant> supplicant_object_;
232 	// Map of all the P2P interface specific aidl objects controlled by
233 	// wpa_supplicant. This map is keyed in by the corresponding
234 	// |ifname|.
235 	std::map<const std::string, std::shared_ptr<P2pIface>>
236 		p2p_iface_object_map_;
237 	// Map of all the STA interface specific aidl objects controlled by
238 	// wpa_supplicant. This map is keyed in by the corresponding
239 	// |ifname|.
240 	std::map<const std::string, std::shared_ptr<StaIface>>
241 		sta_iface_object_map_;
242 	// Map of all the P2P network specific aidl objects controlled by
243 	// wpa_supplicant. This map is keyed in by the corresponding
244 	// |ifname| & |network_id|.
245 	std::map<const std::string, std::shared_ptr<P2pNetwork>>
246 		p2p_network_object_map_;
247 	// Map of all the STA network specific aidl objects controlled by
248 	// wpa_supplicant. This map is keyed in by the corresponding
249 	// |ifname| & |network_id|.
250 	std::map<const std::string, std::shared_ptr<StaNetwork>>
251 		sta_network_object_map_;
252 
253 	// Callbacks registered for the main aidl service object.
254 	std::vector<std::shared_ptr<ISupplicantCallback>> supplicant_callbacks_;
255 	// Map of all the callbacks registered for P2P interface specific
256 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
257 	// the corresponding |ifname|.
258 	std::map<
259 		const std::string,
260 		std::vector<std::shared_ptr<ISupplicantP2pIfaceCallback>>>
261 		p2p_iface_callbacks_map_;
262 	// Map of all the callbacks registered for STA interface specific
263 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
264 	// the corresponding |ifname|.
265 	std::map<
266 		const std::string,
267 		std::vector<std::shared_ptr<ISupplicantStaIfaceCallback>>>
268 		sta_iface_callbacks_map_;
269 	// Map of all the callbacks registered for STA network specific
270 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
271 	// the corresponding |ifname| & |network_id|.
272 	std::map<
273 		const std::string,
274 		std::vector<std::shared_ptr<ISupplicantStaNetworkCallback>>>
275 		sta_network_callbacks_map_;
276 };
277 
278 // The aidl interface uses some values which are the same as internal ones to
279 // avoid nasty runtime conversion functions. So, adding compile time asserts
280 // to guard against any internal changes breaking the aidl interface.
281 static_assert(
282 	static_cast<uint32_t>(DebugLevel::EXCESSIVE) == MSG_EXCESSIVE,
283 	"Debug level value mismatch");
284 static_assert(
285 	static_cast<uint32_t>(DebugLevel::ERROR) == MSG_ERROR,
286 	"Debug level value mismatch");
287 
288 static_assert(
289 	static_cast<uint32_t>(KeyMgmtMask::NONE) ==
290 	WPA_KEY_MGMT_NONE,
291 	"KeyMgmt value mismatch");
292 static_assert(
293 	static_cast<uint32_t>(KeyMgmtMask::WPA_PSK) ==
294 	WPA_KEY_MGMT_PSK,
295 	"KeyMgmt value mismatch");
296 static_assert(
297 	static_cast<uint32_t>(KeyMgmtMask::WPA_EAP) ==
298 	WPA_KEY_MGMT_IEEE8021X,
299 	"KeyMgmt value mismatch");
300 static_assert(
301 	static_cast<uint32_t>(KeyMgmtMask::IEEE8021X) ==
302 	WPA_KEY_MGMT_IEEE8021X_NO_WPA,
303 	"KeyMgmt value mismatch");
304 static_assert(
305 	static_cast<uint32_t>(KeyMgmtMask::FT_EAP) ==
306 	WPA_KEY_MGMT_FT_IEEE8021X,
307 	"KeyMgmt value mismatch");
308 static_assert(
309 	static_cast<uint32_t>(KeyMgmtMask::FT_PSK) ==
310 	WPA_KEY_MGMT_FT_PSK,
311 	"KeyMgmt value mismatch");
312 static_assert(
313 	static_cast<uint32_t>(KeyMgmtMask::OSEN) ==
314 	WPA_KEY_MGMT_OSEN,
315 	"KeyMgmt value mismatch");
316 static_assert(
317 	static_cast<uint32_t>(KeyMgmtMask::SAE) ==
318 	WPA_KEY_MGMT_SAE,
319 	"KeyMgmt value mismatch");
320 static_assert(
321 	static_cast<uint32_t>(KeyMgmtMask::SUITE_B_192) ==
322 	WPA_KEY_MGMT_IEEE8021X_SUITE_B_192,
323 	"KeyMgmt value mismatch");
324 static_assert(
325 	static_cast<uint32_t>(KeyMgmtMask::OWE) ==
326 	WPA_KEY_MGMT_OWE,
327 	"KeyMgmt value mismatch");
328 static_assert(
329 	static_cast<uint32_t>(KeyMgmtMask::WPA_PSK_SHA256) ==
330 	WPA_KEY_MGMT_PSK_SHA256,
331 	"KeyMgmt value mismatch");
332 static_assert(
333 	static_cast<uint32_t>(KeyMgmtMask::WPA_EAP_SHA256) ==
334 	WPA_KEY_MGMT_IEEE8021X_SHA256,
335 	"KeyMgmt value mismatch");
336 static_assert(
337 	static_cast<uint32_t>(KeyMgmtMask::WAPI_PSK) ==
338 	WPA_KEY_MGMT_WAPI_PSK,
339 	"KeyMgmt value mismatch");
340 static_assert(
341 	static_cast<uint32_t>(KeyMgmtMask::WAPI_CERT) ==
342 	WPA_KEY_MGMT_WAPI_CERT,
343 	"KeyMgmt value mismatch");
344 static_assert(
345 	static_cast<uint32_t>(ProtoMask::WPA) ==
346 	WPA_PROTO_WPA,
347 	"Proto value mismatch");
348 static_assert(
349 	static_cast<uint32_t>(ProtoMask::RSN) ==
350 	WPA_PROTO_RSN,
351 	"Proto value mismatch");
352 static_assert(
353 	static_cast<uint32_t>(ProtoMask::OSEN) ==
354 	WPA_PROTO_OSEN,
355 	"Proto value mismatch");
356 static_assert(
357 	static_cast<uint32_t>(ProtoMask::WAPI) ==
358 	WPA_PROTO_WAPI,
359 	"Proto value mismatch");
360 static_assert(
361 	static_cast<uint32_t>(AuthAlgMask::OPEN) ==
362 	WPA_AUTH_ALG_OPEN,
363 	"AuthAlg value mismatch");
364 static_assert(
365 	static_cast<uint32_t>(AuthAlgMask::SHARED) ==
366 	WPA_AUTH_ALG_SHARED,
367 	"AuthAlg value mismatch");
368 static_assert(
369 	static_cast<uint32_t>(AuthAlgMask::LEAP) ==
370 	WPA_AUTH_ALG_LEAP,
371 	"AuthAlg value mismatch");
372 static_assert(
373 	static_cast<uint32_t>(GroupCipherMask::WEP40) ==
374 	WPA_CIPHER_WEP40,
375 	"GroupCipher value mismatch");
376 static_assert(
377 	static_cast<uint32_t>(GroupCipherMask::WEP104) ==
378 	WPA_CIPHER_WEP104,
379 	"GroupCipher value mismatch");
380 static_assert(
381 	static_cast<uint32_t>(GroupCipherMask::TKIP) ==
382 	WPA_CIPHER_TKIP,
383 	"GroupCipher value mismatch");
384 static_assert(
385 	static_cast<uint32_t>(GroupCipherMask::CCMP) ==
386 	WPA_CIPHER_CCMP,
387 	"GroupCipher value mismatch");
388 static_assert(
389 	static_cast<uint32_t>(GroupCipherMask::GCMP_256) ==
390 	WPA_CIPHER_GCMP_256,
391 	"GroupCipher value mismatch");
392 static_assert(
393 	static_cast<uint32_t>(GroupCipherMask::SMS4) ==
394 	WPA_CIPHER_SMS4,
395 	"GroupCipher value mismatch");
396 static_assert(
397 	static_cast<uint32_t>(
398 	GroupCipherMask::GTK_NOT_USED) ==
399 	WPA_CIPHER_GTK_NOT_USED,
400 	"GroupCipher value mismatch");
401 static_assert(
402 	static_cast<uint32_t>(PairwiseCipherMask::NONE) ==
403 	WPA_CIPHER_NONE,
404 	"PairwiseCipher value mismatch");
405 static_assert(
406 	static_cast<uint32_t>(PairwiseCipherMask::TKIP) ==
407 	WPA_CIPHER_TKIP,
408 	"PairwiseCipher value mismatch");
409 static_assert(
410 	static_cast<uint32_t>(PairwiseCipherMask::CCMP) ==
411 	WPA_CIPHER_CCMP,
412 	"PairwiseCipher value mismatch");
413 static_assert(
414 	static_cast<uint32_t>(
415 	PairwiseCipherMask::GCMP_256) ==
416 	WPA_CIPHER_GCMP_256,
417 	"PairwiseCipher value mismatch");
418 static_assert(
419 	static_cast<uint32_t>(
420 	PairwiseCipherMask::SMS4) ==
421 	WPA_CIPHER_SMS4,
422 	"PairwiseCipher value mismatch");
423 static_assert(
424 	static_cast<uint32_t>(StaIfaceCallbackState::DISCONNECTED) ==
425 	WPA_DISCONNECTED,
426 	"State value mismatch");
427 static_assert(
428 	static_cast<uint32_t>(StaIfaceCallbackState::COMPLETED) ==
429 	WPA_COMPLETED,
430 	"State value mismatch");
431 
432 static_assert(
433 	static_cast<uint32_t>(AnqpInfoId::VENUE_NAME) ==
434 	ANQP_VENUE_NAME,
435 	"ANQP ID value mismatch");
436 static_assert(
437 	static_cast<uint32_t>(
438 	AnqpInfoId::ROAMING_CONSORTIUM) ==
439 	ANQP_ROAMING_CONSORTIUM,
440 	"ANQP ID value mismatch");
441 static_assert(
442 	static_cast<uint32_t>(AnqpInfoId::NAI_REALM) ==
443 	ANQP_NAI_REALM,
444 	"ANQP ID value mismatch");
445 static_assert(
446 	static_cast<uint32_t>(
447 	AnqpInfoId::IP_ADDR_TYPE_AVAILABILITY) ==
448 	ANQP_IP_ADDR_TYPE_AVAILABILITY,
449 	"ANQP ID value mismatch");
450 static_assert(
451 	static_cast<uint32_t>(
452 	AnqpInfoId::ANQP_3GPP_CELLULAR_NETWORK) ==
453 	ANQP_3GPP_CELLULAR_NETWORK,
454 	"ANQP ID value mismatch");
455 static_assert(
456 	static_cast<uint32_t>(AnqpInfoId::DOMAIN_NAME) ==
457 	ANQP_DOMAIN_NAME,
458 	"ANQP ID value mismatch");
459 static_assert(
460 	static_cast<uint32_t>(
461 	Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME) ==
462 	HS20_STYPE_OPERATOR_FRIENDLY_NAME,
463 	"HS Subtype value mismatch");
464 static_assert(
465 	static_cast<uint32_t>(Hs20AnqpSubtypes::WAN_METRICS) ==
466 	HS20_STYPE_WAN_METRICS,
467 	"HS Subtype value mismatch");
468 static_assert(
469 	static_cast<uint32_t>(
470 	Hs20AnqpSubtypes::CONNECTION_CAPABILITY) ==
471 	HS20_STYPE_CONNECTION_CAPABILITY,
472 	"HS Subtype value mismatch");
473 static_assert(
474 	static_cast<uint32_t>(
475 	Hs20AnqpSubtypes::OSU_PROVIDERS_LIST) ==
476 	HS20_STYPE_OSU_PROVIDERS_LIST,
477 	"HS Subtype value mismatch");
478 
479 static_assert(
480 	static_cast<uint16_t>(
481 	WpsConfigError::NO_ERROR) ==
482 	WPS_CFG_NO_ERROR,
483 	"Wps config error value mismatch");
484 static_assert(
485 	static_cast<uint16_t>(WpsConfigError::
486 				  PUBLIC_KEY_HASH_MISMATCH) ==
487 	WPS_CFG_PUBLIC_KEY_HASH_MISMATCH,
488 	"Wps config error value mismatch");
489 static_assert(
490 	static_cast<uint16_t>(
491 	WpsErrorIndication::NO_ERROR) ==
492 	WPS_EI_NO_ERROR,
493 	"Wps error indication value mismatch");
494 static_assert(
495 	static_cast<uint16_t>(
496 	WpsErrorIndication::AUTH_FAILURE) ==
497 	WPS_EI_AUTH_FAILURE,
498 	"Wps error indication value mismatch");
499 
500 static_assert(
501 	static_cast<uint32_t>(WpsConfigMethods::USBA) == WPS_CONFIG_USBA,
502 	"Wps config value mismatch");
503 static_assert(
504 	static_cast<uint32_t>(WpsConfigMethods::ETHERNET) == WPS_CONFIG_ETHERNET,
505 	"Wps config value mismatch");
506 static_assert(
507 	static_cast<uint32_t>(WpsConfigMethods::LABEL) == WPS_CONFIG_LABEL,
508 	"Wps config value mismatch");
509 static_assert(
510 	static_cast<uint32_t>(WpsConfigMethods::DISPLAY) == WPS_CONFIG_DISPLAY,
511 	"Wps config value mismatch");
512 static_assert(
513 	static_cast<uint32_t>(WpsConfigMethods::INT_NFC_TOKEN) ==
514 	WPS_CONFIG_INT_NFC_TOKEN,
515 	"Wps config value mismatch");
516 static_assert(
517 	static_cast<uint32_t>(WpsConfigMethods::EXT_NFC_TOKEN) ==
518 	WPS_CONFIG_EXT_NFC_TOKEN,
519 	"Wps config value mismatch");
520 static_assert(
521 	static_cast<uint32_t>(WpsConfigMethods::NFC_INTERFACE) ==
522 	WPS_CONFIG_NFC_INTERFACE,
523 	"Wps config value mismatch");
524 static_assert(
525 	static_cast<uint32_t>(WpsConfigMethods::PUSHBUTTON) ==
526 	WPS_CONFIG_PUSHBUTTON,
527 	"Wps config value mismatch");
528 static_assert(
529 	static_cast<uint32_t>(WpsConfigMethods::KEYPAD) == WPS_CONFIG_KEYPAD,
530 	"Wps config value mismatch");
531 static_assert(
532 	static_cast<uint32_t>(WpsConfigMethods::VIRT_PUSHBUTTON) ==
533 	WPS_CONFIG_VIRT_PUSHBUTTON,
534 	"Wps config value mismatch");
535 static_assert(
536 	static_cast<uint32_t>(WpsConfigMethods::PHY_PUSHBUTTON) ==
537 	WPS_CONFIG_PHY_PUSHBUTTON,
538 	"Wps config value mismatch");
539 static_assert(
540 	static_cast<uint32_t>(WpsConfigMethods::P2PS) == WPS_CONFIG_P2PS,
541 	"Wps config value mismatch");
542 static_assert(
543 	static_cast<uint32_t>(WpsConfigMethods::VIRT_DISPLAY) ==
544 	WPS_CONFIG_VIRT_DISPLAY,
545 	"Wps config value mismatch");
546 static_assert(
547 	static_cast<uint32_t>(WpsConfigMethods::PHY_DISPLAY) ==
548 	WPS_CONFIG_PHY_DISPLAY,
549 	"Wps config value mismatch");
550 
551 static_assert(
552 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_OWNER) ==
553 	P2P_GROUP_CAPAB_GROUP_OWNER,
554 	"P2P capability value mismatch");
555 static_assert(
556 	static_cast<uint32_t>(P2pGroupCapabilityMask::PERSISTENT_GROUP) ==
557 	P2P_GROUP_CAPAB_PERSISTENT_GROUP,
558 	"P2P capability value mismatch");
559 static_assert(
560 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_LIMIT) ==
561 	P2P_GROUP_CAPAB_GROUP_LIMIT,
562 	"P2P capability value mismatch");
563 static_assert(
564 	static_cast<uint32_t>(P2pGroupCapabilityMask::INTRA_BSS_DIST) ==
565 	P2P_GROUP_CAPAB_INTRA_BSS_DIST,
566 	"P2P capability value mismatch");
567 static_assert(
568 	static_cast<uint32_t>(P2pGroupCapabilityMask::CROSS_CONN) ==
569 	P2P_GROUP_CAPAB_CROSS_CONN,
570 	"P2P capability value mismatch");
571 static_assert(
572 	static_cast<uint32_t>(P2pGroupCapabilityMask::PERSISTENT_RECONN) ==
573 	P2P_GROUP_CAPAB_PERSISTENT_RECONN,
574 	"P2P capability value mismatch");
575 static_assert(
576 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_FORMATION) ==
577 	P2P_GROUP_CAPAB_GROUP_FORMATION,
578 	"P2P capability value mismatch");
579 
580 static_assert(
581 	static_cast<uint16_t>(
582 	WpsDevPasswordId::DEFAULT) ==
583 	DEV_PW_DEFAULT,
584 	"Wps dev password id value mismatch");
585 static_assert(
586 	static_cast<uint16_t>(
587 	WpsDevPasswordId::USER_SPECIFIED) ==
588 	DEV_PW_USER_SPECIFIED,
589 	"Wps dev password id value mismatch");
590 static_assert(
591 	static_cast<uint16_t>(
592 	WpsDevPasswordId::MACHINE_SPECIFIED) ==
593 	DEV_PW_MACHINE_SPECIFIED,
594 	"Wps dev password id value mismatch");
595 static_assert(
596 	static_cast<uint16_t>(
597 	WpsDevPasswordId::REKEY) == DEV_PW_REKEY,
598 	"Wps dev password id value mismatch");
599 static_assert(
600 	static_cast<uint16_t>(
601 	WpsDevPasswordId::PUSHBUTTON) ==
602 	DEV_PW_PUSHBUTTON,
603 	"Wps dev password id value mismatch");
604 static_assert(
605 	static_cast<uint16_t>(
606 	WpsDevPasswordId::REGISTRAR_SPECIFIED) ==
607 	DEV_PW_REGISTRAR_SPECIFIED,
608 	"Wps dev password id value mismatch");
609 static_assert(
610 	static_cast<uint16_t>(WpsDevPasswordId::
611 				  NFC_CONNECTION_HANDOVER) ==
612 	DEV_PW_NFC_CONNECTION_HANDOVER,
613 	"Wps dev password id value mismatch");
614 static_assert(
615 	static_cast<uint16_t>(
616 	WpsDevPasswordId::P2PS_DEFAULT) ==
617 	DEV_PW_P2PS_DEFAULT,
618 	"Wps dev password id value mismatch");
619 
620 static_assert(
621 	static_cast<uint16_t>(
622 	P2pStatusCode::SUCCESS) == P2P_SC_SUCCESS,
623 	"P2P status code value mismatch");
624 static_assert(
625 	static_cast<uint16_t>(P2pStatusCode::
626 				  FAIL_INFO_CURRENTLY_UNAVAILABLE) ==
627 	P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE,
628 	"P2P status code value mismatch");
629 static_assert(
630 	static_cast<uint16_t>(
631 	P2pStatusCode::FAIL_INCOMPATIBLE_PARAMS) ==
632 	P2P_SC_FAIL_INCOMPATIBLE_PARAMS,
633 	"P2P status code value mismatch");
634 static_assert(
635 	static_cast<uint16_t>(
636 	P2pStatusCode::FAIL_LIMIT_REACHED) ==
637 	P2P_SC_FAIL_LIMIT_REACHED,
638 	"P2P status code value mismatch");
639 static_assert(
640 	static_cast<uint16_t>(
641 	P2pStatusCode::FAIL_INVALID_PARAMS) ==
642 	P2P_SC_FAIL_INVALID_PARAMS,
643 	"P2P status code value mismatch");
644 static_assert(
645 	static_cast<uint16_t>(P2pStatusCode::
646 				  FAIL_UNABLE_TO_ACCOMMODATE) ==
647 	P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE,
648 	"P2P status code value mismatch");
649 static_assert(
650 	static_cast<uint16_t>(
651 	P2pStatusCode::FAIL_PREV_PROTOCOL_ERROR) ==
652 	P2P_SC_FAIL_PREV_PROTOCOL_ERROR,
653 	"P2P status code value mismatch");
654 static_assert(
655 	static_cast<uint16_t>(
656 	P2pStatusCode::FAIL_NO_COMMON_CHANNELS) ==
657 	P2P_SC_FAIL_NO_COMMON_CHANNELS,
658 	"P2P status code value mismatch");
659 static_assert(
660 	static_cast<uint16_t>(
661 	P2pStatusCode::FAIL_UNKNOWN_GROUP) ==
662 	P2P_SC_FAIL_UNKNOWN_GROUP,
663 	"P2P status code value mismatch");
664 static_assert(
665 	static_cast<uint16_t>(
666 	P2pStatusCode::FAIL_BOTH_GO_INTENT_15) ==
667 	P2P_SC_FAIL_BOTH_GO_INTENT_15,
668 	"P2P status code value mismatch");
669 static_assert(
670 	static_cast<uint16_t>(P2pStatusCode::
671 				  FAIL_INCOMPATIBLE_PROV_METHOD) ==
672 	P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD,
673 	"P2P status code value mismatch");
674 static_assert(
675 	static_cast<uint16_t>(
676 	P2pStatusCode::FAIL_REJECTED_BY_USER) ==
677 	P2P_SC_FAIL_REJECTED_BY_USER,
678 	"P2P status code value mismatch");
679 static_assert(
680 	static_cast<uint16_t>(
681 	P2pStatusCode::SUCCESS_DEFERRED) ==
682 	P2P_SC_SUCCESS_DEFERRED,
683 	"P2P status code value mismatch");
684 
685 static_assert(
686 	static_cast<uint16_t>(
687 	P2pProvDiscStatusCode::SUCCESS) ==
688 	P2P_PROV_DISC_SUCCESS,
689 	"P2P status code value mismatch");
690 static_assert(
691 	static_cast<uint16_t>(
692 	P2pProvDiscStatusCode::TIMEOUT) ==
693 	P2P_PROV_DISC_TIMEOUT,
694 	"P2P status code value mismatch");
695 static_assert(
696 	static_cast<uint16_t>(
697 	P2pProvDiscStatusCode::REJECTED) ==
698 	P2P_PROV_DISC_REJECTED,
699 	"P2P status code value mismatch");
700 static_assert(
701 	static_cast<uint16_t>(
702 	P2pProvDiscStatusCode::TIMEOUT_JOIN) ==
703 	P2P_PROV_DISC_TIMEOUT_JOIN,
704 	"P2P status code value mismatch");
705 static_assert(
706 	static_cast<uint16_t>(
707 	P2pProvDiscStatusCode::INFO_UNAVAILABLE) ==
708 	P2P_PROV_DISC_INFO_UNAVAILABLE,
709 	"P2P status code value mismatch");
710 }  // namespace supplicant
711 }  // namespace wifi
712 }  // namespace hardware
713 }  // namespace android
714 }  // namespace aidl
715 #endif  // WPA_SUPPLICANT_AIDL_AIDL_MANAGER_H
716