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;