From patchwork Fri Feb 17 20:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doru X-Patchwork-Id: 9580781 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C644600C5 for ; Fri, 17 Feb 2017 20:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C83E2877C for ; Fri, 17 Feb 2017 20:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 413022877F; Fri, 17 Feb 2017 20:54:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBFD02877C for ; Fri, 17 Feb 2017 20:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934956AbdBQUyP (ORCPT ); Fri, 17 Feb 2017 15:54:15 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35036 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934780AbdBQUyO (ORCPT ); Fri, 17 Feb 2017 15:54:14 -0500 Received: by mail-wm0-f66.google.com with SMTP id u63so4467348wmu.2 for ; Fri, 17 Feb 2017 12:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=P9E2CGXJlUBHNl28p8oaQgIuqwQsmyeBUXoRqr1cyA4=; b=eFQasufnz3WVtr98MXJa3K1rKC4X5tf5ohGJRArC3loGhQFr/uzbx6X35eoHdxVvXd 4NKRgwHiI6a7fMiAYNkuJWYGKGfxmgLbCziwxRRXvcGPxNNAL1FszzE191hPupbq4YHf PCD7Ea0HJbcRfS4RX/DxB3Cm2cc/o4nIOVSBTYTkoJfbTgwcGKBBv8n2ErfdZ8jY2yHe Cd8gvVJl1EIXsW2SOzj6c1l0WCVnrxFf0/Km3vB3e7T6PjFWS3NHC24gHfUvnlpdDiRq 9aknpXNpijeeFZSJORYKVc0k7GM/af6Y8pITHy7/EUfCurZaoqsHR1g8SVusczHV3h0e GYyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P9E2CGXJlUBHNl28p8oaQgIuqwQsmyeBUXoRqr1cyA4=; b=imRGUEsh7aYTmUoSwL6BsQimmMdTulTDpWzDVb3aXOdXIfFiv5TTnRer9xu7KlHcBE tpzg9Prdt9x/3THyCK+pa0SXmWliAch3faivuY+BbD/JesaFqWulTr+NXqt7BIkc2bMz 5M1KygQGcxIgHv7P02N4krY57VG8dwCzdYE4vWkoTf96kMuv5/vL5udNeHQD2BZGpS8G EEqaBahlyiwsnQ1ExOaeXXvXqRXzvKsrhrjPNWh+RkOMJ92Z/CxuKoUi6e2voYlsU996 eNFFuUB0bEJW8lFz599Y/ZHYitl1BnfsvkkOf2PZIwzZ0ZVj4Grqh2+8BivdEMLdUnXs T8nA== X-Gm-Message-State: AMke39m8uqqIVwT+PuLUX3eV0pCVEXXDJA26dOhbXDMPOiUjSHV1XQ0fw1IDSv4klXhmJA== X-Received: by 10.28.148.76 with SMTP id w73mr5715075wmd.74.1487364852966; Fri, 17 Feb 2017 12:54:12 -0800 (PST) Received: from localhost.localdomain ([188.26.223.208]) by smtp.gmail.com with ESMTPSA id 39sm14297953wrv.55.2017.02.17.12.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 12:54:12 -0800 (PST) From: Doru To: linux-wireless@vger.kernel.org, andra.paraschiv7@gmail.com, costin.raiciu@cs.pub.ro, dragos.niculescu@cs.pub.ro Cc: Doru Gucea Subject: [RFC PATCH 2/2 v2] ath9k_htc: Adjust beacon timers for power save Date: Fri, 17 Feb 2017 22:54:06 +0200 Message-Id: <1487364846-4675-1-git-send-email-gucea.doru@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Doru Gucea Each time we receive a beacon we need to adjust the hardware timers for next DTIM and next TBTT. Before this commit, the Power Save behaviour was incorrect. The scenario was: - STA receives a beacon from AP with TIM unset; - mac80211 layers puts the chip to sleep; - chip is woken up by mac80211's software timer reponsible for beacon miss after 7 * beacon_interval period. Normally the chip should sleep at most DTIM period. This commit configures hardware timers for waking up the chip correctly. More details on the wiki: https://github.com/doru91/linux-stable/wiki/Single-Interface-Power-Save Changelog v1: * moved beacon configuration call in the ath9k_htc driver Signed-off-by: Doru Gucea --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a553c91..5403399 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1518,6 +1518,10 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, mutex_lock(&priv->mutex); ath9k_htc_ps_wakeup(priv); + /* adjust beacon timers */ + if (changed && BSS_CHANGED_BEACON_INFO) + ath9k_htc_beacon_config(priv, vif); + if (changed & BSS_CHANGED_ASSOC) { ath_dbg(common, CONFIG, "BSS Changed ASSOC %d\n", bss_conf->assoc);