From: Jouni Malinen Date: Sat, 20 Mar 2021 10:02:18 +0000 (+0200) Subject: Testing functionality for airtime policy X-Git-Tag: hostap_2_10~369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0c74f0c6bc4851d504518ead2127bc89723d477;p=thirdparty%2Fhostap.git Testing functionality for airtime policy Add a new testing parameter to allow airtime policy implementation to be tested for more coverage even without kernel driver support. Signed-off-by: Jouni Malinen --- diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 62fa51e91..a906637e0 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -1469,6 +1469,8 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd) hapd->ext_mgmt_frame_handling = atoi(value); } else if (os_strcasecmp(cmd, "ext_eapol_frame_io") == 0) { hapd->ext_eapol_frame_io = atoi(value); + } else if (os_strcasecmp(cmd, "force_backlog_bytes") == 0) { + hapd->force_backlog_bytes = atoi(value); #ifdef CONFIG_DPP } else if (os_strcasecmp(cmd, "dpp_config_obj_override") == 0) { os_free(hapd->dpp_config_obj_override); diff --git a/src/ap/airtime_policy.c b/src/ap/airtime_policy.c index 1e67f0d59..abe817c5b 100644 --- a/src/ap/airtime_policy.c +++ b/src/ap/airtime_policy.c @@ -79,6 +79,10 @@ static void count_backlogged_sta(struct hostapd_data *hapd) for (sta = hapd->sta_list; sta; sta = sta->next) { if (hostapd_drv_read_sta_data(hapd, &data, sta->addr)) continue; +#ifdef CONFIG_TESTING_OPTIONS + if (hapd->force_backlog_bytes) + data.backlog_bytes = 1; +#endif /* CONFIG_TESTING_OPTIONS */ if (data.backlog_bytes > 0) set_new_backlog_time(hapd, sta, &now); diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 44f566a42..07d0aaa92 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -354,6 +354,8 @@ struct hostapd_data { int last_bigtk_key_idx; u8 last_bigtk[WPA_BIGTK_MAX_LEN]; size_t last_bigtk_len; + + bool force_backlog_bytes; #endif /* CONFIG_TESTING_OPTIONS */ #ifdef CONFIG_MBO