From patchwork Mon Dec 16 22:00:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 3357081 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 858299F314 for ; Mon, 16 Dec 2013 22:01:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A114B20122 for ; Mon, 16 Dec 2013 22:01:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEF0C2011E for ; Mon, 16 Dec 2013 22:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962Ab3LPWBS (ORCPT ); Mon, 16 Dec 2013 17:01:18 -0500 Received: from mail-ob0-f181.google.com ([209.85.214.181]:52234 "EHLO mail-ob0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938Ab3LPWBN (ORCPT ); Mon, 16 Dec 2013 17:01:13 -0500 Received: by mail-ob0-f181.google.com with SMTP id uy5so5521589obc.12 for ; Mon, 16 Dec 2013 14:01:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Qaxd9TpaA8zomtsU7qEOt+y/LuWhuo/OrYo3x6oqNu8=; b=ACmpdH5PG6Ygi7vz/zPwuPjC3PBUKGnmYKYqpLEbaTmCQ1pP4O4AR0k4zumSlllD29 UV5PVmytHuoajiJo86mDkRGw7QfDShBmpntoR8lSruQmqw29UGq4HS4ywxryWBeO+dp9 dSDNRcfIiN2h++YaxK1awLapvEOn69NPZoB6m4jGP+/cwCBYHIoTlxfYMupoBRZPALe9 0F9PrFkkq9uqP+vGEfrgCtRmhX4QuFguPQeXjiU+bkdqEjCicu5Jtc4+cNDXgu5ukTfe MleskHm/CIKGiEuQbS3Qcv9rFcxn1L60h53+4JS4UNvTPd0EVKijInBl64TBA3khbBbL MVvQ== X-Gm-Message-State: ALoCoQlk4LORnwMkcpJ9ebSviYdWAscNjDdQQzqgdQNvqNaVx0NZGFRJhsLShcN3YkIOihJemkYe X-Received: by 10.182.16.33 with SMTP id c1mr13608021obd.4.1387231272563; Mon, 16 Dec 2013 14:01:12 -0800 (PST) Received: from localhost (64-126-112-59.dyn.everestkc.net. [64.126.112.59]) by mx.google.com with ESMTPSA id ru3sm22957370obc.2.2013.12.16.14.01.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Dec 2013 14:01:12 -0800 (PST) From: Seth Forshee To: Johannes Berg Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list@broadcom.com, "John W. Linville" , Stefano Brivio , Arend van Spriel , Seth Forshee Subject: [RFC PATCH 7/8] b43: Allow HWPS state to be changed Date: Mon, 16 Dec 2013 16:00:59 -0600 Message-Id: <1387231260-2849-8-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387231260-2849-1-git-send-email-seth.forshee@canonical.com> References: <1387231260-2849-1-git-send-email-seth.forshee@canonical.com> 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 During background scans mac80211 wants to set powersave at the AP so that frames will be buffered while off-channel. In order to do this on Broadcom chips B43_MACCTL_HWPS needs to be set when transmitting the nullfunc frames to enable powersave, however b43_power_saving_ctl_bits() doesn't allow it to be set. Rework this function a bit to allow setting HWPS. First, initialize the hwps and awake variables based off the macctl register to avoid changing the unintentionally changing the values. It's not really necessary to set awake since it is later forced to true, but it does no harm and might help avoid future problems. Second, remove the force set of hwps to false. No code currently tries to change the hwps state anyway, so this results in no functional change. Signed-off-by: Seth Forshee --- drivers/net/wireless/b43/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ccd24f0a..bc6ba1c 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -1117,6 +1117,10 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags) (ps_flags & B43_PS_DISABLED)); B43_WARN_ON((ps_flags & B43_PS_AWAKE) && (ps_flags & B43_PS_ASLEEP)); + macctl = b43_read32(dev, B43_MMIO_MACCTL); + hwps = !!(macctl & B43_MACCTL_HWPS); + awake = !!(macctl & B43_MACCTL_AWAKE); + if (ps_flags & B43_PS_ENABLED) { hwps = true; } else if (ps_flags & B43_PS_DISABLED) { @@ -1135,11 +1139,9 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags) // successful, set bit26 } -/* FIXME: For now we force awake-on and hwps-off */ - hwps = false; +/* FIXME: For now we force awake-on */ awake = true; - macctl = b43_read32(dev, B43_MMIO_MACCTL); if (hwps) macctl |= B43_MACCTL_HWPS; else