blob: b1e8f112768a50c398c94690497ca0517a20a485 [file] [log] [blame]
Roshan Pius57ffbcf2016-09-27 09:12:46 -07001/*
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
14extern "C" {
Roshan Pius7c0ebf22016-09-20 15:11:56 -070015#endif // _cplusplus
Roshan Pius57ffbcf2016-09-27 09:12:46 -070016
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 */
22struct wpas_hidl_priv;
23struct wpa_global;
24
25struct wpas_hidl_priv *wpas_hidl_init(struct wpa_global *global);
26void wpas_hidl_deinit(struct wpas_hidl_priv *priv);
27
28#ifdef CONFIG_CTRL_IFACE_HIDL
29int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s);
30int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s);
31int wpas_hidl_register_network(
32 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
33int wpas_hidl_unregister_network(
34 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
35int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s);
36int 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);
Roshan Pius9322a342016-12-12 14:45:02 -080039void 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);
42void 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);
45void wpas_hidl_notify_hs20_rx_subscription_remediation(
46 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
47void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
48 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url);
Roshan Pius0974e962016-12-12 17:05:51 -080049void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s);
50void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s);
Roshan Pius14932752017-01-11 09:48:58 -080051void wpas_hidl_notify_wps_event_fail(
52 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
53 uint16_t error_indication);
54void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s);
55void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
Roshan Pius7c0ebf22016-09-20 15:11:56 -070056#else // CONFIG_CTRL_IFACE_HIDL
Roshan Pius57ffbcf2016-09-27 09:12:46 -070057static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s)
58{
59 return 0;
60}
61static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s)
62{
63 return 0;
64}
65static inline int wpas_hidl_register_network(
66 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
67{
68 return 0;
69}
70static inline int wpas_hidl_unregister_network(
71 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
72{
73 return 0;
74}
75static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s)
76{
77 return 0;
78}
79static inline int wpas_hidl_notify_network_request(
80 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
81 enum wpa_ctrl_req_type rtype, const char *default_txt)
82{
83 return 0;
84}
Roshan Pius9322a342016-12-12 14:45:02 -080085static void wpas_hidl_notify_anqp_query_done(
86 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
87 const struct wpa_bss_anqp *anqp)
88{
89}
90static void wpas_hidl_notify_hs20_icon_query_done(
91 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
92 const u8 *image, u32 image_length)
93{
94}
95static void wpas_hidl_notify_hs20_rx_subscription_remediation(
96 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
97{
98}
99static void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
100 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
101{
102}
Roshan Pius0974e962016-12-12 17:05:51 -0800103static void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
104static void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s) {}
Roshan Pius14932752017-01-11 09:48:58 -0800105static void wpas_hidl_notify_wps_event_fail(
106 struct wpa_supplicant *wpa_s, struct wps_event_fail *fail)
107{
108}
109static void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
110static void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
111{
112}
Roshan Pius7c0ebf22016-09-20 15:11:56 -0700113#endif // CONFIG_CTRL_IFACE_HIDL
Roshan Pius57ffbcf2016-09-27 09:12:46 -0700114
115#ifdef _cplusplus
116}
Roshan Pius7c0ebf22016-09-20 15:11:56 -0700117#endif // _cplusplus
Roshan Pius57ffbcf2016-09-27 09:12:46 -0700118
Roshan Pius7c0ebf22016-09-20 15:11:56 -0700119#endif // WPA_SUPPLICANT_HIDL_HIDL_H