• 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 #else   // CONFIG_CTRL_IFACE_HIDL
wpas_hidl_register_interface(struct wpa_supplicant * wpa_s)95 static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s)
96 {
97 	return 0;
98 }
wpas_hidl_unregister_interface(struct wpa_supplicant * wpa_s)99 static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s)
100 {
101 	return 0;
102 }
wpas_hidl_register_network(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)103 static inline int wpas_hidl_register_network(
104     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
105 {
106 	return 0;
107 }
wpas_hidl_unregister_network(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)108 static inline int wpas_hidl_unregister_network(
109     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
110 {
111 	return 0;
112 }
wpas_hidl_notify_state_changed(struct wpa_supplicant * wpa_s)113 static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s)
114 {
115 	return 0;
116 }
wpas_hidl_notify_network_request(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,enum wpa_ctrl_req_type rtype,const char * default_txt)117 static inline int wpas_hidl_notify_network_request(
118     struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
119     enum wpa_ctrl_req_type rtype, const char *default_txt)
120 {
121 	return 0;
122 }
wpas_hidl_notify_anqp_query_done(struct wpa_supplicant * wpa_s,const u8 * bssid,const char * result,const struct wpa_bss_anqp * anqp)123 static void wpas_hidl_notify_anqp_query_done(
124     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
125     const struct wpa_bss_anqp *anqp)
126 {
127 }
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)128 static void wpas_hidl_notify_hs20_icon_query_done(
129     struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
130     const u8 *image, u32 image_length)
131 {
132 }
wpas_hidl_notify_hs20_rx_subscription_remediation(struct wpa_supplicant * wpa_s,const char * url,u8 osu_method)133 static void wpas_hidl_notify_hs20_rx_subscription_remediation(
134     struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
135 {
136 }
wpas_hidl_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant * wpa_s,u8 code,u16 reauth_delay,const char * url)137 static void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
138     struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
139 {
140 }
wpas_hidl_notify_disconnect_reason(struct wpa_supplicant * wpa_s)141 static void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_assoc_reject(struct wpa_supplicant * wpa_s)142 static void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_auth_timeout(struct wpa_supplicant * wpa_s)143 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)144 static void wpas_hidl_notify_wps_event_fail(
145     struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
146     uint16_t error_indication)
147 {
148 }
wpas_hidl_notify_bssid_changed(struct wpa_supplicant * wpa_s)149 static void wpas_hidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
wpas_hidl_notify_wps_event_success(struct wpa_supplicant * wpa_s)150 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)151 static void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
152 {
153 }
154 static void wpas_hidl_notify_p2p_device_found(
155     struct wpa_supplicant *wpa_s, const u8 *addr,
156     const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
157     u8 peer_wfd_device_info_len);
158 {
159 }
wpas_hidl_notify_p2p_device_lost(struct wpa_supplicant * wpa_s,const u8 * p2p_device_addr)160 static void wpas_hidl_notify_p2p_device_lost(
161     struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
162 {
163 }
wpas_hidl_notify_p2p_find_stopped(struct wpa_supplicant * wpa_s)164 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)165 static void wpas_hidl_notify_p2p_go_neg_req(
166     struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
167     u8 go_intent)
168 {
169 }
wpas_hidl_notify_p2p_go_neg_completed(struct wpa_supplicant * wpa_s,const struct p2p_go_neg_results * res)170 static void wpas_hidl_notify_p2p_go_neg_completed(
171     struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
172 {
173 }
wpas_hidl_notify_p2p_group_formation_failure(struct wpa_supplicant * wpa_s,const char * reason)174 static void wpas_hidl_notify_p2p_group_formation_failure(
175     struct wpa_supplicant *wpa_s, const char *reason)
176 {
177 }
wpas_hidl_notify_p2p_group_started(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,int persistent,int client)178 static void wpas_hidl_notify_p2p_group_started(
179     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
180     int client)
181 {
182 }
wpas_hidl_notify_p2p_group_removed(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,const char * role)183 static void wpas_hidl_notify_p2p_group_removed(
184     struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
185 {
186 }
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)187 static void wpas_hidl_notify_p2p_invitation_received(
188     struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
189     const u8 *bssid, int id, int op_freq)
190 {
191 }
wpas_hidl_notify_p2p_invitation_result(struct wpa_supplicant * wpa_s,int status,const u8 * bssid)192 static void wpas_hidl_notify_p2p_invitation_result(
193     struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
194 {
195 }
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)196 static void wpas_hidl_notify_p2p_provision_discovery(
197     struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
198     enum p2p_prov_disc_status status, u16 config_methods,
199     unsigned int generated_pin)
200 {
201 }
wpas_hidl_notify_p2p_sd_response(struct wpa_supplicant * wpa_s,const u8 * sa,u16 update_indic,const u8 * tlvs,size_t tlvs_len)202 static void wpas_hidl_notify_p2p_sd_response(
203     struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
204     const u8 *tlvs, size_t tlvs_len)
205 {
206 }
wpas_hidl_notify_ap_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)207 static void wpas_hidl_notify_ap_sta_authorized(
208     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
209 {
210 }
wpas_hidl_notify_ap_sta_deauthorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)211 static void wpas_hidl_notify_ap_sta_deauthorized(
212     struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
213 {
214 }
215 #endif  // CONFIG_CTRL_IFACE_HIDL
216 
217 #ifdef _cplusplus
218 }
219 #endif  // _cplusplus
220 
221 #endif  // WPA_SUPPLICANT_HIDL_HIDL_H
222