From patchwork Tue Apr 9 07:35:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10890673 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-2.web.codeaurora.org (Postfix) with ESMTP id 6D3A1922 for ; Tue, 9 Apr 2019 07:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57944286E6 for ; Tue, 9 Apr 2019 07:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C51728866; Tue, 9 Apr 2019 07:37:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 D0233286E6 for ; Tue, 9 Apr 2019 07:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726517AbfDIHhZ (ORCPT ); Tue, 9 Apr 2019 03:37:25 -0400 Received: from mail-eopbgr750077.outbound.protection.outlook.com ([40.107.75.77]:51321 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726112AbfDIHhY (ORCPT ); Tue, 9 Apr 2019 03:37:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EERBV6nb/dsmWXhPUw28pwhZUxjUbcj+IcQJNU+tCR0=; b=OipIiMGpJPBMuafZlYVcdGqgbV80R3fWeRNK1Mv3hzyI41zZFZsSyyhoUs+78UBuKj+vtPz37mGV+U8rUbEjGBDRtvUkBdyZVMBkDRPw1vNWENZhVEFK2H0cdNxjAcDRqhUsN7cysbp93BKyYY4Til+Ne0UNKUGRnllJOT7IGqc= Received: from BL0PR05MB4722.namprd05.prod.outlook.com (20.177.145.27) by BL0PR05MB5361.namprd05.prod.outlook.com (10.167.233.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.8; Tue, 9 Apr 2019 07:36:42 +0000 Received: from BL0PR05MB4722.namprd05.prod.outlook.com ([fe80::7959:ceb:bcd4:3a4a]) by BL0PR05MB4722.namprd05.prod.outlook.com ([fe80::7959:ceb:bcd4:3a4a%6]) with mapi id 15.20.1792.009; Tue, 9 Apr 2019 07:36:42 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5103.namprd05.prod.outlook.com (20.177.250.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.8; Tue, 9 Apr 2019 07:35:13 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::ecfd:3a22:dcb3:3b9e]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::ecfd:3a22:dcb3:3b9e%4]) with mapi id 15.20.1792.009; Tue, 9 Apr 2019 07:35:13 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH 3/3] qtnfmac: modify debugfs to support multiple cards Thread-Topic: [PATCH 3/3] qtnfmac: modify debugfs to support multiple cards Thread-Index: AQHU7qbEKxJKXs9UZ0mNm7MOZX9zoA== Date: Tue, 9 Apr 2019 07:35:12 +0000 Message-ID: <20190409073500.16402-4-sergey.matyukevich.os@quantenna.com> References: <20190409073500.16402-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20190409073500.16402-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR08CA0016.namprd08.prod.outlook.com (2603:10b6:a03:100::29) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: df2b83af-f897-4889-3b90-08d6bcbde65c x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020);SRVR:SN6PR05MB5103; x-ms-traffictypediagnostic: SN6PR05MB5103:|BL0PR05MB5361: x-moderation-data: 4/9/2019 7:36:40 AM x-microsoft-antispam-prvs: x-forefront-prvs: 000227DA0C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(376002)(346002)(136003)(366004)(189003)(199004)(81166006)(68736007)(14454004)(2616005)(436003)(71190400001)(71200400001)(11346002)(486006)(7736002)(5660300002)(66066001)(476003)(99286004)(386003)(6506007)(6436002)(305945005)(446003)(53936002)(186003)(106356001)(50226002)(8936002)(256004)(14444005)(81156014)(6512007)(52116002)(97736004)(6116002)(3846002)(478600001)(1076003)(107886003)(76176011)(54906003)(6916009)(316002)(2501003)(26005)(25786009)(2351001)(105586002)(2906002)(102836004)(4326008)(5640700003)(8676002)(6486002)(86362001)(36756003)(103116003);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR05MB5361;H:BL0PR05MB4722.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: dpFXfpTCWrXIGZWEkhHsfkQk/iZVdBH/lfiey3N6Z6je/Kt+ysoZ/96SjuM+y2/OshFewjD584ISMwulZ3dHuW7zkyOzu9wjs/xv0axdOLo8XlgwhZi/BeximSBWFZGAqRkZtSLyJuufCoknFTvKSBsq8Dz3VcdYHEiOTcvZn+ZJctbWg0vPFra1/OD+8hC2xv8h4ZTNievbEi+y7xkjz9LhYkud0RHNAx0RvFWy/3/7jYnsfmc89yAzJ8nzHDAwSF7n+BclFqENRjnn/ZzbcXPG004rL7LFPoLrMrh5/7I1NFAKxqvuWmV/cz6XeFaVLEuqel+/diA8gdADrfVGuodLNtmRsnnP0nVAxIH8ItKvhubboDpyX3roV41CcfIt4WKhMoHEFJMfXXrvA2sS0dXSnSYnKxBulRolzEflE0g= MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: df2b83af-f897-4889-3b90-08d6bcbde65c X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2019 07:36:42.6311 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR05MB5361 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 This patch modifies location of debugfs entries and their naming conventions to support multiple wireless cards on pcie host. Selected approach is to use separate directories for different wireless cards in top-level qtnfmac debugfs directory. Here is an example that clarifies the chosen naming conventions: $ sudo ls /sys/kernel/debug/qtnfmac/ qtnfmac_pcie:0000:01:00.0 Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/core.c | 26 ++++++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + drivers/net/wireless/quantenna/qtnfmac/debug.c | 4 +++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index ad0c9e012056..8d699cc03d26 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -20,6 +20,8 @@ static bool slave_radar = true; module_param(slave_radar, bool, 0644); MODULE_PARM_DESC(slave_radar, "set 0 to disable radar detection in slave mode"); +static struct dentry *qtnf_debugfs_dir; + struct qtnf_frame_meta_info { u8 magic_s; u8 ifidx; @@ -848,6 +850,30 @@ void qtnf_packet_send_hi_pri(struct sk_buff *skb) } EXPORT_SYMBOL_GPL(qtnf_packet_send_hi_pri); +struct dentry *qtnf_get_debugfs_dir(void) +{ + return qtnf_debugfs_dir; +} +EXPORT_SYMBOL_GPL(qtnf_get_debugfs_dir); + +static int __init qtnf_core_register(void) +{ + qtnf_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); + + if (IS_ERR(qtnf_debugfs_dir)) + qtnf_debugfs_dir = NULL; + + return 0; +} + +static void __exit qtnf_core_exit(void) +{ + debugfs_remove(qtnf_debugfs_dir); +} + +module_init(qtnf_core_register); +module_exit(qtnf_core_exit); + MODULE_AUTHOR("Quantenna Communications"); MODULE_DESCRIPTION("Quantenna 802.11 wireless LAN FullMAC driver."); MODULE_LICENSE("GPL"); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index d5caff45ac47..322858df600c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -153,6 +153,7 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev); void qtnf_netdev_updown(struct net_device *ndev, bool up); void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted); void qtnf_packet_send_hi_pri(struct sk_buff *skb); +struct dentry *qtnf_get_debugfs_dir(void); static inline struct qtnf_vif *qtnf_netdev_get_priv(struct net_device *dev) { diff --git a/drivers/net/wireless/quantenna/qtnfmac/debug.c b/drivers/net/wireless/quantenna/qtnfmac/debug.c index 598ece753a4b..2d3574c1f10e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/debug.c +++ b/drivers/net/wireless/quantenna/qtnfmac/debug.c @@ -5,7 +5,9 @@ void qtnf_debugfs_init(struct qtnf_bus *bus, const char *name) { - bus->dbg_dir = debugfs_create_dir(name, NULL); + struct dentry *parent = qtnf_get_debugfs_dir(); + + bus->dbg_dir = debugfs_create_dir(name, parent); } void qtnf_debugfs_remove(struct qtnf_bus *bus)