From patchwork Thu Jan 9 13:17:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11325659 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 AC4351395 for ; Thu, 9 Jan 2020 13:18:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98A1F20661 for ; Thu, 9 Jan 2020 13:18:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="REcryo3G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730910AbgAINSm (ORCPT ); Thu, 9 Jan 2020 08:18:42 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:55608 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729409AbgAINSl (ORCPT ); Thu, 9 Jan 2020 08:18:41 -0500 Received: from pps.filterd (m0059812.ppops.net [127.0.0.1]) by m0059812.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 009DB44W029584 for ; Thu, 9 Jan 2020 06:18:40 -0700 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by m0059812.ppops.net with ESMTP id 2xap4wwh0e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Jan 2020 06:18:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7rvKrWWICqWBOJ1k5pdPXfRkzRM6O5wRHy223DuMBj56XcR7U9cDd18kS6V+3sLFuW43u/kkpfOgzhx7VX4YgJ1fR6cSfOjFMAqHvytOyyVCLw+qhhHlwOBP+EuNyiIFtV8pRoFtJh8e2q35YittKH/68/MpBkUCkhFZdZgHP8eFlkzr2HdhaHE2sTVZaYQm/gxQdc8Jc5Nn/ciRMmgesf7bTHKNv4/ARqbxPxvj1b85eu0tF7Jyua9gawrYq9POJw29h7QMcUKgb9s9yjO+Nf3Mba+PThO905LMExt9rvEpoSh70J8c6mQEVCe3KHiZZNJfo28fevvoZyek4iYjQ== 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=V+Jp9R3qbfufuV5VwJAqdBD6AxcN9yiBz26CK2osK+U=; b=YT60DNcfGPF24uFsPZ+LK0hBW4tFiTEyKEp+lrv1IeEXVx0mUWX1b4Fnh4zJFOVYWDZFW/I48zJryElJmHLi/h0U7vO6JNITr7ajqAH4xZCwkPrvo/SS9LGTHf1bTkffZI+Bgb+Nupb+nwLGTG2iISUdj1YiCId4lFDwE7WM5YhTtybLNhy+GW87ABCmIi46gwYvvNKpICzZZaBpQfykC590nR1l40L527FTrO9oVWwjgd2wZMRdshrOS7jG2QhpM4mKrKEYVyi/qguRyRZ0g0pMUHiLj9C0lTgDq7OQ4fm+X7835uqhgnjV7GsiULcceDbx33fmi9vIL78yqpyriQ== 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=V+Jp9R3qbfufuV5VwJAqdBD6AxcN9yiBz26CK2osK+U=; b=REcryo3G0Oi3raYmxhWCQcwmNY0wBxchSUhCpXY2zTdsYdIyXxANLJWsknYigvPmkulLmoYswCbldEp3o47R/1HVadNJd9WzkWo6eEtWAxFYdFxphwgAjh97q46KBXh9408smdKrfc9MoC7ZBvAHTdMqHYiwS7H+9E6C9lrvb7I= Received: from DM6PR05MB4284.namprd05.prod.outlook.com (20.176.78.21) by DM6PR05MB6492.namprd05.prod.outlook.com (20.178.226.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.4; Thu, 9 Jan 2020 13:18:39 +0000 Received: from DM6PR05MB4284.namprd05.prod.outlook.com ([fe80::fc8f:de9a:ce53:81b0]) by DM6PR05MB4284.namprd05.prod.outlook.com ([fe80::fc8f:de9a:ce53:81b0%6]) with mapi id 15.20.2623.008; Thu, 9 Jan 2020 13:18:39 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB4637.namprd05.prod.outlook.com (52.135.114.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.6; Thu, 9 Jan 2020 13:18:07 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c%5]) with mapi id 15.20.2623.010; Thu, 9 Jan 2020 13:18:07 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 1/5] qtnfmac: cleanup slave_radar access function Date: Thu, 9 Jan 2020 16:17:51 +0300 Message-ID: <20200109131755.7729-2-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> References: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> X-ClientProxiedBy: HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) MIME-Version: 1.0 Received: from bars.quantenna.com (195.182.157.78) by HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.8 via Frontend Transport; Thu, 9 Jan 2020 13:18:05 +0000 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: c70f3ffd-c755-4e48-3a8b-08d795065daa X-MS-TrafficTypeDiagnostic: SN6PR05MB4637:|DM6PR05MB6492: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-Moderation-Data: 1/9/2020 1:18:37 PM X-MS-Oob-TLC-OOBClassifiers: OLM:792; X-Forefront-PRVS: 02778BF158 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39840400004)(346002)(136003)(396003)(366004)(376002)(199004)(189003)(6486002)(6666004)(478600001)(7696005)(86362001)(54906003)(52116002)(6916009)(8936002)(8676002)(4326008)(2906002)(186003)(26005)(16526019)(66476007)(66556008)(66946007)(81156014)(81166006)(107886003)(2616005)(5660300002)(36756003)(103116003)(1076003)(316002)(956004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR05MB6492;H:DM6PR05MB4284.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: Yh6F0HaATPcMo+EsHbG1BhcyRxYgfyFAq+DmvXgMXKKH+SBi838I6t8ISBhlVjOnh4yCoEhaPorgaEBcNgG8JAQhWXmmU+TrBWk+7e1u7gEXPCmsM/pM06X4O6qQiXr17cEWiMJkdUOIRmiVzyYlHuxPkhBm/IuqkWYsV5+/7LGbhp99ADsvz+nMLR09Wd049f89GyWgz3dhUON+HOg09vc2qF0W3Gvv7DIU8iX7ZOo/bIde4JI/PC40UiAKuIHFAAAefTH4b8izoTjwjsAGO/+LReLMZM0fgbCceJE6RnhjFKdRbqy7F3TELQqnthwzbURGSbcDQ+mCxVnh2TzwGVV+DbT+aaZQJ1VkPihLSVYVbbRPILPlsF4R45EctwuN+3avvxOcXOi8p3/sCnEDo6ppYaUUNOItE/V5hEDXyHiMb+hHf8cpTwZq6zvvBijL X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: c70f3ffd-c755-4e48-3a8b-08d795065daa 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: HNn7ZfmKmTIcl3ncs2kiyVh3hlqJ59BCPxrPY9BXGhuhQ3lNfly25GoZ2/zZj/t/cVu+i2rmGB1G0/HoT17/rmrdt7rQKE9E/Jaz7amC8UPnBE+ta/8yGCVaDE4tcjAK0uWzpbo9OKTdOs6MSkzb+zsVGd84X/zAA6u2lt6EKfG9F7yTFJWgz+8vkDbXhJyeKnOP7wF96oIPAIFrrCYXqf1QwjNlaCKtnT6q5tT5kBg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2020 13:18:39.3212 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB6492 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_02:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=3 clxscore=1015 mlxlogscore=999 phishscore=0 adultscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently this parameter is global, it is not specific to mac. So this function does not need any input parameters. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/core.c | 10 +++++----- drivers/net/wireless/quantenna/qtnfmac/core.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 59d089e092f9..25a9b512b8ce 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1056,7 +1056,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, qtnf_mac_slave_radar_get(wiphy)); + ret = qtnf_cmd_reg_notify(mac, req, qtnf_slave_radar_get()); 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/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 5fb598389487..3e6362d06bd4 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -23,6 +23,11 @@ MODULE_PARM_DESC(slave_radar, "set 0 to disable radar detection in slave mode"); static struct dentry *qtnf_debugfs_dir; +bool qtnf_slave_radar_get(void) +{ + return slave_radar; +} + struct qtnf_wmac *qtnf_core_get_mac(const struct qtnf_bus *bus, u8 macid) { struct qtnf_wmac *mac = NULL; @@ -456,11 +461,6 @@ 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 116ec16aa15b..949219c6cb8c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -133,7 +133,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); +bool qtnf_slave_radar_get(void); 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); From patchwork Thu Jan 9 13:17:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11325661 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 105C31580 for ; Thu, 9 Jan 2020 13:18:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEE9E2077C for ; Thu, 9 Jan 2020 13:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="GsaIcsIp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731023AbgAINSw (ORCPT ); Thu, 9 Jan 2020 08:18:52 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:62328 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbgAINSv (ORCPT ); Thu, 9 Jan 2020 08:18:51 -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 009DBsdC028958 for ; Thu, 9 Jan 2020 06:18:50 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by mx0a-00183b01.pphosted.com with ESMTP id 2xarvjwv1w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Jan 2020 06:18:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a1HWQGmBh/omsCWA8AyRYab+p+5JMijlj3HcJaoiUeZaVOCAo4Aj0017CIWZ2xOeiUJxgM1GwoxwyGfuFJFlVHdruqzB9PiHCvWvxumTPYEaxU+2y2ClWpEbjMMDrVpzyX2k47/+/GENRmWqq89YVDOPHcFl3smLnMHlaOykG3pVojckqkBXY1Z0DkVvsxce7fQ+u4A8vKMINSPC1MUWQj7hbESSS6EqjyhgjEm9RGsQd5npiZ4a3Q3ym5O945s3BE+D+p6GGVYiCfojGKigUqb2LhQqC1sy5yUQq+JIxrL8GuPdwsZGpPXEmL5/A2zvB5BpZs87FFeLirvyda2Ezw== 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=8FxAFLoJ6hwH7o9cn1/VHDMXcHffe+D+qoEELideN7o=; b=LNiiZ77D4Yw7+qNLux12j1i1IVHjrK/h+lRMk8QxhPsqEB8EGOoddRVgfg7xySZxhF/RIsLz33C569iaiLXb4lciCWDdcAIDDK4Dwc8CUMWBaIQ7ZvvlsWaXv8KRO6p+kFiUoqb5eSVSijDOBbybS5qgX4X3xUUIWJPDJhpin3+uF8gNvFptxTw/K6hogjYJBwYBxu3M3tf/v4q2nv6nNdsyd2wjvTMSvyAybFch4aKYHQbRMDiEt2gLnLYr7x6uBezq+8z9b3DQq5Zok4GkrXtw82lcZDjoogCs+LeZ7vwl7W64wPwoUMX3T5928cVYM3xR/wjOee9iMhyXA9Wkrw== 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=8FxAFLoJ6hwH7o9cn1/VHDMXcHffe+D+qoEELideN7o=; b=GsaIcsIpvWNrss3/mf1cyLM8ySJu9ZZjYVX6uIBmtfoCNMaf3fHW1UShE0jgkYgWwC5PMXHZnLXKZ0sAqgiJhZ3kvwlypEXvVTvpUya36oXJOgh+3QlCrSF/0/Y03cSzl8KqLBTIVPJ80oAKekjR7wmIb1Cv/CazLJv8Yf4nZjU= Received: from SN6PR05MB5519.namprd05.prod.outlook.com (52.135.108.218) by SN6PR05MB4861.namprd05.prod.outlook.com (52.135.115.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.4; Thu, 9 Jan 2020 13:18:48 +0000 Received: from SN6PR05MB5519.namprd05.prod.outlook.com ([fe80::550c:3a2f:f56:2d3e]) by SN6PR05MB5519.namprd05.prod.outlook.com ([fe80::550c:3a2f:f56:2d3e%7]) with mapi id 15.20.2623.008; Thu, 9 Jan 2020 13:18:47 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB4637.namprd05.prod.outlook.com (52.135.114.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.6; Thu, 9 Jan 2020 13:18:08 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c%5]) with mapi id 15.20.2623.010; Thu, 9 Jan 2020 13:18:08 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 2/5] qtnfmac: add module param to configure DFS offload Date: Thu, 9 Jan 2020 16:17:52 +0300 Message-ID: <20200109131755.7729-3-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> References: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> X-ClientProxiedBy: HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) MIME-Version: 1.0 Received: from bars.quantenna.com (195.182.157.78) by HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.8 via Frontend Transport; Thu, 9 Jan 2020 13:18:07 +0000 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: 48b15745-1769-4268-d139-08d795065ea2 X-MS-TrafficTypeDiagnostic: SN6PR05MB4637:|SN6PR05MB4861: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-Moderation-Data: 1/9/2020 1:18:43 PM X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 02778BF158 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39850400004)(396003)(376002)(346002)(189003)(199004)(956004)(2616005)(36756003)(26005)(86362001)(52116002)(186003)(6486002)(16526019)(7696005)(6916009)(4326008)(66556008)(1076003)(478600001)(66946007)(66476007)(2906002)(107886003)(5660300002)(8936002)(316002)(8676002)(81166006)(81156014)(103116003)(54906003)(6666004);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR05MB4861;H:SN6PR05MB5519.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: E8DUqmhxnwgbW8DbI80LZvhOswot9S7EOWi7hCxXPfVmPg3rvm5nxkwxY8xrjBiaIqYr1MLt77m8LlaAAvi4DuVHk7hbuzDFqHwv4pI1QeR8y3nB/LAqBw4RVMlgBcLWnJhFypKLwZ5UmYNR4CV60rf3DlgOm1+lavCN4ZG0QSfRa0Fbp31encA9z1Q8JihtCIZJylpUpv8BtlIgrUj+CSNMVfmbjMPTZguYZS+7YpYoAXeWuQ3uOewiVwlTTu3NRDOg26o/P94SHLBiA81WNGO/nsvmjdsZalYaa4GNuUYCgKHTQlyv9CLnsBff6HviiaWWmM80T+QiR3uQZESuNkmYwwQe/bNnGALfdzizGk2QmMGaViAWeJwL5EflDNNWeO2nexpOCCoLTjZrcQh51fF4/vQ69YUR1CzTLKXcB6rDmGXDvTRbQFi4tkfpC3rF X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48b15745-1769-4268-d139-08d795065ea2 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: 5bhcV5uMfoVhdbnSX73R2JQWz47u0Ba4xbp+ssZGZE2LLgMcTUl1+HYwbPdZi8rvs5VkSgiEajM/qTspix353tfrrdNhp3GZs/yqrQr2EKRxF51x78QsTFy/taY/8Olz9TjVqmOKh4h1p8HRZBh6Svn1fbaurs6TmXjNUBxGoJ4nid44/P13acLnzG7O6RWqWA0bJxD6s89B3kOW2+dkoA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2020 13:18:47.8158 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4861 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_02:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=3 lowpriorityscore=0 malwarescore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Firmware may support DFS offload. However the final decision on whether to use it or not should be up to the user. So even if firmware supports DFS offload, it should be enabled only if user explicitly requests it. For this purpose introduce kernel param dfs_offload which is disabled by default. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 ++++++--- drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 ++- drivers/net/wireless/quantenna/qtnfmac/commands.h | 2 +- drivers/net/wireless/quantenna/qtnfmac/core.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + drivers/net/wireless/quantenna/qtnfmac/qlink.h | 5 +++-- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 25a9b512b8ce..8849faa5bc10 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -1056,7 +1056,8 @@ 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, qtnf_slave_radar_get()); + ret = qtnf_cmd_reg_notify(mac, req, qtnf_slave_radar_get(), + qtnf_dfs_offload_get()); if (ret) { pr_err("MAC%u: failed to update region to %c%c: %d\n", mac->macid, req->alpha2[0], req->alpha2[1], ret); @@ -1078,7 +1079,8 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) { struct wiphy *wiphy; - if (bus->hw_info.hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) + if (qtnf_dfs_offload_get() && + (bus->hw_info.hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)) qtn_cfg80211_ops.start_radar_detection = NULL; if (!(bus->hw_info.hw_capab & QLINK_HW_CAPAB_PWR_MGMT)) @@ -1163,7 +1165,8 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) WIPHY_FLAG_NETNS_OK; wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; - if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) + if (qtnf_dfs_offload_get() && + (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD); if (hw_info->hw_capab & QLINK_HW_CAPAB_SCAN_DWELL) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 548f6ff6d0f2..fbeff01f902a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2454,7 +2454,7 @@ 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, - bool slave_radar) + bool slave_radar, bool dfs_offload) { struct wiphy *wiphy = priv_to_wiphy(mac); struct qtnf_bus *bus = mac->bus; @@ -2517,6 +2517,7 @@ int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req, } cmd->slave_radar = slave_radar; + cmd->dfs_offload = dfs_offload; 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 761755bf9ede..ab273257b078 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -58,7 +58,7 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, 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, - bool slave_radar); + bool slave_radar, bool dfs_offload); 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 3e6362d06bd4..9bd4c8f98308 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -21,6 +21,10 @@ 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 bool dfs_offload; +module_param(dfs_offload, bool, 0644); +MODULE_PARM_DESC(dfs_offload, "set 1 to enable DFS offload to firmware"); + static struct dentry *qtnf_debugfs_dir; bool qtnf_slave_radar_get(void) @@ -28,6 +32,11 @@ bool qtnf_slave_radar_get(void) return slave_radar; } +bool qtnf_dfs_offload_get(void) +{ + return dfs_offload; +} + struct qtnf_wmac *qtnf_core_get_mac(const struct qtnf_bus *bus, u8 macid) { struct qtnf_wmac *mac = NULL; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 949219c6cb8c..d715e1cd0006 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_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_slave_radar_get(void); +bool qtnf_dfs_offload_get(void); 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 75527f1bb306..799c622a160d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -596,8 +596,9 @@ 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. + * @slave_radar: whether slave device should enable radar detection. + * @dfs_offload: enable or disable DFS offload to firmware. * @info: variable portion of regulatory notifier callback. */ struct qlink_cmd_reg_notify { @@ -608,7 +609,7 @@ struct qlink_cmd_reg_notify { u8 num_channels; u8 dfs_region; u8 slave_radar; - u8 rsvd[1]; + u8 dfs_offload; u8 info[0]; } __packed; From patchwork Thu Jan 9 13:17:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11325671 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 572CD139A for ; Thu, 9 Jan 2020 13:29:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AB8020661 for ; Thu, 9 Jan 2020 13:29:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="R9oGgCTB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731131AbgAIN3a (ORCPT ); Thu, 9 Jan 2020 08:29:30 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:35850 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731054AbgAIN3a (ORCPT ); Thu, 9 Jan 2020 08:29:30 -0500 X-Greylist: delayed 634 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Jan 2020 08:29:29 EST Received: from pps.filterd (m0048104.ppops.net [127.0.0.1]) by mx0b-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 009DEiqp017503 for ; Thu, 9 Jan 2020 06:18:54 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by mx0b-00183b01.pphosted.com with ESMTP id 2xaptfb6nj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Jan 2020 06:18:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b2ZDnuKeMDOarUodZqeM079sUASL42UIbheZob0OrrDiAxs+AY7eVeA5sR0PJfduhUATw79Rn2gtx4tylARNA96lx73EImR17a2DtlabhRJSxIAitU+2BFf6qO7L1HhFm87drYOcJgnbF+KtimcaGHkFtmnPvGL5aIhBo5woQ1W2V5+uVX9U6+yTcjvaEMTWwlggXt/362GerJ505TA6yL9dT1oLPz7V1LsRJ+/WT4tuWgK2LDG61NYVjdxzato5PtyuiDP1nOpijuJPJjcG0FB0m8NHkIZtNfhC/KFtdLjdOoN5MQwPLySid6/Zv8Ai4kwl49+ZQR9mHCN2Z41LzA== 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=b/9dxbRQlH8B8BeaO+B50YmjF7ZDlJj48R7ftTGiFf4=; b=PPI33VbIvk2YGF89g8Yw9c/GG1lFG75GEiyQgXecjXJcwDJwDXkWnBfyM9LFl7JEZ7YA6wWh8oPIKoWeXy5EC4HKSiok1tGRbTp4NBKJ1QuI/xGY5sT4iiJInSqMX99tq4crvl6TcolllLKx5i+5oIiYq9I0hs+qYJDemiUf2L4LNrOY3+YOirZ6nXyPW00egfb+PjpILBWu/m+hVvvjJJVrfYG6v7qvDQSD0zgcPoJZ43Wnwzu+lS3tqNBv7dL6LzfCl1W08poO8Z69xI9DdDiSHeRI3AkNKy8PZ0YwilTThz3XOTArLo38xxvEcCb8sBPDN8THfHbiPnkk8lkjrQ== 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=b/9dxbRQlH8B8BeaO+B50YmjF7ZDlJj48R7ftTGiFf4=; b=R9oGgCTB8pi/k+bRuOuFG4hIad4LJBWTj6ovEsrvSNHq/uaCyCk0v8oDbNUdHKYQsgcqMGl9EPfqKp6MfziDFL0IOwRLw9HxzSCd/AFWkbmuO2OlR/NJ/RVjWjxBC3Fl/NTn8lQvVC0f4OW8Qij+0D3vnfZD33lRa9A2b8BAE50= Received: from BYAPR05MB5014.namprd05.prod.outlook.com (20.178.0.80) by BYAPR05MB6167.namprd05.prod.outlook.com (20.178.55.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.4; Thu, 9 Jan 2020 13:18:52 +0000 Received: from BYAPR05MB5014.namprd05.prod.outlook.com ([fe80::e44f:c766:5203:4dc3]) by BYAPR05MB5014.namprd05.prod.outlook.com ([fe80::e44f:c766:5203:4dc3%7]) with mapi id 15.20.2623.008; Thu, 9 Jan 2020 13:18:52 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB4637.namprd05.prod.outlook.com (52.135.114.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.6; Thu, 9 Jan 2020 13:18:10 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c%5]) with mapi id 15.20.2623.010; Thu, 9 Jan 2020 13:18:10 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 3/5] qtnfmac: control qtnfmac wireless interfaces bridging Date: Thu, 9 Jan 2020 16:17:53 +0300 Message-ID: <20200109131755.7729-4-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> References: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> X-ClientProxiedBy: HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) MIME-Version: 1.0 Received: from bars.quantenna.com (195.182.157.78) by HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.8 via Frontend Transport; Thu, 9 Jan 2020 13:18:09 +0000 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: e57fae75-5844-491f-1dc2-08d795065fa2 X-MS-TrafficTypeDiagnostic: SN6PR05MB4637:|BYAPR05MB6167: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-Moderation-Data: 1/9/2020 1:18:50 PM X-MS-Oob-TLC-OOBClassifiers: OLM:126; X-Forefront-PRVS: 02778BF158 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(136003)(346002)(396003)(39850400004)(376002)(199004)(189003)(1076003)(8936002)(81166006)(316002)(54906003)(6486002)(107886003)(5660300002)(2616005)(86362001)(956004)(36756003)(478600001)(103116003)(81156014)(6666004)(66556008)(8676002)(16526019)(6916009)(66476007)(2906002)(66946007)(26005)(186003)(7696005)(52116002)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB6167;H:BYAPR05MB5014.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: CkMy2lNkl5gk8TeyyKJ+pSujzU3mQLOr7ttdvstnNFuH+H/0bn9MpA3WUmAVHh+WX0xKzI6QNeSiXfHpe50fTHkOWCGsnHLxxrKqCCens4U67Ng7/FiaKI+K2aNwC544FhSJ9O5JNmBWsKN8h1xFkkV60lT9Bp/3kbAJEqaanwslIrd0XpXzUZG0ZuFcQmy3FNrAgwB2XBxzxrLh5vPfwMpnVfQKaDeaCBVSk82V6zWyzocZpu2nWvR7Fuz/jNZzChoiwfsOHkprHcTmGKxahn+0zVk0PIAzoqi5pv6hSL+q7jYgaqyKZAuDzofUINZNj7y/wdKVpxVIF3HzEh8vSJRI5APFJvvodf3KxqrwDmGsHOtn36f2GjVhruPC6oPCvCvJCqiiLJClVsK9BPnT+0RFqGi1rFhRg5uM9aRBo459rS22QxFOFRiWUQmTqPmC X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: e57fae75-5844-491f-1dc2-08d795065fa2 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: Ko3F72a88iKJbkVUOwgKu4RubkYhcuABQnQVK66rfH2ohUVR+rLLJtRg9T/Zo6qOst3M6MHGbJqDMetcYg8CjRTYc2CnE7cARcgEt8ls4FYSf/tJRfM8DVk0pDgtYM1CqwMHkrpc3v7hhYa27KJ4T4Av1vFnfF8paOq1deg0wc3aOMy98+MQWAdvugLOSeIL+VtDr8Xwl0cXg3UCDNNH/dSkKUAIKMHv2Mf2IbBWnMY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2020 13:18:52.8062 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB6167 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_02:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 lowpriorityscore=0 spamscore=0 suspectscore=1 bulkscore=0 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Bridging qtnfmac interfaces is possible only if the following two conditions are fulfilled: - firmware advertises proper support with QLINK_HW_CAPAB_HW_BRIDGE - kernel is built with CONFIG_NET_SWITCHDEV support Otherwise adding qtnfmac wireless interfaces into the same bridge should not be allowed since packets flooded by kernel may break internal forwarding rules between interfaces. This patch disables adding qtnfmac wireless interfaces into the same bridge if no support is provided either by card or by kernel. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/core.c | 52 +++++++++++++++++---------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 9bd4c8f98308..d723438732df 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -225,9 +225,6 @@ static int qtnf_netdev_port_parent_id(struct net_device *ndev, const struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); const struct qtnf_bus *bus = vif->mac->bus; - if (!(bus->hw_info.hw_capab & QLINK_HW_CAPAB_HW_BRIDGE)) - return -EOPNOTSUPP; - ppid->id_len = sizeof(bus->hw_id); memcpy(&ppid->id, bus->hw_id, ppid->id_len); @@ -665,12 +662,24 @@ bool qtnf_netdev_is_qtn(const struct net_device *ndev) return ndev->netdev_ops == &qtnf_netdev_ops; } +static int qtnf_check_br_ports(struct net_device *dev, void *data) +{ + struct net_device *ndev = data; + + if (dev != ndev && netdev_port_same_parent_id(dev, ndev)) + return -ENOTSUPP; + + return 0; +} + static int qtnf_core_netdevice_event(struct notifier_block *nb, unsigned long event, void *ptr) { struct net_device *ndev = netdev_notifier_info_to_dev(ptr); const struct netdev_notifier_changeupper_info *info; + struct net_device *brdev; struct qtnf_vif *vif; + struct qtnf_bus *bus; int br_domain; int ret = 0; @@ -681,25 +690,34 @@ static int qtnf_core_netdevice_event(struct notifier_block *nb, return NOTIFY_OK; vif = qtnf_netdev_get_priv(ndev); + bus = vif->mac->bus; switch (event) { case NETDEV_CHANGEUPPER: info = ptr; + brdev = info->upper_dev; - if (!netif_is_bridge_master(info->upper_dev)) + if (!netif_is_bridge_master(brdev)) break; pr_debug("[VIF%u.%u] change bridge: %s %s\n", - vif->mac->macid, vif->vifid, - netdev_name(info->upper_dev), + vif->mac->macid, vif->vifid, netdev_name(brdev), info->linking ? "add" : "del"); - if (info->linking) - br_domain = info->upper_dev->ifindex; - else - br_domain = ndev->ifindex; + if (IS_ENABLED(CONFIG_NET_SWITCHDEV) && + (bus->hw_info.hw_capab & QLINK_HW_CAPAB_HW_BRIDGE)) { + if (info->linking) + br_domain = brdev->ifindex; + else + br_domain = ndev->ifindex; + + ret = qtnf_cmd_netdev_changeupper(vif, br_domain); + } else { + ret = netdev_walk_all_lower_dev(brdev, + qtnf_check_br_ports, + ndev); + } - ret = qtnf_cmd_netdev_changeupper(vif, br_domain); break; default: break; @@ -772,13 +790,11 @@ int qtnf_core_attach(struct qtnf_bus *bus) } } - if (bus->hw_info.hw_capab & QLINK_HW_CAPAB_HW_BRIDGE) { - bus->netdev_nb.notifier_call = qtnf_core_netdevice_event; - ret = register_netdevice_notifier(&bus->netdev_nb); - if (ret) { - pr_err("failed to register netdev notifier: %d\n", ret); - goto error; - } + bus->netdev_nb.notifier_call = qtnf_core_netdevice_event; + ret = register_netdevice_notifier(&bus->netdev_nb); + if (ret) { + pr_err("failed to register netdev notifier: %d\n", ret); + goto error; } bus->fw_state = QTNF_FW_STATE_RUNNING; From patchwork Thu Jan 9 13:17:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11325665 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 E0DCD1395 for ; Thu, 9 Jan 2020 13:19:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B49922080D for ; Thu, 9 Jan 2020 13:19:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="a9ew6H4S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731027AbgAINTI (ORCPT ); Thu, 9 Jan 2020 08:19:08 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:42774 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbgAINTH (ORCPT ); Thu, 9 Jan 2020 08:19:07 -0500 Received: from pps.filterd (m0059812.ppops.net [127.0.0.1]) by m0059812.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 009DBojk030668 for ; Thu, 9 Jan 2020 06:19:06 -0700 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by m0059812.ppops.net with ESMTP id 2xap4wwh1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Jan 2020 06:19:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cOqnrIjRq29Bdl2MkCBpwiwZAg7viv/CcoMiyAUFWKn/YRdC0KvzyergUkDm/hZIW1UJ1PHaTD+dh5Np1jBfAXICDCZ+X3e1kBBUt1c/l0i1xivR7BFADfLUkRqhpR7xR/5GEgEMa2HZP/fYspcThMfIamL4kJNjwSB6VncMV2MhETps69Fl21zwVw790l6QRAbKk6LjY64p4vdbU5yvsXiCGklWBzC9bZZp1WUs6E/NyhcfYm4lOyIi/USA9YhSSoKgFaQp2okckeg+EnWZh+OJS9XBBk6m+mQ1xGGkNccfYazq9/e/jzbDQtC9+huzmpRQ9DWEA1xGRaNr4QDkVQ== 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=NCfV2qyprWmWuSjbPDOi6dG2OWq6h7VzAj1Oq4a8NcA=; b=DcNuPugL/qpXcmVMUff3MekGTJyggJJUdWQRGxDJIe/nlDdNyHhDmDrW6Gj4h+V1wl4jQJqSyVv8b73aeXThhuAPE8jCVgzQswnb3amQ0Y8QCwC45RQOB3/poP+XKofV7kWjJoiJe/DA0hyiXo+Q2Sp2gIW3ESIrRyriOtktxiv21WSYAwbrQ/BFvIcBuYUG1Fp4DgJy2RzBFZA3920B3M/VFFase/4iFjbEQtknPM8+eHbDQHNFmsRN6+hUaLr2kPWOTJM8tZu33LpCBLy0rU0mn6x6cHPk9iSfg3A8i3lAs//wVGmfn/N3x/ARRf3I/ABIFPjUbN/oVX+Vnzp4GA== 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=NCfV2qyprWmWuSjbPDOi6dG2OWq6h7VzAj1Oq4a8NcA=; b=a9ew6H4SztjAikPFLtVXi/utQwN1m2lH9ZSDZvNs/Ve5vp82eBcs6vsX1pNow6I7yxyvFa/FCsGHeZD0hMSGqqmEFpuaK53ogroPpWVvMAbwURcAWtaAPowclamAp7TvbjOroRGJalVBuNETVEyaGGvdM+MrvTAd7BlS/+ln0OE= Received: from DM5PR0501MB3718.namprd05.prod.outlook.com (10.167.107.143) by DM5PR0501MB3735.namprd05.prod.outlook.com (10.167.107.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.5; Thu, 9 Jan 2020 13:19:05 +0000 Received: from DM5PR0501MB3718.namprd05.prod.outlook.com ([fe80::c0dc:d81b:b815:afc9]) by DM5PR0501MB3718.namprd05.prod.outlook.com ([fe80::c0dc:d81b:b815:afc9%6]) with mapi id 15.20.2623.008; Thu, 9 Jan 2020 13:19:02 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB4637.namprd05.prod.outlook.com (52.135.114.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.6; Thu, 9 Jan 2020 13:18:12 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c%5]) with mapi id 15.20.2623.010; Thu, 9 Jan 2020 13:18:12 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 4/5] qtnfmac: add support for STA HE rates Date: Thu, 9 Jan 2020 16:17:54 +0300 Message-ID: <20200109131755.7729-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> References: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> X-ClientProxiedBy: HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) MIME-Version: 1.0 Received: from bars.quantenna.com (195.182.157.78) by HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.8 via Frontend Transport; Thu, 9 Jan 2020 13:18:10 +0000 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: 706dc147-f2d7-47cb-3f44-08d79506609a X-MS-TrafficTypeDiagnostic: SN6PR05MB4637:|DM5PR0501MB3735: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-Moderation-Data: 1/9/2020 1:18:59 PM X-MS-Oob-TLC-OOBClassifiers: OLM:106; X-Forefront-PRVS: 02778BF158 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(39850400004)(346002)(366004)(396003)(376002)(199004)(189003)(16526019)(107886003)(26005)(956004)(103116003)(8676002)(186003)(66476007)(5660300002)(2616005)(4326008)(66556008)(6486002)(6666004)(66946007)(478600001)(6916009)(2906002)(1076003)(86362001)(81166006)(36756003)(81156014)(316002)(8936002)(52116002)(7696005)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0501MB3735;H:DM5PR0501MB3718.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: GzenDb3NcuB3hRSIikw6RrwcuGh0tj3BQBsB9Ejpv2DccKED+krnzSFDhLcGt5f0GsJkHDjSJQ+JAvs+HIGABWinxDDdVRhRO15fE8nGgoJ9yTmuso9dFpM5pqaHQWCUiQmVXTRxq852fzBPLB8xQIqo9RiK4d3ez4UTVAS/OQv3JxNCqrVOnWINpY3UAsvkwRHc+l6Vmqlm7+M43Ej7YyIrwVhjJpOfkQz91bcepcCuSRsqV1bitT70XCUp8lzjSRC+DQLZNW8wE+HzDYeDpokz7//B1dbVKFGom7oPAX7tBoTAzlHotDm/3GdeXEzQGVaouWZevQ0xBBNO35cpf0kSNQtP1t/QqVRfCDKG8bwspW+BSaUiYpRwS5FthFtlMgLw1nvvSgapdMMm5VkOCm0xCgO8+ORuK663qnynC7Wm3LmtMHSqcZBaOgoGMI5E X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 706dc147-f2d7-47cb-3f44-08d79506609a 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: 3yP8qjct8STJCNY4k+nb71sv4re0jfbwm8blK2quBYJTAMfxgtiGYZWma0vWZfN15jSrxq1fDt2e48Y2drbzt2TtUlv1AShPftsdKybpvNT7N9CHzyju1CPvvfRWfVV4fv09e+rNZjHDgNAR9W4J0Mgd/662XXyA89d0+7kJGr+pEWZIDxNHxhUmpAsTaVD5mwXA4akyr2Vd78FFh7nRZU3RRGoGijdMpO7pydYP2Bc= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2020 13:19:02.7786 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0501MB3735 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_02:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=1 clxscore=1015 mlxlogscore=690 phishscore=0 adultscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add HE rates into STA info. Report HE Rx/Tx MCS if STA supports them. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 ++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index fbeff01f902a..fa932f771856 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -510,6 +510,8 @@ qtnf_sta_info_parse_rate(struct rate_info *rate_dst, rate_dst->flags |= RATE_INFO_FLAGS_MCS; else if (rate_src->flags & QLINK_STA_INFO_RATE_FLAG_VHT_MCS) rate_dst->flags |= RATE_INFO_FLAGS_VHT_MCS; + else if (rate_src->flags & QLINK_STA_INFO_RATE_FLAG_HE_MCS) + rate_dst->flags |= RATE_INFO_FLAGS_HE_MCS; if (rate_src->flags & QLINK_STA_INFO_RATE_FLAG_SHORT_GI) rate_dst->flags |= RATE_INFO_FLAGS_SHORT_GI; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 799c622a160d..19e432b28de5 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -949,6 +949,7 @@ enum qlink_sta_info_rate_flags { QLINK_STA_INFO_RATE_FLAG_VHT_MCS = BIT(1), QLINK_STA_INFO_RATE_FLAG_SHORT_GI = BIT(2), QLINK_STA_INFO_RATE_FLAG_60G = BIT(3), + QLINK_STA_INFO_RATE_FLAG_HE_MCS = BIT(4), }; /** From patchwork Thu Jan 9 13:17:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11325673 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 16A091398 for ; Thu, 9 Jan 2020 13:29:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4C7E2077B for ; Thu, 9 Jan 2020 13:29:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="ZGREb86q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729303AbgAIN3x (ORCPT ); Thu, 9 Jan 2020 08:29:53 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:4860 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727701AbgAIN3w (ORCPT ); Thu, 9 Jan 2020 08:29:52 -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 009DA7EL017063 for ; Thu, 9 Jan 2020 06:19:24 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2173.outbound.protection.outlook.com [104.47.58.173]) by mx0b-00183b01.pphosted.com with ESMTP id 2xap422x8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Jan 2020 06:19:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Je5/UfrPsZ3FQ3FucOY9zw4joW8rZ4prGAYX4i2sYIRaCF2N/XMM0V6IUB2J6X3f85lbcCKfQasxdAGcbjQkETXlW5nzDprUoRclB6ennduqMzmS7a6F5FKt+UuPo40VbAD/LCNWtb/xwW9Qe+kY4QVkQhFQK8+fMFhEoAsrU8aJTKxnWNo213gLJhOZ6FZ3oNYPMzX5otAv/xPvb37DRRr99hLA8RrFMOuLxWjLBnmBmMOvE2krNjyyg3rHBi6OQWvIUwC9b5eRqctVP/1TNl9lGRi6sBQxn9TiDnIvH3ulmEPtRT+2qzCc72rloVGWPjKkgWbMvy4znJORwm4dPg== 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=jV62/mFxGP6y1SHj9aHc2W6MOrx1a/4NunDyH/QBx2I=; b=btv/F9WPADiUf31YxNJB8GTioR3df0FnwOkJhdJq1XYHizmsAljyJGCHN1f82JQJsE/fgRqh37u1TNdq+AZFykasppraIt6FXtrVfTRk9vZ21vDSJMP/0n6AmlRmM3fEGpasmDmhZ4+hpmv+3YQNOFeMWdXR+nyNbbfwUr2/0Dsl2P+1xRUr2fvklxUSVbnWw/OUBZbAGwtDHkel1EwNckgm7pm4woxpVioeC+G8vZG+NitYlA9nt5dwAYqzY4IJ9iAP3RxHP04cBfxRf9XBONU6o6jo47MVnBNP5+4upEmXNIbWidDgfqoHFRx4+1G1u8Z8ATMnXBnG67mjMqWLMQ== 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=jV62/mFxGP6y1SHj9aHc2W6MOrx1a/4NunDyH/QBx2I=; b=ZGREb86qbsd155R8l+++gAP2rKgxo2ni+BFQNwqiZrPYhlGPWsu+uImd2Z9XbNRSnb2WhY5Fp20bDdQDcZwfuzrgaDhMXW31r1PHLBkhsjnjC8/qt0B9bSsn2Jt6LJYrNLlKDFVtP27lS9uo4cNhwmpTCSYUM7ygmZ3flAJlEKc= Received: from MN2PR05MB6478.namprd05.prod.outlook.com (20.178.246.16) by MN2PR05MB6445.namprd05.prod.outlook.com (20.178.246.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.7; Thu, 9 Jan 2020 13:19:23 +0000 Received: from MN2PR05MB6478.namprd05.prod.outlook.com ([fe80::55ba:fc8c:12f:a0d3]) by MN2PR05MB6478.namprd05.prod.outlook.com ([fe80::55ba:fc8c:12f:a0d3%7]) with mapi id 15.20.2644.006; Thu, 9 Jan 2020 13:19:23 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB4637.namprd05.prod.outlook.com (52.135.114.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.6; Thu, 9 Jan 2020 13:18:13 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::2956:4ff3:7d5b:333c%5]) with mapi id 15.20.2623.010; Thu, 9 Jan 2020 13:18:13 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 5/5] qtnfmac: add support for TWT responder and spatial reuse Date: Thu, 9 Jan 2020 16:17:55 +0300 Message-ID: <20200109131755.7729-6-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> References: <20200109131755.7729-1-sergey.matyukevich.os@quantenna.com> X-ClientProxiedBy: HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) MIME-Version: 1.0 Received: from bars.quantenna.com (195.182.157.78) by HE1PR0901CA0053.eurprd09.prod.outlook.com (2603:10a6:3:45::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.8 via Frontend Transport; Thu, 9 Jan 2020 13:18:12 +0000 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: d3310508-1048-4388-aed9-08d795066192 X-MS-TrafficTypeDiagnostic: SN6PR05MB4637:|MN2PR05MB6445: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-Moderation-Data: 1/9/2020 1:19:21 PM X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-Forefront-PRVS: 02778BF158 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(39850400004)(346002)(396003)(376002)(366004)(199004)(189003)(6666004)(81156014)(316002)(52116002)(8936002)(2906002)(478600001)(16526019)(36756003)(7696005)(107886003)(8676002)(4326008)(66946007)(86362001)(6486002)(5660300002)(956004)(54906003)(26005)(186003)(2616005)(103116003)(66476007)(1076003)(81166006)(6916009)(66556008);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR05MB6445;H:MN2PR05MB6478.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: K44GQHrH6sNx7PB5vXR7/AGu0gAvPVjLcpnhDEPJN+q36jCE/vnCA6QqWjYRoqkYZaZqSpIJ9lZay4oDmHC8ltfL7ADfRKC9qSXgM/fyFKQZOzzu2r0mqyof3sWyHrdrVIAULPBIJ6gWsy2MHW2ksbLKKC7rotog0AyzA1CteDegtt7SEVBBaPyS5QVdM54sPQQXV5JkRcFM6WeUCNHQ5bTAcs20Ep/xlMnkbICdG5v+5YGP62JVAbOrkLXWOt4XeZ31Yznt72ExzgO3pamYyADxH7PSFDXgnr22LrcxJG/pqzT6jp/buRZowuwA64g8j8/XjO+XHm9iB+e+mk6xpwd3IqKxq2ld/FmpLJoG1sCQqEgwxNNMLpH8Uhz1yaVcYhBQOUlOLtcWIEwHks/a5aDXqXyZpf9tFLjlb3dQCnWQrRgQybDjQmfr+XXRulTG X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3310508-1048-4388-aed9-08d795066192 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: gHwAkkDrxydVHgYNyBnuVvBPxl8kD3zCEssx4+E7zsCszkDrvuZksaZZyepMKvbcIHsqI+Sz+kdaEccd1VLRLWKXw5ooBJPeyUriutK8TswUDPZEwKM6KNyEJ2jw5MwW770AgT+2ug+S2dBbs0spsoympB4cfMnvNUe9yJgwdmg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2020 13:19:23.1072 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR05MB6445 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_02:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=1 clxscore=1015 impostorscore=0 mlxlogscore=932 bulkscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Mikhail Karpenko Add support for 11ax features: TWT responder and spatial reuse. Add separate structure for spatial reuse parameters and pass this structure to firmware along with other parameters in start_ap command. Pass TWT responder value to firmware. Bump qlink protocol version. Signed-off-by: Mikhail Karpenko --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 8 ++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 46 ++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index fa932f771856..d0d7ec8794c4 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -257,6 +257,14 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif, cmd->pbss = s->pbss; cmd->ht_required = s->ht_required; cmd->vht_required = s->vht_required; + cmd->twt_responder = s->twt_responder; + if (s->he_obss_pd.enable) { + cmd->sr_params.sr_control |= QLINK_SR_SRG_INFORMATION_PRESENT; + cmd->sr_params.srg_obss_pd_min_offset = + s->he_obss_pd.min_offset; + cmd->sr_params.srg_obss_pd_max_offset = + s->he_obss_pd.max_offset; + } aen = &cmd->aen; aen->auth_type = s->auth_type; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 19e432b28de5..b2edb03819d1 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -6,7 +6,7 @@ #include -#define QLINK_PROTO_VER 15 +#define QLINK_PROTO_VER 16 #define QLINK_MACID_RSVD 0xFF #define QLINK_VIFID_RSVD 0xFF @@ -196,6 +196,45 @@ struct qlink_sta_info_state { __le32 value; } __packed; +/** + * enum qlink_sr_ctrl_flags - control flags for spatial reuse parameter set + * + * @QLINK_SR_PSR_DISALLOWED: indicates whether or not PSR-based spatial reuse + * transmissions are allowed for STAs associated with the AP + * @QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED: indicates whether or not + * Non-SRG OBSS PD spatial reuse transmissions are allowed for STAs associated + * with the AP + * @NON_SRG_OFFSET_PRESENT: indicates whether or not Non-SRG OBSS PD Max offset + * field is valid in the element + * @QLINK_SR_SRG_INFORMATION_PRESENT: indicates whether or not SRG OBSS PD + * Min/Max offset fields ore valid in the element + */ +enum qlink_sr_ctrl_flags { + QLINK_SR_PSR_DISALLOWED = BIT(0), + QLINK_SR_NON_SRG_OBSS_PD_SR_DISALLOWED = BIT(1), + QLINK_SR_NON_SRG_OFFSET_PRESENT = BIT(2), + QLINK_SR_SRG_INFORMATION_PRESENT = BIT(3), +}; + +/** + * struct qlink_sr_params - spatial reuse parameters + * + * @sr_control: spatial reuse control field; flags contained in this field are + * defined in @qlink_sr_ctrl_flags + * @non_srg_obss_pd_max: added to -82 dBm to generate the value of the + * Non-SRG OBSS PD Max parameter + * @srg_obss_pd_min_offset: added to -82 dBm to generate the value of the + * SRG OBSS PD Min parameter + * @srg_obss_pd_max_offset: added to -82 dBm to generate the value of the + * SRG PBSS PD Max parameter + */ +struct qlink_sr_params { + u8 sr_control; + u8 non_srg_obss_pd_max; + u8 srg_obss_pd_min_offset; + u8 srg_obss_pd_max_offset; +} __packed; + /* QLINK Command messages related definitions */ @@ -651,6 +690,8 @@ enum qlink_hidden_ssid { * @ht_required: stations must support HT * @vht_required: stations must support VHT * @aen: encryption info + * @sr_params: spatial reuse parameters + * @twt_responder: enable Target Wake Time * @info: variable configurations */ struct qlink_cmd_start_ap { @@ -666,6 +707,9 @@ struct qlink_cmd_start_ap { u8 ht_required; u8 vht_required; struct qlink_auth_encr aen; + struct qlink_sr_params sr_params; + u8 twt_responder; + u8 rsvd[3]; u8 info[0]; } __packed;