blob: 598120f0254d4f03ea780de85b1817ba4a7fee70 [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 Pius7c0ebf22016-09-20 15:11:56 -070049#else // CONFIG_CTRL_IFACE_HIDL
Roshan Pius57ffbcf2016-09-27 09:12:46 -070050static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s)
51{
52 return 0;
53}
54static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s)
55{
56 return 0;
57}
58static inline int wpas_hidl_register_network(
59 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
60{
61 return 0;
62}
63static inline int wpas_hidl_unregister_network(
64 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
65{
66 return 0;
67}
68static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s)
69{
70 return 0;
71}
72static inline int wpas_hidl_notify_network_request(
73 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
74 enum wpa_ctrl_req_type rtype, const char *default_txt)
75{
76 return 0;
77}
Roshan Pius9322a342016-12-12 14:45:02 -080078static void wpas_hidl_notify_anqp_query_done(
79 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
80 const struct wpa_bss_anqp *anqp)
81{
82}
83static void wpas_hidl_notify_hs20_icon_query_done(
84 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
85 const u8 *image, u32 image_length)
86{
87}
88static void wpas_hidl_notify_hs20_rx_subscription_remediation(
89 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
90{
91}
92static void wpas_hidl_notify_hs20_rx_deauth_imminent_notice(
93 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
94{
95}
Roshan Pius7c0ebf22016-09-20 15:11:56 -070096#endif // CONFIG_CTRL_IFACE_HIDL
Roshan Pius57ffbcf2016-09-27 09:12:46 -070097
98#ifdef _cplusplus
99}
Roshan Pius7c0ebf22016-09-20 15:11:56 -0700100#endif // _cplusplus
Roshan Pius57ffbcf2016-09-27 09:12:46 -0700101
Roshan Pius7c0ebf22016-09-20 15:11:56 -0700102#endif // WPA_SUPPLICANT_HIDL_HIDL_H