]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Differentiate between WNM for station and for AP in build
authorAvraham Stern <avraham.stern@intel.com>
Mon, 12 Jun 2017 06:29:27 +0000 (09:29 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 18 Jul 2017 10:28:09 +0000 (13:28 +0300)
Previously, CONFIG_WNM enabled build that supports WNM for both
station mode and AP mode. However, in most wpa_supplicant cases only
station mode WNM is required and there is no need for AP mode WNM.

Add support to differentiate between station mode WNM and AP mode
WNM in wpa_supplicant builds by adding CONFIG_WNM_AP that should be
used when AP mode WNM support is required in addition to station mode
WNM. This allows binary size to be reduced for builds that require
only the station side WNM functionality.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
hostapd/Android.mk
hostapd/Makefile
hostapd/config_file.c
hostapd/ctrl_iface.c
src/ap/drv_callbacks.c
src/ap/ieee802_11.c
src/ap/ieee802_11_shared.c
src/ap/sta_info.c
src/ap/wpa_auth.c
wpa_supplicant/Android.mk
wpa_supplicant/Makefile

index 721fcbbcf42d53730e72fa6f7573d8ba4331694c..86846816d79402bd388a986c2ebc697958b075bc 100644 (file)
@@ -288,7 +288,7 @@ endif
 endif
 
 ifdef CONFIG_WNM
-L_CFLAGS += -DCONFIG_WNM
+L_CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
 OBJS += src/ap/wnm_ap.c
 endif
 
index fb926fba5b0c7c8b5f130f796914f549461720cf..15deb5cd9b03ff5a5027f79e75841a7e3ce8d506 100644 (file)
@@ -332,7 +332,7 @@ endif
 endif
 
 ifdef CONFIG_WNM
-CFLAGS += -DCONFIG_WNM
+CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
 OBJS += ../src/ap/wnm_ap.o
 endif
 
index dfe8ab794c73b207d6c0db8393d768971b39d61a..a398bb1182fa6cfe66dd7a372a92dbc7a1ccc89e 100644 (file)
@@ -3258,12 +3258,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->time_zone = os_strdup(pos);
                if (bss->time_zone == NULL)
                        return 1;
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        } else if (os_strcmp(buf, "wnm_sleep_mode") == 0) {
                bss->wnm_sleep_mode = atoi(pos);
        } else if (os_strcmp(buf, "bss_transition") == 0) {
                bss->bss_transition = atoi(pos);
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 #ifdef CONFIG_INTERWORKING
        } else if (os_strcmp(buf, "interworking") == 0) {
                bss->interworking = atoi(pos);
index c2eadb5b070160daf4c19aad2d7159f85b2ad58e..c2534d1fb3fa03780fba5a7bd5c5827ba8a90a76 100644 (file)
@@ -764,7 +764,7 @@ static int hostapd_ctrl_iface_send_qos_map_conf(struct hostapd_data *hapd,
 #endif /* CONFIG_INTERWORKING */
 
 
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
 
 static int hostapd_ctrl_iface_disassoc_imminent(struct hostapd_data *hapd,
                                                const char *cmd)
@@ -988,7 +988,7 @@ fail:
        return ret;
 }
 
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 
 
 static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd,
@@ -2538,7 +2538,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
                if (hostapd_ctrl_iface_hs20_deauth_req(hapd, buf + 16))
                        reply_len = -1;
 #endif /* CONFIG_HS20 */
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        } else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) {
                if (hostapd_ctrl_iface_disassoc_imminent(hapd, buf + 18))
                        reply_len = -1;
@@ -2548,7 +2548,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
        } else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) {
                if (hostapd_ctrl_iface_bss_tm_req(hapd, buf + 11))
                        reply_len = -1;
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
        } else if (os_strcmp(buf, "GET_CONFIG") == 0) {
                reply_len = hostapd_ctrl_iface_get_config(hapd, reply,
                                                          reply_size);
index f2cb4b7c216093542f434321e20cc06391007b43..ffa8bf1d156b5c9a13c516d808bf658db04e5ae5 100644 (file)
@@ -981,11 +981,11 @@ static void hostapd_action_rx(struct hostapd_data *hapd,
                        mgmt->u.action.u.sa_query_resp.trans_id);
        }
 #endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        if (mgmt->u.action.category == WLAN_ACTION_WNM) {
                ieee802_11_rx_wnm_action_ap(hapd, mgmt, drv_mgmt->frame_len);
        }
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 #ifdef CONFIG_FST
        if (mgmt->u.action.category == WLAN_ACTION_FST && hapd->iface->fst) {
                fst_rx_action(hapd->iface->fst, mgmt, drv_mgmt->frame_len);
index e5a94c2ca7a428c329751b525efb89a0c525a953..7999611463f6497b9a29715c75ef7e5dd14d60cb 100644 (file)
@@ -3458,11 +3458,11 @@ static int handle_action(struct hostapd_data *hapd,
        case WLAN_ACTION_SA_QUERY:
                return hostapd_sa_query_action(hapd, mgmt, len);
 #endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        case WLAN_ACTION_WNM:
                ieee802_11_rx_wnm_action_ap(hapd, mgmt, len);
                return 1;
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 #ifdef CONFIG_FST
        case WLAN_ACTION_FST:
                if (hapd->iface->fst)
index bf6d4cc35a92f88ed7b764c67051dc1a4e776813..902f64fd5a66bf4945a38646b72e4491fadd1c87 100644 (file)
@@ -186,9 +186,9 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
                        *pos |= 0x08; /* Bit 19 - BSS Transition */
                break;
        case 3: /* Bits 24-31 */
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
                *pos |= 0x02; /* Bit 25 - SSID List */
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
                if (hapd->conf->time_advertisement == 2)
                        *pos |= 0x08; /* Bit 27 - UTC TSF Offset */
                if (hapd->conf->interworking)
@@ -254,10 +254,10 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
        if (len < 9 &&
            (hapd->conf->ftm_initiator || hapd->conf->ftm_responder))
                len = 9;
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        if (len < 4)
                len = 4;
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 #ifdef CONFIG_HS20
        if (hapd->conf->hs20 && len < 6)
                len = 6;
@@ -516,7 +516,7 @@ u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid)
 {
        u8 *pos = eid;
 
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        if (hapd->conf->ap_max_inactivity > 0) {
                unsigned int val;
                *pos++ = WLAN_EID_BSS_MAX_IDLE_PERIOD;
@@ -534,7 +534,7 @@ u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid)
                pos += 2;
                *pos++ = 0x00; /* TODO: Protected Keep-Alive Required */
        }
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 
        return pos;
 }
