From patchwork Tue Apr 16 11:47:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jurijs Soloveckis X-Patchwork-Id: 1924080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pqMOnteG; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=maxlinear.com header.i=@maxlinear.com header.a=rsa-sha256 header.s=selector1 header.b=c2ddzjlk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJj3W2Slzz1yXv for ; Tue, 16 Apr 2024 21:48:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=inoacaT22GJZxjQLiw+pEm2HYoYic1GpgVhMA4BBago=; b=pqMOnteG8rF9+B kqIGqN6ohCLOjWvqv77n2JO3WYjeadn/C9wnYbVJZ3Kxnz+1sE8hYrCpYDYX+MO2QzoWKGmB2wk9W 0wnI+T3WqC5nv94Z23TP/AaNLu9b+7+AQb4i7WZLI8L9yrg2cZOrhpclWun0dwBR+MOcB46w3o49k wEnnvKAXoVHW+x2oreJeHwcUu3jg5Oa69DA2Aw0LrZIBgItdjzqaMLCb2KDqFmrla1KXty8p7Wx2E gqfxgmsTPJg9o1hLHFmGzs1lZhbruTD4529bBTehyojub/lvnUh8C0Hzjp4b4jXcDfKG8v4cyyqZP fXU34KYZ0BFEnZAOEFbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwhHz-0000000C0fr-0qcM; Tue, 16 Apr 2024 11:47:51 +0000 Received: from mail-dm6nam11on20700.outbound.protection.outlook.com ([2a01:111:f403:2415::700] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwhHv-0000000C0ea-35Qb for hostap@lists.infradead.org; Tue, 16 Apr 2024 11:47:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WByc5alXRRnex2O8x7wBjHJavjIeXkjcbcISZC6NdctsDDYiYQay0JzjFqD0jQyJhADC8xNWYVHI1wIEBh/Oh/ONwbBykJrhNM2D4zY3JcnLOT0WUNeLu4+6VXQ6e03NHZvtknDU8+v1FA6Mx8bR+DqJNhCcHjCf4UxL81LHcAhhIqFLqFZB5I/ZtrQYlsHzHLS0UzzHCuR1fJwN1ztfxim9xHGCuQLxSY6XPBZnFBdOQmRAnM+CM6vZU6n/baxFWHgVYozZdlzoqJ52M4ka26SrXirni0tTDiN1jXg3eaXOn7kulTYE5GwlCGt6wEgm3bhEiRaAkcdz6rwcL+EC3A== 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=JEiPqmYFHbCnRncO8ZyNDMPRoEvHu3RsraFARutlbPs=; b=bVLxnGn5BIsU8U891zucaw55WmsgKUDGDrwMR1Tj0Kd4g1yywF547BtkRnD+xM2Gps6u1ihIzRV1DWPD3zi5Mfhg+bMK88K4Q2hUNVjSKis1QX3FdGNTQSMCP31J0f4P7spwg1VxyI5ruv1gd9UsU4of1Ll+nikw1BeHiTewgDc1dya/L8l/jpmdDlej+zVwrBXTm1+Ugy1ymjgtnPPj6PbcBiB5IeWmtJuOC0zMiaOKCioS8ZGOTR7Wj9ZySytaONmIsUrvbBpleb+TTF6z3QSJuOf4bIZeNhNCWq1shMcGeGIHuWQ/6Z4h9L986QV4s3sH3F8mYycAD/L8QUfdFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=maxlinear.com; dmarc=pass action=none header.from=maxlinear.com; dkim=pass header.d=maxlinear.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxlinear.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JEiPqmYFHbCnRncO8ZyNDMPRoEvHu3RsraFARutlbPs=; b=c2ddzjlkg3GKRg+0D2XTBjGIbGNUe9ckScd3cr28nKpM7VBBUToF842FmaSXjJVInxex14mmIQ4hlj37VtoL5yXuc4beX5+G/vl30VKFNNNGTmmROhrcw3JoAdXEJgzeTBcQpr0RxeMOjM+ay4Av73G1Crrtn7jeNNjw9tj0xGo= Received: from DM4PR19MB6173.namprd19.prod.outlook.com (2603:10b6:8:b3::17) by MN0PR19MB5849.namprd19.prod.outlook.com (2603:10b6:208:379::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 16 Apr 2024 11:47:37 +0000 Received: from DM4PR19MB6173.namprd19.prod.outlook.com ([fe80::d157:1e69:71ef:1538]) by DM4PR19MB6173.namprd19.prod.outlook.com ([fe80::d157:1e69:71ef:1538%4]) with mapi id 15.20.7452.049; Tue, 16 Apr 2024 11:47:36 +0000 From: Jurijs Soloveckis To: "hostap@lists.infradead.org" CC: Sergejs Hatinecs , Arnon Meydav Subject: [PATCH] Set correct center segment indexes in channel switch fallback Thread-Topic: [PATCH] Set correct center segment indexes in channel switch fallback Thread-Index: AdqP87hS7FrJItY0RueZMMk4Oj6/yw== Date: Tue, 16 Apr 2024 11:47:36 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=maxlinear.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR19MB6173:EE_|MN0PR19MB5849:EE_ x-ms-office365-filtering-correlation-id: 65d5e82a-b661-4791-17f1-08dc5e0b02d5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1phd4Q2XDpwnV0zHCz4+yGy8PvHzMXuE6Ouk7RCX3/Lio5znE+PJnt4C3iy76aWVOKHbJJbO4ZgsQKpcdGCCauoQEwxy55zx6ZiXjSAwI0J6AJAwDZNHkRPzx9h0otIUecKv+mFj0si/IqInvWn56WpBXjAGel28PRSRVZaKZpXRKEYE/UPDJkH+AMDk1VriT90Fmh/274MC2LIU2XVy1u3icUVaR3GuL+tR43dBEBf2WlifhxqgEb7sqzOvNkDZuiPoysA3lSfFO9+kZeLTK69RZ8uxOoZESX8QuulIrDdetEeoe+rhhG1kEch3MBiq7g/LrwvSW5W7o4e6gnNsSjDg1tWZ8RuzHYCR4JPNPfjxlrPwEChX1BQ3Fqo25nEUPhg3I0FLTe9WyCMAFZzU0tXYxJhJdw7wcS5KRdeseZmY/OrIJ45w0Rm77cahVhBIKriYOnX5bxBQRvVsydZ0ZDFRGSrx9d5uCyoGzoV49e3Q8lfLRHo/Gg0LvqtYYvc0mFUuBRbuRMw9r3ggb2QAc74a+sl7MJ0aGQzlvX6BN4g2wUfsgEdLM7SWm+eJyOItPSfaP8v9Zy4ERrm74a/bwZBUcj9P8mSZ2xus90eJM+W6FA2VOfmXDZNfp9lK8U4ATiNmMaeiUM/h5sseb4dZOtO6ct/hCxTp6L43tbuT0uDuIksJ7u+RUEQ66rHc0mCL6CwKVqpFe6ZyvpGG85OYbeyjC0h7GLt3wmg/Jd4SBFo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR19MB6173.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: lFSE/bpuWKKAHmlhF3jNOjVH5W9+4U9E2ydv8u3QUgUWzxcwCDUWcL8cYRi4WFhNgAdMUj5gubbDPl8a0/Kyny84tOlsEYQdbnUEcmKjTyAY3T2GO8LECb79VEIocxFsfduuWap+eK1q14QsXCrqeGKLtMRT5Og7X3MMGS2OovthlD6BXlPJvRLHJqGoin5jPAE8tzY0qKQhgU1N95I5Dyw5hGHWZR5e9FZar2MiOO3kCW00/BPKfIb+sgGHRDJ/FzW/5ovUdvYE9juQntcJf2WIOV9CfqcEv71dEhmWhPSQ2Ou2USpsGGFj6M/L5DO1V80A0velbmMVy3ZudnSyDc4CiRMflBwZQZgpOeKcAvhP1W1Vsuq3A+878V/Tkmjpy9Bdys7AbzJvrb2WFGse87g2O+/pmJ7QpiwUOxFpURJfKpgnQXHs7VZXdvswgD4eOC/RujOCzsM+L+HdXM6Vy8a1JDdmi3ng9mSaQKqmMZf9MiJrfkRKvDiAaSO9CKZw2wHkYUuBBypb+cBlktXQ98i3ZDDP2K54Xz46n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atorOrg: maxlinear.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR19MB6173.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65d5e82a-b661-4791-17f1-08dc5e0b02d5 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2024 11:47:36.4428 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: dac28005-13e0-41b8-8280-7663835f2b1d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hEkCCgS/m3GxQvCWBLaIRqKe++QS59eNG9oGQEe8S17akp6PrvEsFe/N8i0PizmFWFRbBxrH5VRVdyG7Gh8v8Q9JKP50WqC82MjnFpA1c14= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR19MB5849 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_044747_935050_A566F86F X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Set correct center segment indexes in channel switch fallback for non-5GHz band Signed-off-by: Jurijs Soloveckis --- src/ap/hostapd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 ARC_VALID Message has a valid ARC signature -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 ARC_SIGNED Message has a ARC signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Set correct center segment indexes in channel switch fallback for non-5GHz band Signed-off-by: Jurijs Soloveckis --- src/ap/hostapd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index f8cb6432d..cee33ffcf 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -4419,15 +4419,15 @@ void hostapd_switch_channel_fallback(struct hostapd_iface *iface, const struct hostapd_freq_params *freq_params) { - int seg0_idx = 0, seg1_idx = 0; + u8 seg0_idx = 0, seg1_idx = 0; enum oper_chan_width bw = CONF_OPER_CHWIDTH_USE_HT; wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes"); if (freq_params->center_freq1) - seg0_idx = 36 + (freq_params->center_freq1 - 5180) / 5; + ieee80211_freq_to_chan(freq_params->center_freq1, &seg0_idx); if (freq_params->center_freq2) - seg1_idx = 36 + (freq_params->center_freq2 - 5180) / 5; + ieee80211_freq_to_chan(freq_params->center_freq2, &seg1_idx); switch (freq_params->bandwidth) { case 0: