blob: 045a4faa96660e39d95b5caf7637b1060851eba6 [file] [log] [blame]
Dmitry Shmidte4663042016-04-04 10:07:49 -07001/*
2 * binder 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
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070010#ifndef WPA_SUPPLICANT_BINDER_BINDER_H
11#define WPA_SUPPLICANT_BINDER_BINDER_H
Dmitry Shmidte4663042016-04-04 10:07:49 -070012
13#ifdef _cplusplus
14extern "C" {
15#endif /* _cplusplus */
16
17/**
18 * This is the binder RPC interface entry point to the wpa_supplicant core.
19 * This initializes the binder driver & BinderManager instance and then forwards
20 * all the notifcations from the supplicant core to the BinderManager.
21 */
22struct wpas_binder_priv;
23struct wpa_global;
24
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070025struct wpas_binder_priv *wpas_binder_init(struct wpa_global *global);
Dmitry Shmidte4663042016-04-04 10:07:49 -070026void wpas_binder_deinit(struct wpas_binder_priv *priv);
27
28#ifdef CONFIG_CTRL_IFACE_BINDER
29int wpas_binder_register_interface(struct wpa_supplicant *wpa_s);
30int wpas_binder_unregister_interface(struct wpa_supplicant *wpa_s);
Roshan Piusd3854452016-07-07 16:46:41 -070031int wpas_binder_register_network(
32 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
33int wpas_binder_unregister_network(
34 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
Roshan Piuse8d0d162016-08-01 13:09:26 -070035int wpas_binder_notify_state_changed(struct wpa_supplicant *wpa_s);
Roshan Pius65628ce2016-08-17 13:10:23 -070036int wpas_binder_notify_network_request(
37 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
38 enum wpa_ctrl_req_type rtype, const char *default_txt);
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070039#else /* CONFIG_CTRL_IFACE_BINDER */
Dmitry Shmidte4663042016-04-04 10:07:49 -070040static inline int wpas_binder_register_interface(struct wpa_supplicant *wpa_s)
41{
42 return 0;
43}
44static inline int wpas_binder_unregister_interface(struct wpa_supplicant *wpa_s)
45{
46 return 0;
47}
Roshan Piusd3854452016-07-07 16:46:41 -070048static inline int wpas_binder_register_network(
49 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
50{
51 return 0;
52}
53static inline int wpas_binder_unregister_network(
54 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
55{
56 return 0;
57}
Roshan Piuse8d0d162016-08-01 13:09:26 -070058static inline int wpas_binder_notify_state_changed(struct wpa_supplicant *wpa_s)
59{
60 return 0;
61}
Roshan Pius65628ce2016-08-17 13:10:23 -070062static inline int wpas_binder_notify_network_request(
63 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
64 enum wpa_ctrl_req_type rtype, const char *default_txt)
65{
66 return 0;
67}
Dmitry Shmidte4663042016-04-04 10:07:49 -070068#endif /* CONFIG_CTRL_IFACE_BINDER */
69
70#ifdef _cplusplus
71}
72#endif /* _cplusplus */
73
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070074#endif /* WPA_SUPPLICANT_BINDER_BINDER_H */