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: warmcat X-Patchwork-Id: 43272 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13CA4240BA for ; Sun, 18 Jan 2015 05:11:04 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf1164386wiv.0 for ; Sat, 17 Jan 2015 21:11:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=4d7G58RtJ3TQPecQkVtAay3CUUx1CHVjdA3KLJGZ4lQ=; b=OPtdc6WqPvYroPq+y3ue8LpH1GZhBE16m7Dhtg2/B+3vXnFXSDH0W9qy8ga2xQo/Ig YlDd611281JGtWVDAzoDRYouZeWGU0yJ/GZyYn6iszT2uQzX920g/JaHH3YtLoPgoEF8 HU7C99pL9gAARtBHNxOjg5yqPwp5B56fPQ2UukXcv1KSuGqTeKqLuHYz/mL9wJouVhj8 tiIEI2A0bdtJEpk9Z5NA9ayGepsV6dwSj3Qgl8cSIjR2CHP/IMCDx5qG0FcpkHD2vAL4 QcVo6Edr/j46KHD3JyCopsQrr6nfpsNEXWaRobLq4WSA24AORIqK8lNZ/dvNxPcXThQR OcWg== X-Gm-Message-State: ALoCoQl6s1TvJQ7HWnCs4KAL9K2tfgeqe/gCtsqFiLfVg9OPtsHnbsLibZUXiCP0clbp31dCuyFd X-Received: by 10.180.74.132 with SMTP id t4mr1301923wiv.3.1421557863376; Sat, 17 Jan 2015 21:11:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.137 with SMTP id w9ls487172lal.5.gmail; Sat, 17 Jan 2015 21:11:03 -0800 (PST) X-Received: by 10.152.36.100 with SMTP id p4mr20120745laj.11.1421557863106; Sat, 17 Jan 2015 21:11:03 -0800 (PST) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com. [2a00:1450:4010:c03::232]) by mx.google.com with ESMTPS id g1si7161030lbd.126.2015.01.17.21.11.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 Jan 2015 21:11:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::232 as permitted sender) client-ip=2a00:1450:4010:c03::232; Received: by mail-la0-f50.google.com with SMTP id pn19so24271030lab.9 for ; Sat, 17 Jan 2015 21:11:02 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr23465808laf.81.1421557862524; Sat, 17 Jan 2015 21:11:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp740433lbb; Sat, 17 Jan 2015 21:11:01 -0800 (PST) X-Received: by 10.68.132.198 with SMTP id ow6mr34942163pbb.61.1421557860767; Sat, 17 Jan 2015 21:11:00 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si11212053pdn.49.2015.01.17.21.10.59; Sat, 17 Jan 2015 21:11:00 -0800 (PST) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbbARFK5 (ORCPT + 3 others); 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) 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: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Original-Sender: andy.green@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::232 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 netdev" 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); };