From patchwork Mon Mar 26 13:36:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10307827 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DFB4A60386 for ; Mon, 26 Mar 2018 13:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDF21296C7 for ; Mon, 26 Mar 2018 13:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C247D296CD; Mon, 26 Mar 2018 13:37:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B37E296C9 for ; Mon, 26 Mar 2018 13:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752048AbeCZNg7 (ORCPT ); Mon, 26 Mar 2018 09:36:59 -0400 Received: from mail-sn1nam01on0084.outbound.protection.outlook.com ([104.47.32.84]:28030 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751374AbeCZNg4 (ORCPT ); Mon, 26 Mar 2018 09:36:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gDVEUtoV++FGrtfliPbt3IHt8JSxGPDAXMxIUvq/zgE=; b=EhC99WnziX0JcGkh1AteqKloXPXAw2cJpY3BPMDZqCRrbXxUuoMhPo4JWT1iMVixQEDawPTZUgH27asGFkh6Nzv1G73OR5NrUGF0EaytfWN0JtA+XW+msTZJOkqXUOKKUp49uECtVirMuxFkvTk2ZPN95yqUk01ps30KnR8nDwg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.5; Mon, 26 Mar 2018 13:36:53 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Igor Mitsyanko , Avinash Patil , Dmitry Lebed , Dmitry Lebed Subject: [PATCH 3/3] qtnfmac: add DFS offload support Date: Mon, 26 Mar 2018 16:36:33 +0300 Message-Id: <20180326133633.8771-4-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180326133633.8771-1-sergey.matyukevich.os@quantenna.com> References: <20180326133633.8771-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: VI1PR0501CA0024.eurprd05.prod.outlook.com (10.172.9.162) To BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36238315-78a9-4a2b-9420-08d5931ea3d8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BY2PR05MB1927; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1927; 3:IcvihlbIlmjeqXdahESqBJrNSZHf3PHaAYPhCSJYRB5q7SUDKyPd71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/Ef4hsM7c4zk8NR6uHmCU+9YNhJ+pRYtOGdp5s9+cCekdHD8UppfCd4hQ3RraI0WbaVM+O6fNU5wnldDvqTmwniJ1WuOAk/AUrR68LyyyArOl2lIzCeOlniHT774lhy0ae5ev+1vf6T/WssClpMTm90I2dSsx3Tw42bQ1U6iO9cJxoupJWPXY8qT3Xhf607fXqQ0cXVMjH69+yJ51/dV5qsuf7/pO+biSQF3McP/wq8Qg+RDwGL9+juw6e37BI3jJUJ8ZbG6IFGEUsVJCDFEq+qbEmt; 4:zJ0hGkF55J0039p9b+ZB6pdJinpZ7HQuA1xCceFssd6sD27s9ELuI26IZ6SjbGzbS7fSs13TIxJ/gQYaFvGAvUaTcnU/r4Sibxldd9Cb/o76eHJaDGIOUGE9TjmT0HX4Xq+4OvwP8DIsXStMt9fo9vsxvoXNu9dbG9R0TgMBFsxdLC11OwRAfpFzTOH3ghaur5yKVYMs4uDoHn1Ur1VGOAH7ifrXXZUGihlSQY0w290F9qQ9iMzZLUhIXeJB0c5FSZ6Ap53HKfx6EVwQDOctBQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6041310)(20161123562045)(201703131423095)(20161123555045)(201703061421075)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:BY2PR05MB1927; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB1927; X-Forefront-PRVS: 06237E4555 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(346002)(376002)(189003)(199004)(25786009)(386003)(6666003)(86362001)(6916009)(4326008)(508600001)(81156014)(81166006)(8676002)(2351001)(6486002)(8936002)(39060400002)(50226002)(106356001)(54906003)(103116003)(2361001)(186003)(7736002)(53416004)(50466002)(2616005)(956004)(48376002)(26005)(446003)(11346002)(16526019)(59450400001)(69596002)(105586002)(51416003)(76176011)(305945005)(52116002)(97736004)(66066001)(47776003)(6116002)(3846002)(7696005)(1076002)(5660300001)(68736007)(36756003)(53936002)(16586007)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1927; H:bars.quantenna.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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB1927; 23:gljcHu4bPBC1hNqzuaxw2CF5+WCE5hPSa9/FsUDiH?= =?us-ascii?Q?CZW5yGJfqXABcJR4xqkagqg+yp9v2SCJQmh/UPP03On7GYevMI3Qm8N7Vwsz?= =?us-ascii?Q?GyueAGWfnjUqvjTTiiPl2rpG2UV0KN8Hhq4Kg8X75+ByvxRtBv/sME4UJ61p?= =?us-ascii?Q?E849WilJm4/9y86+qq8JUw8ACeAboami8CajydxSaAaV5Z/OfTpSa+GXPDC2?= =?us-ascii?Q?zHTZkP5ggXhA2a+/2zuGtCrJCSYbbJPWPytd1JWhsy7Jq52WEXSIGFl+cKZs?= =?us-ascii?Q?QvnZaTqyD1PXmsqFiZILwYmb771rSC9hXkfRnc2cGcYrNSMu9jaAnjVo8Wwi?= =?us-ascii?Q?0vi402fSZXRNLz+71Ea5WmANQqh69UwJN4ZmC2VNGZK+1VZGEtR+pkGBx7zu?= =?us-ascii?Q?6Ib9USEMX8Gt9hXfpkzLxZPHmywZaUokNAp4vJUYw28bEiWaLPiVEejFPyxN?= =?us-ascii?Q?nq76p0KmgrMngNwywQWrnevnNr3C+cEuojJfBwVnVZfFDnjB67x0Zbxbpw1k?= =?us-ascii?Q?K/lKZ7tJyw/aREgh5WIluaplFZdqqCLBxZJ84WJciWksod37EBDbt2vsunjL?= =?us-ascii?Q?5j3s33fDKpfXg1JRHy6m6eAxBpvYxycZsNoqUUXxAI80OcULw36/yPUKRihR?= =?us-ascii?Q?HmZg0yyXEQG2D1qZO0qhtEYyNMMJz9f+tS5oxVihK8DNtm75YFNbZxxfD6iL?= =?us-ascii?Q?TcV4zql7fzIrwAKPeoUCgx3jBdZbDlFb1DTQ/kOfsW2u3HsvtdWvoXZM142I?= =?us-ascii?Q?XxIeVfT28HuhCsV5BI+YpruJywX4goymtbcvpT3iEIEQchBoY57isPlbm+RE?= =?us-ascii?Q?6KbCWlKkoJ9yatzfAriWeR7AgzrhclzxIxbu9++2PbRHJiSudR/egZmV56V9?= =?us-ascii?Q?LN0JVwTN8i+VE50PXz96ZqqnEYBv4/WRNRmp/EZSBz8roUnSHEx/MIF7UVtl?= =?us-ascii?Q?0JZOOx94feL/xkWgKmxbT9KgmwKF7OYrle2RsyQ5Zx24vuvbpWqtFQE+LHXN?= =?us-ascii?Q?zpyyc3OkTqdSU/mGF5sC5kBoViPVIvNFpYZIOGDNOoumPrJYQ0g5kYgWAXz4?= =?us-ascii?Q?xq74xPt5UwQ0BWd/DlWHSjP+XTfGoXmXshQGuiA5cDjNxqXMptG9JOA48Ilr?= =?us-ascii?Q?+qbx9I0ySIbERcKiwTUPtRzXRKcUb5lxMLB6CSjVQEevEqCF/s1zrZPS54E0?= =?us-ascii?Q?QmcniUPBM/t4/QyQXGqaLB8S3reuWe5AhdBFOw2pKhapI+aBmKoLFYyfly3w?= =?us-ascii?Q?SGbrepz9ZhE9w0tv6UCmqnm9MvzKR1smH4lPx6X?= X-Microsoft-Antispam-Message-Info: PkpvzXRmXLyvw/C22KX2t5qDcl9gRLj0I4+PWrMRlog1p94uBv1xSs7CyPT4ak+9j7s3dAovDt+4+/Nn63I6gqEhm6JqRXd/Vh4X0uahw7eLM3WYCZ1mTaaKUI1cYjAFPI4uQ9NGJx8FxFMylpqCjqQSdB70r9/nHUG+OTxpV4KlRBQbBi8DN3dqyURN71aD X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1927; 6:sWz8UlDQMYNcgpgb7yoRlNowC95JRrlctq1NCD5AP/DB2UApauRo5oqr+nhJkUemzvuJoREkmFvTEptbrZOn2kQjjOm9F5+vOGKPJkIyS3UTHckmdkoZisbbpOywMplXx7C7UkLM6tMIYbhGSKJ7YpS7NP0m7kZ6y/XP6X76ijLKJmPeOGSn60Rgv5aDH2opT9V7CCIefneIR2tsTbCnHCLAa5ziRR2et02HURkqy73T7NxgN6b6Uj1OFX6YmLbToOoroU3m7aGWmIqvCrNepHEEef+iBQdVQUGflIclzSRUKtjJqwuFizJwV6VQUA+cqbS4nYG8fCiJN3+/1zaHrKj5aQxv2VRfXApu0syhZp3SbY6ROSJqDGW7i7KOlqE7obAp44hyWEf59MSkIGw4vnOuWthmQkNwYolCT0DClaIcQQHHxLfdEEySEELlnE0X3Wo26tblQeaHd/la8LM00Q==; 5:/yUoZRI/MgtrCf6nv28Zr2hxqZhxF3cW2MdILe7VS2reYpDTUgr1LJN+Y9K30aoyRbkIHpIEVHtZ72VIV9Oayn730sZUz5xGQa4/658kStJpq75bybsipCG5/4dlE+Z2E+AQobM3Wb+SKEGFWkcKITq9fqfd3Xz5QiFMCtA5z4k=; 24:GmwXfVZdvKXGROphJ+FrZSWSvbdc5Ha+TZD9iLOpQ3FPXr6SjVxPlUaYsAnBNeEWkYphfbm45xwQJkMdLpCHmCXZT1Hc1lwUSDxKZnOTJls= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1927; 7:V+tdEEw/jzjiZogw3W/QcxbuPxmq2UfykheMNr7wUNJfI6g+OyuK+ctilzb5bSifX0DA1BdRP5wJnCY6roBj/3O35VHRfv+cgCXtHTK4bjedkr7fNoQK/O7td/vKVU87QAa43PPWqObEHYRkzMMW4tsGflBNZLIOdsqu6Z+CHZXcV3QnQMmMZGzuRyOcPYdgGJru41L1U8VIajW3oa9WlRqpd/3+7U9kAamX3rf1H09F0TEQnuWVCXKlP+Ifcfoj X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2018 13:36:53.1889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36238315-78a9-4a2b-9420-08d5931ea3d8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1927 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Lebed DFS offload support implemented: - DFS_OFFLOAD feature is advertised depending on HW capabilities - CAC_STARTED event forwarding from HW implemented - start_radar_detection() callback now returning -ENOTSUPP if DFS_OFFLOAD is enabled Signed-off-by: Dmitry Lebed --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/event.c | 11 +++++++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 7 +++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 0398bece5782..5122dc798064 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -813,6 +813,9 @@ static int qtnf_start_radar_detection(struct wiphy *wiphy, struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); int ret; + if (wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD)) + return -ENOTSUPP; + ret = qtnf_cmd_start_cac(vif, chandef, cac_time_ms); if (ret) pr_err("%s: failed to start CAC ret=%d\n", ndev->name, ret); @@ -909,6 +912,9 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) { struct wiphy *wiphy; + if (bus->hw_info.hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) + qtn_cfg80211_ops.start_radar_detection = NULL; + wiphy = wiphy_new(&qtn_cfg80211_ops, sizeof(struct qtnf_wmac)); if (!wiphy) return NULL; @@ -982,6 +988,9 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) WIPHY_FLAG_AP_UAPSD | WIPHY_FLAG_HAS_CHANNEL_SWITCH; + if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD); + wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2; diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index bcd415f96412..cb2a6c12f870 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -443,6 +443,17 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif, cfg80211_cac_event(vif->netdev, &chandef, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); break; + case QLINK_RADAR_CAC_STARTED: + if (vif->wdev.cac_started) + break; + + if (!wiphy_ext_feature_isset(wiphy, + NL80211_EXT_FEATURE_DFS_OFFLOAD)) + break; + + cfg80211_cac_event(vif->netdev, &chandef, + NL80211_RADAR_CAC_STARTED, GFP_KERNEL); + break; default: pr_warn("%s: unhandled radar event %u\n", vif->netdev->name, ev->event); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 9bf3ae4d1b3b..9ab27e158023 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -68,10 +68,12 @@ struct qlink_msg_header { * @QLINK_HW_CAPAB_STA_INACT_TIMEOUT: device implements a logic to kick-out * associated STAs due to inactivity. Inactivity timeout period is taken * from QLINK_CMD_START_AP parameters. + * @QLINK_HW_CAPAB_DFS_OFFLOAD: device implements DFS offload functionality */ enum qlink_hw_capab { - QLINK_HW_CAPAB_REG_UPDATE = BIT(0), - QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1), + QLINK_HW_CAPAB_REG_UPDATE = BIT(0), + QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1), + QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2), }; enum qlink_iface_type { @@ -1031,6 +1033,7 @@ enum qlink_radar_event { QLINK_RADAR_CAC_ABORTED, QLINK_RADAR_NOP_FINISHED, QLINK_RADAR_PRE_CAC_EXPIRED, + QLINK_RADAR_CAC_STARTED, }; /**