From patchwork Fri Feb 3 02:05:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaidong Wang X-Patchwork-Id: 1736687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=to2prNMP; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XBrL9z4o; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P7JvG5TFlz23hn for ; Fri, 3 Feb 2023 13:07:22 +1100 (AEDT) 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=l3ScYc4d/5URFTYAoPhRlWVcGIyocN8Qd9NAWI0nbsE=; b=to2prNMPP5+T8S we0P4yVKoz4bpsaJW9x1wu1/2hMe7R3327Ob4Qvvgy0jYSizlLFUTAVy75O/i0pMUmmXuM1HcUNJQ /sBSZSLYZEqjE+T+cptT2iDtyaaIiZjDC6xF/bSFW4+Ven52OG7LgxME4py4vul1/+Xv3JqMpoM57 6ZHN6waEUSp/Sfd+3ToLPmco2YLfjEdxoDyiyLUaR5Nq7apg7b994i2T77J2kLmn3tOE/SNF9Ilzl PPkF6KwrdpNDBidG6NkUSNdW4E0CPWH52Jzs2s/nPzsTQ3kMRNjb7s2UTkUFLiuSmlccZ7lu/7+rT fc1ntoNzJwzGKCrmcnBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNlSs-0000wP-D9; Fri, 03 Feb 2023 02:06:10 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNlSk-0000vU-C8 for hostap@lists.infradead.org; Fri, 03 Feb 2023 02:06:07 +0000 Received: by mail-pj1-x1030.google.com with SMTP id o13so3692642pjg.2 for ; Thu, 02 Feb 2023 18:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=H8BS68GSUrvBtLTKDtE2WR9LPwcdsQ5lHVsI3YNrpw8=; b=XBrL9z4o8tTQb5abQK1kLuI/z7vyCsJ9rOE146qp3hwIO1kGcuymRXQBIp41V92x9H P4MQD/6BbymySXSbV5bkc485yVyzefmRa4VJG/eiysU1m9ZK5p96rL2GxAzECqXo6Ykt XXH7E6M4xfje5h18Fo3c+w4Y10lJ5jaxBBjrU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H8BS68GSUrvBtLTKDtE2WR9LPwcdsQ5lHVsI3YNrpw8=; b=aecyivsRBGsbSFTrUVf1E3fPpRfxZOiIUJMFgEJyWKzyOAhQ9hDm32mscHj8GTFBDp NoQPDlEIuqeIDwek4NpVHqy83cKEV5b42l7UO/RmZMywQ8k2U4MBt9T/RQn1LgOs0QPu UTSl8o+AChlzw7xD9THFYDsRrJ+0p8VA7zEc5sKkkkCxyrQknjuZizXx0DnbB1LdjRjZ 7CMV2X4fdv3BLCu1kQGu3V6x3h51BTJdDKtHQp0ZipNx5ZEegsoYSUgKRafgeHpPtbV7 KtNsbTRmut2fXC2iZfTenaxMe+lcZgyKQdEaY0vD1THeS9Smk0iIT8X6xgO2a90DVzWq QQtQ== X-Gm-Message-State: AO0yUKXZV3r4BprLjg4OsFJIKoBNtofFyGwLl15wAO9reRVfh/mD4/Gz T0IIaLzBFQPs2lyuooo060D4/7YZRrN/3VTD X-Google-Smtp-Source: AK7set9qnC4CjFgGKlb3x9zEfOAJzfPIge/lCdkPloc2lb0lg0gq0DzmY1imaasEzuSkkYgSseL9YA== X-Received: by 2002:a17:903:22cd:b0:198:b5e1:7501 with SMTP id y13-20020a17090322cd00b00198b5e17501mr8088684plg.63.1675389959760; Thu, 02 Feb 2023 18:05:59 -0800 (PST) Received: from kaidong.c.googlers.com.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id c7-20020a170902d48700b0019615a0d083sm328939plg.210.2023.02.02.18.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 18:05:59 -0800 (PST) From: Kaidong Wang To: hostap@lists.infradead.org Cc: Kaidong Wang Subject: [PATCH 1/1] Apply bias towards 6GHz in roaming Date: Fri, 3 Feb 2023 02:05:40 +0000 Message-Id: <20230203020540.3822980-1-kaidong@chromium.org> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_180602_452560_5D54DF51 X-CRM114-Status: GOOD ( 11.60 ) 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: wpa_supplicant_need_to_roam_within_ess applies bias to the minimum difference of the signal level required to roam if the roam is from 2.4GHz to higher band, but doesn't apply bias if the roam is from [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1030 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 wpa_supplicant_need_to_roam_within_ess applies bias to the minimum difference of the signal level required to roam if the roam is from 2.4GHz to higher band, but doesn't apply bias if the roam is from a lower band to 6GHz. Add bias towards 6GHz, as 6GHz networks usually provide higher throughput. Signed-off-by: Kaidong Wang --- wpa_supplicant/events.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 64b2bcd1d..4d2a30b0d 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1969,7 +1969,7 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, struct wpa_bss *selected) { int min_diff, diff; - int to_5ghz; + int to_5ghz, to_6ghz; int cur_level; unsigned int cur_est, sel_est; struct wpa_signal_info si; @@ -2036,8 +2036,9 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, } to_5ghz = selected->freq > 4000 && current_bss->freq < 4000; + to_6ghz = is_6ghz_freq(selected->freq) && !is_6ghz_freq(current_bss->freq); - if (cur_level < 0 && cur_level > selected->level + to_5ghz * 2 && + if (cur_level < 0 && cur_level > selected->level + to_5ghz * 2 + to_6ghz * 2 && sel_est < cur_est * 1.2) { wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better " "signal level"); @@ -2089,6 +2090,8 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, if (to_5ghz) min_diff -= 2; + if (to_6ghz) + min_diff -= 2; diff = selected->level - cur_level; if (diff < min_diff) { wpa_dbg(wpa_s, MSG_DEBUG,