wpa_supplicant: Add notifications for ANQP/HS20 events
These events are exposed as callbacks in the HIDL control interface.
So, hookup these notifications from wpa_supplicant core to notify.c.
Will add the HIDL interface changes in a separate CL.
Bug: 31116047
Test: Compiles
Change-Id: Id58198d98546ec9451a5abf0c71da0ac254e77b6
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index e88f147..858636f 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -20,6 +20,7 @@
#include "driver_i.h"
#include "config.h"
#include "scan.h"
+#include "notify.h"
#include "bss.h"
#include "blacklist.h"
#include "gas_query.h"
@@ -439,6 +440,10 @@
RX_HS20_ICON MACSTR " %s %u",
MAC2STR(sa), icon->file_name,
(unsigned int) icon->image_len);
+ wpas_notify_hs20_icon_query_done(wpa_s, sa,
+ icon->file_name,
+ icon->image,
+ icon->image_len);
return 0;
}
}
@@ -1161,6 +1166,7 @@
osu_method, url);
else
wpa_msg(wpa_s, MSG_INFO, HS20_SUBSCRIPTION_REMEDIATION);
+ wpas_notify_hs20_rx_subscription_remediation(wpa_s, url, osu_method);
}
@@ -1174,6 +1180,7 @@
wpa_msg(wpa_s, MSG_INFO, HS20_DEAUTH_IMMINENT_NOTICE "%u %u %s",
code, reauth_delay, url);
+ wpas_notify_hs20_rx_deauth_imminent_notice(wpa_s, code, reauth_delay, url);
if (code == HS20_DEAUTH_REASON_CODE_BSS) {
wpa_printf(MSG_DEBUG, "HS 2.0: Add BSS to blacklist");
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 1fb40c7..d8368aa 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -3025,6 +3025,7 @@
out:
wpa_msg(wpa_s, MSG_INFO, ANQP_QUERY_DONE "addr=" MACSTR " result=%s",
MAC2STR(dst), anqp_result);
+ wpas_notify_anqp_query_done(wpa_s, dst, anqp_result, bss ? bss->anqp : NULL);
}
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index ba96548..9e702f0 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -863,3 +863,43 @@
}
#endif /* CONFIG_P2P */
}
+
+void wpas_notify_anqp_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
+ const char *result,
+ const struct wpa_bss_anqp *anqp)
+{
+#ifdef CONFIG_INTERWORKING
+ if (!wpa_s || !bssid || !anqp)
+ return;
+#endif /* CONFIG_INTERWORKING */
+}
+
+void wpas_notify_hs20_icon_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
+ const char* file_name, const u8* image,
+ u32 image_length)
+{
+#ifdef CONFIG_HS20
+ if (!wpa_s || !bssid || !file_name || !image)
+ return;
+#endif /* CONFIG_HS20 */
+}
+
+void wpas_notify_hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
+ const char* url,
+ u8 osu_method)
+{
+#ifdef CONFIG_HS20
+ if (!wpa_s || !url)
+ return;
+#endif /* CONFIG_HS20 */
+}
+
+void wpas_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s,
+ u8 code, u16 reauth_delay,
+ const char *url)
+{
+#ifdef CONFIG_HS20
+ if (!wpa_s || !url)
+ return;
+#endif /* CONFIG_HS20 */
+}
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index e4d7fbf..2590e9a 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -10,6 +10,7 @@
#define NOTIFY_H
#include "p2p/p2p.h"
+#include "bss.h"
struct wps_credential;
struct wps_event_m2d;
@@ -141,5 +142,16 @@
void wpas_notify_p2p_invitation_received(struct wpa_supplicant *wpa_s,
const u8 *sa, const u8 *go_dev_addr,
const u8 *bssid, int id, int op_freq);
-
+void wpas_notify_anqp_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
+ const char* result,
+ const struct wpa_bss_anqp *anqp);
+void wpas_notify_hs20_icon_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
+ const char* file_name, const u8* image,
+ u32 image_length);
+void wpas_notify_hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
+ const char* url,
+ u8 osu_method);
+void wpas_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s,
+ u8 code, u16 reauth_delay,
+ const char *url);
#endif /* NOTIFY_H */