From patchwork Tue Apr 9 07:35:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10890667 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 BF0A9922 for ; Tue, 9 Apr 2019 07:36:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA27928861 for ; Tue, 9 Apr 2019 07:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E4C328866; Tue, 9 Apr 2019 07:36:46 +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 1DF1028861 for ; Tue, 9 Apr 2019 07:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfDIHgp (ORCPT ); Tue, 9 Apr 2019 03:36:45 -0400 Received: from mail-eopbgr710070.outbound.protection.outlook.com ([40.107.71.70]:11174 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726001AbfDIHgo (ORCPT ); Tue, 9 Apr 2019 03:36:44 -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=SCNIeg9obs4PXCejsFu3FGe7uDvz6JZwTevxDBVOS8E=; b=oLr7+Gl8+PSFo/P4eda8tj8xipOQV0rCf4Fyqkvp/hBANK0KwZrTsDL0Wtzi/fZxcOjBtK6AYwhNLKDFSddGlrokpB7DhyneMlV7caUhmT+f1VIqN2PHTnMpciOML3Vbx/o7MKJBLBm0DjUlzKVcy0ZJiSwz2MdACNhNBxhtQaw= Received: from DM6PR05MB4284.namprd05.prod.outlook.com (20.176.78.21) by DM6PR05MB6010.namprd05.prod.outlook.com (20.178.29.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Tue, 9 Apr 2019 07:36:36 +0000 Received: from DM6PR05MB4284.namprd05.prod.outlook.com ([fe80::bcb5:51c1:9a74:1aa]) by DM6PR05MB4284.namprd05.prod.outlook.com ([fe80::bcb5:51c1:9a74:1aa%2]) with mapi id 15.20.1792.009; Tue, 9 Apr 2019 07:36:35 +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:09 +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:09 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH 1/3] qtnfmac: handle channel switch events for connected stations only Thread-Topic: [PATCH 1/3] qtnfmac: handle channel switch events for connected stations only Thread-Index: AQHU7qbCco7z937WgE+zPUrTfnDjJA== Date: Tue, 9 Apr 2019 07:35:08 +0000 Message-ID: <20190409073500.16402-2-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: d9702b47-1b38-4bb0-ed35-08d6bcbde452 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:|DM6PR05MB6010: x-moderation-data: 4/9/2019 7:36:34 AM x-microsoft-antispam-prvs: x-forefront-prvs: 000227DA0C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(366004)(39850400004)(136003)(189003)(199004)(7736002)(106356001)(5640700003)(52116002)(446003)(107886003)(486006)(105586002)(6436002)(66066001)(6486002)(53936002)(305945005)(103116003)(476003)(6512007)(6916009)(2351001)(186003)(4326008)(54906003)(25786009)(86362001)(316002)(11346002)(5660300002)(436003)(2616005)(99286004)(81166006)(386003)(81156014)(1076003)(2501003)(8676002)(478600001)(6506007)(26005)(8936002)(256004)(14444005)(3846002)(6116002)(102836004)(2906002)(50226002)(76176011)(68736007)(14454004)(36756003)(71190400001)(71200400001)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR05MB6010;H:DM6PR05MB4284.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: xB4X0W2knUod3VxLHjPP2w+71TqNKnmd8cfnsRiZjOseg5jv7q0/BKFcEfjNJrmlPd2DJtlr1t35sU/dTARRbS2v0r5NxIsca+Evyoy3yACbWwJRHoBGmjNYuVZ0OaBgSmX3R7belfGrJ/2prHIGUJ/DlgjE1RIuVdGO0tFUndwEBlstqVssC3eBHznOCcxPiuDOTN56AtvdIB9fstdwkgCt2f0QPmESJzYNX8ARo2LLl8kKTru+0eevsI+ui1ru5/C87MC2P2d5h3R9rIZOe0wpUBy6nrBt5uVcsVPLSh/mCoGwI6f5gtdKhuzzUM7LNxa3v2rSZMRmAVTdNiy8OCs8upan03Vs3ICKwxJ27Pl7KPOD15KZRuJLLYtJyOa4ORnjjGGs8gnEb+EAF//88Jv60PHOD3jUqtHeQ19h3sk= MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9702b47-1b38-4bb0-ed35-08d6bcbde452 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:35.8303 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB6010 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 Channel switch events from firmware should be processed only when STA is already connected to BSS. On connect this notification is not needed since full BSS info will be supplied by cfg80211_connect_result. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/event.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 6c1b886339ac..b57c8c18a8d0 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -493,14 +493,20 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac, for (i = 0; i < QTNF_MAX_INTF; i++) { vif = &mac->iflist[i]; + if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) continue; - if (vif->netdev) { - mutex_lock(&vif->wdev.mtx); - cfg80211_ch_switch_notify(vif->netdev, &chandef); - mutex_unlock(&vif->wdev.mtx); - } + if (vif->wdev.iftype == NL80211_IFTYPE_STATION && + !vif->wdev.current_bss) + continue; + + if (!vif->netdev) + continue; + + mutex_lock(&vif->wdev.mtx); + cfg80211_ch_switch_notify(vif->netdev, &chandef); + mutex_unlock(&vif->wdev.mtx); } return 0; From patchwork Tue Apr 9 07:35:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10890671 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 2E43017E1 for ; Tue, 9 Apr 2019 07:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1838728864 for ; Tue, 9 Apr 2019 07:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A21E28875; Tue, 9 Apr 2019 07:37:01 +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 7360D28864 for ; Tue, 9 Apr 2019 07:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbfDIHg7 (ORCPT ); Tue, 9 Apr 2019 03:36:59 -0400 Received: from mail-eopbgr760049.outbound.protection.outlook.com ([40.107.76.49]:41382 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726766AbfDIHg7 (ORCPT ); Tue, 9 Apr 2019 03:36:59 -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=irAXeeXbwENGIl6DiAFAHNx3X0FXoLq6YEflbjpvFbw=; b=RcF4tcIhUG5+9By7Ex4Xz5DYDV5Mj8FBhhfp+la3WGQtGNXl4ia0TNLzkRwOYuBDrsIGw2UulRj64wQ8V4peDSt5hYCfw1K0LgdMRYV7DCFRIm+bULSqaw2lCHXn7tcSg7dzC8fv+OEdzlgkqux2P9Qm4kqIfHsw05qoMOrVr+A= Received: from DM6PR05MB5883.namprd05.prod.outlook.com (20.178.26.204) by DM6PR05MB4475.namprd05.prod.outlook.com (20.176.79.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.9; Tue, 9 Apr 2019 07:36:36 +0000 Received: from DM6PR05MB5883.namprd05.prod.outlook.com ([fe80::d5d5:7b9f:869e:9c43]) by DM6PR05MB5883.namprd05.prod.outlook.com ([fe80::d5d5:7b9f:869e:9c43%5]) with mapi id 15.20.1792.009; Tue, 9 Apr 2019 07:36:36 +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:10 +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:10 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Sergey Matyukevich Subject: [PATCH 2/3] qtnfmac: allow to control DFS slave radar detection Thread-Topic: [PATCH 2/3] qtnfmac: allow to control DFS slave radar detection Thread-Index: AQHU7qbDxK8saf+Zg0+BlKCDHeW1Xg== Date: Tue, 9 Apr 2019 07:35:10 +0000 Message-ID: <20190409073500.16402-3-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: 93d54d7e-70bf-4d72-0fcf-08d6bcbde55f 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:|DM6PR05MB4475: x-moderation-data: 4/9/2019 7:36:35 AM x-microsoft-antispam-prvs: x-forefront-prvs: 000227DA0C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39850400004)(189003)(199004)(99286004)(76176011)(25786009)(8936002)(97736004)(26005)(386003)(2906002)(102836004)(6506007)(54906003)(316002)(6486002)(105586002)(106356001)(103116003)(68736007)(71190400001)(6916009)(2501003)(14454004)(1076003)(36756003)(6436002)(81166006)(71200400001)(50226002)(81156014)(478600001)(7736002)(8676002)(86362001)(486006)(2616005)(436003)(2351001)(6512007)(446003)(11346002)(5640700003)(53936002)(186003)(4326008)(107886003)(5660300002)(14444005)(5024004)(256004)(305945005)(52116002)(66066001)(3846002)(6116002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR05MB4475;H:DM6PR05MB5883.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: XCvB0P/ZUt5jNebv6IXmLUisxfEWVw01nRLSnVmXc481Ay3AnqJtZT1/z9t9Elj8Mz9gc5X+Wwe39UUxRHRhEsTNe8IGRa3LKh1JJXfrA8kLuJAVgTgOHCccyHlZStqcuISOu+KV+d6Ncg7Z2viBlO5PlgrZQclVbEc3FtfGRUvMQhpwJ+UG6GGOEP7z9IJuZfq8PjmysxeUjaCHQQaGarKMLzqScN+B+vC0Ti9jJteIhh4AmnZ5yX7cNK7FlUXMNI61p1YCnpxyZTZTkhd/El7qvenW8UiC6LU8ZvoQ9JBXzhZ02Ss3+9NOlc+jsHECPb4Tekyk1eYVuAvCGOlcZ4KMlNZ8i1dXe+imIfmbb6LM30gscP4rjGwy0xZPD/AvhrI6zX77UNcOADWkhhCOF5lrrx3PlehZ8DbBkc/3CBM= MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93d54d7e-70bf-4d72-0fcf-08d6bcbde55f 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:36.8999 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4475 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: Igor Mitsyanko In ETSI region DFS slave device can operate in two modes on DFS channels: - do on-channel radar detection and use higher Tx power - don't do radar detection and use lower Tx power as a consequence Allow user to control that behavior through qtnfmac module parameter. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/commands.c | 4 +++- drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 ++- drivers/net/wireless/quantenna/qtnfmac/core.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + drivers/net/wireless/quantenna/qtnfmac/qlink.h | 4 +++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index c78500bcaa2d..d90016125dfc 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1008,7 +1008,7 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy, pr_debug("MAC%u: initiator=%d alpha=%c%c\n", mac->macid, req->initiator, req->alpha2[0], req->alpha2[1]); - ret = qtnf_cmd_reg_notify(mac, req); + ret = qtnf_cmd_reg_notify(mac, req, qtnf_mac_slave_radar_get(wiphy)); if (ret) { pr_err("MAC%u: failed to update region to %c%c: %d\n", mac->macid, req->alpha2[0], req->alpha2[1], ret); diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 22313a46c3ae..459f6b81d2eb 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2367,7 +2367,8 @@ int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up) return ret; } -int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req) +int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req, + bool slave_radar) { struct wiphy *wiphy = priv_to_wiphy(mac); struct qtnf_bus *bus = mac->bus; @@ -2429,6 +2430,7 @@ int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req) break; } + cmd->slave_radar = slave_radar; cmd->num_channels = 0; for (band = 0; band < NUM_NL80211_BANDS; band++) { diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h index 6406365287fc..88d7a3cd90d2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -57,7 +57,8 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, u16 reason_code); int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up); -int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req); +int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req, + bool slave_radar); int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, struct qtnf_chan_stats *stats); int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif, diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 54ea86ae4959..ad0c9e012056 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -16,6 +16,10 @@ #define QTNF_DMP_MAX_LEN 48 #define QTNF_PRIMARY_VIF_IDX 0 +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"); + struct qtnf_frame_meta_info { u8 magic_s; u8 ifidx; @@ -426,6 +430,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, return mac; } +bool qtnf_mac_slave_radar_get(struct wiphy *wiphy) +{ + return slave_radar; +} + static const struct ethtool_ops qtnf_ethtool_ops = { .get_drvinfo = cfg80211_get_drvinfo, }; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index af8372dfb927..d5caff45ac47 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -134,6 +134,7 @@ struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac); struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac); void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac); void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac); +bool qtnf_mac_slave_radar_get(struct wiphy *wiphy); struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus); int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv, const char *name, unsigned char name_assign_type); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 158c9eba20ef..8a3c6344fa8e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -588,6 +588,7 @@ enum qlink_user_reg_hint_type { * of &enum qlink_user_reg_hint_type. * @num_channels: number of &struct qlink_tlv_channel in a variable portion of a * payload. + * @slave_radar: whether slave device should enable radar detection. * @dfs_region: one of &enum qlink_dfs_regions. * @info: variable portion of regulatory notifier callback. */ @@ -598,7 +599,8 @@ struct qlink_cmd_reg_notify { u8 user_reg_hint_type; u8 num_channels; u8 dfs_region; - u8 rsvd[2]; + u8 slave_radar; + u8 rsvd[1]; u8 info[0]; } __packed; 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)