From patchwork Thu Feb 13 11:45:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 216471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6290CC2BA83 for ; Thu, 13 Feb 2020 11:46:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B87B217F4 for ; Thu, 13 Feb 2020 11:46:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="PsIgWXyn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729852AbgBMLqF (ORCPT ); Thu, 13 Feb 2020 06:46:05 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:33372 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbgBMLqF (ORCPT ); Thu, 13 Feb 2020 06:46:05 -0500 Received: from pps.filterd (m0048105.ppops.net [127.0.0.1]) by mx0a-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01DBh1S5010035 for ; Thu, 13 Feb 2020 04:46:04 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by mx0a-00183b01.pphosted.com with ESMTP id 2y1ufxergv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 04:46:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SESsLZ/EmHO7jvRmRNC1X4W4rwmblcPhYjPnzf+KTssjCsMFg+KIGXZLChjscmLQtbtwgq152m7b6hEuu6BlZnNL9wrdLgPED59V83IHhJ0jFNIRnMWoK4vvfp8QWYbKm8gfIwiggjmEITIkbI/lCS0LNDTGxprcyvVQ/OfqGSyvddXIXZuNer/T3VzivnarP8qCABr8K2YmgCnNaprRa9p9W0QdbZSAQovECua5xfD1OC/YObBGC4fiQxG5Xwr+ulf9cVgA0Us2UqcmJra3c0LpWgmSYCtD0d67JmMO2muQ50s6h3O+bz7lfc+P3eP6Hdw7A4LduD8fMhIgGPv/yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/4PwYidN/ADXtQtXEYXSzCdpdzu4ZaPnW2+Xc74MbT4=; b=RROCKTx3pDiNOG/B8IAqhSPy6bzqB4bHfWEoQIqCy+0XnaTBHhOdkAlK8G1CTwgeV9bBalBrFwa1b/BVhtYd5r/AcpC7N0d+OlK96mw9x2a5Yq2V3wPCMPFSxOjHSbEGLXIWyOZEfUXWPs7xiGhbnwk8h6dTBl70s09zGRGARI030kbhO8uy/4Dlb9QOVBCYcO9czykp7YM8D98riO+T7ZM08N8shP3mFh+RbWWllko/GoE1HVhtKCbv/KRrstMSZ97O1UJ9x06dqCyQpcCLR7ToXb2PNJGM6GwvPBRMsoL8qM7j1tZxTUlPdXYF3uBu3DvvWaDLcyXF2yqA9uWwWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/4PwYidN/ADXtQtXEYXSzCdpdzu4ZaPnW2+Xc74MbT4=; b=PsIgWXynR52mWLsjZ2SVYfvQ3VKmWPni1fEvyrQ0d036bEwogTIxjIPEYmIheTf1kMwaSL3uoZteyrRgkEcjapyVstfSNKNFUWVgtB9sPzt+oEMkVoWIS2o4mTCBoSsjJIm3niooJ65eggjjp3/vsqVxoLVKrMdDcBCr1F+xC/4= Received: from SN6PR05MB4397.namprd05.prod.outlook.com (52.135.73.16) by SN6PR05MB4560.namprd05.prod.outlook.com (52.135.75.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.16; Thu, 13 Feb 2020 11:46:02 +0000 Received: from SN6PR05MB4397.namprd05.prod.outlook.com ([fe80::d002:cb3b:6c19:8b96]) by SN6PR05MB4397.namprd05.prod.outlook.com ([fe80::d002:cb3b:6c19:8b96%6]) with mapi id 15.20.2729.020; Thu, 13 Feb 2020 11:46:01 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5597.namprd05.prod.outlook.com (52.135.111.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.16; Thu, 13 Feb 2020 11:45:30 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::25b7:98a0:c066:1a9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::25b7:98a0:c066:1a9%6]) with mapi id 15.20.2729.021; Thu, 13 Feb 2020 11:45:30 +0000 Received: from bars.quantenna.com (195.182.157.78) by HE1PR05CA0129.eurprd05.prod.outlook.com (2603:10a6:7:28::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Thu, 13 Feb 2020 11:45:29 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Sergey Matyukevich Subject: [PATCH 3/5] qtnfmac: set valid edmg in cfg80211_chan_def Thread-Topic: [PATCH 3/5] qtnfmac: set valid edmg in cfg80211_chan_def Thread-Index: AQHV4mMXAwb/JCOU2EiG4m8XUoR+3g== Date: Thu, 13 Feb 2020 11:45:30 +0000 Message-ID: <20200213114518.4415-4-sergey.matyukevich.os@quantenna.com> References: <20200213114518.4415-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20200213114518.4415-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR05CA0129.eurprd05.prod.outlook.com (2603:10a6:7:28::16) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) 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: 379374d6-27ca-43a7-634e-08d7b07a39f2 x-ms-traffictypediagnostic: SN6PR05MB5597:|SN6PR05MB4560: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 2/13/2020 11:45:59 AM x-ms-oob-tlc-oobclassifiers: OLM:102; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39850400004)(346002)(396003)(136003)(199004)(189003)(6916009)(36756003)(103116003)(26005)(71200400001)(2616005)(4326008)(6666004)(66946007)(186003)(956004)(16526019)(5660300002)(107886003)(478600001)(66476007)(66446008)(81166006)(6486002)(64756008)(66556008)(2906002)(1076003)(8936002)(8676002)(81156014)(86362001)(316002)(7696005)(52116002)(4744005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR05MB4560; H:SN6PR05MB4397.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZhBN582WFq2j7d76aWWj3DwaKddgEt4l8gPdchC7trSbt1/4ek5AJehY6z1UGNLITsZkllNFHWSno8SkCBPn2pgf2d0Qcl93hvKqyL5LrwjGWrXqVyZoyekisgtlRIzk9jRx2G+8OYTmtOunrg3BB2w/160S+yNLPavXb5Rs+hLc7E9dpW9VMUr4PnTlIQi5CbLTrYJDSSV5fsEuZveb9wpW/7vLg8wvCJieamRbsIMmXoVh6khj4VMS4jCAC+lwJWN34YSxNPso6ZJV4Wwh6/jeOIqvjmwtbnDUY1Aay2T4BsmgkqOb0z6XkZoApiNGnFzKAJK5Emagvz9itQrR3eIMzED3b5ClWpne2bbTwM9EzzHWCPH+njcy/yePMaN+LtFvBBP1FjT2QCLANFzTCVQOAroeBGS8Cs+zqiS4SK+j+uNWGHJ3mzEpUBlsJhWp x-ms-exchange-antispam-messagedata: TH0J+FLi2KcCtFyZRKE/pRkt/FI0HBKHgJO2Z3lkoqaRI6ZnMGhBEph4nK6Ag1dC5/i9SL14eBBeH6nqDqupp/DfFCAguz6mkYg24uuro9rpiJ6Xksmw6K7tfTnxJiCufzPDRF9QembR3Eiq2zRIHw== MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 379374d6-27ca-43a7-634e-08d7b07a39f2 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-userprincipalname: ubPcpsNoAmNEp6Zy3Oai7cybGNvSyZm2w5IePlxp/HYBBdLTRf6xH04EmtxtryG6Viy7TIAwm3lmFc6rmZmCd0kn6tZPDtQCtmNVSjD64EGNMb4hqNE/uFj9AoHG1S6XoBciO+/4Hyog2/KH2wDVkghUw0jnGrqXeLO4yI4/pnbEQ/hn91Ssu7zvSC6CWNtcISmicpQZLgPkTbUsJlpaz8BI8tr7QYCROIP8KrfJfxw= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:46:02.0074 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4560 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-13_03:2020-02-12,2020-02-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 impostorscore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=769 lowpriorityscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002130093 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Make sure that edmg field of cfg80211_chan_def structure is properly initialized by zeros. Otherwise cfg80211_chandef_valid may return false if edmg fields contain some garbage. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/qlink_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c index 1a972bce7b8b..30b60d6ae546 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c @@ -124,6 +124,8 @@ void qlink_chandef_q2cfg(struct wiphy *wiphy, chdef->center_freq1 = le16_to_cpu(qch->center_freq1); chdef->center_freq2 = le16_to_cpu(qch->center_freq2); chdef->width = qlink_chanwidth_to_nl(qch->width); + chdef->edmg.bw_config = 0; + chdef->edmg.channels = 0; } void qlink_chandef_cfg2q(const struct cfg80211_chan_def *chdef, From patchwork Thu Feb 13 11:45:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 216470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8F61C2BA83 for ; Thu, 13 Feb 2020 11:46:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A56AD217F4 for ; Thu, 13 Feb 2020 11:46:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="BX/9CzwC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729893AbgBMLqO (ORCPT ); Thu, 13 Feb 2020 06:46:14 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:30078 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729511AbgBMLqN (ORCPT ); Thu, 13 Feb 2020 06:46:13 -0500 Received: from pps.filterd (m0059811.ppops.net [127.0.0.1]) by mx0b-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01DBgx8I005138 for ; Thu, 13 Feb 2020 04:46:12 -0700 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by mx0b-00183b01.pphosted.com with ESMTP id 2y1u7fc5ys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 04:46:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fHI1FX+2PO3VvpgQYVqhGn3FOJh8+cJNa+P3YwPU07FsEhUi1ztrF+Lyrp6YzgbL7GF24YjNVXhjQxw4h8ndJgq2dg0ofSxjr0W/gLz+l0o/rn7V/Zj9Y6bJm4fW6PIvbS7CsfiVR6gJXiav2gEwF+x7e5OcnUjyjO5xEB0ELBVpVjcXGFDIUPOmRcEshO4PNp63z/vnUJBe4G8d8dUosQip8u2BBW+yiou/sDaCdFbcAnHkdfFxITNQXD4BVRJ6H5GAy5KiwqoJgiFrY59vlZUOa5aeDxxKHSLXOUvRfVzxNTTdivA8nKmNEwfQwec4mmMJ3EPHTiKIj4VSP/O6EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LmfCGkq31scRroXJnt2yI+gDaIyg78GPeC+5BpF9yFw=; b=CVFjAbCHHQgO34ZThKTPQ/CNbp0CrwwVs3dQnC8jFtiIQqeGidScVaML1l+6BHQfNbR7aO77zRSn6tbUHP3lIEYRRoiNmzFjWprJQxUYKxb23m0il6R21kelsFWToPvX+QKzcebadbWfHiaWWau09Alo/WmoAXe+SzWwMcouUl5dY9r6/xswqsblHOqjqYo/6KGypjqUZIdHEYxMjJD9CcSyPp4w3/lrY2M4E3WfvQo2MgwytJQxnbwpS9l2WkcF/zMOVzOzPTAjS4516zsMPsj58pp9TmHRybIGHBd8j9jVjqh2Enwm8c21k9+rJYOvhStJ298L2OrhxMubK3X9uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LmfCGkq31scRroXJnt2yI+gDaIyg78GPeC+5BpF9yFw=; b=BX/9CzwCExr5UCXCS6yrpFZQDHx+HtS1R0BniRU3Zy68wqPyTh22b1zug6XzDw2FIx+bM+YvhpzFuIeSR+Dxdp6sHBeF5PvF3h0gmDPymdfgUtjD88XQpRKlitoW391lrepaTkQPrT6DNC8wFbV4Jkze/N2sUjfaEw2s5B0zRzw= Received: from DM6PR05MB6890.namprd05.prod.outlook.com (52.132.248.88) by DM6PR05MB4585.namprd05.prod.outlook.com (20.176.79.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.16; Thu, 13 Feb 2020 11:46:10 +0000 Received: from DM6PR05MB6890.namprd05.prod.outlook.com ([fe80::a8ea:6419:e3c5:ae00]) by DM6PR05MB6890.namprd05.prod.outlook.com ([fe80::a8ea:6419:e3c5:ae00%5]) with mapi id 15.20.2750.007; Thu, 13 Feb 2020 11:46:10 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5597.namprd05.prod.outlook.com (52.135.111.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.16; Thu, 13 Feb 2020 11:45:31 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::25b7:98a0:c066:1a9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::25b7:98a0:c066:1a9%6]) with mapi id 15.20.2729.021; Thu, 13 Feb 2020 11:45:31 +0000 Received: from bars.quantenna.com (195.182.157.78) by HE1PR05CA0129.eurprd05.prod.outlook.com (2603:10a6:7:28::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Thu, 13 Feb 2020 11:45:30 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Sergey Matyukevich Subject: [PATCH 4/5] qtnfmac: assign each wiphy to its own virtual platform device Thread-Topic: [PATCH 4/5] qtnfmac: assign each wiphy to its own virtual platform device Thread-Index: AQHV4mMYRBFgSK3BiESW42L3aWadlw== Date: Thu, 13 Feb 2020 11:45:31 +0000 Message-ID: <20200213114518.4415-5-sergey.matyukevich.os@quantenna.com> References: <20200213114518.4415-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20200213114518.4415-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR05CA0129.eurprd05.prod.outlook.com (2603:10a6:7:28::16) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) 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: 835a532c-ee5d-4b42-d4fb-08d7b07a3aa2 x-ms-traffictypediagnostic: SN6PR05MB5597:|DM6PR05MB4585: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 2/13/2020 11:46:07 AM x-ms-oob-tlc-oobclassifiers: OLM:3631; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(376002)(346002)(39850400004)(366004)(189003)(199004)(7696005)(5660300002)(8936002)(86362001)(52116002)(26005)(81156014)(956004)(81166006)(2616005)(66446008)(66556008)(66946007)(8676002)(186003)(16526019)(66476007)(64756008)(2906002)(6916009)(4326008)(6486002)(316002)(36756003)(1076003)(107886003)(478600001)(71200400001)(103116003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR05MB4585; H:DM6PR05MB6890.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: BCL:0; x-microsoft-antispam-message-info: vRH+6PhzyYndwm15pRgBpWnP3XeIzCfhoH18JDbitGUtR6UsBnL+G6KRZ/ISn5j5nHbgcxCJXocOJz0L4X/RgxisGX5VsBtzT+RY9igQDwzYbwNjb8GzNlv3DUdPa493u90KSv+hnpBy1jSzAFvLw8MvEdN0Q4to6MAL1pHyMcFGUi93TByKxlx01pTrR272pjB3gjW44R3AMnkxTntyVw6wk/cXM3lCIh6C+9d9RkYarLcNMjTwPhaiyLkj9EqmSvUWQnzVuuG7SmUomTGIWK7UA0t+DQD4E9HRwDG6/f7rnhwLU2ktfXEuStxFA/VzXWRg8s/w2Lq5o5K8HrXyPz7IIl0fS2QhD4jaqGhZZiDeBvI5cITF+iYw5XBubPrT0+jp5LAwKmA82SK08K7BKTSXH6jxRtr+0jcLLbBGWI6x8DhIuUzD4s77tlqCwwDj x-ms-exchange-antispam-messagedata: ezKSxA/5d6HZmomRPNLNTIAeVKDqg1owDoQGKyzMLaJLEm96XuQlSo1TiNx/FAkY3msF4Qs2ciiCWV1Fzd7gQNeEqSRZxxe5MNSnn+62SvTQhc6vRXmpNjlRs9z11ClpmKLpbQTRDvMHVnvrC25Tnw== MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 835a532c-ee5d-4b42-d4fb-08d7b07a3aa2 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-userprincipalname: Zgwjaqi42+dKlIQDo22vj5p4DHUhUgWUeIfzybrYWlSgXDLLzQGwpL4qbtsealKp6ttlP4Vsb72BCZdD+3oSlDNsJttOrVs2joiIrxBkh1QuM9nE1c/oQPeAB/Ec85+UL3nfiHyjS9iM6bPsFuO98ZIm15f9m+fcK0Vg3lMuopbioSqaMffxQ4oAj1duDLT/7Cg4yds8BRQa8o4MRaHGCd20Sr8UqNPqy7gcg7waQkQ= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:46:10.6969 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4585 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-13_03:2020-02-12,2020-02-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002130093 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Quantenna Pearl device exposes multiple (up to 3) radio interfaces under single PCIe function. So far all the wiphy devices were attached to the same pcie device. As a result, all different wireless network devices were reported under the same sysfs directory for pcie device, e.g.: $ ls /sys/class/net/wlan0/device/net/ wlan0 wlan1 It turns out that such behavior may confuse various users of wireless subsystem. For instance, it turned out to be the case for: - Linux init systems, e.g. for renaming based on parent device - OpenWRT configuration scripts Suggested solution is to add an intermediate virtual platform device for each radio interface. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 8 ++++++-- drivers/net/wireless/quantenna/qtnfmac/core.c | 18 ++++++++++++++---- drivers/net/wireless/quantenna/qtnfmac/core.h | 5 ++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 722d5caefe3c..018d3ed75fda 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1061,7 +1061,8 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy, } } -struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) +struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus, + struct platform_device *pdev) { struct wiphy *wiphy; @@ -1076,7 +1077,10 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) if (!wiphy) return NULL; - set_wiphy_dev(wiphy, bus->dev); + if (pdev) + set_wiphy_dev(wiphy, &pdev->dev); + else + set_wiphy_dev(wiphy, bus->dev); return wiphy; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 9e666fac8b5f..eea777f8acea 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -431,18 +431,28 @@ static void qtnf_vif_send_data_high_pri(struct work_struct *work) static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, unsigned int macid) { + struct platform_device *pdev = NULL; + struct qtnf_wmac *mac; struct qtnf_vif *vif; struct wiphy *wiphy; - struct qtnf_wmac *mac; unsigned int i; - wiphy = qtnf_wiphy_allocate(bus); + if (bus->hw_info.num_mac > 1) { + pdev = platform_device_register_data(bus->dev, + dev_name(bus->dev), + macid, NULL, 0); + if (IS_ERR(pdev)) + return ERR_PTR(-EINVAL); + } + + wiphy = qtnf_wiphy_allocate(bus, pdev); if (!wiphy) return ERR_PTR(-ENOMEM); mac = wiphy_priv(wiphy); mac->macid = macid; + mac->pdev = pdev; mac->bus = bus; mutex_init(&mac->mac_lock); INIT_DELAYED_WORK(&mac->scan_timeout, qtnf_mac_scan_timeout); @@ -493,7 +503,6 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, dev_net_set(dev, wiphy_net(wiphy)); dev->ieee80211_ptr = &vif->wdev; ether_addr_copy(dev->dev_addr, vif->mac_addr); - SET_NETDEV_DEV(dev, wiphy_dev(wiphy)); dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT; dev->tx_queue_len = 100; @@ -505,7 +514,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, qdev_vif = netdev_priv(dev); *((void **)qdev_vif) = vif; - SET_NETDEV_DEV(dev, mac->bus->dev); + SET_NETDEV_DEV(dev, wiphy_dev(wiphy)); ret = register_netdevice(dev); if (ret) { @@ -561,6 +570,7 @@ static void qtnf_core_mac_detach(struct qtnf_bus *bus, unsigned int macid) wiphy->bands[band] = NULL; } + platform_device_unregister(mac->pdev); qtnf_mac_iface_comb_free(mac); qtnf_mac_ext_caps_free(mac); kfree(mac->macinfo.wowlan); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index b993f9ca14c5..269ce12cf8bf 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -20,6 +20,7 @@ #include #include #include +#include #include "qlink.h" #include "trans.h" @@ -107,6 +108,7 @@ struct qtnf_wmac { struct mutex mac_lock; /* lock during wmac speicific ops */ struct delayed_work scan_timeout; struct ieee80211_regdomain *rd; + struct platform_device *pdev; }; struct qtnf_hw_info { @@ -127,7 +129,8 @@ void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac); void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac); bool qtnf_slave_radar_get(void); bool qtnf_dfs_offload_get(void); -struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus); +struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus, + struct platform_device *pdev); int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv, const char *name, unsigned char name_assign_type); void qtnf_main_work_queue(struct work_struct *work);