From patchwork Mon Mar 5 06:59:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10258227 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 C254760211 for ; Mon, 5 Mar 2018 06:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE978288D1 for ; Mon, 5 Mar 2018 06:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A376F288F4; Mon, 5 Mar 2018 06:59:27 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EC401288D1 for ; Mon, 5 Mar 2018 06:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=m7yk987Uxvo1hDzy3bx6CzBGrYG11qQ/E2ZIoETFxUU=; b=gw/3BWxynNn0SVZmGqYWaWdzH+ qHyb3ZbONam2U+hI9D1Y6+NMLkR0sz8zB0tZcurR3nbwxYIN5OlB0BIVf8S+iuA6ZhJ+Le5M123ll 7gQYWxneo33Vh4+DyQogEhSZC34J1MIU8kH9ppii4+GN5uMC/VprRcD5AeuJM1IKOr+UOhdGMqqTq tf89eoRM6SXGRllJ7VW8qjLoy/IYvw1x+dtdo7HEcXuk9LJkktqESsYYj3BFYnAiM1UvrblictNy9 WULDZJu8eEsxP30KhSYZ0GZftU+O4i9huqX9ztfbcOY38hhoiuAbL+Ss4M1bW4MzL6Aki58ClYg2L 2wDy6aKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1esk5f-00028F-R9; Mon, 05 Mar 2018 06:59:19 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1esk5Y-00020m-IF for ath10k@lists.infradead.org; Mon, 05 Mar 2018 06:59:14 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 47F5260452; Mon, 5 Mar 2018 06:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520233141; bh=WJmNnHe4z9NW4KVQtHGP0MVCMDzqpgQRIVLolPNjhvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qq8xvkkObYDfGttvxgB46NRZU9rEnzLTHqCuFJ2LpzY+cBviK6imO9GuJGll9f8Vw 1FSWOazu3QQo6okRsgdujGOWyRI75twzJnAtzTcsXvkTW63QJiA3gpBgwtiuD6ALwv 6dkaodOqxQdZ+qiLgvqgU968gzD2SQlkIafgaH0c= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3CDDC6043F; Mon, 5 Mar 2018 06:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520233140; bh=WJmNnHe4z9NW4KVQtHGP0MVCMDzqpgQRIVLolPNjhvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THzO2KrRgekyOjpfEvSOmAmiiDDKJIO7FWtXAwgzdFb/485IJlGYZG9BuDtKlaewt RM+jwwj3p9NDcPEWtp5lGk7apBAE6KW+NHt78pi6r7MoLzz4day3VyllyqwWBfrL/9 yDCvwQlQBIzRDYLCJwj2HccTUxy2+H/anfQsXbes= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3CDDC6043F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: Add WMI FWTEST command support Date: Mon, 5 Mar 2018 12:29:07 +0530 Message-Id: <1520233148-26050-2-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1520233148-26050-1-git-send-email-akolli@codeaurora.org> References: <1520233148-26050-1-git-send-email-akolli@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180304_225912_735923_10295FA5 X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sathishkumar Muruganandam , linux-wireless@vger.kernel.org, Anilkumar Kolli MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sathishkumar Muruganandam This patch adds support for WMI_FWTEST_CMD. This command is used for setting the wifi parameters. Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 18 ++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 24 +++++++++++++++++++++++- drivers/net/wireless/ath/ath10k/wmi.h | 7 +++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 14093cfdc505..5b710c64493d 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -125,6 +126,8 @@ struct wmi_ops { enum wmi_force_fw_hang_type type, u32 delay_ms); struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb); + struct sk_buff *(*gen_fw_test)(struct ath10k *ar, u32 param_id, + u32 param_value); struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u64 module_enable, u32 log_level); struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter); @@ -959,6 +962,21 @@ struct wmi_ops { } static inline int +ath10k_wmi_fw_test(struct ath10k *ar, u32 param_id, u32 param_value) +{ + struct sk_buff *skb; + + if (!ar->wmi.ops->gen_fw_test) + return -EOPNOTSUPP; + + skb = ar->wmi.ops->gen_fw_test(ar, param_id, param_value); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->fwtest_cmdid); +} + +static inline int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) { struct sk_buff *skb; diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 58dc2189ba49..09ffc188e5f5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -511,7 +512,7 @@ .pdev_ratepwr_chainmsk_table_cmdid = WMI_CMD_UNSUPPORTED, .pdev_fips_cmdid = WMI_CMD_UNSUPPORTED, .tt_set_conf_cmdid = WMI_CMD_UNSUPPORTED, - .fwtest_cmdid = WMI_CMD_UNSUPPORTED, + .fwtest_cmdid = WMI_10_2_FWTEST_CMDID, .vdev_atf_request_cmdid = WMI_CMD_UNSUPPORTED, .peer_atf_request_cmdid = WMI_CMD_UNSUPPORTED, .pdev_get_ani_cck_config_cmdid = WMI_CMD_UNSUPPORTED, @@ -7092,6 +7093,25 @@ void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, } static struct sk_buff * +ath10k_wmi_op_gen_fw_test(struct ath10k *ar, u32 param_id, u32 param_value) +{ + struct wmi_fw_test_cmd *cmd; + struct sk_buff *skb; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return ERR_PTR(-ENOMEM); + + cmd = (struct wmi_fw_test_cmd *)skb->data; + cmd->param_id = __cpu_to_le32(param_id); + cmd->param_value = __cpu_to_le32(param_value); + + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi fw_test %d %d", + param_id, param_value); + return skb; +} + +static struct sk_buff * ath10k_wmi_op_gen_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) { @@ -8368,6 +8388,7 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ /* .gen_adaptive_qcs not implemented */ + .gen_fw_test = ath10k_wmi_op_gen_fw_test, }; static const struct wmi_ops wmi_10_4_ops = { @@ -8418,6 +8439,7 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) .gen_pdev_set_wmm = ath10k_wmi_op_gen_pdev_set_wmm, .gen_force_fw_hang = ath10k_wmi_op_gen_force_fw_hang, .gen_mgmt_tx = ath10k_wmi_op_gen_mgmt_tx, + .gen_fw_test = ath10k_wmi_op_gen_fw_test, .gen_dbglog_cfg = ath10k_wmi_10_4_op_gen_dbglog_cfg, .gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable, .gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable, diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index c7b30ed9015d..1cb410ab6f8f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1558,6 +1559,7 @@ enum wmi_10_2_cmd_id { WMI_10_2_SET_LTEU_CONFIG_CMDID, WMI_10_2_SET_CCA_PARAMS, WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, + WMI_10_2_FWTEST_CMDID, WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1, }; @@ -6366,6 +6368,11 @@ struct wmi_force_fw_hang_cmd { __le32 delay_ms; } __packed; +struct wmi_fw_test_cmd { + __le32 param_id; + __le32 param_value; +} __packed; + enum ath10k_dbglog_level { ATH10K_DBGLOG_LEVEL_VERBOSE = 0, ATH10K_DBGLOG_LEVEL_INFO = 1,