diff mbox

ath10k: set the AP keepalive timer

Message ID 1389863904-7159-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Chun-Yeow Yeoh Jan. 16, 2014, 9:18 a.m. UTC
Set the AP keepalive timer as following:
ap_keepalive_min_idle_inactive_time_secs to 60 seconds
ap_keepalive_max_idle_inactive_time_secs to 120 seconds
ap_keepalive_max_unresponsive_time_secs to 300 seconds

This ensure that the WMI_PEER_STA_KICKOUT_EVENTID is triggered
by the FW only once the unresponsive timer is expired.

Tested with firmware version 999.999.0.636 but the timer
is still default to 100 seconds. Tested with firmware 
version 10.1.467-1, the timer is set according to 
ap_keepalive_max_unresponsive_time_secs.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 drivers/net/wireless/ath/ath10k/mac.c |   22 ++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h |    3 +++
 2 files changed, 25 insertions(+)

Comments

Kalle Valo Jan. 16, 2014, 9:27 a.m. UTC | #1
Chun-Yeow Yeoh <yeohchunyeow@gmail.com> writes:

> Set the AP keepalive timer as following:
> ap_keepalive_min_idle_inactive_time_secs to 60 seconds
> ap_keepalive_max_idle_inactive_time_secs to 120 seconds
> ap_keepalive_max_unresponsive_time_secs to 300 seconds
>
> This ensure that the WMI_PEER_STA_KICKOUT_EVENTID is triggered
> by the FW only once the unresponsive timer is expired.
>
> Tested with firmware version 999.999.0.636 but the timer
> is still default to 100 seconds. Tested with firmware 
> version 10.1.467-1, the timer is set according to 
> ap_keepalive_max_unresponsive_time_secs.
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

Heh, bad timing. Yesterday I implemented STA quick kickout and in that
patch I set the same parameters as you did. I just used longer values to
avoid inactivity timeouts triggering in the firmware. We have the same
functionality in hostapd, so there's no need to use the one in firmware.

I'll send my patch after lunch, please take a look at that and see if
it's ok.
Chun-Yeow Yeoh Jan. 16, 2014, 9:32 a.m. UTC | #2
> Heh, bad timing. Yesterday I implemented STA quick kickout and in that
> patch I set the same parameters as you did. I just used longer values to
> avoid inactivity timeouts triggering in the firmware. We have the same
> functionality in hostapd, so there's no need to use the one in firmware.
>
> I'll send my patch after lunch, please take a look at that and see if
> it's ok.
Ok, no problem.

I am annoying that immediately getting continuous
WMI_PEER_STA_KICKOUT_EVENTID message even though the STA is active
when tested with firmware 10.1.467-1.

----
Chun-Yeow
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 776e364..2141034 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2313,6 +2313,28 @@  static int ath10k_add_interface(struct ieee80211_hw *hw,
 		ret = ath10k_wmi_pdev_set_param(ar, param_id, 0);
 		if (ret)
 			ath10k_warn("Failed to disable STA KICKOUT\n");
+
+		/* Set the AP keepalive timer */
+		vdev_param =
+			ar->wmi.vdev_param->ap_keepalive_min_idle_inactive_time_secs;
+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+			WMI_VDEV_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS);
+		if (ret)
+			ath10k_warn("Failed to set keepalive min idle timer\n");
+
+		vdev_param =
+			ar->wmi.vdev_param->ap_keepalive_max_idle_inactive_time_secs;
+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+			WMI_VDEV_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS);
+		if (ret)
+			ath10k_warn("Failed to set keepalive max idle timer\n");
+
+		vdev_param =
+			ar->wmi.vdev_param->ap_keepalive_max_unresponsive_time_secs;
+		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+			WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS);
+		if (ret)
+			ath10k_warn("Failed to set keepalive unresponsive timer\n");
 	}
 
 	if (arvif->vdev_type == WMI_VDEV_TYPE_STA) {
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 4b5e7d3..7ce002a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -3080,6 +3080,9 @@  struct wmi_vdev_param_map {
 };
 
 #define WMI_VDEV_PARAM_UNSUPPORTED 0
+#define WMI_VDEV_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS 60
+#define WMI_VDEV_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS 120
+#define WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS 300
 
 /* the definition of different VDEV parameters */
 enum wmi_vdev_param {