index f515c034d891f970452c75a9c3be4cd751a1e697..1e21282c9484b2bbc413edf2fbc1946f206a26ae 100644 (file)
@@ -617,7 +617,7 @@ void ap_sta_no_session_timeout(struct hostapd_data *hapd, struct sta_info *sta)
 
 static void ap_handle_session_warning_timer(void *eloop_ctx, void *timeout_ctx)
 {
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
        struct hostapd_data *hapd = eloop_ctx;
        struct sta_info *sta = timeout_ctx;
 
@@ -628,7 +628,7 @@ static void ap_handle_session_warning_timer(void *eloop_ctx, void *timeout_ctx)
 
        wnm_send_ess_disassoc_imminent(hapd, sta, sta->hs20_session_info_url,
                                       sta->hs20_disassoc_timer);
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 }
 
 
index b1edce813be850335880171d8e52bed8e3c9d531..863ae832e0103fe70fdccd95a46150cc749bf605 100644 (file)
@@ -3445,7 +3445,7 @@ static int wpa_group_update_sta(struct wpa_state_machine *sm, void *ctx)
 }
 
 
-#ifdef CONFIG_WNM
+#ifdef CONFIG_WNM_AP
 /* update GTK when exiting WNM-Sleep Mode */
 void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm)
 {
@@ -3524,7 +3524,7 @@ int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos)
        return pos - start;
 }
 #endif /* CONFIG_IEEE80211W */
-#endif /* CONFIG_WNM */
+#endif /* CONFIG_WNM_AP */
 
 
 static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
index e77d096230c97aa0ab267edf4fb8f3acb2e93570..6d6d09542ee4d6d2746f0d0c32e227fe17104741 100644 (file)
@@ -858,7 +858,8 @@ ifdef CONFIG_IEEE80211AX
 OBJS += src/ap/ieee802_11_he.c
 endif
 endif
-ifdef CONFIG_WNM
+ifdef CONFIG_WNM_AP
+L_CFLAGS += -DCONFIG_WNM_AP
 OBJS += src/ap/wnm_ap.c
 endif
 ifdef CONFIG_MBO
index 948385b4c9f6994679c21117247a48348d85a1d0..98ff595f4a0e4ca045a69e9f13983517f8a966e6 100644 (file)
@@ -900,7 +900,8 @@ ifdef CONFIG_IEEE80211AX
 OBJS += ../src/ap/ieee802_11_he.o
 endif
 endif
-ifdef CONFIG_WNM
+ifdef CONFIG_WNM_AP
+CFLAGS += -DCONFIG_WNM_AP
 OBJS += ../src/ap/wnm_ap.o
 endif
 ifdef CONFIG_MBO