• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * hidl interface for wpa_supplicant daemon
3  * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4  * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
5  *
6  * This software may be distributed under the terms of the BSD license.
7  * See README for more details.
8  */
9 
10 #ifndef WPA_SUPPLICANT_HIDL_HIDL_H
11 #define WPA_SUPPLICANT_HIDL_HIDL_H
12 
13 #ifdef _cplusplus
14 extern "C" {
15 #endif  // _cplusplus
16 
17 /**
18  * This is the hidl RPC interface entry point to the wpa_supplicant core.
19  * This initializes the hidl driver & HidlManager instance and then forwards
20  * all the notifcations from the supplicant core to the HidlManager.
21  */
22 struct wpas_hidl_priv;
23 struct wpa_global;
24 
25 struct wpas_hidl_priv *wpas_hidl_init(struct wpa_global *global);
26 void wpas_hidl_deinit(struct wpas_hidl_priv *priv);
27 
28 #ifdef CONFIG_CTRL_IFACE_HIDL
29 int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s);
30 int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s);
31 int wpas_hidl_register_network(
32     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
33 int wpas_hidl_unregister_network(
34     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
35 int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s);
36 int wpas_hidl_notify_network_request(
37     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
38     enum wpa_ctrl_req_type rtype, const char *default_txt);
39 void wpas_hidl_notify_anqp_query_done(
40     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
41     const struct wpa_bss_anqp *anqp);
42 void wpas_hidl_notify_hs20_icon_query_done(
43     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
44     const u8 *image, u32 image_length);
45 void wpas_hidl_notify_hs20_rx_subscription_remediation(
46     struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
47 void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
48     struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url);
49 void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s);
50 void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s);
51 void wpas_hidl_notify_auth_timeout(struct wpa_supplicant *wpa_s);
52 void wpas_hidl_notify_bssid_changed(struct wpa_supplicant *wpa_s);
53 void wpas_hidl_notify_wps_event_fail(
54     struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
55     uint16_t error_indication);
56 void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s);
57 void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
58 void wpas_hidl_notify_p2p_device_found(
59     struct wpa_supplicant *wpa_s, const u8 *addr,
60     const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
61     u8 peer_wfd_device_info_len);
62 void wpas_hidl_notify_p2p_device_lost(
63     struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
64 void wpas_hidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
65 void wpas_hidl_notify_p2p_go_neg_req(
66     struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
67     u8 go_intent);
68 void wpas_hidl_notify_p2p_go_neg_completed(
69     struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
70 void wpas_hidl_notify_p2p_group_formation_failure(
71     struct wpa_supplicant *wpa_s, const char *reason);
72 void wpas_hidl_notify_p2p_group_started(
73     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
74     int client);
75 void wpas_hidl_notify_p2p_group_removed(
76     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
77     const char *role);
78 void wpas_hidl_notify_p2p_invitation_received(
79     struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
80     const u8 *bssid, int id, int op_freq);
81 void wpas_hidl_notify_p2p_invitation_result(
82     struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
83 void wpas_hidl_notify_p2p_provision_discovery(
84     struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
85     enum p2p_prov_disc_status status, u16 config_methods,
86     unsigned int generated_pin);
87 void wpas_hidl_notify_p2p_sd_response(
88     struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
89     const u8 *tlvs, size_t tlvs_len);
90 void wpas_hidl_notify_ap_sta_authorized(
91     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr);
92 void wpas_hidl_notify_ap_sta_deauthorized(
93     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr);
94 void wpas_hidl_notify_eap_error(struct wpa_supplicant *wpa_s, int error_code);
95 #else   // CONFIG_CTRL_IFACE_HIDL
wpas_hidl_register_interface(struct wpa_supplicant * wpa_s)96 static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s)
97 {
98 	return 0;
99 }
wpas_hidl_unregister_interface(struct wpa_supplicant * wpa_s)100 static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s)
101 {
102 	return 0;
103 }
wpas_hidl_register_network(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)104 static inline int wpas_hidl_register_network(
105     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
106 {
107 	return 0;
108 }
wpas_hidl_unregister_network(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)109 static inline int wpas_hidl_unregister_network(
110     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
111 {
112 	return 0;
113 }
wpas_hidl_notify_state_changed(struct wpa_supplicant * wpa_s)114 static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s)
115 {
116 	return 0;
117 }
wpas_hidl_notify_network_request(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,enum wpa_ctrl_req_type rtype,const char * default_txt)118 static inline int wpas_hidl_notify_network_request(
119     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
120     enum wpa_ctrl_req_type rtype, const char *default_txt)
121 {
122 	return 0;
123 }
wpas_hidl_notify_anqp_query_done(struct wpa_supplicant * wpa_s,const u8 * bssid,const char * result,const struct wpa_bss_anqp * anqp)124 static void wpas_hidl_notify_anqp_query_done(
125     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
126     const struct wpa_bss_anqp *anqp)
127 {
128 }
wpas_hidl_notify_hs20_icon_query_done(struct wpa_supplicant * wpa_s,const u8 * bssid,const char * file_name,const u8 * image,u32 image_length)129 static void wpas_hidl_notify_hs20_icon_query_done(
130     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
131     const u8 *image, u32 image_length)
132 {
133 }
wpas_hidl_notify_hs20_rx_subscription_remediation(struct wpa_supplicant * wpa_s,const char * url,u8 osu_method)134 static void wpas_hidl_notify_hs20_rx_subscription_remediation(
135     struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
136 {
137 }
wpas_hidl_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant * wpa_s,u8 code,u16 reauth_delay,const char * url)138 static void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
139     struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
140 {
141 }
wpas_hidl_notify_disconnect_reason(struct wpa_supplicant * wpa_s)142 static void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_assoc_reject(struct wpa_supplicant * wpa_s)143 static void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_auth_timeout(struct wpa_supplicant * wpa_s)144 static void wpas_hidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_wps_event_fail(struct wpa_supplicant * wpa_s,uint8_t * peer_macaddr,uint16_t config_error,uint16_t error_indication)145 static void wpas_hidl_notify_wps_event_fail(
146     struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
147     uint16_t error_indication)
148 {
149 }
wpas_hidl_notify_bssid_changed(struct wpa_supplicant * wpa_s)150 static void wpas_hidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_wps_event_success(struct wpa_supplicant * wpa_s)151 static void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant * wpa_s)152 static void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
153 {
154 }
155 static void wpas_hidl_notify_p2p_device_found(
156     struct wpa_supplicant *wpa_s, const u8 *addr,
157     const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
158     u8 peer_wfd_device_info_len);
159 {
160 }
wpas_hidl_notify_p2p_device_lost(struct wpa_supplicant * wpa_s,const u8 * p2p_device_addr)161 static void wpas_hidl_notify_p2p_device_lost(
162     struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
163 {
164 }
wpas_hidl_notify_p2p_find_stopped(struct wpa_supplicant * wpa_s)165 static void wpas_hidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_p2p_go_neg_req(struct wpa_supplicant * wpa_s,const u8 * src_addr,u16 dev_passwd_id,u8 go_intent)166 static void wpas_hidl_notify_p2p_go_neg_req(
167     struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
168     u8 go_intent)
169 {
170 }
wpas_hidl_notify_p2p_go_neg_completed(struct wpa_supplicant * wpa_s,const struct p2p_go_neg_results * res)171 static void wpas_hidl_notify_p2p_go_neg_completed(
172     struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
173 {
174 }
wpas_hidl_notify_p2p_group_formation_failure(struct wpa_supplicant * wpa_s,const char * reason)175 static void wpas_hidl_notify_p2p_group_formation_failure(
176     struct wpa_supplicant *wpa_s, const char *reason)
177 {
178 }
wpas_hidl_notify_p2p_group_started(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,int persistent,int client)179 static void wpas_hidl_notify_p2p_group_started(
180     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
181     int client)
182 {
183 }
wpas_hidl_notify_p2p_group_removed(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,const char * role)184 static void wpas_hidl_notify_p2p_group_removed(
185     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
186 {
187 }
wpas_hidl_notify_p2p_invitation_received(struct wpa_supplicant * wpa_s,const u8 * sa,const u8 * go_dev_addr,const u8 * bssid,int id,int op_freq)188 static void wpas_hidl_notify_p2p_invitation_received(
189     struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
190     const u8 *bssid, int id, int op_freq)
191 {
192 }
wpas_hidl_notify_p2p_invitation_result(struct wpa_supplicant * wpa_s,int status,const u8 * bssid)193 static void wpas_hidl_notify_p2p_invitation_result(
194     struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
195 {
196 }
wpas_hidl_notify_p2p_provision_discovery(struct wpa_supplicant * wpa_s,const u8 * dev_addr,int request,enum p2p_prov_disc_status status,u16 config_methods,unsigned int generated_pin)197 static void wpas_hidl_notify_p2p_provision_discovery(
198     struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
199     enum p2p_prov_disc_status status, u16 config_methods,
200     unsigned int generated_pin)
201 {
202 }
wpas_hidl_notify_p2p_sd_response(struct wpa_supplicant * wpa_s,const u8 * sa,u16 update_indic,const u8 * tlvs,size_t tlvs_len)203 static void wpas_hidl_notify_p2p_sd_response(
204     struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
205     const u8 *tlvs, size_t tlvs_len)
206 {
207 }
wpas_hidl_notify_ap_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)208 static void wpas_hidl_notify_ap_sta_authorized(
209     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
210 {
211 }
wpas_hidl_notify_ap_sta_deauthorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)212 static void wpas_hidl_notify_ap_sta_deauthorized(
213     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
214 {
215 }
wpas_hidl_notify_eap_error(struct wpa_supplicant * wpa_s,int error_code)216 static void wpas_hidl_notify_eap_error(
217     struct wpa_supplicant *wpa_s, int error_code)
218 {
219 }
220 #endif  // CONFIG_CTRL_IFACE_HIDL
221 
222 #ifdef _cplusplus
223 }
224 #endif  // _cplusplus
225 
226 #endif  // WPA_SUPPLICANT_HIDL_HIDL_H
227