From patchwork Mon Aug 7 15:05:37 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: 711529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 774E9C00528 for ; Mon, 7 Aug 2023 15:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbjHGPGR (ORCPT ); Mon, 7 Aug 2023 11:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjHGPGM (ORCPT ); Mon, 7 Aug 2023 11:06:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8F7010F8; Mon, 7 Aug 2023 08:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lPyA03y6Gt+3zS01SpUM28Gh0M/Dl4TOTdspclqd0dDSSjcVF3EfdgDaYMcWhVf9fajXaGXuzjmHrSji2/hvdH50IMYQpXrnea9guuMsZoGc7I1LaS2rXvlIquKTfTsknLFdRFRQm3kBjur7WwkitYvMV3KwCQErD6LN0YsXkeCbF7dpQ0RX0q6MNlX2wd9o0/sslnFeogcBtUdx0o637JbYq1ISldRwqqQ6EWM9vDNr8r+iyv49qeVfClXcDYLL46ttv263Hetdl6WcxIfawFIhsOBXOFKgMv8zf2JcV6q56C3C5fE3yVdn8BHtkEPPSFatlsVM8zbSsf4VjM0bUw== 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=cPOV2Gz1E59W2pcAPTmW+HAfVjs5tUjGRDiUoEX/uys=; b=JjAo4j/E+IdQBToEfyMOf+O6KhiOUiv+BAf5+lQYP6GIS7RRqeTHHUb7Dtc7Y7cS70/k/hWpixYPjUxGIwLMqOGmdR57bCAdrra2s75t9np4sB0O5lz2/jOQu25mAPHCf3NTX5j2djzTS/zURlt2iTxScm+xzF2nFYj3cEZGMlE6ssiMUyTHIo9HOVnXpo62zne/gUZFbwNZiUrFSO1tJGGysG5Gh0R4FnIhEZmH9swJFECEC5KYqOxo6SSaRLOxVXYH5WDe+n9sFDpUCGcHayoggVfv9lUEQbi/oLyPPn0CIsmI484qQ+vCpCwSk1z2PDd7bfxgCxItUb1aGL3+xQ== 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=cPOV2Gz1E59W2pcAPTmW+HAfVjs5tUjGRDiUoEX/uys=; b=aEAD1dKcXbj2ZdT9JHtGqc5VBbGzSggQoTwhAejuVzVFWGbu3yEpYtlnTMMpCvjYIm/VXGQbDjpSg1oio8L9tuRuu0yIZrWBGahfe4hAOYZTwpBdgHmcPtMKKq5mH7kcvYN9DoydYZ/8OLOQN/PVyS6B/01XYaSZo9xkU3bLDXQ= 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 SN7PR11MB7590.namprd11.prod.outlook.com (2603:10b6:806:348::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Mon, 7 Aug 2023 15:06:07 +0000 Received: from IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca]) by IA1PR11MB7773.namprd11.prod.outlook.com ([fe80::14b1:be6e:19a3:2eca%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 15:06:06 +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 4/9] wifi: wfx: introduce hif_scan_uniq() Date: Mon, 7 Aug 2023 17:05:37 +0200 Message-Id: <20230807150542.247801-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807150542.247801-1-jerome.pouiller@silabs.com> References: <20230807150542.247801-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: PR0P264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::24) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|SN7PR11MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ed0e708-3480-48ec-9214-08db9757d36e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H/do6JqcBsc11+npB2JUKxGKZzkzPhzJc1g6QtmGinKxHEKXw1jumGzE4ySof5ovJ9MOHfqDPWldV4pzbetYAI6P3c/dwQIdeHtyRPMhLa70wbUjFXqbtfzlTZyhIMixYdUNkF6nYwa31b7zIk04uZ+5ElIm8XvquRwFg0CgDj/9dT9vLNNMtTUaYEGzO3lkhfEU8q1B5TU37TMnaTZvzMTDcaPCaPpHCatqk06IrPQ6pmqYmNW4HW1D7Sn1NRyqabZlSvVS7Quw3MTLJd56GkQbNPtcjjR5F1NdWhi1zmMFRIO5VvYZ/g4RfX0ZbRtMWi+ez6Q+DyYO/w6umFhbzW22c5OCstLTJbuIrxkr7RKurKXveAPgcW5gkaOmI8B3dWoDXWtFwDtWnMSuRxf52z8MU3knXH3jjxEng+selFIQYuXI1XaRbpmFYOxUgsq7Z3pLVr1gu5VLYx0haq5EtR0p0W8JZyRLVGeOA0SL89QLDy06BIkglSueDCa+IU3KT+KSKaPV7LrFhOvTO7R92Yll3ybvX2jDOSXDxAXboIiLNMmS9SyCSuzflBGH7y34iwTpdF9JZGE1BhdycpnhLHTlN5KsEP1warZ4wcKaIVRN7by53RCEExzcBB6r/UvD 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:(13230028)(136003)(39850400004)(376002)(346002)(396003)(366004)(451199021)(1800799003)(186006)(2906002)(4326008)(6916009)(66556008)(66476007)(66946007)(6486002)(52116002)(6666004)(66574015)(83380400001)(5660300002)(41300700001)(8936002)(316002)(8676002)(38350700002)(38100700002)(2616005)(478600001)(36756003)(107886003)(26005)(6506007)(1076003)(86362001)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EgfcGZx8dEsZhLEYqDTDCBVB/6Dc?= =?utf-8?q?XX9TRjAB0yrX90caj4ALHhaT90DMonfGJ4aGFCRbHZRWDtOh3vY38vFlPvtpdHijn?= =?utf-8?q?0BzyQp4dEsZnaByW2uNvrs+LUMPk8qHlRKqj60h01cXh02Qhcc0gRHfx8Bao29Mrc?= =?utf-8?q?rB5N0AL0uG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+UeFOH+3seaL/PbwC0GaJU88e/rAvX3WtCPpveFipXRerai43f?= =?utf-8?q?WDJIhOeFVvFh+ncIPDeA94Dte80HicOlLoTH4GKOaj9TyR9er6rqciwcfQ2lkj5qD?= =?utf-8?q?7xuugWBshvi1vxHfOc8PVKL1yx81idF9RknGSuJ962DMGjXCC0uN0LOqseb2EVFyX?= =?utf-8?q?1omukt+aUIBTVVM+/aetaFyrnnBRRLpQeyBMYwRh5nQFZhFS/tFNNPbYL9Lv4IbW3?= =?utf-8?q?7PELmyFMnp8DEmxaEg5pgXiv26qJT65R7XSjfMjwhvKvhTpkX0A2Lpc0iDeFfA0Qw?= =?utf-8?q?DduxpYz7PhblCEYKeZPhb0FRtCpcLc0jGapSajXuEVvcSmcwWhIep2ZAlFQbj4Iew?= =?utf-8?q?Z5M3dT9uydvWFL3C8dGTStlxRuyraDpw/DKoSA+xz5ybIwZeQ27rAYhLWvy4kibkm?= =?utf-8?q?+XlrvsCXO9p88/ciwjTSU4F8RmGEOqHBvXUXdmZRWLAMwUkN7l7XO/N9zHo5m6JXZ?= =?utf-8?q?GTnPncoUH8ae?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ed0e708-3480-48ec-9214-08db9757d36e X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 15:06:06.9243 (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: lgbH3INbRmAYdr5d28f/H5FAepSzAVdxZXt+hulUItfnDfC7w7qoyf1F7ZtbFdlaq+pnc64Xei4f2H/6xitxzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Like hif_scan(), the new hif_scan_uniq() function invokes HIF_SCAN. However, it probes only one channel and disable probe requests. This new function is the basis 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);