[PATCH] Add an option to remove advanced features
Chaitanya Tata
chaitanya.mgit at gmail.com
Wed Oct 11 08:19:37 PDT 2023
For a memory constrained system, basic Wi-Fi is enough, so, add a
configuration option to compiled out advanced Wi-Fi features but seldom
used as below:
* RRM
* Robust AV
* WMM-AC
Signed-off-by: Chaitanya Tata <Chaitanya.Tata at nordicsemi.no>
---
hostapd/ctrl_iface.c | 2 +
wpa_supplicant/Makefile | 24 ++++-
wpa_supplicant/ctrl_iface.c | 167 ++++++++++++++++--------------
wpa_supplicant/defconfig | 9 ++
wpa_supplicant/events.c | 18 +++-
wpa_supplicant/scan.c | 3 +-
wpa_supplicant/sme.c | 7 +-
wpa_supplicant/wpa_cli.c | 3 +-
wpa_supplicant/wpa_supplicant.c | 35 ++++++-
wpa_supplicant/wpa_supplicant_i.h | 33 +++---
10 files changed, 193 insertions(+), 108 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index f90eb22c4..b1ebb788e 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1299,12 +1299,14 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
hostapd_disassoc_deny_mac(hapd);
} else if (os_strcasecmp(cmd, "accept_mac_file") == 0) {
hostapd_disassoc_accept_mac(hapd);
+#ifdef CONFIG_WMM_AC
} else if (os_strncmp(cmd, "wme_ac_", 7) == 0 ||
os_strncmp(cmd, "wmm_ac_", 7) == 0) {
hapd->parameter_set_count++;
if (ieee802_11_update_beacons(hapd->iface))
wpa_printf(MSG_DEBUG,
"Failed to update beacons with WMM parameters");
+#endif /* CONFIG_WMM_AC */
} else if (os_strcmp(cmd, "wpa_passphrase") == 0 ||
os_strcmp(cmd, "sae_password") == 0 ||
os_strcmp(cmd, "sae_pwe") == 0) {
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 57620fe79..a0934bb93 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -111,10 +111,7 @@ 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
OBJS_p += ../src/utils/common.o
OBJS_p += ../src/utils/wpa_debug.o
@@ -123,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
@@ -445,6 +441,25 @@ ifdef CONFIG_NO_ROAMING
CFLAGS += -DCONFIG_NO_ROAMING
endif
+ifdef CONFIG_RRM
+CFLAGS += -DCONFIG_RRM
+OBJS += rrm.o
+ifdef CONFIG_AP
+OBJS += ../src/ap/rrm.o
+endif
+OBJS += op_classes.o
+endif
+
+ifdef CONFIG_WMM_AC
+CFLAGS += -DCONFIG_WMM_AC
+OBJS += wmm_ac.o
+endif
+
+ifdef CONFIG_ROBUST_AV
+CFLAGS += -DCONFIG_ROBUST_AV
+OBJS += robust_av.o
+endif
+
include ../src/drivers/drivers.mak
ifdef CONFIG_AP
OBJS_d += $(DRV_BOTH_OBJS)
@@ -951,7 +966,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
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index b14c78f80..47548dffa 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -932,8 +932,10 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
return -1;
wnm_set_coloc_intf_elems(wpa_s, elems);
#endif /* CONFIG_WNM */
+#ifdef CONFIG_ROBUST_AV
} else if (os_strcasecmp(cmd, "enable_dscp_policy_capa") == 0) {
wpa_s->enable_dscp_policy_capa = !!atoi(value);
+#endif /* CONFIG_ROBUST_AV */
} else {
value[-1] = '=';
ret = wpa_config_process_global(wpa_s->conf, cmd, -1);
@@ -1260,6 +1262,7 @@ static int wpa_supplicant_ctrl_iface_tdls_link_status(
#endif /* CONFIG_TDLS */
+#ifdef CONFIG_WMM_AC
static int wmm_ac_ctrl_addts(struct wpa_supplicant *wpa_s, char *cmd)
{
char *token, *context = NULL;
@@ -1308,7 +1311,7 @@ static int wmm_ac_ctrl_delts(struct wpa_supplicant *wpa_s, char *cmd)
return wpas_wmm_ac_delts(wpa_s, tsid);
}
-
+#endif /* CONFIG_WMM_AC */
#ifdef CONFIG_IEEE80211R
static int wpa_supplicant_ctrl_iface_ft_ds(
@@ -8327,7 +8330,6 @@ static int wpas_ctrl_iface_wnm_bss_query(struct wpa_supplicant *wpa_s, char *cmd
list);
}
-
static int wpas_ctrl_iface_coloc_intf_report(struct wpa_supplicant *wpa_s,
char *cmd)
{
@@ -8900,7 +8902,9 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
wpa_s->next_scan_bssid_wildcard_ssid = 0;
os_free(wpa_s->select_network_scan_freqs);
wpa_s->select_network_scan_freqs = NULL;
+#ifdef CONFIG_ROBUST_AV
os_memset(&wpa_s->robust_av, 0, sizeof(struct robust_av_data));
+#endif /* CONFIG_ROBUST_AV */
wpa_bss_flush(wpa_s);
if (!dl_list_empty(&wpa_s->bss)) {
@@ -8927,7 +8931,9 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
free_bss_tmp_disallowed(wpa_s);
+#ifdef CONFIG_ROBUST_AV
os_memset(&wpa_s->robust_av, 0, sizeof(struct robust_av_data));
+#endif /* CONFIG_ROBUST_AV */
#ifdef CONFIG_PASN
wpas_pasn_auth_stop(wpa_s);
@@ -10559,7 +10565,7 @@ static int wpas_ctrl_vendor_elem_remove(struct wpa_supplicant *wpa_s, char *cmd)
return res;
}
-
+#ifdef CONFIG_RRM
static void wpas_ctrl_neighbor_rep_cb(void *ctx, struct wpabuf *neighbor_rep)
{
struct wpa_supplicant *wpa_s = ctx;
@@ -10662,7 +10668,6 @@ out:
wpabuf_free(neighbor_rep);
}
-
static int wpas_ctrl_iface_send_neighbor_rep(struct wpa_supplicant *wpa_s,
char *cmd)
{
@@ -10702,7 +10707,7 @@ static int wpas_ctrl_iface_send_neighbor_rep(struct wpa_supplicant *wpa_s,
return ret;
}
-
+#endif /* CONFIG_RRM */
static int wpas_ctrl_iface_erp_flush(struct wpa_supplicant *wpa_s)
{
@@ -11056,76 +11061,6 @@ int wpas_ctrl_cmd_debug_level(const char *cmd)
}
-static int wpas_ctrl_iface_configure_mscs(struct wpa_supplicant *wpa_s,
- const char *cmd)
-{
- size_t frame_classifier_len;
- const char *pos, *end;
- struct robust_av_data *robust_av = &wpa_s->robust_av;
- int val;
-
- /*
- * format:
- * <add|remove|change> [up_bitmap=<hex byte>] [up_limit=<integer>]
- * [stream_timeout=<in TUs>] [frame_classifier=<hex bytes>]
- */
- os_memset(robust_av, 0, sizeof(struct robust_av_data));
- if (os_strncmp(cmd, "add ", 4) == 0) {
- robust_av->request_type = SCS_REQ_ADD;
- } else if (os_strcmp(cmd, "remove") == 0) {
- robust_av->request_type = SCS_REQ_REMOVE;
- robust_av->valid_config = false;
- return wpas_send_mscs_req(wpa_s);
- } else if (os_strncmp(cmd, "change ", 7) == 0) {
- robust_av->request_type = SCS_REQ_CHANGE;
- } else {
- return -1;
- }
-
- pos = os_strstr(cmd, "up_bitmap=");
- if (!pos)
- return -1;
-
- val = hex2byte(pos + 10);
- if (val < 0)
- return -1;
- robust_av->up_bitmap = val;
-
- pos = os_strstr(cmd, "up_limit=");
- if (!pos)
- return -1;
-
- robust_av->up_limit = atoi(pos + 9);
-
- pos = os_strstr(cmd, "stream_timeout=");
- if (!pos)
- return -1;
-
- robust_av->stream_timeout = atoi(pos + 15);
- if (robust_av->stream_timeout == 0)
- return -1;
-
- pos = os_strstr(cmd, "frame_classifier=");
- if (!pos)
- return -1;
-
- pos += 17;
- end = os_strchr(pos, ' ');
- if (!end)
- end = pos + os_strlen(pos);
-
- frame_classifier_len = (end - pos) / 2;
- if (frame_classifier_len > sizeof(robust_av->frame_classifier) ||
- hexstr2bin(pos, robust_av->frame_classifier, frame_classifier_len))
- return -1;
-
- robust_av->frame_classifier_len = frame_classifier_len;
- robust_av->valid_config = true;
-
- return wpas_send_mscs_req(wpa_s);
-}
-
-
#ifdef CONFIG_PASN
static int wpas_ctrl_iface_pasn_start(struct wpa_supplicant *wpa_s, char *cmd)
{
@@ -11227,6 +11162,75 @@ static int wpas_ctrl_iface_pasn_deauthenticate(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_PASN */
+#ifdef CONFIG_ROBUST_AV
+static int wpas_ctrl_iface_configure_mscs(struct wpa_supplicant *wpa_s,
+ const char *cmd)
+{
+ size_t frame_classifier_len;
+ const char *pos, *end;
+ struct robust_av_data *robust_av = &wpa_s->robust_av;
+ int val;
+
+ /*
+ * format:
+ * <add|remove|change> [up_bitmap=<hex byte>] [up_limit=<integer>]
+ * [stream_timeout=<in TUs>] [frame_classifier=<hex bytes>]
+ */
+ os_memset(robust_av, 0, sizeof(struct robust_av_data));
+ if (os_strncmp(cmd, "add ", 4) == 0) {
+ robust_av->request_type = SCS_REQ_ADD;
+ } else if (os_strcmp(cmd, "remove") == 0) {
+ robust_av->request_type = SCS_REQ_REMOVE;
+ robust_av->valid_config = false;
+ return wpas_send_mscs_req(wpa_s);
+ } else if (os_strncmp(cmd, "change ", 7) == 0) {
+ robust_av->request_type = SCS_REQ_CHANGE;
+ } else {
+ return -1;
+ }
+
+ pos = os_strstr(cmd, "up_bitmap=");
+ if (!pos)
+ return -1;
+
+ val = hex2byte(pos + 10);
+ if (val < 0)
+ return -1;
+ robust_av->up_bitmap = val;
+
+ pos = os_strstr(cmd, "up_limit=");
+ if (!pos)
+ return -1;
+
+ robust_av->up_limit = atoi(pos + 9);
+
+ pos = os_strstr(cmd, "stream_timeout=");
+ if (!pos)
+ return -1;
+
+ robust_av->stream_timeout = atoi(pos + 15);
+ if (robust_av->stream_timeout == 0)
+ return -1;
+
+ pos = os_strstr(cmd, "frame_classifier=");
+ if (!pos)
+ return -1;
+
+ pos += 17;
+ end = os_strchr(pos, ' ');
+ if (!end)
+ end = pos + os_strlen(pos);
+
+ frame_classifier_len = (end - pos) / 2;
+ if (frame_classifier_len > sizeof(robust_av->frame_classifier) ||
+ hexstr2bin(pos, robust_av->frame_classifier, frame_classifier_len))
+ return -1;
+
+ robust_av->frame_classifier_len = frame_classifier_len;
+ robust_av->valid_config = true;
+
+ return wpas_send_mscs_req(wpa_s);
+}
static int set_type4_frame_classifier(const char *cmd,
struct type4_params *param)
@@ -11923,6 +11927,7 @@ static int wpas_ctrl_iface_send_dscp_query(struct wpa_supplicant *wpa_s,
return wpas_send_dscp_query(wpa_s, pos + 12, os_strlen(pos + 12));
}
+#endif /* CONFIG_ROBUST_AV */
static int wpas_ctrl_iface_mlo_signal_poll(struct wpa_supplicant *wpa_s,
@@ -12707,6 +12712,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 */
+#ifdef CONFIG_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) {
@@ -12715,6 +12721,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_WMM_AC */
} else if (os_strncmp(buf, "SIGNAL_POLL", 11) == 0) {
reply_len = wpa_supplicant_signal_poll(wpa_s, reply,
reply_size);
@@ -12851,9 +12858,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;
+#ifdef CONFIG_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_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) {
@@ -13026,9 +13035,6 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = -1;
#endif /* CONFIG_DPP3 */
#endif /* CONFIG_DPP */
- } else if (os_strncmp(buf, "MSCS ", 5) == 0) {
- if (wpas_ctrl_iface_configure_mscs(wpa_s, buf + 5))
- reply_len = -1;
#ifdef CONFIG_PASN
} else if (os_strncmp(buf, "PASN_START ", 11) == 0) {
if (wpas_ctrl_iface_pasn_start(wpa_s, buf + 11) < 0)
@@ -13041,6 +13047,10 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpas_ctrl_iface_pasn_deauthenticate(wpa_s, buf + 12) < 0)
reply_len = -1;
#endif /* CONFIG_PASN */
+#ifdef CONFIG_ROBUST_AV
+ } else if (os_strncmp(buf, "MSCS ", 5) == 0) {
+ if (wpas_ctrl_iface_configure_mscs(wpa_s, buf + 5))
+ reply_len = -1;
} else if (os_strncmp(buf, "SCS ", 4) == 0) {
if (wpas_ctrl_iface_configure_scs(wpa_s, buf + 4))
reply_len = -1;
@@ -13050,6 +13060,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strncmp(buf, "DSCP_QUERY ", 11) == 0) {
if (wpas_ctrl_iface_send_dscp_query(wpa_s, buf + 11))
reply_len = -1;
+#endif /* CONFIG_ROBUST_AV */
} else if (os_strcmp(buf, "MLO_STATUS") == 0) {
reply_len = wpas_ctrl_iface_mlo_status(wpa_s, reply,
reply_size);
diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig
index a4f20d439..c3a1cc130 100644
--- a/wpa_supplicant/defconfig
+++ b/wpa_supplicant/defconfig
@@ -652,3 +652,12 @@ CONFIG_DPP2=y
# design is still subject to change. As such, this should not yet be enabled in
# production use.
#CONFIG_PASN=y
+
+# Radio Measurement (IEEE 802.11k)
+CONFIG_RRM=y
+
+# WMM admission control
+CONFIG_WMM_AC=y
+
+# Robust AV streaming for consumer and enterprise Wi-Fi applications 802.11-202 (4.3.24)
+CONFIG_ROBUST_AV=y
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index f205b91d5..ac827d849 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -386,7 +386,9 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
wpa_s->key_mgmt = 0;
wpa_s->allowed_key_mgmts = 0;
+#ifdef CONFIG_RRM
wpas_rrm_reset(wpa_s);
+#endif /* CONFIG_RRM */
wpa_s->wnmsleep_used = 0;
wnm_clear_coloc_intf_reporting(wpa_s);
wpa_s->disable_mbo_oce = 0;
@@ -2305,9 +2307,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;
+#ifdef CONFIG_RRM
if (own_request && data &&
wpas_beacon_rep_scan_process(wpa_s, scan_res, &data->scan_info) > 0)
goto scan_work_done;
+#endif /* CONFIG_RRM */
if ((wpa_s->conf->ap_scan == 2 && !wpas_wps_searching(wpa_s)))
goto scan_work_done;
@@ -3321,10 +3325,12 @@ no_pfs:
data->assoc_info.resp_ies_len);
#endif /* CONFIG_IEEE80211R */
+#ifdef CONFIG_ROBUST_AV
if (bssid_known)
wpas_handle_assoc_resp_mscs(wpa_s, bssid,
data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len);
+#endif /* CONFIG_ROBUST_AV */
/* WPA/RSN IE from Beacon/ProbeResp */
p = data->assoc_info.beacon_ies;
@@ -3379,8 +3385,10 @@ no_pfs:
wpa_s->assoc_freq = data->assoc_info.freq;
+#ifdef CONFIG_ROBUST_AV
wpas_handle_assoc_resp_qos_mgmt(wpa_s, data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len);
+#endif /* CONFIG_ROBUST_AV */
return 0;
}
@@ -3862,6 +3870,7 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
wpas_wps_notify_assoc(wpa_s, bssid);
+#ifdef CONFIG_WMM_AC
if (data) {
wmm_ac_notify_assoc(wpa_s, data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len,
@@ -3870,6 +3879,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_WMM_AC */
#if defined(CONFIG_FILS) || defined(CONFIG_MBO)
bss = wpa_bss_get_bssid(wpa_s, bssid);
@@ -4722,10 +4732,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);
+#ifdef CONFIG_WMM_AC
if (category == WLAN_ACTION_WMM) {
wmm_ac_rx_action(wpa_s, mgmt->da, mgmt->sa, payload, plen);
return;
}
+#endif /* CONFIG_WMM_AC */
#ifdef CONFIG_IEEE80211R
if (category == WLAN_ACTION_FT) {
@@ -4797,6 +4809,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_INTERWORKING */
+#ifdef CONFIG_RRM
if (category == WLAN_ACTION_RADIO_MEASUREMENT &&
payload[0] == WLAN_RRM_RADIO_MEASUREMENT_REQUEST) {
wpas_rrm_handle_radio_measurement_request(wpa_s, mgmt->sa,
@@ -4819,6 +4832,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
rssi);
return;
}
+#endif /* CONFIG_RRM */
#ifdef CONFIG_FST
if (mgmt->u.action.category == WLAN_ACTION_FST && wpa_s->fst) {
@@ -4838,7 +4852,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
return;
}
#endif /* CONFIG_DPP */
-
+#ifdef CONFIG_ROBUST_AV
if (category == WLAN_ACTION_ROBUST_AV_STREAMING &&
payload[0] == ROBUST_AV_SCS_RESP) {
wpas_handle_robust_av_scs_recv_action(wpa_s, mgmt->sa,
@@ -4859,7 +4873,7 @@ static void wpas_event_rx_mgmt_action(struct wpa_supplicant *wpa_s,
payload + 4, plen - 4);
return;
}
-
+#endif /* CONFIG_ROBUST_AV */
wpas_p2p_rx_action(wpa_s, mgmt->da, mgmt->sa, mgmt->bssid,
category, payload, plen, freq);
if (wpa_s->ifmsh)
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index c3984a40c..5e0347221 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -258,9 +258,10 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
/* Clear the scan_res_handler */
wpa_s->scan_res_handler = NULL;
}
-
+#ifdef CONFIG_RRM
if (wpa_s->beacon_rep_data.token)
wpas_rrm_refuse_request(wpa_s);
+#endif /* CONFIG_RRM */
return;
}
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index bb04652f5..ead939037 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -909,11 +909,12 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
sme_auth_handle_rrm(wpa_s, bss);
+#ifdef CONFIG_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_RRM */
if (params.p2p)
wpa_drv_get_ext_capa(wpa_s, WPA_IF_P2P_CLIENT);
else
@@ -2387,7 +2388,7 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
}
pfs_fail:
#endif /* CONFIG_DPP2 */
-
+#ifdef CONFIG_RRM
wpa_s->mscs_setup_done = false;
if (wpa_bss_ext_capab(wpa_s->current_bss, WLAN_EXT_CAPAB_MSCS) &&
wpa_s->robust_av.valid_config) {
@@ -2421,7 +2422,7 @@ pfs_fail:
wpabuf_free(mscs_ie);
}
mscs_fail:
-
+#endif /* CONFIG_RRM */
if (ssid && ssid->multi_ap_backhaul_sta) {
size_t multi_ap_ie_len;
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index effc7b3bc..4d557275b 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -2830,7 +2830,7 @@ static int wpa_cli_cmd_tdls_link_status(struct wpa_ctrl *ctrl, int argc,
return wpa_cli_cmd(ctrl, "TDLS_LINK_STATUS", 1, argc, argv);
}
-
+#ifdef CONFIG_WMM_AC
static int wpa_cli_cmd_wmm_ac_addts(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
@@ -2850,6 +2850,7 @@ static int wpa_cli_cmd_wmm_ac_status(struct wpa_ctrl *ctrl, int argc,
{
return wpa_ctrl_command(ctrl, "WMM_AC_STATUS");
}
+#endif /* CONFIG_WMM_AC */
static int wpa_cli_cmd_tdls_chan_switch(struct wpa_ctrl *ctrl, int argc,
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 69f228919..a8bb5637e 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -582,7 +582,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
wpa_tdls_deinit(wpa_s->wpa);
#endif /* CONFIG_TDLS */
+#ifdef CONFIG_WMM_AC
wmm_ac_clear_saved_tspecs(wpa_s);
+#endif /* CONFIG_WMM_AC */
pmksa_candidate_free(wpa_s->wpa);
ptksa_cache_deinit(wpa_s->ptksa);
wpa_s->ptksa = NULL;
@@ -698,9 +700,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
wpabuf_free(wpa_s->vendor_elem[i]);
wpa_s->vendor_elem[i] = NULL;
}
-
+#ifdef CONFIG_WMM_AC
wmm_ac_notify_disassoc(wpa_s);
-
+#endif /* CONFIG_WMM_AC */
wpa_s->sched_scan_plans_num = 0;
os_free(wpa_s->sched_scan_plans);
wpa_s->sched_scan_plans = NULL;
@@ -715,7 +717,9 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
wpabuf_free(wpa_s->lci);
wpa_s->lci = NULL;
+#ifdef CONFIG_RRM
wpas_clear_beacon_rep_data(wpa_s);
+#endif /* CONFIG_RRM */
#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
#ifdef CONFIG_MESH
@@ -747,8 +751,10 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
#ifdef CONFIG_PASN
wpas_pasn_auth_stop(wpa_s);
#endif /* CONFIG_PASN */
+#ifdef CONFIG_ROBUST_AV
wpas_scs_deinit(wpa_s);
wpas_dscp_deinit(wpa_s);
+#endif /* CONFIG_ROBUST_AV */
}
@@ -1058,9 +1064,10 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
if (state == WPA_DISCONNECTED || state == WPA_INACTIVE)
wpa_supplicant_start_autoscan(wpa_s);
+#ifdef CONFIG_WMM_AC
if (old_state >= WPA_ASSOCIATED && wpa_s->wpa_state < WPA_ASSOCIATED)
wmm_ac_notify_disassoc(wpa_s);
-
+#endif /* CONFIG_WMM_AC */
if (wpa_s->wpa_state != old_state) {
wpas_notify_state_changed(wpa_s, wpa_s->wpa_state, old_state);
@@ -2448,7 +2455,9 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_s->eapol_failed = 0;
wpa_s->multi_ap_ie = 0;
+#ifdef CONFIG_WMM_AC
wmm_ac_clear_saved_tspecs(wpa_s);
+#endif /* CONFIG_WMM_AC */
wpa_s->reassoc_same_bss = 0;
wpa_s->reassoc_same_ess = 0;
#ifdef CONFIG_TESTING_OPTIONS
@@ -2459,7 +2468,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) {
+#ifdef CONFIG_WMM_AC
wmm_ac_save_tspecs(wpa_s);
+#endif /* CONFIG_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);
@@ -3206,8 +3217,10 @@ static int wpas_populate_wfa_capa(struct wpa_supplicant *wpa_s,
size_t wfa_ie_len, buf_len;
os_memset(wfa_capa, 0, sizeof(wfa_capa));
+#ifdef CONFIG_ROBUST_AV
if (wpa_s->enable_dscp_policy_capa)
wfa_capa[0] |= WFA_CAPA_QM_DSCP_POLICY;
+#endif /* CONFIG_ROBUST_AV */
if (wpa_is_non_eht_scs_traffic_desc_supported(bss))
wfa_capa[0] |= WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC;
@@ -3471,13 +3484,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 */
+#ifdef CONFIG_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_RRM */
/*
* Workaround: Add Extended Capabilities element only if the AP
* included this element in Beacon/Probe Response frames. Some older
@@ -3703,6 +3717,7 @@ pfs_fail:
if (wpa_s->disable_mscs_support)
goto mscs_end;
#endif /* CONFIG_TESTING_OPTIONS */
+#ifdef CONFIG_RRM
if (wpa_bss_ext_capab(bss, WLAN_EXT_CAPAB_MSCS) &&
wpa_s->robust_av.valid_config) {
struct wpabuf *mscs_ie;
@@ -3733,7 +3748,7 @@ pfs_fail:
wpabuf_free(mscs_ie);
}
mscs_end:
-
+#endif /* CONFIG_RRM */
wpa_ie_len = wpas_populate_wfa_capa(wpa_s, bss, wpa_ie, wpa_ie_len,
max_wpa_ie_len);
@@ -4017,7 +4032,9 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
wpa_sm_set_assoc_rsnxe(wpa_s->wpa, NULL, 0);
wpa_s->rsnxe_len = 0;
+#ifdef CONFIG_ROBUST_AV
wpa_s->mscs_setup_done = false;
+#endif /* CONFIG_ROBUST_AV */
wpa_ie = wpas_populate_assoc_ies(wpa_s, bss, ssid, ¶ms, NULL);
if (!wpa_ie) {
@@ -4465,8 +4482,10 @@ static void wpa_supplicant_clear_connection(struct wpa_supplicant *wpa_s,
if (old_ssid != wpa_s->current_ssid)
wpas_notify_network_changed(wpa_s);
+#ifdef CONFIG_ROBUST_AV
wpas_scs_deinit(wpa_s);
wpas_dscp_deinit(wpa_s);
+#endif /* CONFIG_ROBUST_AV */
eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL);
}
@@ -5767,7 +5786,9 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
#ifdef CONFIG_TESTING_OPTIONS
dl_list_init(&wpa_s->drv_signal_override);
#endif /* CONFIG_TESTING_OPTIONS */
+#ifdef CONFIG_ROBUST_AV
dl_list_init(&wpa_s->active_scs_ids);
+#endif /* CONFIG_ROBUST_AV */
return wpa_s;
}
@@ -7142,7 +7163,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;
+#ifdef CONFIG_WMM_AC
wpa_s->wmm_ac_supported = capa.wmm_ac_supported;
+#endif /* CONFIG_WMM_AC */
wpa_s->max_num_akms = capa.max_num_akms;
if (capa.mac_addr_rand_scan_supported)
@@ -7296,7 +7319,9 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
if (wpas_init_ext_pw(wpa_s) < 0)
return -1;
+#ifdef CONFIG_RRM
wpas_rrm_reset(wpa_s);
+#endif /* CONFIG_RRM */
wpas_sched_scan_plans_set(wpa_s, wpa_s->conf->sched_scan_plans);
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index c44413e4e..b7cd0c2fb 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -1536,34 +1536,40 @@ struct wpa_supplicant {
unsigned int multi_ap_ie:1;
unsigned int multi_ap_backhaul:1;
unsigned int multi_ap_fronthaul:1;
+#ifdef CONFIG_RRM
struct robust_av_data robust_av;
bool mscs_setup_done;
+ struct scs_robust_av_data scs_robust_av_req;
+ u8 scs_dialog_token;
+ struct dl_list active_scs_ids;
+ bool ongoing_scs_req;
+ u8 dscp_req_dialog_token;
+ u8 dscp_query_dialog_token;
+ unsigned int enable_dscp_policy_capa:1;
+ unsigned int connection_dscp:1;
+ unsigned int wait_for_dscp_req:1;
+#endif /* CONFIG_RRM */
bool wps_scan_done; /* Set upon receiving scan results event */
bool supp_pbc_active; /* Set for interface when PBC is triggered */
bool wps_overlap;
-
#ifdef CONFIG_PASN
struct pasn_data pasn;
struct wpa_radio_work *pasn_auth_work;
unsigned int pasn_count;
struct pasn_auth *pasn_params;
#endif /* CONFIG_PASN */
- struct scs_robust_av_data scs_robust_av_req;
- u8 scs_dialog_token;
+
+ struct wpa_signal_info last_signal_info;
+
+#ifdef CONFIG_PASN
+ struct wpas_pasn pasn;
+ struct wpa_radio_work *pasn_auth_work;
+#endif /* CONFIG_PASN */
#ifdef CONFIG_TESTING_OPTIONS
unsigned int disable_scs_support:1;
unsigned int disable_mscs_support:1;
#endif /* CONFIG_TESTING_OPTIONS */
- struct dl_list active_scs_ids;
- bool ongoing_scs_req;
- u8 dscp_req_dialog_token;
- u8 dscp_query_dialog_token;
- unsigned int enable_dscp_policy_capa:1;
- unsigned int connection_dscp:1;
- unsigned int wait_for_dscp_req:1;
-
- struct wpa_signal_info last_signal_info;
};
@@ -1700,7 +1706,7 @@ int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent,
bool flow_type, u8 flow_id, bool protection,
u8 twt_channel, u8 control);
int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags);
-
+#ifdef CONFIG_RRM
void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
const u8 *report, size_t report_len);
@@ -1718,6 +1724,7 @@ void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
const u8 *frame, size_t len,
int rssi);
void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
+#endif /* CONFIG_RRM */
int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
struct wpa_scan_results *scan_res,
struct scan_info *info);
--
2.25.1
More information about the Hostap
mailing list