aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>2013-05-16 14:44:31 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-24 10:01:55 (GMT)
commit336167c80e4bf46e4c9974e81bb8cf72e56bb75e (patch)
tree861d59075b58e68492f85f639aacd5f9677a828c
parent1245503188621df81d98801987471f2dabe1b382 (diff)
downloadhostap-336167c80e4bf46e4c9974e81bb8cf72e56bb75e.zip
hostap-336167c80e4bf46e4c9974e81bb8cf72e56bb75e.tar.gz
hostap-336167c80e4bf46e4c9974e81bb8cf72e56bb75e.tar.bz2
AP: Fix inactivity STA timer trigger for driver offload case
Some non-mac80211 drivers, such as ath6kl, support STA inactivity timer in firmware and may not provide connected stations' idle time to the userspace. If the driver indicates support for offloaded operation, do not start the inactivity timer in the hostapd. Signed-hostap: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
-rw-r--r--src/ap/hostapd.c16
-rw-r--r--src/ap/sta_info.c15
2 files changed, 18 insertions, 13 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index efaae85..492861e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1980,13 +1980,15 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
} else
wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
- wpa_printf(MSG_DEBUG, "%s: reschedule ap_handle_timer timeout "
- "for " MACSTR " (%d seconds - ap_max_inactivity)",
- __func__, MAC2STR(sta->addr),
- hapd->conf->ap_max_inactivity);
- eloop_cancel_timeout(ap_handle_timer, hapd, sta);
- eloop_register_timeout(hapd->conf->ap_max_inactivity, 0,
- ap_handle_timer, hapd, sta);
+ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) {
+ wpa_printf(MSG_DEBUG, "%s: reschedule ap_handle_timer timeout "
+ "for " MACSTR " (%d seconds - ap_max_inactivity)",
+ __func__, MAC2STR(sta->addr),
+ hapd->conf->ap_max_inactivity);
+ eloop_cancel_timeout(ap_handle_timer, hapd, sta);
+ eloop_register_timeout(hapd->conf->ap_max_inactivity, 0,
+ ap_handle_timer, hapd, sta);
+ }
}
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 9d28d9c..474597e 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -545,13 +545,16 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
sta->acct_interim_interval = hapd->conf->acct_interim_interval;
accounting_sta_get_id(hapd, sta);
+ 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,
+ ap_handle_timer, hapd, sta);
+ }
+
/* initialize STA info data */
- 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,
- ap_handle_timer, hapd, sta);
os_memcpy(sta->addr, addr, ETH_ALEN);
sta->next = hapd->sta_list;
hapd->sta_list = sta;