From patchwork Fri Sep 29 16:46:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9978455 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 28D3760311 for ; Fri, 29 Sep 2017 16:46:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A38129538 for ; Fri, 29 Sep 2017 16:46:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EAB628B2D; Fri, 29 Sep 2017 16:46:34 +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 82D6A28B2D for ; Fri, 29 Sep 2017 16:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbdI2Qqb (ORCPT ); Fri, 29 Sep 2017 12:46:31 -0400 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:30056 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbdI2Qq3 (ORCPT ); Fri, 29 Sep 2017 12:46:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1506703589; x=1538239589; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=Gt9a0orITK9Dw/gZc2tYD9j8AYGxJqpb3jjcjV0+Fmo=; b=ohrgb+mWP54etLUDl1H8Ju4ls4xhPZW/20kNnwd3yFNNt6GDG47hX/c1 l00DvHzr33xrLSybdbFIhLkvcpNKqNdBVqf0WMkCq736Tp9Vwm3RdJZFx QMsQcsO91YnnXy4txB1nIR81WKKMRQjdJMjuT9xUIKUsnvMkgmCSgx/Mc w=; X-IronPort-AV: E=Sophos;i="5.42,453,1500966000"; d="scan'208";a="115375714" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by sabertooth01.qualcomm.com with ESMTP; 29 Sep 2017 09:46:29 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8669"; a="1006710039" X-MGA-submission: =?us-ascii?q?MDFOvmH0b+h7WyMMXKjcJgOVwDengptQuqXb18?= =?us-ascii?q?WCJ00L937oD02XBG3umarvVX2A5PsgvgP+2IT3Sr6Vu0gPBqAZVjfASB?= =?us-ascii?q?8lvyYCr3ZlITWkEYvOqhs6h32kxsdGp2x51mcKB6jQ+PE85qKdmGnCHV?= =?us-ascii?q?3V?= Received: from nasanexm03a.na.qualcomm.com ([10.85.0.103]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/AES256-SHA; 29 Sep 2017 09:46:29 -0700 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by nasanexm03a.na.qualcomm.com (10.85.0.103) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Fri, 29 Sep 2017 09:46:28 -0700 Received: from potku.adurom.net (10.80.80.8) by euamsexm01a.eu.qualcomm.com (10.251.127.40) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Fri, 29 Sep 2017 18:46:23 +0200 Subject: [PATCH] ath10k: check power save support in STA mode through FW IE From: Kalle Valo To: CC: Date: Fri, 29 Sep 2017 19:46:18 +0300 Message-ID: <150670357817.24239.7065449335785410650.stgit@potku.adurom.net> User-Agent: StGit/0.17.1-17-ge4e0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To euamsexm01a.eu.qualcomm.com (10.251.127.40) 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: Venkateswara Naralasetty Currently ath10k host enables power save support in station mode by default for all firmwares but Power save for station mode still not supported in some of the firmware versions. Which results in firmware crash while issueing multiple scan commands. Fix this problem by introducing new FW feature flag to check power save support in firmware and then the firmware image can tell to ath10k that power save mode is not supported in station mode. Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 1 + drivers/net/wireless/ath/ath10k/core.h | 3 +++ drivers/net/wireless/ath/ath10k/mac.c | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index a4f635820f35..7cc426c41817 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -377,6 +377,7 @@ static const char *const ath10k_core_fw_feature_str[] = { [ATH10K_FW_FEATURE_BTCOEX_PARAM] = "btcoex-param", [ATH10K_FW_FEATURE_SKIP_NULL_FUNC_WAR] = "skip-null-func-war", [ATH10K_FW_FEATURE_ALLOWS_MESH_BCAST] = "allows-mesh-bcast", + [ATH10K_FW_FEATURE_NO_PS] = "no-ps", }; static unsigned int ath10k_core_get_fw_feature_str(char *buf, diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 949ebb3e967b..643041ef3271 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -612,6 +612,9 @@ enum ath10k_fw_features { */ ATH10K_FW_FEATURE_ALLOWS_MESH_BCAST = 16, + /* Firmware does not support power save in station mode. */ + ATH10K_FW_FEATURE_NO_PS = 17, + /* keep last */ ATH10K_FW_FEATURE_COUNT, }; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 5683f1a5330e..10fb83784832 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -8146,8 +8146,13 @@ int ath10k_mac_register(struct ath10k *ar) BIT(NL80211_IFTYPE_P2P_GO); ieee80211_hw_set(ar->hw, SIGNAL_DBM); - ieee80211_hw_set(ar->hw, SUPPORTS_PS); - ieee80211_hw_set(ar->hw, SUPPORTS_DYNAMIC_PS); + + if (!test_bit(ATH10K_FW_FEATURE_NO_PS, + ar->running_fw->fw_file.fw_features)) { + ieee80211_hw_set(ar->hw, SUPPORTS_PS); + ieee80211_hw_set(ar->hw, SUPPORTS_DYNAMIC_PS); + } + ieee80211_hw_set(ar->hw, MFP_CAPABLE); ieee80211_hw_set(ar->hw, REPORTS_TX_ACK_STATUS); ieee80211_hw_set(ar->hw, HAS_RATE_CONTROL);