From patchwork Wed Apr 20 05:31:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 720601 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3K5SksM032031 for ; Wed, 20 Apr 2011 05:28:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123Ab1DTF2o (ORCPT ); Wed, 20 Apr 2011 01:28:44 -0400 Received: from mail-px0-f179.google.com ([209.85.212.179]:33573 "EHLO mail-px0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617Ab1DTF2n (ORCPT ); Wed, 20 Apr 2011 01:28:43 -0400 Received: by pxi2 with SMTP id 2so318654pxi.10 for ; Tue, 19 Apr 2011 22:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:x-mailer:cc:subject; bh=uRa8IkqualovoWWrPEvhgzDVVnhossPLvweNTAm+okU=; b=vK31T0Oo+eR2NV6jj403lj+GWycftMYkHdHMbmMpHLfw/z1zMiMaVhcGCnMbxHPXDA j+coakoaxwvClfJDT+4BmkgHeEMQncy/p801WBBUD+h2tkPuGyylv9OQO9iwGXCK1nIq FWGjI6IPqtbhCeuotdIQRjvdaz0Z3dwA7qPHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:x-mailer:cc:subject; b=mCMLIC8FezN/PKIQiikDiCkA8rld5J4LnHoLImJ2+I2Os/uGWfKMlcSb4qRgrSo15c xuEdfVvrbAwml/Ou0wKnhzUsGrYvGUCoA+K7V5v1r6orCYSZTONEhTtlmswYAakmoS3d fwB8fLTQ64husZArA+8iuSYRVce5tSLLC2PHs= Received: by 10.68.8.2 with SMTP id n2mr1737540pba.245.1303277322928; Tue, 19 Apr 2011 22:28:42 -0700 (PDT) Received: from atheros-test ([182.72.177.186]) by mx.google.com with ESMTPS id k2sm404054pbj.47.2011.04.19.22.28.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 22:28:42 -0700 (PDT) From: Sujith MIME-Version: 1.0 Message-ID: <19886.28574.983271.871943@gargle.gargle.HOWL> Date: Wed, 20 Apr 2011 11:01:10 +0530 To: linville@tuxdriver.com X-Mailer: VM 8.1.1 under 23.3.1 (x86_64-unknown-linux-gnu) CC: linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net Subject: [PATCH 4/5] ath9k_htc: Use power save wrappers when accessing HW Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Apr 2011 05:28:46 +0000 (UTC) From: Sujith Manoharan Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 24 +++++++++++++++++++++--- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index eca7774..894e5ef 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -33,9 +33,15 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, memset(&cmd_rsp, 0, sizeof(cmd_rsp)); + ath9k_htc_ps_wakeup(priv); + WMI_CMD(WMI_INT_STATS_CMDID); - if (ret) + if (ret) { + ath9k_htc_ps_restore(priv); return -EINVAL; + } + + ath9k_htc_ps_restore(priv); len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", "RX", @@ -85,9 +91,15 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf, memset(&cmd_rsp, 0, sizeof(cmd_rsp)); + ath9k_htc_ps_wakeup(priv); + WMI_CMD(WMI_TX_STATS_CMDID); - if (ret) + if (ret) { + ath9k_htc_ps_restore(priv); return -EINVAL; + } + + ath9k_htc_ps_restore(priv); len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", "Xretries", @@ -149,9 +161,15 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf, memset(&cmd_rsp, 0, sizeof(cmd_rsp)); + ath9k_htc_ps_wakeup(priv); + WMI_CMD(WMI_RX_STATS_CMDID); - if (ret) + if (ret) { + ath9k_htc_ps_restore(priv); return -EINVAL; + } + + ath9k_htc_ps_restore(priv); len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", "NoBuf", diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index fbc238a..c8577d5 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1582,6 +1582,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw, int ret = 0; mutex_lock(&priv->mutex); + ath9k_htc_ps_wakeup(priv); switch (action) { case IEEE80211_AMPDU_RX_START: @@ -1607,6 +1608,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw, ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n"); } + ath9k_htc_ps_restore(priv); mutex_unlock(&priv->mutex); return ret;