From patchwork Thu Jul 30 10:52:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Kondratiev X-Patchwork-Id: 6901491 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 674E2C05AC for ; Thu, 30 Jul 2015 10:55:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48CF42057F for ; Thu, 30 Jul 2015 10:55:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B03720575 for ; Thu, 30 Jul 2015 10:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755529AbbG3Ky6 (ORCPT ); Thu, 30 Jul 2015 06:54:58 -0400 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:64261 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755517AbbG3Kyv (ORCPT ); Thu, 30 Jul 2015 06:54:51 -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=1438253691; x=1469789691; h=from:cc:to:subject:date:message-id:in-reply-to: references; bh=RH2ldAxNgp4BMZnXWRKBvoN4i6khNOJciMnOPdIYmro=; b=K+A6CVOa6d4sn3y9FRYrRWM4aoGiRCQyATokvmZaCojYMD/G/na3pkmH mrGq4O2K6Ik9n6cnYA7nH0D2/p8C4QoKv4l/AHiDpveYdxG+gzF3uLBVl UzvZvmqtK8QZzDFrDFSjzO1CfOLux8zvzwGTnn4HATnsDbLmjpMG1L1lh s=; X-IronPort-AV: E=McAfee;i="5700,7163,7877"; a="94860456" Received: from ironmsg02-r.qualcomm.com ([172.30.46.16]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jul 2015 03:54:51 -0700 From: Vladimir Kondratiev Cc: Vladimir Kondratiev , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com X-IronPort-AV: E=Sophos;i="5.15,576,1432623600"; d="scan'208";a="523805166" Received: from lx-wigig-72.mea.qualcomm.com ([10.18.134.58]) by ironmsg02-R.qualcomm.com with ESMTP; 30 Jul 2015 03:52:58 -0700 To: Kalle Valo Subject: [PATCH v3 19/19] wil6210: support future boot loaders Date: Thu, 30 Jul 2015 13:52:07 +0300 Message-Id: <1438253527-3372-20-git-send-email-qca_vkondrat@qca.qualcomm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438253527-3372-1-git-send-email-qca_vkondrat@qca.qualcomm.com> References: <1438253527-3372-1-git-send-email-qca_vkondrat@qca.qualcomm.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Boot loader versions as backward compatible, starting from v1 Signed-off-by: Vladimir Kondratiev --- drivers/net/wireless/ath/wil6210/main.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index d11a147..2fb04c5 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -643,37 +643,26 @@ static int wil_get_bl_info(struct wil6210_priv *wil) u8 *mac; u16 rf_status; - bl_ver = wil_r(wil, RGF_USER_BL + - offsetof(struct bl_dedicated_registers_v0, - boot_loader_struct_version)); - switch (bl_ver) { - case 0: - wil_memcpy_fromio_32(&bl, wil->csr + HOSTADDR(RGF_USER_BL), - sizeof(bl.bl0)); - le32_to_cpus(&bl.bl0.boot_loader_ready); - le32_to_cpus(&bl.bl0.boot_loader_struct_version); + wil_memcpy_fromio_32(&bl, wil->csr + HOSTADDR(RGF_USER_BL), + sizeof(bl)); + bl_ver = le32_to_cpu(bl.bl0.boot_loader_struct_version); + mac = bl.bl0.mac_address; + + if (bl_ver == 0) { le32_to_cpus(&bl.bl0.rf_type); le32_to_cpus(&bl.bl0.baseband_type); - mac = bl.bl0.mac_address; rf_status = 0; /* actually, unknown */ wil_info(wil, "Boot Loader struct v%d: MAC = %pM RF = 0x%08x bband = 0x%08x\n", bl_ver, mac, bl.bl0.rf_type, bl.bl0.baseband_type); wil_info(wil, "Boot Loader build unknown for struct v0\n"); - break; - case 1: - case 2: - wil_memcpy_fromio_32(&bl, wil->csr + HOSTADDR(RGF_USER_BL), - sizeof(bl.bl1)); - le32_to_cpus(&bl.bl1.boot_loader_ready); - le32_to_cpus(&bl.bl1.boot_loader_struct_version); + } else { le16_to_cpus(&bl.bl1.rf_type); rf_status = le16_to_cpu(bl.bl1.rf_status); le32_to_cpus(&bl.bl1.baseband_type); le16_to_cpus(&bl.bl1.bl_version_subminor); le16_to_cpus(&bl.bl1.bl_version_build); - mac = bl.bl1.mac_address; wil_info(wil, "Boot Loader struct v%d: MAC = %pM RF = 0x%04x (status 0x%04x) bband = 0x%08x\n", bl_ver, mac, @@ -682,10 +671,6 @@ static int wil_get_bl_info(struct wil6210_priv *wil) wil_info(wil, "Boot Loader build %d.%d.%d.%d\n", bl.bl1.bl_version_major, bl.bl1.bl_version_minor, bl.bl1.bl_version_subminor, bl.bl1.bl_version_build); - break; - default: - wil_err(wil, "BL: unsupported struct version 0x%08x\n", bl_ver); - return -EINVAL; } if (!is_valid_ether_addr(mac)) {