]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add an option to remove WMM-AC
authorChaitanya Tata <chaitanya.mgit@gmail.com>
Mon, 27 Nov 2023 19:03:58 +0000 (00:33 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 3 Dec 2023 09:43:45 +0000 (11:43 +0200)
For a memory constrained system, it may be more important to reduce
binary size than include support for these capabilities.

By default this is enabled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
wpa_supplicant/Android.mk
wpa_supplicant/Makefile
wpa_supplicant/android.config
wpa_supplicant/ctrl_iface.c
wpa_supplicant/defconfig
wpa_supplicant/events.c
wpa_supplicant/wpa_cli.c
wpa_supplicant/wpa_supplicant.c

index 8fccfe7cf8b2eab0d879008005a55a001c5a5eb3..809973a21762a721bd21ca454537dcb7eafa6b11 100644 (file)
@@ -100,7 +100,6 @@ OBJS += src/utils/wpabuf.c
 OBJS += src/utils/bitfield.c
 OBJS += src/utils/ip_addr.c
 OBJS += src/utils/crc32.c
-OBJS += wmm_ac.c
 OBJS += twt.c
 OBJS_p = wpa_passphrase.c
 OBJS_p += src/utils/common.c
@@ -430,6 +429,12 @@ endif
 OBJS += op_classes.c
 endif
 
+ifdef CONFIG_NO_WMM_AC
+L_CFLAGS += -DCONFIG_NO_WMM_AC
+else
+OBJS += wmm_ac.c
+endif
+
 ifdef CONFIG_NO_ROBUST_AV
 L_CFLAGS += -DCONFIG_NO_ROBUST_AV
 else
index 819a0dd88c738c11b29f556d1fd7cba6a1d58dd9..d7d2cceba2419de6868fa90bc5bf373a0c46d54a 100644 (file)
@@ -120,7 +120,6 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
 OBJS_c += ../src/utils/wpa_debug.o
 OBJS_c += ../src/utils/common.o
 OBJS_c += ../src/common/cli.o
-OBJS += wmm_ac.o
 
 ifndef CONFIG_OS
 ifdef CONFIG_NATIVE_WINDOWS
@@ -480,6 +479,12 @@ endif
 OBJS += op_classes.o
 endif
 
+ifdef CONFIG_NO_WMM_AC
+CFLAGS += -DCONFIG_NO_WMM_AC
+else
+OBJS += wmm_ac.o
+endif
+
 ifdef CONFIG_NO_ROBUST_AV
 CFLAGS += -DCONFIG_NO_ROBUST_AV
 else
index 55ddb2a6d83b6c92dfc595c2777d22c0b0cead32..9aff882e2538a6cfc9a6e1c8e275853915abb3e0 100644 (file)
@@ -551,4 +551,7 @@ CONFIG_WEP=y
 # applications; IEEE Std 802.11-2020, 4.3.24; SCS, MSCS, QoS Management
 #CONFIG_NO_ROBUST_AV=y
 
+# Disable support for WMM admission control
+#CONFIG_NO_WMM_AC=y
+
 include $(wildcard $(LOCAL_PATH)/android_config_*.inc)
index 1167dd48d34200425d12b0f90640c1311ea1624b..32f964f9c26593ac87079ecddc4406d4a0f27da0 100644 (file)
@@ -1264,6 +1264,8 @@ static int wpa_supplicant_ctrl_iface_tdls_link_status(
 #endif /* CONFIG_TDLS */
 
 
+#ifndef CONFIG_NO_WMM_AC
+
 static int wmm_ac_ctrl_addts(struct wpa_supplicant *wpa_s, char *cmd)
 {
        char *token, *context = NULL;
@@ -1313,6 +1315,8 @@ static int wmm_ac_ctrl_delts(struct wpa_supplicant *wpa_s, char *cmd)
        return wpas_wmm_ac_delts(wpa_s, tsid);
 }
 
+#endif /* CONFIG_NO_WMM_AC */
+
 
 #ifdef CONFIG_IEEE80211R
 static int wpa_supplicant_ctrl_iface_ft_ds(
@@ -12746,6 +12750,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                reply_len = wpa_supplicant_ctrl_iface_tdls_link_status(
                        wpa_s, buf + 17, reply, reply_size);
 #endif /* CONFIG_TDLS */
+#ifndef CONFIG_NO_WMM_AC
        } else if (os_strcmp(buf, "WMM_AC_STATUS") == 0) {
                reply_len = wpas_wmm_ac_status(wpa_s, reply, reply_size);
        } else if (os_strncmp(buf, "WMM_AC_ADDTS ", 13) == 0) {
@@ -12754,6 +12759,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strncmp(buf, "WMM_AC_DELTS ", 13) == 0) {
                if (wmm_ac_ctrl_delts(wpa_s, buf + 13))
                        reply_len = -1;
+#endif /* CONFIG_NO_WMM_AC */
        } else if (os_strncmp(buf, "SIGNAL_POLL", 11) == 0) {
                reply_len = wpa_supplicant_signal_poll(wpa_s, reply,
                                                       reply_size);
index 4f9d9b6a8a0418eff6a81a52d400391f8cf4250a..60d1bfc5715e79c5ccbdca934b029c6f7e6cd272 100644 (file)
@@ -680,3 +680,6 @@ CONFIG_DPP2=y
 # Disable support for Robust AV streaming for consumer and enterprise Wi-Fi
 # applications; IEEE Std 802.11-2020, 4.3.24; SCS, MSCS, QoS Management
 #CONFIG_NO_ROBUST_AV=y
+
+# Disable support for WMM admission control
+#CONFIG_NO_WMM_AC=y
index 96e706e4af308f13eb1adffdfa15132e147dd38f..4644f54888c98d4af79bce5c2b3bf141baf00a8d 100644 (file)
@@ -4347,6 +4347,7 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
 
        wpas_wps_notify_assoc(wpa_s, bssid);
 
+#ifndef CONFIG_NO_WMM_AC
        if (data) {
                wmm_ac_notify_assoc(wpa_s, data->assoc_info.resp_ies,
                                    data->assoc_info.resp_ies_len,
@@ -4355,6 +4356,7 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
                if (wpa_s->reassoc_same_bss)
                        wmm_ac_restore_tspecs(wpa_s);
        }
+#endif /* CONFIG_NO_WMM_AC */
 
 #if defined(CONFIG_FILS) || defined(CONFIG_MBO)
        bss = wpa_bss_get_bssid(wpa_s, bssid);
@@ -5227,10 +5229,12 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
                " Category=%u DataLen=%d freq=%d MHz",
                MAC2STR(mgmt->sa), category, (int) plen, freq);
 
+#ifndef CONFIG_NO_WMM_AC
        if (category == WLAN_ACTION_WMM) {
                wmm_ac_rx_action(wpa_s, mgmt->da, mgmt->sa, payload, plen);
                return;
        }
+#endif /* CONFIG_NO_WMM_AC */
 
 #ifdef CONFIG_IEEE80211R
        if (category == WLAN_ACTION_FT) {
index 65078edf1b6dc6e88345c442efa8ad892323378a..b1334e2e6cb24717d2043aae8e6a5af10ef12fd6 100644 (file)
@@ -2847,6 +2847,8 @@ static int wpa_cli_cmd_tdls_link_status(struct wpa_ctrl *ctrl, int argc,
 }
 
 
+#ifndef CONFIG_NO_WMM_AC
+
 static int wpa_cli_cmd_wmm_ac_addts(struct wpa_ctrl *ctrl, int argc,
                                    char *argv[])
 {
@@ -2867,6 +2869,8 @@ static int wpa_cli_cmd_wmm_ac_status(struct wpa_ctrl *ctrl, int argc,
        return wpa_ctrl_command(ctrl, "WMM_AC_STATUS");
 }
 
+#endif /* CONFIG_NO_WMM_AC */
+
 
 static int wpa_cli_cmd_tdls_chan_switch(struct wpa_ctrl *ctrl, int argc,
                                        char *argv[])
@@ -3889,6 +3893,7 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
        { "tdls_link_status", wpa_cli_cmd_tdls_link_status, NULL,
          cli_cmd_flag_none,
          "<addr> = TDLS link status with <addr>" },
+#ifndef CONFIG_NO_WMM_AC
        { "wmm_ac_addts", wpa_cli_cmd_wmm_ac_addts, NULL,
          cli_cmd_flag_none,
          "<uplink/downlink/bidi> <tsid=0..7> <up=0..7> [nominal_msdu_size=#] "
@@ -3900,6 +3905,7 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
        { "wmm_ac_status", wpa_cli_cmd_wmm_ac_status, NULL,
          cli_cmd_flag_none,
          "= show status for Wireless Multi-Media Admission-Control" },
+#endif /* CONFIG_NO_WMM_AC */
        { "tdls_chan_switch", wpa_cli_cmd_tdls_chan_switch, NULL,
          cli_cmd_flag_none,
          "<addr> <oper class> <freq> [sec_channel_offset=] [center_freq1=] "
index 24f3e0bc02f558b3ce0232bac3160529ab9fdfdf..ade4d003a98621d6bf12301963ece70ca6550916 100644 (file)
@@ -582,7 +582,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
        wpa_tdls_deinit(wpa_s->wpa);
 #endif /* CONFIG_TDLS */
 
+#ifndef CONFIG_NO_WMM_AC
        wmm_ac_clear_saved_tspecs(wpa_s);
+#endif /* CONFIG_NO_WMM_AC */
        pmksa_candidate_free(wpa_s->wpa);
        ptksa_cache_deinit(wpa_s->ptksa);
        wpa_s->ptksa = NULL;
@@ -699,7 +701,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
                wpa_s->vendor_elem[i] = NULL;
        }
 
+#ifndef CONFIG_NO_WMM_AC
        wmm_ac_notify_disassoc(wpa_s);
+#endif /* CONFIG_NO_WMM_AC */
 
        wpa_s->sched_scan_plans_num = 0;
        os_free(wpa_s->sched_scan_plans);
@@ -1067,8 +1071,10 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
        if (state == WPA_DISCONNECTED || state == WPA_INACTIVE)
                wpa_supplicant_start_autoscan(wpa_s);
 
+#ifndef CONFIG_NO_WMM_AC
        if (old_state >= WPA_ASSOCIATED && wpa_s->wpa_state < WPA_ASSOCIATED)
                wmm_ac_notify_disassoc(wpa_s);
+#endif /* CONFIG_NO_WMM_AC */
 
        if (wpa_s->wpa_state != old_state) {
                wpas_notify_state_changed(wpa_s, wpa_s->wpa_state, old_state);
@@ -2486,7 +2492,9 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
 
        wpa_s->eapol_failed = 0;
        wpa_s->multi_ap_ie = 0;
+#ifndef CONFIG_NO_WMM_AC
        wmm_ac_clear_saved_tspecs(wpa_s);
+#endif /* CONFIG_NO_WMM_AC */
        wpa_s->reassoc_same_bss = 0;
        wpa_s->reassoc_same_ess = 0;
 #ifdef CONFIG_TESTING_OPTIONS
@@ -2497,7 +2505,9 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                wpa_dbg(wpa_s, MSG_DEBUG, "Re-association to the same ESS");
                wpa_s->reassoc_same_ess = 1;
                if (wpa_s->current_bss && wpa_s->current_bss == bss) {
+#ifndef CONFIG_NO_WMM_AC
                        wmm_ac_save_tspecs(wpa_s);
+#endif /* CONFIG_NO_WMM_AC */
                        wpa_s->reassoc_same_bss = 1;
                } else if (wpa_s->current_bss && wpa_s->current_bss != bss) {
                        os_get_reltime(&wpa_s->roam_start);
@@ -7217,7 +7227,9 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
                wpa_s->extended_capa_len = capa.extended_capa_len;
                wpa_s->num_multichan_concurrent =
                        capa.num_multichan_concurrent;
+#ifndef CONFIG_NO_WMM_AC
                wpa_s->wmm_ac_supported = capa.wmm_ac_supported;
+#endif /* CONFIG_NO_WMM_AC */
                wpa_s->max_num_akms = capa.max_num_akms;
 
                if (capa.mac_addr_rand_scan_supported)