Fix CONFIG_NO_WPA compile/link errors
Enabling CONFIG_NO_WPA causes some errors. Fix them.
Bug: 365585450
Test: m
Change-Id: I70523d9864fdf3bdcaac5ba2cf880ccb66887003
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 3e6f88d..2a665d7 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3430,7 +3430,10 @@
static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
- int l, len, found = 0, found_x = 0, wpa_found, rsn_found;
+ int l, len, found = 0, wpa_found, rsn_found;
+#ifndef CONFIG_NO_WPA
+ int found_x = 0;
+#endif /* CONFIG_NO_WPA */
const u8 *p, *ie;
u8 bssid[ETH_ALEN];
bool bssid_known;
@@ -3566,18 +3569,22 @@
wpa_find_assoc_pmkid(wpa_s,
data->assoc_info.authorized);
}
+#ifndef CONFIG_NO_WPA
if (!found_x && p[0] == WLAN_EID_RSNX) {
if (wpa_sm_set_assoc_rsnxe(wpa_s->wpa, p, len))
break;
found_x = 1;
}
+#endif /* CONFIG_NO_WPA */
l -= len;
p += len;
}
if (!found && data->assoc_info.req_ies)
wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
if (!found_x && data->assoc_info.req_ies)
wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
#if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA)
/* The WPA/RSN IE has been updated at this point. Since the Firmware could have roamed
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 982ff6c..e3ed858 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -422,7 +422,9 @@
wpa_sm_set_ap_rsne_override_2(wpa_s->wpa, NULL, 0);
wpa_sm_set_ap_rsnxe_override(wpa_s->wpa, NULL, 0);
wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
wpa_s->rsnxe_len = 0;
wpa_s->pairwise_cipher = WPA_CIPHER_NONE;
wpa_s->group_cipher = WPA_CIPHER_NONE;
@@ -2167,6 +2169,7 @@
return -1;
}
+#ifndef CONFIG_NO_WPA
wpa_s->rsnxe_len = sizeof(wpa_s->rsnxe);
if (wpa_sm_set_assoc_rsnxe_default(wpa_s->wpa, wpa_s->rsnxe,
&wpa_s->rsnxe_len)) {
@@ -2174,6 +2177,7 @@
"RSN: Failed to generate RSNXE");
return -1;
}
+#endif /* CONFIG_NO_WPA */
}
if (0) {
@@ -4296,7 +4300,9 @@
/* Starting new association, so clear the possibly used WPA IE from the
* previous association. */
wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+#ifndef CONFIG_NO_WPA
wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
+#endif /* CONFIG_NO_WPA */
wpa_s->rsnxe_len = 0;
#ifndef CONFIG_NO_ROBUST_AV
wpa_s->mscs_setup_done = false;
@@ -4768,8 +4774,10 @@
}
wpa_supplicant_rsn_supp_set_config(wpa_s, wpa_s->current_ssid);
+#ifndef CONFIG_NO_WPA
if (bss)
wpa_sm_set_ssid(wpa_s->wpa, bss->ssid, bss->ssid_len);
+#endif /* CONFIG_NO_WPA */
wpa_supplicant_initiate_eapol(wpa_s);
if (old_ssid != wpa_s->current_ssid)
wpas_notify_network_changed(wpa_s);
@@ -7524,9 +7532,11 @@
#ifdef CONFIG_PASN
wpa_pasn_sm_set_caps(wpa_s->wpa, wpa_s->drv_flags2);
#endif /* CONFIG_PASN */
+#ifndef CONFIG_NO_WPA
wpa_sm_set_driver_bss_selection(wpa_s->wpa,
!!(wpa_s->drv_flags &
WPA_DRIVER_FLAGS_BSS_SELECTION));
+#endif /* CONFIG_NO_WPA */
if (wpa_s->max_remain_on_chan == 0)
wpa_s->max_remain_on_chan = 1000;