aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-12-16 10:45:59 (GMT)
committerJouni Malinen <j@w1.fi>2012-12-16 10:45:59 (GMT)
commite6955ba9f9eb7572539f890583995edcbd9a4730 (patch)
tree208b73e26454dfdc92edbc1d72e10806881961cb /wpa_supplicant/sme.c
parentbd896433af9201ad9a7b648363b242586a8f92fe (diff)
downloadhostap-e6955ba9f9eb7572539f890583995edcbd9a4730.zip
hostap-e6955ba9f9eb7572539f890583995edcbd9a4730.tar.gz
hostap-e6955ba9f9eb7572539f890583995edcbd9a4730.tar.bz2
WNM: Add WNM-Sleep Mode into Extended Capabilities element
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index e273cb3..885219f 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -94,6 +94,7 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_IEEE80211R */
int i, bssid_changed;
struct wpabuf *resp = NULL;
+ u32 ext_capab;
if (bss == NULL) {
wpa_msg(wpa_s, MSG_ERROR, "SME: No scan result available for "
@@ -308,8 +309,16 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_HS20 */
+ ext_capab = 0;
#ifdef CONFIG_INTERWORKING
- if (wpa_s->conf->interworking) {
+ if (wpa_s->conf->interworking)
+ ext_capab |= BIT(31); /* Interworking */
+#endif /* CONFIG_INTERWORKING */
+#ifdef CONFIG_WNM
+ ext_capab |= BIT(17); /* WNM-Sleep Mode */
+#endif /* CONFIG_WNM */
+
+ if (ext_capab) {
u8 *pos = wpa_s->sme.assoc_req_ie;
if (wpa_s->sme.assoc_req_ie_len > 0 && pos[0] == WLAN_EID_RSN)
pos += 2 + pos[1];
@@ -319,12 +328,8 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
wpa_s->sme.assoc_req_ie_len += 6;
*pos++ = WLAN_EID_EXT_CAPAB;
*pos++ = 4;
- *pos++ = 0x00;
- *pos++ = 0x00;
- *pos++ = 0x00;
- *pos++ = 0x80; /* Bit 31 - Interworking */
+ WPA_PUT_LE32(pos, ext_capab);
}
-#endif /* CONFIG_INTERWORKING */
#ifdef CONFIG_SAE
if (params.auth_alg == WPA_AUTH_ALG_SAE) {