From patchwork Thu Feb 13 11:45:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11380217 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89F9A921 for ; Thu, 13 Feb 2020 11:46:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F156218AC for ; Thu, 13 Feb 2020 11:46:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="dVpBjSAE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729794AbgBMLp7 (ORCPT ); Thu, 13 Feb 2020 06:45:59 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:17030 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbgBMLp7 (ORCPT ); Thu, 13 Feb 2020 06:45:59 -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 01DBhBds010061 for ; Thu, 13 Feb 2020 04:45:58 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by mx0a-00183b01.pphosted.com with ESMTP id 2y1ufxergd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 04:45:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CUZxEN8oYe1Vo5REHk+r2Vu3A1qeFX6u/VClPIhscXoCvSYJ7EDO8cvP80ex4JdIIzv4c4A4XD4sO2LvXHQfE/YhdFcawdEQQM4ARILKRGbKr0eRUsfFVARCsHwkD6Mrkrj2xw+YhsjuYqURUvZR5s7sPPnVt0Sd7ckgKVya7LuA/vaWuDyPPsEE1QOIDokB3Ksz00MGaIEqwl80DLRNk3BTAOeXJ9dFUI2VI+HZ9x+eDxm5tEeElW3Curcp5NAvcIA+RuRXdSJIPhNzdceb9kAQKkzAHh+j5TQiUoVnE0AFI7l7W1FLVwA83FZoSfkCMIylHXuqYiX7/FyDsaq6jg== 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=el9npCRvZOYKPizhWjXAh+K6CK3jY3SRFNl394/bMFM=; b=iDJblHeovyd9TCJKb6OPojFCrk2Ls/w4SnjQQdcYuixfodNfROSdoZqFM9ngPKLaR5mTiIXQ0TMIn9zQXQy+TgC+tJhW5aXZ4hUCzkPzbOcMUzX3pl1RdVJLa3VIXakWjdskvN63K/t/+tHeCewkBRklKKssZ5bWZawsgmXFtdnHc7lbLNwqSBHFJ08aW/+wlgiji9bBQ3SipG9NQIU5tO/7vFSuTsluDhls1F6uMUHiRr+wuKMRanKykfIu82EIZo2lHrxCJJgs3XRyN2PPxgqCqTz6jJ5WDBeS4UC1WYiIzuj0HCrBJukVA5B/y4Iuib61cLQpFymbe+qNwMoE6Q== 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=el9npCRvZOYKPizhWjXAh+K6CK3jY3SRFNl394/bMFM=; b=dVpBjSAEf6wsmlI3e5h3Fum/USPEJafU+pwOMHYu5nBhXMdd1cd/s/hY0gT/obRe93zvd9Fp4InnQgZniGvweOawujHEir0AkEW1MNjaUFc5tQaEimYWG70KWc9KneLYvFdGae4KlH3jnkFlL3m+4RaNPv7mIMV0HGqgPiBZhX0= Received: from SN6PR05MB4109.namprd05.prod.outlook.com (52.132.125.141) by SN6PR05MB4078.namprd05.prod.outlook.com (52.132.124.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.6; Thu, 13 Feb 2020 11:45:56 +0000 Received: from SN6PR05MB4109.namprd05.prod.outlook.com ([fe80::6476:f5a8:6675:edc6]) by SN6PR05MB4109.namprd05.prod.outlook.com ([fe80::6476:f5a8:6675:edc6%7]) with mapi id 15.20.2750.000; Thu, 13 Feb 2020 11:45:56 +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:28 +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:28 +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:27 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Sergey Matyukevich Subject: [PATCH 1/5] qtnfmac: support WPA3 SAE in AP mode Thread-Topic: [PATCH 1/5] qtnfmac: support WPA3 SAE in AP mode Thread-Index: AQHV4mMWctbKJmYQ5EeAELHrKvmqUg== Date: Thu, 13 Feb 2020 11:45:28 +0000 Message-ID: <20200213114518.4415-2-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: 262b71f4-621d-4602-4a34-08d7b07a38a9 x-ms-traffictypediagnostic: SN6PR05MB5597:|SN6PR05MB4078: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 2/13/2020 11:45:53 AM x-ms-oob-tlc-oobclassifiers: OLM:87; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(39850400004)(376002)(136003)(366004)(346002)(199004)(189003)(1076003)(66446008)(316002)(7696005)(52116002)(64756008)(66476007)(66556008)(81166006)(66946007)(86362001)(478600001)(2616005)(956004)(103116003)(16526019)(5660300002)(26005)(2906002)(186003)(36756003)(6486002)(4326008)(107886003)(81156014)(6916009)(71200400001)(8936002)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR05MB4078;H:SN6PR05MB4109.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: NgYmGOdORkN9S2Vm/7EbgWQFWgg+LveJwhNjwgvGFSDpzQEJ2XLmEpd/r+aFfX++sAbA7wGeF7YUAmmLW1a4Mpkwf+nQzU/2jOzjgX4JYTPZBpf/a8+JG01oHOiRJgpKaKd7ggbHa+5LXC44XnH5BQAS17/4wZio0NrVLjr5xR1gyKmzfYVXI3/MqHGdpTkxYfCtnhKlbTergGIBRHNcM0HEBKmfX4X84s1I5/4AqrC9oa+1heiaXR6OG0cuU5ID+72aSOJkneRM06k312rfM3lribjMYzJdjV9kzV0wXUWPPyZiERIdOcqcrwW2FkJPeayBU9ObsqV+Lr/kZE2zHvSBqSQoO0FXNzqCYSAZ0+fDxZI1cAotVV7t7TxFGm5BUB+wlIdmEVWKxab/bsJofjE2+qWaqNBQJ0fxp1jMLSm+t1TECHK5PhbQJzAIdmrE x-ms-exchange-antispam-messagedata: Ajr/ZLCkFv5I17lDc6ETHYOVYY8xkOHCdxTxvT6tECMbTqE082TiUtpnL5z6SnVyq/c/9ivwHQhMcsjDt07CakyR5QFWwTeqItyF+7y4Ja+kRO3x3MPPHPa0jVrnRwQ+/hp/vGjF3JNFjCjccIaKTA== MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 262b71f4-621d-4602-4a34-08d7b07a38a9 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: YHk0mroDFlGxx5g3tuOTHr8l1DihRpYElnN8sgyYLBUaKntGPpTG7r5drPDJVB04iJlrQH6p+fCqaCpnuBVg+Q1W4MgaAm3TdbRADGxzxdQSf/Q3+PFPCjWMyixVayrwMBAbZbnpfAoNJILCMUA3Wks4Cq0U8ER6O7SSC7d72RiYDbEL2qJG82Ga/SG4hYaE X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:45:56.0672 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4078 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=990 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 Enable WPA3 SAE support in AP mode. Driver currently supports cards that offload SAE authentication to userspace. So allow userspace software to subscribe and to send AUTH frames. Besides, enable AP mode support in external_auth cfg80211 callback. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 ++++----- drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/event.c | 6 +++--- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 73d5014a4234..a5ab1270add1 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -60,7 +60,8 @@ qtnf_mgmt_stypes[NUM_NL80211_IFTYPES] = { BIT(IEEE80211_STYPE_AUTH >> 4), }, [NL80211_IFTYPE_AP] = { - .tx = BIT(IEEE80211_STYPE_ACTION >> 4), + .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | + BIT(IEEE80211_STYPE_AUTH >> 4), .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | @@ -679,10 +680,8 @@ qtnf_external_auth(struct wiphy *wiphy, struct net_device *dev, struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); int ret; - if (vif->wdev.iftype != NL80211_IFTYPE_STATION) - return -EOPNOTSUPP; - - if (!ether_addr_equal(vif->bssid, auth->bssid)) + if (vif->wdev.iftype == NL80211_IFTYPE_STATION && + !ether_addr_equal(vif->bssid, auth->bssid)) pr_warn("unexpected bssid: %pM", auth->bssid); ret = qtnf_cmd_send_external_auth(vif, auth); diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index ccc1e06dfcf6..4a4c213fe9f1 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2211,7 +2211,7 @@ int qtnf_cmd_send_external_auth(struct qtnf_vif *vif, cmd = (struct qlink_cmd_external_auth *)cmd_skb->data; - ether_addr_copy(cmd->bssid, auth->bssid); + ether_addr_copy(cmd->peer, auth->bssid); cmd->status = cpu_to_le16(auth->status); qtnf_bus_lock(vif->mac->bus); diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 7e408b5c5549..cb610a7864ea 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -578,9 +578,9 @@ qtnf_event_handle_external_auth(struct qtnf_vif *vif, ether_addr_copy(auth.bssid, ev->bssid); auth.action = ev->action; - pr_info("%s: external auth bss=%pM action=%u akm=%u\n", - vif->netdev->name, auth.bssid, auth.action, - auth.key_mgmt_suite); + pr_debug("%s: external SAE processing: bss=%pM action=%u akm=%u\n", + vif->netdev->name, auth.bssid, auth.action, + auth.key_mgmt_suite); ret = cfg80211_external_auth_request(vif->netdev, &auth, GFP_KERNEL); if (ret) diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 7ee1070f985f..5e9254f8fa8a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -589,7 +589,7 @@ struct qlink_cmd_connect { */ struct qlink_cmd_external_auth { struct qlink_cmd chdr; - u8 bssid[ETH_ALEN]; + u8 peer[ETH_ALEN]; __le16 status; u8 payload[0]; } __packed; From patchwork Thu Feb 13 11:45:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11380221 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53385921 for ; Thu, 13 Feb 2020 11:46:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E78E218AC for ; Thu, 13 Feb 2020 11:46:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="OO2PGvYT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729872AbgBMLqJ (ORCPT ); Thu, 13 Feb 2020 06:46:09 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:60652 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbgBMLqJ (ORCPT ); Thu, 13 Feb 2020 06:46:09 -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 01DBh9lZ010055 for ; Thu, 13 Feb 2020 04:46:08 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2175.outbound.protection.outlook.com [104.47.57.175]) by mx0a-00183b01.pphosted.com with ESMTP id 2y1ufxerh1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 04:46:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g7vLqPIC6ODoGKvNusuH0ugosEguvcK7oRkXgdJJvow7GrTlQC8xRZQM+KHVLIFoCxSz+z9aFtSUO1P0H0j9rtOpp5Qtg0Z0HHSvP0P9DNfo+SLXlgYHfjndTyNDvhJ/yQ85zgaxTbtmzNkBGwORMOCMoTlZcAHH+9jhjUQW+o3frFI5NTVK9WkcNMEpbru437Mo5T22DOjKTpa1QIiZBnhyiZsPtGt42uQxNLL8paL3Yn1QFY2sHLXLNhlKzt9SyTq8kJyrPE5OBrTsOUYo4T3iCOBc/VT3KyecfjSRCk0iJGWQGaTN72aJrKxpj4aFgMNDXFfsnW94v/CEgUcgPw== 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=5blg9/oW9eT7WvvePOqZm6F5uKC6acr5xwktSAq2KSw=; b=lW7DJeqCoRrjyd2Djd1W1aCa+hNmg5rLiGZR+q8d1mwHc346/YdYrqexCWf36+j7X8pwteBdKjtJYCVLqMWs9kJsoE5lo9/2TLFvw8qZc7Vqku0uK5Y7wdrBjuxBLSm8VacOJX4xwsM62RZ+AMG43mOSwWd6fWSBFUh8C2ojbdockmNWbGNYV6CbqMm+WlSL99hXZKsxMKVIJm9cl1p3yqNQA0pbHaP0oDQQ7mvNBWeLE1LQY39ofQDegcQMenaQz8IGVr1FNgtPWQkorsuexs66bAFx60730EHHFoZrT/sp31mkToEC/t8BpP4IVpd7uQOlwl72FhFEMSlQb5IMPA== 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=5blg9/oW9eT7WvvePOqZm6F5uKC6acr5xwktSAq2KSw=; b=OO2PGvYTtb4S74q90Z1Pnn/lgB+ajp7xFFdpEFBHS5srCnL6vWUX2qcQ8bka7QSyZWzQgtV2D+Lwey3g2XwTIlRc5RR+JCG+d52p6Ea4BRU80CcM10Er3mjy3Lz82vdIW7eqQFccXeBYaW3n4PApLQP010cxk+/oe5nXpmP2bzs= Received: from CY4PR0501MB3779.namprd05.prod.outlook.com (52.132.101.18) by CY4PR0501MB3841.namprd05.prod.outlook.com (52.132.100.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.14; Thu, 13 Feb 2020 11:46:05 +0000 Received: from CY4PR0501MB3779.namprd05.prod.outlook.com ([fe80::11cd:7387:5fdc:2f7a]) by CY4PR0501MB3779.namprd05.prod.outlook.com ([fe80::11cd:7387:5fdc:2f7a%6]) with mapi id 15.20.2729.021; Thu, 13 Feb 2020 11:46:05 +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:29 +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:29 +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:28 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Sergey Matyukevich Subject: [PATCH 2/5] qtnfmac: support WPA3 OWE in AP mode Thread-Topic: [PATCH 2/5] qtnfmac: support WPA3 OWE in AP mode Thread-Index: AQHV4mMWiyW5CBbo+EifJhfDrmMz+A== Date: Thu, 13 Feb 2020 11:45:29 +0000 Message-ID: <20200213114518.4415-3-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: cfb0ba5c-1733-4058-fd2d-08d7b07a3956 x-ms-traffictypediagnostic: SN6PR05MB5597:|CY4PR0501MB3841: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 2/13/2020 11:46:01 AM x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(136003)(39850400004)(366004)(189003)(199004)(52116002)(7696005)(26005)(71200400001)(186003)(16526019)(81156014)(478600001)(36756003)(86362001)(6486002)(316002)(4326008)(2906002)(81166006)(8676002)(66476007)(107886003)(103116003)(956004)(2616005)(5660300002)(1076003)(66946007)(6916009)(64756008)(66556008)(8936002)(66446008);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR0501MB3841;H:CY4PR0501MB3779.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:3; 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: TwAe0q2LvcDPm6BjLr9MT6SMufSyngjCMHDwF810tqSoKMzcBrZFOHbYlLbaBuvX07u/PBG3UtCpQRUgg2dcfxEGpQiTPB0ENj+a/YZ5fg/N18C86ApMOvINxFLmx50B26WOc4Oz3HoGs5CzvPYMivJgzyn6hTr2Lrog8Io0yg/pgzgx/N1iQUdjkIktBScR1REib07TEbTJmZ6wWVVrnB/YC2Lrigt+6KXYdHaFVwNUxz2ZmwHmu3/U5yg9PsGXpSl+dI4LLdNiGkjeYLZcy2F3kq8bUr3wi/5nAlCE41Ody/tpcGKn9w6Ny0S8GqZLBsit3moDn5vY09r2yfqaxd93JUm6me4ZGoa/1UH7gM7xipalf88om3gz3fAuBL6PkZ5LeYUL8VJ0oRtMQ2hhmHhkNbWlnD4q/eS7vdblymFghKDB2wKzFh8x9judAHdk x-ms-exchange-antispam-messagedata: fVGNPAnDY6TydYdEHDRfFjpvXiy7MbKN2ywrQFeYlsMSEpknyRyuESwCmFTzyXNvzcxUrx9HjVTRPLst8xOmix2RicIK3GTqWvG9gH08GtjNtFOEwoLy14P6yE65db57w+fCgzBOAnqm2XPtTmR18Q== MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfb0ba5c-1733-4058-fd2d-08d7b07a3956 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: AsWuO0GcOrBBe75xp+TAnmjr05vpYQmrEXKN0O8yjC3nP60YXL5foXuvjNbZyyJI+u+Ok6E7tsupwj+nU8fRDEAvOYdrtKrZPKK+AT8EJIzqbezrA/GNL0HzOoWva4V0YQ53hWfjPfg22VUyzs1tRQwkDILMu0B0UJ31Tkxezi+ciUqtyvExYN3hxF1TQBnCXGDWweNiSFmW1eZGxmCJmMR1QYjY356ggIR4BCxindk= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:46:05.2666 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0501MB3841 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=999 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 Enable WPA3 OWE support in AP mode. Driver currently supports cards that offload OWE processing to userspace. This patch adds all the required tools for such offloading. Firmware requests OWE processing sending new UPDATE_OWE event to driver, which uses cfg80211_update_owe_info_event to notify userspace software. After OWE processing is completed, userspace sends calculated IEs to firmware using update_owe_info cfg80211 callback. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 21 ++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 36 +++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.h | 2 + drivers/net/wireless/quantenna/qtnfmac/event.c | 48 +++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 31 ++++++++++++++- 5 files changed, 137 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index a5ab1270add1..722d5caefe3c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -908,6 +908,26 @@ static int qtnf_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, return ret; } +static int qtnf_update_owe_info(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_update_owe_info *owe_info) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); + int ret; + + if (vif->wdev.iftype != NL80211_IFTYPE_AP) + return -EOPNOTSUPP; + + ret = qtnf_cmd_send_update_owe(vif, owe_info); + if (ret) { + pr_err("VIF%u.%u: failed to update owe info\n", + vif->mac->macid, vif->vifid); + goto out; + } + +out: + return ret; +} + #ifdef CONFIG_PM static int qtnf_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wowlan) { @@ -1004,6 +1024,7 @@ static struct cfg80211_ops qtn_cfg80211_ops = { .set_power_mgmt = qtnf_set_power_mgmt, .get_tx_power = qtnf_get_tx_power, .set_tx_power = qtnf_set_tx_power, + .update_owe_info = qtnf_update_owe_info, #ifdef CONFIG_PM .suspend = qtnf_suspend, .resume = qtnf_resume, diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 4a4c213fe9f1..f40d8c3c3d9e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2791,3 +2791,39 @@ int qtnf_cmd_netdev_changeupper(const struct qtnf_vif *vif, int br_domain) return ret; } + +int qtnf_cmd_send_update_owe(struct qtnf_vif *vif, + struct cfg80211_update_owe_info *owe) +{ + struct qlink_cmd_update_owe *cmd; + struct sk_buff *cmd_skb; + int ret; + + if (sizeof(*cmd) + owe->ie_len > QTNF_MAX_CMD_BUF_SIZE) { + pr_warn("VIF%u.%u: OWE update IEs too big: %zu\n", + vif->mac->macid, vif->vifid, owe->ie_len); + return -E2BIG; + } + + cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, + QLINK_CMD_UPDATE_OWE, + sizeof(*cmd)); + if (!cmd_skb) + return -ENOMEM; + + cmd = (struct qlink_cmd_update_owe *)cmd_skb->data; + ether_addr_copy(cmd->peer, owe->peer); + cmd->status = cpu_to_le16(owe->status); + if (owe->ie_len && owe->ie) + qtnf_cmd_skb_put_buffer(cmd_skb, owe->ie, owe->ie_len); + + qtnf_bus_lock(vif->mac->bus); + ret = qtnf_cmd_send(vif->mac->bus, cmd_skb); + if (ret) + goto out; + +out: + qtnf_bus_unlock(vif->mac->bus); + + return ret; +} diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h index 9db695101d28..72ad6ae5c750 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -76,5 +76,7 @@ int qtnf_cmd_set_tx_power(const struct qtnf_vif *vif, int qtnf_cmd_send_wowlan_set(const struct qtnf_vif *vif, const struct cfg80211_wowlan *wowl); int qtnf_cmd_netdev_changeupper(const struct qtnf_vif *vif, int br_domain); +int qtnf_cmd_send_update_owe(struct qtnf_vif *vif, + struct cfg80211_update_owe_info *owe); #endif /* QLINK_COMMANDS_H_ */ diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index cb610a7864ea..c775c177933b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -625,6 +625,50 @@ qtnf_event_handle_mic_failure(struct qtnf_vif *vif, return 0; } +static int +qtnf_event_handle_update_owe(struct qtnf_vif *vif, + const struct qlink_event_update_owe *owe_ev, + u16 len) +{ + struct wiphy *wiphy = priv_to_wiphy(vif->mac); + struct cfg80211_update_owe_info owe_info = {}; + const u16 ie_len = len - sizeof(*owe_ev); + u8 *ie; + + if (len < sizeof(*owe_ev)) { + pr_err("VIF%u.%u: payload is too short (%u < %zu)\n", + vif->mac->macid, vif->vifid, len, + sizeof(struct qlink_event_update_owe)); + return -EINVAL; + } + + if (!wiphy->registered || !vif->netdev) + return 0; + + if (vif->wdev.iftype != NL80211_IFTYPE_AP) { + pr_err("VIF%u.%u: UPDATE_OWE event when not in AP mode\n", + vif->mac->macid, vif->vifid); + return -EPROTO; + } + + ie = kzalloc(ie_len, GFP_KERNEL); + if (!ie) + return -ENOMEM; + + memcpy(owe_info.peer, owe_ev->peer, ETH_ALEN); + memcpy(ie, owe_ev->ies, ie_len); + owe_info.ie_len = ie_len; + owe_info.ie = ie; + + pr_info("%s: external OWE processing: peer=%pM\n", + vif->netdev->name, owe_ev->peer); + + cfg80211_update_owe_info_event(vif->netdev, &owe_info, GFP_KERNEL); + kfree(ie); + + return 0; +} + static int qtnf_event_parse(struct qtnf_wmac *mac, const struct sk_buff *event_skb) { @@ -693,6 +737,10 @@ static int qtnf_event_parse(struct qtnf_wmac *mac, ret = qtnf_event_handle_mic_failure(vif, (const void *)event, event_len); break; + case QLINK_EVENT_UPDATE_OWE: + ret = qtnf_event_handle_update_owe(vif, (const void *)event, + event_len); + break; default: pr_warn("unknown event type: %x\n", event_id); break; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 5e9254f8fa8a..4d22a54c034f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -15,7 +15,7 @@ #define QLINK_VER(_maj, _min) (((_maj) << QLINK_PROTO_VER_MAJOR_S) | (_min)) #define QLINK_PROTO_VER_MAJOR 18 -#define QLINK_PROTO_VER_MINOR 0 +#define QLINK_PROTO_VER_MINOR 1 #define QLINK_PROTO_VER \ QLINK_VER(QLINK_PROTO_VER_MAJOR, QLINK_PROTO_VER_MINOR) @@ -322,6 +322,7 @@ enum qlink_cmd_type { QLINK_CMD_WOWLAN_SET = 0x0063, QLINK_CMD_EXTERNAL_AUTH = 0x0066, QLINK_CMD_TXPWR = 0x0067, + QLINK_CMD_UPDATE_OWE = 0x0068, }; /** @@ -960,6 +961,20 @@ struct qlink_cmd_scan { u8 var_info[0]; } __packed; +/** + * struct qlink_cmd_update_owe - data for QLINK_CMD_UPDATE_OWE_INFO command + * + * @peer: MAC of the peer device for which OWE processing has been completed + * @status: OWE external processing status code + * @ies: IEs for the peer constructed by the user space + */ +struct qlink_cmd_update_owe { + struct qlink_cmd chdr; + u8 peer[ETH_ALEN]; + __le16 status; + u8 ies[0]; +} __packed; + /* QLINK Command Responses messages related definitions */ @@ -1222,6 +1237,7 @@ enum qlink_event_type { QLINK_EVENT_RADAR = 0x0029, QLINK_EVENT_EXTERNAL_AUTH = 0x0030, QLINK_EVENT_MIC_FAILURE = 0x0031, + QLINK_EVENT_UPDATE_OWE = 0x0032, }; /** @@ -1430,6 +1446,19 @@ struct qlink_event_mic_failure { u8 pairwise; } __packed; +/** + * struct qlink_event_update_owe - data for QLINK_EVENT_UPDATE_OWE event + * + * @peer: MAC addr of the peer device for which OWE processing needs to be done + * @ies: IEs from the peer + */ +struct qlink_event_update_owe { + struct qlink_event ehdr; + u8 peer[ETH_ALEN]; + u8 rsvd[2]; + u8 ies[0]; +} __packed; + /* QLINK TLVs (Type-Length Values) definitions */ 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: 11380219 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56AAD921 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 2D556218AC 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: 11380223 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0CE2921 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 A7216218AC 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); From patchwork Thu Feb 13 11:45:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11380225 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4083921 for ; Thu, 13 Feb 2020 11:46:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9D10217F4 for ; Thu, 13 Feb 2020 11:46:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="p6An2wyg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729937AbgBMLqe (ORCPT ); Thu, 13 Feb 2020 06:46:34 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:24864 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727059AbgBMLqd (ORCPT ); Thu, 13 Feb 2020 06:46:33 -0500 Received: from pps.filterd (m0048103.ppops.net [127.0.0.1]) by mx0b-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01DBkWEA014106 for ; Thu, 13 Feb 2020 04:46:32 -0700 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by mx0b-00183b01.pphosted.com with ESMTP id 2y1u4wm5vy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 04:46:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SmObKTP97uZsqXluoIBy/vbpepyYMH07dxMqxk/QtbIMUCWvD6N7KKGtvHNwsn+PM00GhHh5UDJwZGLQ1FmYr4CongXVKxDtjJ9lI95opdRQbe1pzW24LPLvL6OlNw6nA24I5i6DKheky9CTSDwb7Jj0SndrQ43j42eXO1VfeJDa+JGHZHtHwU6NoEtElzPsV0e9HyypvxiZ/Zj3PSUIhlabH4OjjO8wBTX4BsGKPlWle+ZEJnvOCcdsRQNutmmtp5A/PY5jNY/qMEVv2Uk2eEHZ37GpQk3mLw9Q3fBFqAfVMXmX195lfGGYj8gT3B8d8yS5vXHHgTW/UPJYm6eolA== 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=FOpphuJl/+QRnKNuSwIY9XwWw7FppD8ZV3CXEOGTqjU=; b=XwE2f4nx1qMWr3TfeezoQwboNmM8bng5Bknhax29mDG8ScvxTT3vwIW+nYlAZnGX60lR0OMAO3QyvFH+M7KyxxYm3RI8SF/BLf25ZbDyftHczf1SI3XpfN/YNUDzFabHzLMnt/KtCiyC3bSG8K56cFIVninKN17Ybuos47LhEYl+TfFlhUUJ90rPgysfZUFb2z1XBqzPsaPv/RXfyxGZQw5J+/n/zLOxGDmHHtN3hWs2wUIkG+co7zO9l+ZIG1dDTinqqCtue8JvsTTDpRdOxC7UbNbE6QKlH+FlAspfa+H9IP2WONjXD6BTLd8Mn4Z+yW7jCEo1EErwkkncO38JCQ== 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=FOpphuJl/+QRnKNuSwIY9XwWw7FppD8ZV3CXEOGTqjU=; b=p6An2wygdRcEOUhZvma0f+9kr7DvaiO6QqgTSazhoSkfenR3K7kCf0gRSkKEO3z9CSTAVVgCRFiDbDKxZCmu6qG0MK2XinDeHX7oBAUF4EDELaFHz+qptxbz9PMtUxOOfLh0AoHaOQ93DuD2BYMUiYx5EMMv6vghNwmLy4gIl68= Received: from SN6PR05MB5888.namprd05.prod.outlook.com (20.177.254.78) by SN6PR05MB4511.namprd05.prod.outlook.com (52.135.75.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.12; Thu, 13 Feb 2020 11:46:16 +0000 Received: from SN6PR05MB5888.namprd05.prod.outlook.com ([fe80::5994:1f67:71be:1e63]) by SN6PR05MB5888.namprd05.prod.outlook.com ([fe80::5994:1f67:71be:1e63%5]) with mapi id 15.20.2729.021; Thu, 13 Feb 2020 11:46:15 +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:32 +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:32 +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:31 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Sergey Matyukevich , Dmitrii Lebed Subject: [PATCH 5/5] qtnfmac: add interface combination check for repeater mode Thread-Topic: [PATCH 5/5] qtnfmac: add interface combination check for repeater mode Thread-Index: AQHV4mMZqKsbnxyHPUK4bJ5apGIf/g== Date: Thu, 13 Feb 2020 11:45:32 +0000 Message-ID: <20200213114518.4415-6-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: 386c29c5-6b3e-486f-30e5-08d7b07a3b54 x-ms-traffictypediagnostic: SN6PR05MB5597:|SN6PR05MB4511: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 2/13/2020 11:46:13 AM x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(376002)(396003)(136003)(366004)(346002)(199004)(189003)(2906002)(66556008)(8936002)(36756003)(66476007)(6486002)(478600001)(103116003)(1076003)(86362001)(64756008)(6916009)(66946007)(16526019)(2616005)(8676002)(186003)(5660300002)(71200400001)(956004)(316002)(54906003)(81166006)(4326008)(26005)(66446008)(107886003)(81156014)(7696005)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR05MB4511;H:SN6PR05MB5888.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: VLFGBOjAYKEtDIm2bCkqlk+5VVF3WLmutrWqOaF0oolLituPgtBTMMUdftIFqI9CfjbIVoDW9jxh4BVQdf37f8xGDE3KeJi+Koyo6MMUGcNko7NXc70n8z3cq0NqHhYtjpNbgwSiMmJaA5evjkVS4dnPXKQnK44QhDBfj8KD8Ri2CGYXCXmarjfdvBHPiLOANK1A+wtsLUzZfx3ULWvxRmwCX0DhGtjlmnowbfq/YXIBW/zvBEOTVTmiPjUdW+Ha3VKZou6DjnkY7PdBczTNTOVIsaPBGzvEMX7ZPIBQ0kkj7KjaIBQtLtFHu2ADfc5Y6HXs+MlmW+IwT6TKjyxpClh7g3rq3eSKYln5RJkMJ6EWvbyc1Bqrds3gDnnSqs0+kWlMQhUDDGjSNeH1wxhNAQyHBNHLIlbGWAlpncweoYXWK8Gss6p2pbVCbLxg9GPV x-ms-exchange-antispam-messagedata: lHUo1nHTEtFpRfnbXzwyGzPwU5kqe88Dp3/44NH4+s65POvYkpjGocjWWmG0TXQ9zIJtMgCWw9ghj6nPinbB87SlTm/A0Mhru3EChPPbJk7pd+cfzr7gGRh8kKUjbGMDx20QgZaYVVTwvBi/8N6YnA== MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 386c29c5-6b3e-486f-30e5-08d7b07a3b54 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: CUaY3vjb6GXnUd6AtV93JGhyyK4wov3tu8k8UkzJX1BbGUFP5eYOmHzhTW+N8vacTv0RkapLszWry6G8UE5OqJwsdGkxOqIAvPOOOS2YBiV6ypmFstyld0hd0QnA1ZKkNi6I3E7hcIL+N8l3HeO7SMHpQGKqt621jtZEJtqqqE+7btEI1aD4ZLZPmk2OOS6+o2+F5YQZ51N5Kaerg/1tUjGePCXn2N9qVY+Yi7EH3+I= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:46:15.8800 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4511 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 lowpriorityscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002130094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Dmitry Lebed Firmware supports only STA as primary interface in repeater mode. Since the only meaningful usage of AP + STA interface combination is repeater, reject such combination with AP as primary interface. Signed-off-by: Dmitry Lebed --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 018d3ed75fda..8be17106008d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -102,6 +102,21 @@ qtnf_validate_iface_combinations(struct wiphy *wiphy, ret = cfg80211_check_combinations(wiphy, ¶ms); + if (ret) + return ret; + + /* Check repeater interface combination: primary VIF should be STA only. + * STA (primary) + AP (secondary) is OK. + * AP (primary) + STA (secondary) is not supported. + */ + vif = qtnf_mac_get_base_vif(mac); + if (vif && vif->wdev.iftype == NL80211_IFTYPE_AP && + vif != change_vif && new_type == NL80211_IFTYPE_STATION) { + ret = -EINVAL; + pr_err("MAC%u invalid combination: AP as primary repeater interface is not supported\n", + mac->macid); + } + return ret; }