Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 1 | /* |
| 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 |
| 14 | extern "C" { |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 15 | #endif // _cplusplus |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 16 | |
| 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 | */ |
| 22 | struct wpas_hidl_priv; |
| 23 | struct wpa_global; |
| 24 | |
| 25 | struct wpas_hidl_priv *wpas_hidl_init(struct wpa_global *global); |
| 26 | void wpas_hidl_deinit(struct wpas_hidl_priv *priv); |
| 27 | |
| 28 | #ifdef CONFIG_CTRL_IFACE_HIDL |
| 29 | int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s); |
| 30 | int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s); |
| 31 | int wpas_hidl_register_network( |
| 32 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); |
| 33 | int wpas_hidl_unregister_network( |
| 34 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); |
| 35 | int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s); |
| 36 | int 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 Pius | 9322a34 | 2016-12-12 14:45:02 -0800 | [diff] [blame^] | 39 | void 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); |
| 42 | void 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); |
| 45 | void wpas_hidl_notify_hs20_rx_subscription_remediation( |
| 46 | struct wpa_supplicant *wpa_s, const char *url, u8 osu_method); |
| 47 | void wpas_hidl_notify_hs20_rx_deauth_imminent_notice( |
| 48 | struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url); |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 49 | #else // CONFIG_CTRL_IFACE_HIDL |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 50 | static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
| 58 | static inline int wpas_hidl_register_network( |
| 59 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 60 | { |
| 61 | return 0; |
| 62 | } |
| 63 | static inline int wpas_hidl_unregister_network( |
| 64 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 65 | { |
| 66 | return 0; |
| 67 | } |
| 68 | static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | static 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 Pius | 9322a34 | 2016-12-12 14:45:02 -0800 | [diff] [blame^] | 78 | static 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 | } |
| 83 | static 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 | } |
| 88 | static void wpas_hidl_notify_hs20_rx_subscription_remediation( |
| 89 | struct wpa_supplicant *wpa_s, const char *url, u8 osu_method) |
| 90 | { |
| 91 | } |
| 92 | static 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 Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 96 | #endif // CONFIG_CTRL_IFACE_HIDL |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 97 | |
| 98 | #ifdef _cplusplus |
| 99 | } |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 100 | #endif // _cplusplus |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 101 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 102 | #endif // WPA_SUPPLICANT_HIDL_HIDL_H |