]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Fix inactivity STA timer trigger for driver offload case
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Thu, 16 May 2013 14:44:31 +0000 (20:14 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 24 Nov 2013 10:01:55 +0000 (12:01 +0200)
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>

src/ap/hostapd.c
src/ap/sta_info.c

index efaae853329ecec85ab2fe0e641c8d148a0dbec8..492861e07a42eaf031094caacf384e4674fad0cb 100644 (file)
@@ -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);
+       }
 }
 
 
index 9d28d9ceea4ab753a01d5b452ffd4704ec55b6a1..474597edbcc4ca96dd1f5546364b49c14d863b20 100644 (file)
@@ -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;