]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add an option to remove RRM and supported operating class indication
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:43 +0000 (11:43 +0200)
Removing radio measurements and supported operating class indication
might be needed to reduce binary size for a memory constrained system
that does not need more advanced features. However, removing these is
not recommended since they can help the AP manage the network and STA
steering.

By default this functionality is enabled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
12 files changed:
src/ap/hostapd.c
src/ap/ieee802_11.c
wpa_supplicant/Android.mk
wpa_supplicant/Makefile
wpa_supplicant/android.config
wpa_supplicant/ctrl_iface.c
wpa_supplicant/defconfig
wpa_supplicant/dpp_supplicant.c
wpa_supplicant/events.c
wpa_supplicant/scan.c
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c

index 0fcc4378c04e1064a3aa72c9c23ac63d27474ab6..fea3d8b3c436c97538c3c990084280f4caca1bfc 100644 (file)
@@ -557,7 +557,9 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
        hapd->setup_complete_cb = NULL;
 #endif /* CONFIG_MESH */
 
+#ifndef CONFIG_NO_RRM
        hostapd_clean_rrm(hapd);
+#endif /* CONFIG_NO_RRM */
        fils_hlp_deinit(hapd);
 
 #ifdef CONFIG_OCV
index 701acaffd80197efab43f47ccf842e4acf593e81..e85b0635f318bd538d3f0c02edc0fedecb9ffa9a 100644 (file)
@@ -6067,9 +6067,11 @@ static int handle_action(struct hostapd_data *hapd,
                                return 1;
                }
                break;
+#ifndef CONFIG_NO_RRM
        case WLAN_ACTION_RADIO_MEASUREMENT:
                hostapd_handle_radio_measurement(hapd, (const u8 *) mgmt, len);
                return 1;
+#endif /* CONFIG_NO_RRM */
        }
 
        hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
