From patchwork Mon Aug 14 12:19:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9898747 X-Patchwork-Delegate: kvalo@adurom.com 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 10D79602BA for ; Mon, 14 Aug 2017 12:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 024A3205FC for ; Mon, 14 Aug 2017 12:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB55326E69; Mon, 14 Aug 2017 12:19:18 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E4E3205FC for ; Mon, 14 Aug 2017 12:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbdHNMTR (ORCPT ); Mon, 14 Aug 2017 08:19:17 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37533 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbdHNMTP (ORCPT ); Mon, 14 Aug 2017 08:19:15 -0400 Received: by mail-pg0-f65.google.com with SMTP id 83so10426500pgb.4 for ; Mon, 14 Aug 2017 05:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dnnjrtERrcfD/XIKUtmx/3unzGWjWykPhnQpOd4HlQg=; b=BwD3XbJ11zahauehpYmzTMGLBzqZiLicbNaEbEiOl9bBDJ2yVicBplR+33Aa8bIpUG JNvVulZx5rrpjs5c2Z3qEwBYxqfUEPRYr7ZRwzyL18Ph6MDuRb2rP+S3NOtolasUADqn hSHa/0BzK+lbrTxKkSSz1PRJNVn+WE9mWCPfAqfQn+HBe1ihM8dDBJA1xf7pUjYyPoLh qwUNH4psMytVmsqlV82x52EnQVBhcKljOrLCIfFIV9OHO2RFQqKck7Uze/yLM4nXUosh MbRDfSkczg7ekzhR22cfI2GUGk2Ji+0RAqFeqGf7zwnDbXb5yqbvd+7A2DbR4myVAnPE wkhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dnnjrtERrcfD/XIKUtmx/3unzGWjWykPhnQpOd4HlQg=; b=aBpH8th/aj9KDYtU3nOP9jQ7S7pAtryCQs7FEhO8THO2jYqpjMUBH4wwzyIrAN/S51 Ow0e/etXpl2kN5gSLxol73z26O9BTC1VcY1OVqUg/+1+9biL56FXoYQTG/swnnlCrScI ifkUuZvDlYXv7Q+oDSFaz86PwbEZCoX08z9LT9SftJz2m3HhpJ0xK3FZU4Fen9PBIr7t TqLzwUYtUNGjSe595Q19yHJhRhu+iujUdEtppXriUxb6+OOdlaVBLn0bV4lGZfcJ0NmH qe9hzRmmEHVP4rmHwz9a2qcqcPGmDsSnfVakr96nHbPi6y88gcL+SfHj2rEMX3btYguZ 8vbg== X-Gm-Message-State: AHYfb5ie1SLaZx7BxVRZtVwWA9s6Z/zwMmN+rLZp/RuDKuhg83Ipjo7d hEfydaQuIz89u2zf X-Received: by 10.84.215.211 with SMTP id g19mr27020189plj.438.1502713155056; Mon, 14 Aug 2017 05:19:15 -0700 (PDT) Received: from ubuntu.members.linode.com ([2400:8902::f03c:91ff:fee7:7cf1]) by smtp.gmail.com with ESMTPSA id f15sm12673683pgu.90.2017.08.14.05.19.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Aug 2017 05:19:14 -0700 (PDT) From: Xinming Hu To: Linux Wireless Cc: Kalle Valo , Brian Norris , Dmitry Torokhov , rajatja@google.com, Zhiyuan Yang , Tim Song , Cathy Luo , Ganapathi Bhat , Xinming Hu Subject: [PATCH 3/3] mwifiex: debugfs: trigger device dump for usb interface Date: Mon, 14 Aug 2017 12:19:03 +0000 Message-Id: <1502713143-24373-3-git-send-email-huxinming820@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502713143-24373-1-git-send-email-huxinming820@gmail.com> References: <1502713143-24373-1-git-send-email-huxinming820@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Xinming Hu This patch extend device_dump debugfs function to make it works for usb interface. Signed-off-by: Xinming Hu Signed-off-by: Cathy Luo Signed-off-by: Ganapathi Bhat --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 11 +++++++---- drivers/net/wireless/marvell/mwifiex/debugfs.c | 9 +++++---- drivers/net/wireless/marvell/mwifiex/fw.h | 1 + drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 ++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 0edc5d6..b16dd6a 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -290,13 +290,16 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] = get_unaligned_le16((u8 *)host_cmd + S_DS_GEN); + /* Setup the timer after transmit command, except that specific + * command might not have command response. + */ + if (cmd_code != HostCmd_CMD_FW_DUMP_EVENT) + mod_timer(&adapter->cmd_timer, + jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S)); + /* Clear BSS_NO_BITS from HostCmd */ cmd_code &= HostCmd_CMD_ID_MASK; - /* Setup the timer after transmit command */ - mod_timer(&adapter->cmd_timer, - jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S)); - return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c index 6f4239b..5d476de 100644 --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c @@ -168,10 +168,11 @@ { struct mwifiex_private *priv = file->private_data; - if (!priv->adapter->if_ops.device_dump) - return -EIO; - - priv->adapter->if_ops.device_dump(priv->adapter); + if (priv->adapter->iface_type == MWIFIEX_USB) + mwifiex_send_cmd(priv, HostCmd_CMD_FW_DUMP_EVENT, + HostCmd_ACT_GEN_SET, 0, NULL, true); + else + priv->adapter->if_ops.device_dump(priv->adapter); return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 610a3ea..2d3a644 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h @@ -398,6 +398,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define HostCmd_CMD_TDLS_CONFIG 0x0100 #define HostCmd_CMD_MC_POLICY 0x0121 #define HostCmd_CMD_TDLS_OPER 0x0122 +#define HostCmd_CMD_FW_DUMP_EVENT 0x0125 #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223 #define HostCmd_CMD_CHAN_REGION_CFG 0x0242 #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251 diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c index fb09014..211e47d 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -2206,6 +2206,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, case HostCmd_CMD_CHAN_REGION_CFG: ret = mwifiex_cmd_chan_region_cfg(priv, cmd_ptr, cmd_action); break; + case HostCmd_CMD_FW_DUMP_EVENT: + cmd_ptr->command = cpu_to_le16(cmd_no); + cmd_ptr->size = cpu_to_le16(S_DS_GEN); + break; default: mwifiex_dbg(priv->adapter, ERROR, "PREP_CMD: unknown cmd- %#x\n", cmd_no);