From patchwork Sun Jan 18 05:10:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 5652861 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D12769F333 for ; Sun, 18 Jan 2015 05:11:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F5412037E for ; Sun, 18 Jan 2015 05:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E4F02035B for ; Sun, 18 Jan 2015 05:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbbARFK5 (ORCPT ); Sun, 18 Jan 2015 00:10:57 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:42176 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbbARFKz (ORCPT ); Sun, 18 Jan 2015 00:10:55 -0500 Received: by mail-pd0-f179.google.com with SMTP id v10so12036664pde.10; Sat, 17 Jan 2015 21:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=aN8JFGaBMj+uNnfE7IsbkyHMrWUKvPMYpLPesSnqsCw=; b=crvrhDwXYqUs1aqei8kdO8Ns+IGfhr8a6g5wDsx+WDCMyhxaLIdYdVuHIc0VkleF6l VrWotyGUX92vVYa7myGrETJERghjvLSXTZ3abkgRXibvtckbYD4tFD+sXvvCbkvYPltT LWcEJn/nb+oSMNk4hhsRwa5wZsaPCWnDiPqN6Pynz/56PejvD0RjLRtihgVCyAc3bqrY P9Uz9MI3yN8lbWjN4SjCTvCcHuOvW28aQIWCfGpsZGDel8r8K6/rzdeh/D44CSvAOrx3 Q2I4m+sKAmPO5Z6xXFMzck7rgqxmzN1onIPW+gKAuDmxverTEnKjmsCJDevPVx1razMC vQIA== X-Received: by 10.66.179.7 with SMTP id dc7mr34594670pac.24.1421557854489; Sat, 17 Jan 2015 21:10:54 -0800 (PST) Received: from warmcat.com (114-36-241-182.dynamic.hinet.net. [114.36.241.182]) by mx.google.com with ESMTPSA id gi6sm8017408pbd.93.2015.01.17.21.10.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Jan 2015 21:10:53 -0800 (PST) Subject: [PATCH 2/7] net: wireless: wcn36xx: get chip type from platform ops From: Andy Green To: Kalle Valo , Eugene Krasnikov Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Sun, 18 Jan 2015 13:10:49 +0800 Message-ID: <20150118051049.31866.47265.stgit@114-36-241-182.dynamic.hinet.net> In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net> References: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 Autodetecting the chip type does not work well. Stop attempting to do it and require a platform op that tells us what the chip is. Signed-off-by: Andy Green --- drivers/net/wireless/ath/wcn36xx/main.c | 18 +++++------------- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 6 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 7dd8873..c4178c7 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -221,17 +221,6 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn) } } -static void wcn36xx_detect_chip_version(struct wcn36xx *wcn) -{ - if (get_feat_caps(wcn->fw_feat_caps, DOT11AC)) { - wcn36xx_info("Chip is 3680\n"); - wcn->chip_version = WCN36XX_CHIP_3680; - } else { - wcn36xx_info("Chip is 3660\n"); - wcn->chip_version = WCN36XX_CHIP_3660; - } -} - static int wcn36xx_start(struct ieee80211_hw *hw) { struct wcn36xx *wcn = hw->priv; @@ -286,8 +275,6 @@ static int wcn36xx_start(struct ieee80211_hw *hw) wcn36xx_feat_caps_info(wcn); } - wcn36xx_detect_chip_version(wcn); - /* DMA channel initialization */ ret = wcn36xx_dxe_init(wcn); if (ret) { @@ -1023,6 +1010,11 @@ static int wcn36xx_probe(struct platform_device *pdev) wcn->hw = hw; wcn->dev = &pdev->dev; wcn->ctrl_ops = pdev->dev.platform_data; + if (!wcn->ctrl_ops->get_chip_type) { + dev_err(&pdev->dev, "Missing ops->get_chip_type\n"); + return -EINVAL; + } + wcn->chip_version = wcn->ctrl_ops->get_chip_type(); mutex_init(&wcn->hal_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index a5366b6..04793c6 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -110,6 +110,7 @@ struct wcn36xx_platform_ctrl_ops { void (*close)(void); int (*tx)(char *buf, size_t len); int (*get_hw_mac)(u8 *addr); + int (*get_chip_type)(void); int (*smsm_change_state)(u32 clear_mask, u32 set_mask); };