@@ -6674,7 +6676,9 @@ static void handle_action_cb(struct hostapd_data *hapd,
                             size_t len, int ok)
 {
        struct sta_info *sta;
+#ifndef CONFIG_NO_RRM
        const struct rrm_measurement_report_element *report;
+#endif /* CONFIG_NO_RRM */
 
 #ifdef CONFIG_DPP
        if (len >= IEEE80211_HDRLEN + 6 &&
@@ -6728,6 +6732,7 @@ static void handle_action_cb(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_HS20 */
 
+#ifndef CONFIG_NO_RRM
        if (len < 24 + 5 + sizeof(*report))
                return;
        report = (const struct rrm_measurement_report_element *)
@@ -6738,6 +6743,7 @@ static void handle_action_cb(struct hostapd_data *hapd,
            report->len >= 3 &&
            report->type == MEASURE_TYPE_BEACON)
                hostapd_rrm_beacon_req_tx_status(hapd, mgmt, len, ok);
+#endif /* CONFIG_NO_RRM */
 }
 
 
index 5b0ca2e3be2ced5302ffe5749c9dd9ef2efaebb4..83922621b984d0bb87471a3389b74f5bf08618d2 100644 (file)
@@ -101,8 +101,6 @@ OBJS += src/utils/bitfield.c
 OBJS += src/utils/ip_addr.c
 OBJS += src/utils/crc32.c
 OBJS += wmm_ac.c
-OBJS += op_classes.c
-OBJS += rrm.c
 OBJS += twt.c
 OBJS += robust_av.c
 OBJS_p = wpa_passphrase.c
@@ -423,6 +421,16 @@ ifdef CONFIG_NO_TKIP
 L_CFLAGS += -DCONFIG_NO_TKIP
 endif
 
+ifdef CONFIG_NO_RRM
+L_CFLAGS += -DCONFIG_NO_RRM
+else
+OBJS += rrm.c
+ifdef CONFIG_AP
+OBJS += src/ap/rrm.c
+endif
+OBJS += op_classes.c
+endif
+
 
 include $(LOCAL_PATH)/src/drivers/drivers.mk
 
@@ -906,7 +914,6 @@ OBJS += src/ap/beacon.c
 OBJS += src/ap/bss_load.c
 OBJS += src/ap/eap_user_db.c
 OBJS += src/ap/neighbor_db.c
-OBJS += src/ap/rrm.c
 OBJS += src/ap/ieee802_11_ht.c
 ifdef CONFIG_IEEE80211AC
 OBJS += src/ap/ieee802_11_vht.c
index 8adbc3b414c1be1f00aacdbc7b6544713eae9c39..2be4a5d76ef68b0336afce0e71b3df0ecd96accc 100644 (file)
@@ -111,8 +111,6 @@ OBJS += ../src/utils/wpabuf.o
 OBJS += ../src/utils/bitfield.o
 OBJS += ../src/utils/ip_addr.o
 OBJS += ../src/utils/crc32.o
-OBJS += op_classes.o
-OBJS += rrm.o
 OBJS += twt.o
 OBJS += robust_av.o
 OBJS_p = wpa_passphrase.o
@@ -473,6 +471,16 @@ ifdef CONFIG_NO_LOAD_DYNAMIC_EAP
 CFLAGS += -DCONFIG_NO_LOAD_DYNAMIC_EAP
 endif
 
+ifdef CONFIG_NO_RRM
+CFLAGS += -DCONFIG_NO_RRM
+else
+OBJS += rrm.o
+ifdef CONFIG_AP
+OBJS += ../src/ap/rrm.o
+endif
+OBJS += op_classes.o
+endif
+
 include ../src/drivers/drivers.mak
 ifdef CONFIG_AP
 OBJS_d += $(DRV_BOTH_OBJS)
@@ -979,7 +987,6 @@ OBJS += ../src/ap/beacon.o
 OBJS += ../src/ap/bss_load.o
 OBJS += ../src/ap/eap_user_db.o
 OBJS += ../src/ap/neighbor_db.o
-OBJS += ../src/ap/rrm.o
 OBJS += ../src/ap/ieee802_11_ht.o
 ifdef CONFIG_IEEE80211AC
 OBJS += ../src/ap/ieee802_11_vht.o
index 283f8eb0a995518405d7affa0aa3c0adafd05a5d..c2da557c9b09a82a6351448fe8bf65b696a6be08 100644 (file)
@@ -542,4 +542,9 @@ CONFIG_WIFI_DISPLAY=y
 # be completely removed in a future release.
 CONFIG_WEP=y
 
+# Disable support for Radio Measurement (IEEE 802.11k) and supported operating
+# class indication. Removing these is not recommended since they can help the
+# AP manage the network and STA steering.
+#CONFIG_NO_RRM=y
+
 include $(wildcard $(LOCAL_PATH)/android_config_*.inc)
index b716fa774ee975a4570966170a35c29c1cd5f966..a46c12a3fdf95d65cd2db1125eabcaf34fb10bfb 100644 (file)
@@ -10505,6 +10505,8 @@ static int wpas_ctrl_vendor_elem_remove(struct wpa_supplicant *wpa_s, char *cmd)
 }
 
 
+#ifndef CONFIG_NO_RRM
+
 static void wpas_ctrl_neighbor_rep_cb(void *ctx, struct wpabuf *neighbor_rep)
 {
        struct wpa_supplicant *wpa_s = ctx;
@@ -10648,6 +10650,8 @@ static int wpas_ctrl_iface_send_neighbor_rep(struct wpa_supplicant *wpa_s,
        return ret;
 }
 
+#endif /* CONFIG_NO_RRM */
+
 
 static int wpas_ctrl_iface_erp_flush(struct wpa_supplicant *wpa_s)
 {
@@ -12873,9 +12877,11 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strncmp(buf, "VENDOR_ELEM_REMOVE ", 19) == 0) {
                if (wpas_ctrl_vendor_elem_remove(wpa_s, buf + 19) < 0)
                        reply_len = -1;
+#ifndef CONFIG_NO_RRM
        } else if (os_strncmp(buf, "NEIGHBOR_REP_REQUEST", 20) == 0) {
                if (wpas_ctrl_iface_send_neighbor_rep(wpa_s, buf + 20))
                        reply_len = -1;
+#endif /* CONFIG_NO_RRM */
        } else if (os_strcmp(buf, "ERP_FLUSH") == 0) {
                wpas_ctrl_iface_erp_flush(wpa_s);
        } else if (os_strncmp(buf, "MAC_RAND_SCAN ", 14) == 0) {
index 8422a095fcf3b2479c4b2be2fc471649623f663f..27ca6ba40ab46fdbb8ecbd1d4b5c337a010c1bc9 100644 (file)
@@ -671,3 +671,8 @@ CONFIG_DPP2=y
 # design is still subject to change. As such, this should not yet be enabled in
 # production use.
 #CONFIG_PASN=y
+
+# Disable support for Radio Measurement (IEEE 802.11k) and supported operating
+# class indication. Removing these is not recommended since they can help the
+# AP manage the network and STA steering.
+#CONFIG_NO_RRM=y
index b1a1e0ee03321b58103bddac763bc8df27f03c47..4dd6a2ce1e567bbadbebc342abebe28e672299ad 100644 (file)
@@ -1915,7 +1915,11 @@ static void wpas_dpp_start_gas_client(struct wpa_supplicant *wpa_s)
        offchannel_send_action_done(wpa_s);
        wpas_dpp_listen_stop(wpa_s);
 
+#ifdef CONFIG_NO_RRM
+       supp_op_classes = NULL;
+#else /* CONFIG_NO_RRM */
        supp_op_classes = wpas_supp_op_classes(wpa_s);
+#endif /* CONFIG_NO_RRM */
        buf = dpp_build_conf_req_helper(auth, wpa_s->conf->dpp_name,
                                        wpa_s->dpp_netrole,
                                        wpa_s->conf->dpp_mud_url,
index 26059a1adac52bd1fbe707d875432205f272fb9e..ad3dcd9d3e640dd97207b1e3d594497484c45221 100644 (file)
@@ -382,7 +382,9 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
        wpa_s->key_mgmt = 0;
        wpa_s->allowed_key_mgmts = 0;
 
+#ifndef CONFIG_NO_RRM
        wpas_rrm_reset(wpa_s);
+#endif /* CONFIG_NO_RRM */
        wpa_s->wnmsleep_used = 0;
        wnm_clear_coloc_intf_reporting(wpa_s);
        wpa_s->disable_mbo_oce = 0;
@@ -2470,9 +2472,11 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
        if (sme_proc_obss_scan(wpa_s) > 0)
                goto scan_work_done;
 
+#ifndef CONFIG_NO_RRM
        if (own_request && data &&
            wpas_beacon_rep_scan_process(wpa_s, scan_res, &data->scan_info) > 0)
                goto scan_work_done;
+#endif /* CONFIG_NO_RRM */
 
        if (ml_link_probe_scan(wpa_s))
                goto scan_work_done;
@@ -5294,6 +5298,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_INTERWORKING */
 
+#ifndef CONFIG_NO_RRM
        if (category == WLAN_ACTION_RADIO_MEASUREMENT &&
            payload[0] == WLAN_RRM_RADIO_MEASUREMENT_REQUEST) {
                wpas_rrm_handle_radio_measurement_request(wpa_s, mgmt->sa,
@@ -5316,6 +5321,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
                                                         rssi);
                return;
        }
+#endif /* CONFIG_NO_RRM */
 
 #ifdef CONFIG_FST
        if (mgmt->u.action.category == WLAN_ACTION_FST && wpa_s->fst) {
index 4ed20b62dbc0f238d5509a74023669f10b0dc4e8..a8555579916ef8a3b4180f975d420538683d8a72 100644 (file)
@@ -261,8 +261,10 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
                        wpa_s->scan_res_handler = NULL;
                }
 
+#ifndef CONFIG_NO_RRM
                if (wpa_s->beacon_rep_data.token)
                        wpas_rrm_refuse_request(wpa_s);
+#endif /* CONFIG_NO_RRM */
 
                return;
        }
index d5a4785eaa7adc5a62445e78c1c4a419da2f1fa7..5e3ddafc03b2864f35bb15ce8469ff333859fc9d 100644 (file)
@@ -874,10 +874,12 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
 
        sme_auth_handle_rrm(wpa_s, bss);
 
+#ifndef CONFIG_NO_RRM
        wpa_s->sme.assoc_req_ie_len += wpas_supp_op_class_ie(
                wpa_s, ssid, bss,
                wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len,
                sizeof(wpa_s->sme.assoc_req_ie) - wpa_s->sme.assoc_req_ie_len);
+#endif /* CONFIG_NO_RRM */
 
        if (params.p2p)
                wpa_drv_get_ext_capa(wpa_s, WPA_IF_P2P_CLIENT);
index c4c58b75707dd7e9e8578cb2ef54e172470cf266..95a9de614d59d9c5b04ad2bbd7eb7a9454d678a1 100644 (file)
@@ -715,7 +715,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
 
        wpabuf_free(wpa_s->lci);
        wpa_s->lci = NULL;
+#ifndef CONFIG_NO_RRM
        wpas_clear_beacon_rep_data(wpa_s);
+#endif /* CONFIG_NO_RRM */
 
 #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
 #ifdef CONFIG_MESH
@@ -3499,12 +3501,14 @@ static u8 * wpas_populate_assoc_ies(
        os_memset(wpa_s->p2p_ip_addr_info, 0, sizeof(wpa_s->p2p_ip_addr_info));
 #endif /* CONFIG_P2P */
 
+#ifndef CONFIG_NO_RRM
        if (bss) {
                wpa_ie_len += wpas_supp_op_class_ie(wpa_s, ssid, bss,
                                                    wpa_ie + wpa_ie_len,
                                                    max_wpa_ie_len -
                                                    wpa_ie_len);
        }
+#endif /* CONFIG_NO_RRM */
 
        /*
         * Workaround: Add Extended Capabilities element only if the AP
@@ -7352,7 +7356,9 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
        if (wpas_init_ext_pw(wpa_s) < 0)
                return -1;
 
+#ifndef CONFIG_NO_RRM
        wpas_rrm_reset(wpa_s);
+#endif /* CONFIG_NO_RRM */
 
        wpas_sched_scan_plans_set(wpa_s, wpa_s->conf->sched_scan_plans);