From patchwork Fri Feb 16 08:04:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 10224149 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 B1AF360231 for ; Fri, 16 Feb 2018 08:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3E2A2943F for ; Fri, 16 Feb 2018 08:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9822C29446; Fri, 16 Feb 2018 08:13:37 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 24B3E29441 for ; Fri, 16 Feb 2018 08:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbeBPINf (ORCPT ); Fri, 16 Feb 2018 03:13:35 -0500 Received: from alexa-out-ams-01.qualcomm.com ([185.23.61.162]:49963 "EHLO alexa-out-ams-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987AbeBPINc (ORCPT ); Fri, 16 Feb 2018 03:13:32 -0500 X-Greylist: delayed 468 seconds by postgrey-1.27 at vger.kernel.org; Fri, 16 Feb 2018 03:13:31 EST X-IronPort-AV: E=Sophos;i="5.39,1,1493708400"; d="scan'208";a="5649" Received: from ironmsg02-ams.qualcomm.com ([10.251.56.3]) by alexa-out-ams-01.qualcomm.com with ESMTP; 16 Feb 2018 08:59:14 +0100 X-IronPort-AV: E=McAfee;i="5900,7806,8806"; a="325555" X-MGA-submission: =?us-ascii?q?MDHIBBh3TSuv3ILOmHxTQ/s2Z2USOlLs+mspGF?= =?us-ascii?q?LzVqILEzcgULEQQ8FYeM9umSbEHfjgYlMhN9CSL2TtI31NMAmN560Jpl?= =?us-ascii?q?VgpaPWCYT7TaYWpGGPDCQaf2kMUYBhybTFTOco05MIYLfpkYi8LN7KwW?= =?us-ascii?q?6u?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg02-ams.qualcomm.com with ESMTP; 16 Feb 2018 09:04:52 +0100 From: Maya Erez To: Kalle Valo Cc: Lior David , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, Maya Erez Subject: [PATCH 8/8] wil6210: add debugfs 'mids' file Date: Fri, 16 Feb 2018 10:04:43 +0200 Message-Id: <1518768283-2318-9-git-send-email-merez@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518768283-2318-1-git-send-email-merez@codeaurora.org> References: <1518768283-2318-1-git-send-email-merez@codeaurora.org> 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: Lior David Added a new debugfs file 'mids' to print the list of virtual interfaces by MAC ID (MID). Allows mapping between the internal MID used by FW and the actual network interface used by the VIF. This is needed by debugging tools. Signed-off-by: Lior David Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/debugfs.c | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 93a99a1..8c90b31 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -1495,6 +1495,42 @@ static int wil_sta_seq_open(struct inode *inode, struct file *file) .llseek = seq_lseek, }; +static int wil_mids_debugfs_show(struct seq_file *s, void *data) +{ + struct wil6210_priv *wil = s->private; + struct wil6210_vif *vif; + struct net_device *ndev; + int i; + + mutex_lock(&wil->vif_mutex); + for (i = 0; i < wil->max_vifs; i++) { + vif = wil->vifs[i]; + + if (vif) { + ndev = vif_to_ndev(vif); + seq_printf(s, "[%d] %pM %s\n", i, ndev->dev_addr, + ndev->name); + } else { + seq_printf(s, "[%d] unused\n", i); + } + } + mutex_unlock(&wil->vif_mutex); + + return 0; +} + +static int wil_mids_seq_open(struct inode *inode, struct file *file) +{ + return single_open(file, wil_mids_debugfs_show, inode->i_private); +} + +static const struct file_operations fops_mids = { + .open = wil_mids_seq_open, + .release = single_release, + .read = seq_read, + .llseek = seq_lseek, +}; + static ssize_t wil_read_file_led_cfg(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { @@ -1749,6 +1785,7 @@ static void wil6210_debugfs_init_blobs(struct wil6210_priv *wil, {"mbox", 0444, &fops_mbox}, {"vrings", 0444, &fops_vring}, {"stations", 0444, &fops_sta}, + {"mids", 0444, &fops_mids}, {"desc", 0444, &fops_txdesc}, {"bf", 0444, &fops_bf}, {"mem_val", 0644, &fops_memread},