Fix the os_none, driver_none build.
Fixes broken method signatures and conditionally includes function
references based on feature macro defines.
Change-Id: Ibbf06e4b1de3ad9f6f4bbac654f0873aff4d2694
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index e163b70..c94adde 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -180,7 +180,7 @@
}
static inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk,
- size_t pmk_len)
+ size_t pmk_len, const u8 *bssid)
{
}
@@ -318,9 +318,9 @@
const u8 *rx_replay_counter)
{
}
-
-static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck,
- const u8 *ptk_kek)
+static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm,
+ const u8 *ptk_kck, size_t ptk_kck_len,
+ const u8 *ptk_kek, size_t ptk_kek_len)
{
}
diff --git a/src/utils/common.h b/src/utils/common.h
index 0b9cc3d..d9e7a00 100644
--- a/src/utils/common.h
+++ b/src/utils/common.h
@@ -147,6 +147,17 @@
#endif /* __CYGWIN__ || CONFIG_NATIVE_WINDOWS */
+#ifndef bswap_16
+#define bswap_16(a) ((((u16) (a) << 8) & 0xff00) | (((u16) (a) >> 8) & 0xff))
+#endif
+
+#ifndef bswap_32
+#define bswap_32(a) ((((u32) (a) << 24) & 0xff000000) | \
+ (((u32) (a) << 8) & 0xff0000) | \
+ (((u32) (a) >> 8) & 0xff00) | \
+ (((u32) (a) >> 24) & 0xff))
+#endif
+
#ifndef WPA_BYTE_SWAP_DEFINED
#ifndef __BYTE_ORDER
@@ -374,17 +385,6 @@
#define __func__ "__func__ not defined"
#endif
-#ifndef bswap_16
-#define bswap_16(a) ((((u16) (a) << 8) & 0xff00) | (((u16) (a) >> 8) & 0xff))
-#endif
-
-#ifndef bswap_32
-#define bswap_32(a) ((((u32) (a) << 24) & 0xff000000) | \
- (((u32) (a) << 8) & 0xff0000) | \
- (((u32) (a) >> 8) & 0xff00) | \
- (((u32) (a) >> 24) & 0xff))
-#endif
-
#ifndef MSG_DONTWAIT
#define MSG_DONTWAIT 0
#endif
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index b1adab7..a1ccbc0 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -899,6 +899,9 @@
static int wpa_config_parse_cipher(int line, const char *value)
{
+#ifdef CONFIG_NO_WPA
+ return -1;
+#else
int val = wpa_parse_cipher(value);
if (val < 0) {
wpa_printf(MSG_ERROR, "Line %d: invalid cipher '%s'.",
@@ -911,12 +914,16 @@
return -1;
}
return val;
+#endif /* CONFIG_NO_WPA */
}
#ifndef NO_CONFIG_WRITE
static char * wpa_config_write_cipher(int cipher)
{
+#ifdef CONFIG_NO_WPA
+ return NULL;
+#else
char *buf = os_zalloc(50);
if (buf == NULL)
return NULL;
@@ -927,6 +934,7 @@
}
return buf;
+#endif /* CONFIG_NO_WPA */
}
#endif /* NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index ef55fdc..2d97cb1 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1151,6 +1151,7 @@
}
sel = ie.group_cipher & ssid->group_cipher;
+#ifndef CONFIG_NO_WPA
wpa_s->group_cipher = wpa_pick_group_cipher(sel);
if (wpa_s->group_cipher < 0) {
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select group "
@@ -1159,8 +1160,10 @@
}
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using GTK %s",
wpa_cipher_txt(wpa_s->group_cipher));
+#endif /* CONFIG_NO_WPA */
sel = ie.pairwise_cipher & ssid->pairwise_cipher;
+#ifndef CONFIG_NO_WPA
wpa_s->pairwise_cipher = wpa_pick_pairwise_cipher(sel, 1);
if (wpa_s->pairwise_cipher < 0) {
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select pairwise "
@@ -1169,6 +1172,7 @@
}
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK %s",
wpa_cipher_txt(wpa_s->pairwise_cipher));
+#endif /* CONFIG_NO_WPA */
sel = ie.key_mgmt & ssid->key_mgmt;
#ifdef CONFIG_SAE