From patchwork Tue Aug 22 21:47:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ryanhsu@qti.qualcomm.com X-Patchwork-Id: 9916213 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 3BE0D600C5 for ; Tue, 22 Aug 2017 21:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D344288AA for ; Tue, 22 Aug 2017 21:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FE532891A; Tue, 22 Aug 2017 21:47:12 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 3EC63288AA for ; Tue, 22 Aug 2017 21:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbdHVVrI (ORCPT ); Tue, 22 Aug 2017 17:47:08 -0400 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:3456 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752893AbdHVVrH (ORCPT ); Tue, 22 Aug 2017 17:47:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1503438427; x=1534974427; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=pRYCe7deyFwlKFEBxMUf0Mc8uk5PGl0U7yT3UZaSCVk=; b=jgy48cWSL8Ngw6EfPL248uzhOxnDc4G8U+/DyLAdGWYp8aDhK0M5Nkg/ Cg5HZSspMhEnYUOKZDLyzrTw2QcxGmXR1vTt+Q7MH7ulTIaCb3LXXzO4k JYqUMVmILj/RrffYVd9NRFTrQTCTuOAIcS2PmMmlRVmjpYAyJlQNSTMLD w=; X-IronPort-AV: E=Sophos;i="5.41,414,1498546800"; d="scan'208";a="113184719" Received: from unknown (HELO ironmsg01-lv.qualcomm.com) ([10.47.202.180]) by sabertooth01.qualcomm.com with ESMTP; 22 Aug 2017 14:47:07 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8631"; a="37368647" X-MGA-submission: =?us-ascii?q?MDEqIlW9QOotYSO8Ywg97HykWRBfX2IRHeF3/I?= =?us-ascii?q?s4ZE7haaIeOwghtHtMnLvSHhCt98nKMN9aP/gZtHxxrwsAbb7Mh5dSId?= =?us-ascii?q?ZNuB/ZVSfDpDyXMCdoKL2+80iMppewc4iUvcmtzZMIqa3Plys+9kvmqH?= =?us-ascii?q?6w?= Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 22 Aug 2017 14:47:07 -0700 Received: from ryanhsu-linux2.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 22 Aug 2017 14:47:06 -0700 From: To: , CC: Subject: [PATCH v3 2/2] ath10k: Configure and enable the wakeup capability Date: Tue, 22 Aug 2017 14:47:35 -0700 Message-ID: <1503438455-6133-2-git-send-email-ryanhsu@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503438455-6133-1-git-send-email-ryanhsu@qti.qualcomm.com> References: <1503438455-6133-1-git-send-email-ryanhsu@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To NALASEXR01G.na.qualcomm.com (10.49.56.53) 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: Ryan Hsu ACPI will rely on device driver to tell it if the device could support wakeup function when system in D3 state. This has caused some platform can't support remote wakeup correctly, because the ACPI wakeup GPE is not enabled, hence registers the .set_wakeup callback to handle it if device supports wakeup. Tested with QCA6174 hw3.0, firmware ('WLAN.RM.4.4.1-00008-QCARMSWP-1') Signed-off-by: Ryan Hsu --- drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ath/ath10k/wow.c | 14 ++++++++++++++ drivers/net/wireless/ath/ath10k/wow.h | 1 + 3 files changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 2e5d2ca..bbf7da1 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7488,6 +7488,7 @@ static const struct ieee80211_ops ath10k_ops = { #ifdef CONFIG_PM .suspend = ath10k_wow_op_suspend, .resume = ath10k_wow_op_resume, + .set_wakeup = ath10k_wow_op_set_wakeup, #endif #ifdef CONFIG_MAC80211_DEBUGFS .sta_add_debugfs = ath10k_sta_add_debugfs, diff --git a/drivers/net/wireless/ath/ath10k/wow.c b/drivers/net/wireless/ath/ath10k/wow.c index 77100d4..0d46d6d 100644 --- a/drivers/net/wireless/ath/ath10k/wow.c +++ b/drivers/net/wireless/ath/ath10k/wow.c @@ -277,6 +277,18 @@ exit: return ret ? 1 : 0; } +void ath10k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled) +{ + struct ath10k *ar = hw->priv; + + mutex_lock(&ar->conf_mutex); + if (test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT, + ar->running_fw->fw_file.fw_features)) { + device_set_wakeup_enable(ar->dev, enabled); + } + mutex_unlock(&ar->conf_mutex); +} + int ath10k_wow_op_resume(struct ieee80211_hw *hw) { struct ath10k *ar = hw->priv; @@ -336,5 +348,7 @@ int ath10k_wow_init(struct ath10k *ar) ar->wow.wowlan_support.n_patterns = ar->wow.max_num_patterns; ar->hw->wiphy->wowlan = &ar->wow.wowlan_support; + device_set_wakeup_capable(ar->dev, true); + return 0; } diff --git a/drivers/net/wireless/ath/ath10k/wow.h b/drivers/net/wireless/ath/ath10k/wow.h index abbb04b..9745b9d 100644 --- a/drivers/net/wireless/ath/ath10k/wow.h +++ b/drivers/net/wireless/ath/ath10k/wow.h @@ -28,6 +28,7 @@ int ath10k_wow_init(struct ath10k *ar); int ath10k_wow_op_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); int ath10k_wow_op_resume(struct ieee80211_hw *hw); +void ath10k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled); #else