Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 1 | /* |
| 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 Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 10 | #ifndef WPA_SUPPLICANT_BINDER_BINDER_H |
| 11 | #define WPA_SUPPLICANT_BINDER_BINDER_H |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 12 | |
| 13 | #ifdef _cplusplus |
| 14 | extern "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 | */ |
| 22 | struct wpas_binder_priv; |
| 23 | struct wpa_global; |
| 24 | |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 25 | struct wpas_binder_priv *wpas_binder_init(struct wpa_global *global); |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 26 | void wpas_binder_deinit(struct wpas_binder_priv *priv); |
| 27 | |
| 28 | #ifdef CONFIG_CTRL_IFACE_BINDER |
| 29 | int wpas_binder_register_interface(struct wpa_supplicant *wpa_s); |
| 30 | int wpas_binder_unregister_interface(struct wpa_supplicant *wpa_s); |
Roshan Pius | d385445 | 2016-07-07 16:46:41 -0700 | [diff] [blame] | 31 | int wpas_binder_register_network( |
| 32 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); |
| 33 | int wpas_binder_unregister_network( |
| 34 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); |
Roshan Pius | e8d0d16 | 2016-08-01 13:09:26 -0700 | [diff] [blame] | 35 | int wpas_binder_notify_state_changed(struct wpa_supplicant *wpa_s); |
Roshan Pius | 65628ce | 2016-08-17 13:10:23 -0700 | [diff] [blame] | 36 | int 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 Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 39 | #else /* CONFIG_CTRL_IFACE_BINDER */ |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 40 | static inline int wpas_binder_register_interface(struct wpa_supplicant *wpa_s) |
| 41 | { |
| 42 | return 0; |
| 43 | } |
| 44 | static inline int wpas_binder_unregister_interface(struct wpa_supplicant *wpa_s) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
Roshan Pius | d385445 | 2016-07-07 16:46:41 -0700 | [diff] [blame] | 48 | static inline int wpas_binder_register_network( |
| 49 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 50 | { |
| 51 | return 0; |
| 52 | } |
| 53 | static inline int wpas_binder_unregister_network( |
| 54 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
Roshan Pius | e8d0d16 | 2016-08-01 13:09:26 -0700 | [diff] [blame] | 58 | static inline int wpas_binder_notify_state_changed(struct wpa_supplicant *wpa_s) |
| 59 | { |
| 60 | return 0; |
| 61 | } |
Roshan Pius | 65628ce | 2016-08-17 13:10:23 -0700 | [diff] [blame] | 62 | static 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 Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 68 | #endif /* CONFIG_CTRL_IFACE_BINDER */ |
| 69 | |
| 70 | #ifdef _cplusplus |
| 71 | } |
| 72 | #endif /* _cplusplus */ |
| 73 | |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 74 | #endif /* WPA_SUPPLICANT_BINDER_BINDER_H */ |