From patchwork Mon Dec 8 07:03:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 5454541 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E975E9F1C5 for ; Mon, 8 Dec 2014 07:03:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1626720142 for ; Mon, 8 Dec 2014 07:03:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03D5020114 for ; Mon, 8 Dec 2014 07:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754308AbaLHHDt (ORCPT ); Mon, 8 Dec 2014 02:03:49 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:11733 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754151AbaLHHDr (ORCPT ); Mon, 8 Dec 2014 02:03:47 -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=1418022227; x=1449558227; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=3LUM/WUDlEnU/pt7uq2GJiHs4RGb1Cak3d77UlDtQfk=; b=jIqtCg9GLQhVWnqJD3PBQfkxz5cVGVUZhhui+shhKoBOmyb06UVdYukO TV5/3+K4+zi1yGkFCVpE5oxgqaDL26HcICt9f77m5S28liJiOY3ZEOd/G 2O5EHDtJpXE4KAE0NYbvCe7mExpy8RddRDT8awXa6sn7okEEeAz4J3sO6 I=; X-IronPort-AV: E=McAfee;i="5600,1067,7645"; a="79662403" Received: from ironmsg06-lv.qualcomm.com ([10.47.202.185]) by sabertooth01.qualcomm.com with ESMTP; 07 Dec 2014 23:03:46 -0800 X-IronPort-AV: E=Sophos;i="5.07,536,1413270000"; d="scan'208";a="16699644" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by Ironmsg06-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 07 Dec 2014 23:03:46 -0800 Received: from potku.adurom.net.qca.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.913.22; Sun, 7 Dec 2014 23:03:34 -0800 From: Kalle Valo To: Michal Kazior CC: "ath10k@lists.infradead.org" , linux-wireless Subject: Re: [PATCH v4 6/8] ath10k: introduce wmi ops References: <20141203080803.31187.85059.stgit@potku.adurom.net> <20141203081054.31187.10953.stgit@potku.adurom.net> Date: Mon, 8 Dec 2014 09:03:30 +0200 In-Reply-To: (Michal Kazior's message of "Mon, 8 Dec 2014 07:51:28 +0100") Message-ID: <87fvcq4o8t.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01H.na.qualcomm.com (10.85.0.34) To NALASEXR01G.na.qualcomm.com (10.49.56.53) 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 Michal Kazior writes: > On 3 December 2014 at 09:10, Kalle Valo wrote: > [...] >> int ath10k_wmi_attach(struct ath10k *ar) >> { >> - if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) { >> - if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features)) >> - ar->wmi.cmd = &wmi_10_2_cmd_map; >> - else >> - ar->wmi.cmd = &wmi_10x_cmd_map; >> - >> + switch (ar->wmi.op_version) { >> + case ATH10K_FW_WMI_OP_VERSION_10_2: >> + ar->wmi.cmd = &wmi_10_2_cmd_map; >> + ar->wmi.ops = &wmi_10_2_ops; >> ar->wmi.vdev_param = &wmi_10x_vdev_param_map; >> ar->wmi.pdev_param = &wmi_10x_pdev_param_map; >> - } else { >> + break; >> + case ATH10K_FW_WMI_OP_VERSION_10_1: >> + ar->wmi.cmd = &wmi_10x_cmd_map; >> + ar->wmi.ops = &wmi_10_1_ops; >> + ar->wmi.vdev_param = &wmi_10x_vdev_param_map; >> + ar->wmi.pdev_param = &wmi_10x_pdev_param_map; >> + break; >> + case ATH10K_FW_WMI_OP_VERSION_MAIN: >> ar->wmi.cmd = &wmi_cmd_map; >> + ar->wmi.ops = &wmi_ops; >> ar->wmi.vdev_param = &wmi_vdev_param_map; >> ar->wmi.pdev_param = &wmi_pdev_param_map; >> + break; >> + default: > > I think we don't need the `default` here now, do we? Instead _UNSET > and _MAX should be handled. Correct. I folded this change: --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -4786,7 +4786,8 @@ int ath10k_wmi_attach(struct ath10k *ar) ar->wmi.vdev_param = &wmi_vdev_param_map; ar->wmi.pdev_param = &wmi_pdev_param_map; break; - default: + case ATH10K_FW_WMI_OP_VERSION_UNSET: + case ATH10K_FW_WMI_OP_VERSION_MAX: ath10k_err(ar, "unsupported WMI op version: %d\n", ar->wmi.op_version); return -EINVAL;