From patchwork Wed Sep 27 16:32:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 145793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3117238vqu; Wed, 27 Sep 2023 23:51:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIx1TT3rm8BNlCC0g+5EJEsg0kLNXWqmGD7YeAJxxoP22Zgxn8JmQNeM2P17BOdOSRACQi X-Received: by 2002:ac5:c5cc:0:b0:490:411c:e593 with SMTP id g12-20020ac5c5cc000000b00490411ce593mr332264vkl.15.1695883917420; Wed, 27 Sep 2023 23:51:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695883917; cv=pass; d=google.com; s=arc-20160816; b=Hod5sNIPWfawFhDNWLttxquJUm57nR0sOvGY9jObsxHzq+QfJfwfRWZp9RN9cch1iz jPdmE3eMmgtQgLbvSbaEP15cDZXZ6tE91AcoUZ3D3dq7P+8toq4WhSOjB9it5VPxksJg ySAVuh84vYOZhkpVkVwF4JytewaVCWOdyV2XDsTNW0wRbme5PPAcEL3l/OfeKW5DOhEj fxpHYU33S6bUotTCzPfp9NJDnq6Z6XFtdRLGP0p86z+EoYanfsnCYhi30yn+5uKh7Mw6 9KtFr26VKiFuQif8BeHa1pIoo2sP0dNs4GvX46n3ClknePNFsmzsT2MvtWaJA8UrOGV0 ZfZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6nFqrlsCNFUBc16Ioc8XPt2MHtqcMhvTI8S6mM1dcgY=; fh=l0GbbulFVEGIByrdVk2PDAYC0467jisoj0AJEvNmoTE=; b=ykaSdhQItw6u0YUiBXW4ROVMfoAGUOgdxdqB0YfKru4lMefgfe88e3Y9zs0elegwze tgOtOZzviUaPDzTaqyWLfOdFF8Nmdii4nuad8VG3FEMy3/xFGVBeWIciYHVqGNIjAx/v ZvAAMbpKoS64CEpj+T9i2x9WtUl24LCXQfvHYZ3yK91xCZQWqD9DOhQT5+kYklxhWUPR 9/QRcpu1A1UmpQRQOKwV3OEmIXtr+VZ9Ji3bil3sksRZNpDkYdX8JMaLaak60M1Mqkns 1XeZQOvx/7AtFMAmqhdN76mVgszawkoReusiePpwm2gUgBZqjVtDzoEsfHycwWhEM7Ha VxKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=i1q0Me3l; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y18-20020a056a00181200b00690a75a318asi19821966pfa.67.2023.09.27.23.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 23:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b=i1q0Me3l; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=silabs.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 34BFA802D44A; Wed, 27 Sep 2023 09:33:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231967AbjI0Qdm (ORCPT + 19 others); Wed, 27 Sep 2023 12:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbjI0Qdb (ORCPT ); Wed, 27 Sep 2023 12:33:31 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2088.outbound.protection.outlook.com [40.107.237.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FCADE5; Wed, 27 Sep 2023 09:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEBnJZEVJnX2shs4eWB4KGe+cpi39/InfRmTbDsHTyRh9YHl/gy3Fi58+BEfnY+CX3Loqrj0qUBzgKDjuGwkiJSC5Qe9NX1m62BLlTHkxVrYVOGujBrpyjG6pozJW+jMZPBISxGX+voE95/E51PRM+szvYEhn6lKEfrucpmVi67cWw4jLkkmux+L0OSvu9EHPy+5mUhsRH6RLDgyUx4CnaU8cHU9miHPdKvIpXympTbWAUFaYlB8NlGmkdQis6lmnHj/oc303O6lJFXWg+yTnTK9SiiaFRIl9+69Ic/JWcGBG2aL8uoWnCkplqo6lFU8Bzsux+1Bripojh+HlHzvCw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6nFqrlsCNFUBc16Ioc8XPt2MHtqcMhvTI8S6mM1dcgY=; b=Lpcu9pnCexadUwrHWlRrUloHNv0EP43n3r3BrqCSHwCFv+rahGrZFbk0QAGB9ZyNhdlDX1vSrFf7eKJ/j39am16spUPUIJUZUM0kCg5L2KxadFG+JkwOAc8Jciu1PVBv4c8GLwAGzPjLAVLnsMC221oCwktOG2FMFj5954KxKPmsa/rSI+Ldy7aN6vyO800Syky2C6CAeev4IoPSYWrat/6Dxt2J8u4FHmAFZQs9H9buOG5J8l393xd5Fx1bWpbTux+Q3GiSjVMbq2qAa2X3Km4JRBhI8VlV7HL8b1VIu5rY4fN7dC3uXtaVZex2/wiYTSr0qHcR2nFqEk167oaK3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6nFqrlsCNFUBc16Ioc8XPt2MHtqcMhvTI8S6mM1dcgY=; b=i1q0Me3l7H0/z+yUJXEgYv0r83r4x/rEegrBr8lJuqXBSWne+yyHz02kxYYqw83lKpb8vMn1dg+LDqHRmTF+t/kaChSc68pxFAAjrXnysHTnGJRx/bxaHCm1ISKpcT2PeTkttwr3eGwFC3xB8mGwh9KRqTZFLcJrc/bFGfihE5o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) by CO1PR11MB5041.namprd11.prod.outlook.com (2603:10b6:303:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 16:33:23 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::d6c8:4cb6:2594:d8f3%4]) with mapi id 15.20.6813.027; Wed, 27 Sep 2023 16:33:23 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 4/9] wifi: wfx: introduce hif_scan_uniq() Date: Wed, 27 Sep 2023 18:32:52 +0200 Message-Id: <20230927163257.568496-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927163257.568496-1-jerome.pouiller@silabs.com> References: <20230927163257.568496-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR06CA0052.namprd06.prod.outlook.com (2603:10b6:8:54::30) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|CO1PR11MB5041:EE_ X-MS-Office365-Filtering-Correlation-Id: 6756ae1d-7477-4d58-4c4a-08dbbf7776f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3+vvr1FaiJkvWRr5TfHBXSZg4rL+Arb+pvJt/CSzX2Hawv4XENUjQn+MmJ4pssNex3SNk1em8kUeirObn/DPyXi1IDhqGEznUYtjQ3bcMQ+fGvR6MsSShgibirc4cGpLH+y7FvWu6qTumnChu915mI5n4djAN7JMIYYWEd5L8M1XnmNpciHGdr3OJgjxmSKWChpdM5ICfvy3jvQi61Nwe0kaAB5wW0F9d29GGC/ruJJUqtsdnxR3X4/BL4TBCPpENnfOYGJ1lM90tVeGMgBkvZwf30zbEvEKhXjzQwXKMRz5NVhW8TtfkDY/25Xy4LWZ3tapJFHtUF2LtHUvSMF/AkNRZ79qPh32WxNPs1SHPN66B853rIYQYT2BBUiu8gzuFXl04pdIN8pF2C+reRKxCbQyeQegzGrVbvHpYkm//f9WK2E1y3sGr2mOXmpHQtzjWt54huBgurE8bi2Zq5A4wPYMyikeQvVamDmpy9/jYOZb3aTVu2cKViPaRVbd5X8gDOijGWNSx6kgmkc5be+/p41HCKy8NtlT/u0bXxuZLSCWeYV+xksGK6WBMzYzSxUl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR11MB7773.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(6506007)(107886003)(66574015)(66556008)(66476007)(6666004)(1076003)(86362001)(6486002)(52116002)(6512007)(478600001)(38100700002)(2906002)(83380400001)(5660300002)(316002)(6916009)(36756003)(8936002)(8676002)(2616005)(66946007)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lsTwwH2pBQowgZVda5G4RvqAk5l+?= =?utf-8?q?eYwwHTHlHx7le9I2dZW1FU0F1/5rvuYmYCBFq/24/HahGFCLuyzXgOuJsk5F601vd?= =?utf-8?q?B/lYVQfSpD9EPVeYDKvTgZOGUI82knL+tLtPXQCnqIss0TgiWrYjsfhL/WVtdp21F?= =?utf-8?q?wD/9RBpRurGu3fEtbdUQmXIKzB1ZsOfsE5nkeidkXWoRl4HITNOUVfO7uQQqfxe1D?= =?utf-8?q?cdB/sia/rMeI1p28S9RC8tBZEfLdEusUuRO1HmanqYZK39TbAT6TQDZhBtPlPOd2I?= =?utf-8?q?wuQah+x3VNMMYc+VJFHPbeJQbvcM32iJ30LfhM6WmGFcAH9h7kcgJ9hkbjNKqY21S?= =?utf-8?q?goXXEH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5AJEGbbzRGjTGlzDzcaocOCDPb+jhUG5JTdcrJn?= =?utf-8?q?87B0I5lJoxcsccMns8oAwh7cCD05e3R2pgBC0SAbcPJAgeQn3Q9DZwE8GQJIKq4zG?= =?utf-8?q?CjG+Y/yKFp7V9mkEcagYXn/LtnRGUCLQ15u+tfEnTF7NuIG+f9JH2QhMkpFy0lKaA?= =?utf-8?q?ElAb+GKAReSJXtKWES+xDwOnul1wrK6dRNLKMbh7quw72F163aGqLHvSvDr2XiO2A?= =?utf-8?q?X2hfFEdlFWR+nh8rGAIg4PZWz1XDdsoEQPn5WoIW0N4h7xjCZUbrZlGR5sNRsXo2/?= =?utf-8?q?dFlUIq1q7V/kAhzwlfbKrjVoFTE3eMUR4ItNQ9c4e6FPOVOHo5U/BtfkMF8zSUB6N?= =?utf-8?q?VMBRKamS7iN?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6756ae1d-7477-4d58-4c4a-08dbbf7776f5 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 16:33:22.3110 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E+WnMR7LViNCRDNKtYWlEfaKqNl5xuOLiauXqNXrD7lWBfdrVxpBkIkTBSj0me8ChZKZpEV94RpMID0HdZJvDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5041 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:33:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778263174761433434 X-GMAIL-MSGID: 1778263174761433434 Like hof_scan(), hif_scan_uniq() invoke HIF_SCAN. However, it only allows to probe one channel and disable probe requests. It works very well to implement Remain-On-Channel. Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 25 ++++++++++++++++++++++++ drivers/net/wireless/silabs/wfx/hif_tx.h | 1 + 2 files changed, 26 insertions(+) diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.c b/drivers/net/wireless/silabs/wfx/hif_tx.c index de5a31482df38..9f403d275cb13 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.c +++ b/drivers/net/wireless/silabs/wfx/hif_tx.c @@ -238,6 +238,31 @@ int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, s return ret; } +/* Hijack scan request to implement Remain-On-Channel */ +int wfx_hif_scan_uniq(struct wfx_vif *wvif, struct ieee80211_channel *chan, int duration) +{ + int ret; + struct wfx_hif_msg *hif; + size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) + sizeof(u8); + struct wfx_hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif); + + if (!hif) + return -ENOMEM; + body->num_of_ssids = HIF_API_MAX_NB_SSIDS; + body->maintain_current_bss = 1; + body->disallow_ps = 1; + body->tx_power_level = cpu_to_le32(chan->max_power); + body->num_of_channels = 1; + body->channel_list[0] = chan->hw_value; + body->max_transmit_rate = API_RATE_INDEX_B_1MBPS; + body->min_channel_time = cpu_to_le32(duration); + body->max_channel_time = cpu_to_le32(duration * 110 / 100); + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len); + ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); + kfree(hif); + return ret; +} + int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req, int chan_start_idx, int chan_num) { diff --git a/drivers/net/wireless/silabs/wfx/hif_tx.h b/drivers/net/wireless/silabs/wfx/hif_tx.h index 71817a6571f0b..aab54df6aafa6 100644 --- a/drivers/net/wireless/silabs/wfx/hif_tx.h +++ b/drivers/net/wireless/silabs/wfx/hif_tx.h @@ -54,6 +54,7 @@ int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len); int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211, int chan_start, int chan_num); +int wfx_hif_scan_uniq(struct wfx_vif *wvif, struct ieee80211_channel *chan, int duration); int wfx_hif_stop_scan(struct wfx_vif *wvif); int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len); int wfx_hif_shutdown(struct wfx_dev *wdev);