From patchwork Thu Jan 16 09:18:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3497651 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D1C25C02DC for ; Thu, 16 Jan 2014 09:18:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 960A820170 for ; Thu, 16 Jan 2014 09:18:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D1422015E for ; Thu, 16 Jan 2014 09:18:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026AbaAPJSk (ORCPT ); Thu, 16 Jan 2014 04:18:40 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:64646 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbaAPJSh (ORCPT ); Thu, 16 Jan 2014 04:18:37 -0500 Received: by mail-pa0-f42.google.com with SMTP id kl14so2422864pab.15 for ; Thu, 16 Jan 2014 01:18:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Zw01UIu+jW5i0RsN2+7iaqfhS23mZ0Hv9fow+WbtwcU=; b=ljqWy/gmUsLbp2KEvVNhIHl90anwnE1dULQ9yhY2Zx+CScdNbWFzjSoJmsdGDolNLR IsvUrCRYFkjWIaPHkskgP7nXJNOuSAvPTEU7WVv6XLY2WJtgIcZdS1IZxgIa36qQtZhH WCd4Ip0NeAMHhCo/0f/cLqlxgj7v69/Lqjy9BcJ/Pz5KTWUDjG9XXkKxlpuSolUNitNn QPWlRGsjhi1VK+bCoCFsqQUNZOXUo9IwUvrGcgmtafI5+fXp4G5SoTBn7csGa4ljJw+x TropQMtmlCgwYwB+gMrNFuY7lXlTIDQB7kZ2DTTJyD412BEABoQnLD5aEFzCQAK+X8a6 cGgg== X-Received: by 10.66.65.204 with SMTP id z12mr8652952pas.60.1389863916857; Thu, 16 Jan 2014 01:18:36 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id i10sm17788767pat.11.2014.01.16.01.18.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 01:18:35 -0800 (PST) From: Chun-Yeow Yeoh To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: set the AP keepalive timer Date: Thu, 16 Jan 2014 17:18:24 +0800 Message-Id: <1389863904-7159-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/ath/ath10k/mac.c | 22 ++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 3 +++ 2 files changed, 25 insertions(+) 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 {