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 | 0974e96 | 2016-12-12 17:05:51 -0800 | [diff] [blame] | 49 | void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s); |
| 50 | void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s); |
Roshan Pius | 1493275 | 2017-01-11 09:48:58 -0800 | [diff] [blame] | 51 | void wpas_hidl_notify_wps_event_fail( |
| 52 | struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error, |
| 53 | uint16_t error_indication); |
| 54 | void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s); |
| 55 | void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s); |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 56 | #else // CONFIG_CTRL_IFACE_HIDL |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 57 | static inline int wpas_hidl_register_interface(struct wpa_supplicant *wpa_s) |
| 58 | { |
| 59 | return 0; |
| 60 | } |
| 61 | static inline int wpas_hidl_unregister_interface(struct wpa_supplicant *wpa_s) |
| 62 | { |
| 63 | return 0; |
| 64 | } |
| 65 | static inline int wpas_hidl_register_network( |
| 66 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 67 | { |
| 68 | return 0; |
| 69 | } |
| 70 | static inline int wpas_hidl_unregister_network( |
| 71 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 72 | { |
| 73 | return 0; |
| 74 | } |
| 75 | static inline int wpas_hidl_notify_state_changed(struct wpa_supplicant *wpa_s) |
| 76 | { |
| 77 | return 0; |
| 78 | } |
| 79 | static inline int wpas_hidl_notify_network_request( |
| 80 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, |
| 81 | enum wpa_ctrl_req_type rtype, const char *default_txt) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
Roshan Pius | 9322a34 | 2016-12-12 14:45:02 -0800 | [diff] [blame] | 85 | static void wpas_hidl_notify_anqp_query_done( |
| 86 | struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result, |
| 87 | const struct wpa_bss_anqp *anqp) |
| 88 | { |
| 89 | } |
| 90 | static void wpas_hidl_notify_hs20_icon_query_done( |
| 91 | struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name, |
| 92 | const u8 *image, u32 image_length) |
| 93 | { |
| 94 | } |
| 95 | static void wpas_hidl_notify_hs20_rx_subscription_remediation( |
| 96 | struct wpa_supplicant *wpa_s, const char *url, u8 osu_method) |
| 97 | { |
| 98 | } |
| 99 | static void wpas_hidl_notify_hs20_rx_deauth_imminent_notice( |
| 100 | struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url) |
| 101 | { |
| 102 | } |
Roshan Pius | 0974e96 | 2016-12-12 17:05:51 -0800 | [diff] [blame] | 103 | static void wpas_hidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {} |
| 104 | static void wpas_hidl_notify_assoc_reject(struct wpa_supplicant *wpa_s) {} |
Roshan Pius | 1493275 | 2017-01-11 09:48:58 -0800 | [diff] [blame] | 105 | static void wpas_hidl_notify_wps_event_fail( |
Roshan Pius | e8e4188 | 2017-01-25 12:26:05 -0800 | [diff] [blame^] | 106 | struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error, |
| 107 | uint16_t error_indication) |
Roshan Pius | 1493275 | 2017-01-11 09:48:58 -0800 | [diff] [blame] | 108 | { |
| 109 | } |
| 110 | static void wpas_hidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {} |
| 111 | static void wpas_hidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s) |
| 112 | { |
| 113 | } |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 114 | #endif // CONFIG_CTRL_IFACE_HIDL |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 115 | |
| 116 | #ifdef _cplusplus |
| 117 | } |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 118 | #endif // _cplusplus |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 119 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 120 | #endif // WPA_SUPPLICANT_HIDL_HIDL_H |