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