--- a/src/ap/airtime_policy.c +++ b/src/ap/airtime_policy.c @@ -80,8 +80,12 @@ static void count_backlogged_sta(struct if (hostapd_drv_read_sta_data(hapd, &data, sta->addr)) continue; - if (data.backlog_bytes > 0) + if (data.backlog_bytes > 0 || + data.tx_airtime > sta->tx_airtime) { set_new_backlog_time(hapd, sta, &now); + sta->tx_airtime = data.tx_airtime; + } + if (os_reltime_before(&now, &sta->backlogged_until)) num_backlogged++; } --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -286,6 +286,7 @@ struct sta_info { #ifdef CONFIG_AIRTIME_POLICY unsigned int airtime_weight; struct os_reltime backlogged_until; + unsigned long long tx_airtime; #endif /* CONFIG_AIRTIME_POLICY */ };