From patchwork Wed Oct 4 17:28:39 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: 729676 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 A5DC2E7C4E9 for ; Wed, 4 Oct 2023 17:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243727AbjJDR3V (ORCPT ); Wed, 4 Oct 2023 13:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243707AbjJDR3M (ORCPT ); Wed, 4 Oct 2023 13:29:12 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96ECFC; Wed, 4 Oct 2023 10:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhJ8P4iIMSrVCQfZ4qCrrmYbwqnVPLyhCAhIyhgrxRP9uq40Q8SJVcP0bVkoP4G7b1hSdS0d1FBO6XjjYRQWg3jQmOX5sUdcXjtNUBucGE4PpEwB8ZUTa0w937+QG1jwqjfagQ/UTouxe6n2HR+8D4/11kywau1fTXqaJ5+7Gg2lgDguHb3rPR++pzAI+kyo5EhmqxEEHCbKY03WI7k2EPTAHsb3Y2PK1usqJuuuuU9/4IerLkiC+qfc5ocFMfk1c7+HVbZnXtMimYxYQqtx6xMGxZvYVlQPgEsGzEz8E6hvmbXgiX/8hHWqajNhgzPb6lY+acq4KZJFaB5beXvNcA== 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=ZKGE0PVXXQcxMHBexgM0a82hGFqOfelXY7ux0dNB3u5sl9IfJyPkojc0FNUSGwqiZQ+gi3RcKAzgO/hGHV3PMfDPokzlW3ZjEc6r4abDot1v05iXtmKO+8AjWp/0FvdZD/lYBJYKRB7hTEjqqX2cDhiOWxQyPs+lzNDarskjsmy/AASZeI/fpMDg5Uj8yPKhqKKvR/TTaJpuh1eXKjbSDq08dLb1RidrjFg/B3BCDioVJFJhfkIp2Bc4PjTadtRO2PWDmUbIzWi8SUaf68ge2GgBWxeNy9HpaIkyhE0ZVk/crcyFbUpuJQD3H9IhL95bnRQr/aS68P1x0+NuJsQHtA== 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=Fb/c5669A/l1DrTPR2uIqd027UEDhS4WEQUHt3W+GO9gWHfKFZbX6I2Vllc4VnlKSTviSJ4EAS/fPiwtC+EGVjhUI+DRWYCJgGoDuAyX9yl2jKwS522w/p4lvEiSFE9WLLuiXsi708EEXABqBD12uqCbslEYUAxtdjJEHdOnh5I= 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 PH7PR11MB5982.namprd11.prod.outlook.com (2603:10b6:510:1e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Wed, 4 Oct 2023 17:29:01 +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.6838.030; Wed, 4 Oct 2023 17:29:01 +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 v3 4/8] wifi: wfx: introduce hif_scan_uniq() Date: Wed, 4 Oct 2023 19:28:39 +0200 Message-Id: <20231004172843.195332-5-jerome.pouiller@silabs.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231004172843.195332-1-jerome.pouiller@silabs.com> References: <20231004172843.195332-1-jerome.pouiller@silabs.com> X-ClientProxiedBy: DS7PR03CA0305.namprd03.prod.outlook.com (2603:10b6:8:2b::25) To IA1PR11MB7773.namprd11.prod.outlook.com (2603:10b6:208:3f0::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB7773:EE_|PH7PR11MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: bc88b17c-7cd2-4cc0-d98d-08dbc4ff65be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 24FkOJ4GPDkHQnUPUOY/J5d5AV6aBmCrA/y2wpD1LUcMxhA+slrckDgZ6v+Vhj2Si9YgfNc+HzzSNDWZUU/lcqDuzbaeiTzaKbkrkmWcJEW5lD+FfitXhkHkjmvjTiH5TwgneHQCKqPTSigbl6EoM4dMueKI8CvA/mMw6evseNdbY7v/KgTmWGuTwySOeU3W3Uphj0GiJ3tcjwC/R4WzasrXdamP742NNAttNe60sGLotSckKNPq58YtIvEW+VqeBjOXokEscRJAVN1mJohyZfCAEYGRQ8hHDFHhENWTVJUj6P2FDcuksyerytucQaByNsoOD6QHqj4FYVuCvj2epE+qIBsWY0T2Cxi3G0BYoeN9RrOy8/cEl5gk3HA8bcqyAMNbeCcoQOvf6BzYYDi7v1tsHZIEYprYRUTbb3+V0lJKy8A+rtImcUgDCNrfOtY0vImrzj35hTfCV2qwv8Kco/EhE6QxbJyz3WnT0TP2c/98HQ49Ijm0T2505lFg8PQMHX6HBDFGENvlMcPqTCKytPFDkbU7H+Ro681AT/P5Qs0esxMBbIg+6T56Kwo7e2tx 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)(366004)(346002)(39850400004)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(36756003)(6512007)(38100700002)(6666004)(52116002)(86362001)(478600001)(6506007)(66556008)(66946007)(66476007)(316002)(6916009)(41300700001)(2616005)(107886003)(1076003)(8936002)(4326008)(8676002)(66574015)(5660300002)(83380400001)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rwwC5qSy9ALpJs3kTVM5bQ/Gm/Pr?= =?utf-8?q?pF51g65/bhGX2ZeKwS0TNlx6wPcYObraTEczKHwA1Kl9imkY+osHiKWyBnxnZWxss?= =?utf-8?q?MBkzRiCj0f1ZxAzBhv617LGRvoiOAe0s7rkOOS+USW/ANbisd+fr4snRV0xNCWmhJ?= =?utf-8?q?6bjU21VA+JayaYM9cxfJS2N3HAeK64AVe4NU4St6i+ouN++N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CY0amp?= =?utf-8?q?Ra95lVGZOIoCDxwtt3nz1BRm13tiHBpvxMVrZ4AlK4q7PotIVxd543pV2rwwPg/rM?= =?utf-8?q?Vem2XS9wjdHQYtilUZ+l0tH8fnXAe0DQP+abqibWXwtWOR0lBMdrD95wbzxmz9wwy?= =?utf-8?q?IyI3pfWKEJvf8Kvh/xX/qcdMITbEGfvi5XP5vtnF1/s1tn6BSjK/Ld7iWA53dLBhu?= =?utf-8?q?yomuIy8720/hJtbJ/B6zBMpRtt8oup3tYzwx9LVS52a4yW0pM6Q7tNARocyOTGCwj?= =?utf-8?q?6nCnpYXaC3rGRHTDrs9TS4/KtbLn3qW3vJCRFFYUCjVLy7n5dNBLzZQ6ZV4W6eG42?= =?utf-8?q?749MS/b0E+owgDN6CZGt9GeBKRms//JYP7LKTugaxaheQGz3cMEjHNBnBZA1/BLZp?= =?utf-8?q?fFzmTpilcEjdmQQOaJGQVsZl/ToL8aX5op7ptL0vzAYmkJfnbaj3CHT+6yyuhXmjG?= =?utf-8?q?9NeC/OtySvQ7ovqi6tvsybH8M02z1LcrN2mK/7lqlpUJqNh7USmWCwWChBEJTT3i5?= =?utf-8?q?3VnnG/ttitp?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc88b17c-7cd2-4cc0-d98d-08dbc4ff65be X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB7773.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:29:00.8080 (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: s9xIopHvYs7d+UrEJqcYWpt5O5KZ+0ldJF+ekGkc0FF6eWXEJgHf17SSWLtBEYiGozqasYG7I/WuOEMTdxj0ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5982 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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);