sta->power_capab = 0;
}
+ if (elems->bss_max_idle_period &&
+ hapd->conf->max_acceptable_idle_period) {
+ u16 req;
+
+ req = WPA_GET_LE16(elems->bss_max_idle_period);
+ if (req <= hapd->conf->max_acceptable_idle_period)
+ sta->max_idle_period = req;
+ else if (hapd->conf->max_acceptable_idle_period >
+ hapd->conf->ap_max_inactivity)
+ sta->max_idle_period =
+ hapd->conf->max_acceptable_idle_period;
+ }
+
return WLAN_STATUS_SUCCESS;
}
#endif /* CONFIG_IEEE80211AX */
p = hostapd_eid_ext_capab(hapd, p, false);
- p = hostapd_eid_bss_max_idle_period(hapd, p);
+ p = hostapd_eid_bss_max_idle_period(hapd, p, sta->max_idle_period);
if (sta && sta->qos_map_enabled)
p = hostapd_eid_qos_map_set(hapd, p);
struct sta_info *sta = timeout_ctx;
unsigned long next_time = 0;
int reason;
+ int max_inactivity = hapd->conf->ap_max_inactivity;
wpa_printf(MSG_DEBUG, "%s: %s: " MACSTR " flags=0x%x timeout_next=%d",
hapd->conf->iface, __func__, MAC2STR(sta->addr), sta->flags,
return;
}
+ if (sta->max_idle_period)
+ max_inactivity = (sta->max_idle_period * 1024 + 999) / 1000;
+
if ((sta->flags & WLAN_STA_ASSOC) &&
(sta->timeout_next == STA_NULLFUNC ||
sta->timeout_next == STA_DISASSOC)) {
* Anyway, try again after the next inactivity timeout,
* but do not disconnect the station now.
*/
- next_time = hapd->conf->ap_max_inactivity + fuzz;
+ next_time = max_inactivity + fuzz;
} else if (inactive_sec == -ENOENT) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
"Station " MACSTR " has lost its driver entry",
/* Avoid sending client probe on removed client */
sta->timeout_next = STA_DISASSOC;
goto skip_poll;
- } else if (inactive_sec < hapd->conf->ap_max_inactivity) {
+ } else if (inactive_sec < max_inactivity) {
/* station activity detected; reset timeout state */
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
"Station " MACSTR " has been active %is ago",
MAC2STR(sta->addr), inactive_sec);
sta->timeout_next = STA_NULLFUNC;
- next_time = hapd->conf->ap_max_inactivity + fuzz -
- inactive_sec;
+ next_time = max_inactivity + fuzz - inactive_sec;
} else {
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
"Station " MACSTR " has been "
"inactive too long: %d sec, max allowed: %d",
MAC2STR(sta->addr), inactive_sec,
- hapd->conf->ap_max_inactivity);
+ max_inactivity);
if (hapd->conf->skip_inactivity_poll)
sta->timeout_next = STA_DISASSOC;
/* data nullfunc frame poll did not produce TX errors; assume
* station ACKed it */
sta->timeout_next = STA_NULLFUNC;
- next_time = hapd->conf->ap_max_inactivity;
+ next_time = max_inactivity;
}
skip_poll:
{
struct sta_info *sta;
int i;
+ int max_inactivity = hapd->conf->ap_max_inactivity;
sta = ap_get_sta(hapd, addr);
if (sta)
}
sta->supported_rates_len = i;
+ if (sta->max_idle_period)
+ max_inactivity = (sta->max_idle_period * 1024 + 999) / 1000;
+
if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) {
wpa_printf(MSG_DEBUG, "%s: register ap_handle_timer timeout "
"for " MACSTR " (%d seconds - ap_max_inactivity)",
__func__, MAC2STR(addr),
- hapd->conf->ap_max_inactivity);
- eloop_register_timeout(hapd->conf->ap_max_inactivity, 0,
+ max_inactivity);
+ eloop_register_timeout(max_inactivity, 0,
ap_handle_timer, hapd, sta);
}