From patchwork Wed Jan 11 16:12:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 9510557 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 1296C60762 for ; Wed, 11 Jan 2017 16:14:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 183AB284C3 for ; Wed, 11 Jan 2017 16:14:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C74628577; Wed, 11 Jan 2017 16:14:44 +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 C7F03284C3 for ; Wed, 11 Jan 2017 16:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764200AbdAKQN7 (ORCPT ); Wed, 11 Jan 2017 11:13:59 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:4523 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764106AbdAKQNz (ORCPT ); Wed, 11 Jan 2017 11:13:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1484151235; x=1515687235; h=cc:from:to:subject:date:message-id:in-reply-to: references; bh=TCnGvcf6vdkP6OgIKNlVh2s18EYTDbYGBf8wHOTHtDQ=; b=hxs0GG3qj3bDb5D3hfCN5lyWbXO2dc9GjifuMFHyR7uz++GiYQdU2zPa MCnh9MmKmFIF6Ao4W6kWpGOUMcF+eC0Ywh2WYy1aAJdXHXrP76GyBU33x 9KI+VY1ICSUJ7Z8p9yBve3eTsN3iryz82P1zqCfgVSGHI5l2VDZZsg4g3 A=; X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="350066648" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine02.qualcomm.com with ESMTP; 11 Jan 2017 08:13:05 -0800 Cc: Dedy Lansky , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez X-IronPort-AV: E=McAfee;i="5700,7163,8405"; a="1343044445" X-Amp-Result: SKIPPED(no attachment in message) Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by Ironmsg04-R.qualcomm.com with ESMTP; 11 Jan 2017 08:13:04 -0800 From: Maya Erez To: Kalle Valo Subject: [PATCH 05/12] wil6210: support new WMI-only FW capability Date: Wed, 11 Jan 2017 18:12:41 +0200 Message-Id: <1484151168-894-6-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484151168-894-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1484151168-894-1-git-send-email-qca_merez@qca.qualcomm.com> 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: Dedy Lansky WMI_ONLY FW is used for testing in production. It cannot be used for scan/connect, etc. In case FW reports this capability, driver will not allow interface up. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/netdev.c | 5 +++-- drivers/net/wireless/ath/wil6210/pcie_bus.c | 10 +++++++--- drivers/net/wireless/ath/wil6210/wmi.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index 353cd71..a92d7bb 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c @@ -24,8 +24,9 @@ static int wil_open(struct net_device *ndev) wil_dbg_misc(wil, "open\n"); - if (debug_fw) { - wil_err(wil, "while in debug_fw mode\n"); + if (debug_fw || + test_bit(WMI_FW_CAPABILITY_WMI_ONLY, wil->fw_capabilities)) { + wil_err(wil, "while in debug_fw or wmi_only mode\n"); return -EINVAL; } diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c index d186115..d6c65a9 100644 --- a/drivers/net/wireless/ath/wil6210/pcie_bus.c +++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c @@ -99,8 +99,10 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil) */ int msi_only = pdev->msi_enabled; bool _use_msi = use_msi; + bool wmi_only = test_bit(WMI_FW_CAPABILITY_WMI_ONLY, + wil->fw_capabilities); - wil_dbg_misc(wil, "if_pcie_enable\n"); + wil_dbg_misc(wil, "if_pcie_enable, wmi_only %d\n", wmi_only); pdev->msi_enabled = 0; @@ -123,9 +125,11 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil) if (rc) goto stop_master; - /* need reset here to obtain MAC */ + /* need reset here to obtain MAC or in case of WMI-only FW, full reset + * and fw loading takes place + */ mutex_lock(&wil->mutex); - rc = wil_reset(wil, false); + rc = wil_reset(wil, wmi_only); mutex_unlock(&wil->mutex); if (rc) goto release_irq; diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h index 4996fc8..ad2782f 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.h +++ b/drivers/net/wireless/ath/wil6210/wmi.h @@ -57,6 +57,7 @@ enum wmi_fw_capability { WMI_FW_CAPABILITY_RF_SECTORS = 2, WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT = 3, WMI_FW_CAPABILITY_DISABLE_AP_SME = 4, + WMI_FW_CAPABILITY_WMI_ONLY = 5, WMI_FW_CAPABILITY_MAX, };