From patchwork Wed Sep 9 20:00:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Valentin?= X-Patchwork-Id: 1361000 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=marcant.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=NGnbtUPq; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmtGw3VXQz9sTK for ; Thu, 10 Sep 2020 06:02:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=133djugV1lvYCVX/3S2y9pQE/3iDusiToBJlqbTmSxA=; b=NGnbtUPqeVZMpB9v0W0LO4RrYA +3z7VUsNCxtV3y71YmE/cBUWYG/+sNgTax65FxHrAEqNeGgaf8v2Uq00aVkI3irU8NiZ3jELLAnuX zo2CajngDdKR0viTggO6QDdRV+/6iUFEC6edxCOAttbIADYTMi/ItKVdvVy8OqlIWlAjssLWLHqtR UszOZVxPKDBwFrazwBJ26DuPbRqnpWxdKEM/xOEMufE9flJ1FY468yML6ikUhXHRWwEWdwfMlKef4 T9qseO4S6GzHhilH1UAD9U/X/DyNMJp0tcGZJq3HgxmELd8JOSx8fDQiaO10QJt5qKuLSBf34lkwY Pwg+cDKA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG6Gs-0001fe-Kr; Wed, 09 Sep 2020 20:00:46 +0000 Received: from mail3.marcant.net ([217.14.160.188]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG6Gp-0001fA-JR for openwrt-devel@lists.openwrt.org; Wed, 09 Sep 2020 20:00:44 +0000 Received: from [192.168.180.1] (port=43082 helo=admins.marcant.net) by mail3.marcant.net with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1kG6Gj-0002VU-1Z for openwrt-devel@lists.openwrt.org; Wed, 09 Sep 2020 22:00:37 +0200 Received: from varus.marcant.loc (unknown [192.168.3.44]) by admins.marcant.net (Postfix) with ESMTPA id 4A8362807DA; Wed, 9 Sep 2020 22:00:37 +0200 (CEST) From: =?utf-8?q?Andr=C3=A9_Valentin?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2] hostapd: enable background scanning in wpa_supplicant_full Date: Wed, 9 Sep 2020 22:00:32 +0200 Message-Id: <20200909200032.3662-1-avalentin@marcant.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200909_160043_791396_274E4D32 X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Andr=C3=A9_Valentin?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Activation of autoscanning enables a a wifi client to select the best accesspoint based on rssi. This feature is useful in case you have multiple access points in your range and you do not want to stick the client on the first one it connected to. Especially when used with 802.11r this allows seamless transition to the optimal accesspoints. Setting the config value bgscan to -65 will tell wpa_supplicant to try to connect to an access points with better rssi. Example config: config wifi-iface 'default_radio1' option device 'radio1' option mode 'sta' option ssid 'openwrt' option encryption 'psk2' option key 'mykey' option network 'wlan' option roam_rssi_threshold '-65' The ipk sizes for mipsel_24kc change like this: old: wpad-openssl_2020-06-08-5a8b3662-4_mipsel_24kc.ipk 550133 new: wpad-openssl_2020-06-08-5a8b3662-5_mipsel_24kc.ipk 551961 Signed-off-by: André Valentin --- package/network/services/hostapd/files/hostapd.sh | 7 +++++++ package/network/services/hostapd/files/wpa_supplicant-full.config | 6 +++--- package/network/services/hostapd/Makefile | 1 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 88113cd7ce..85299234c2 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -272,6 +272,8 @@ hostapd_common_add_bss_config() { config_add_array operator_icon config_add_array hs20_conn_capab config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + + config_add_string roam_rssi_threshold } hostapd_set_vlan_file() { @@ -1178,6 +1180,11 @@ wpa_supplicant_add_network() { [ -n "$bssid_blacklist" ] && append network_data "bssid_blacklist=$bssid_blacklist" "$N$T" [ -n "$bssid_whitelist" ] && append network_data "bssid_whitelist=$bssid_whitelist" "$N$T" + [ -n "$roam_rssi_threshold" ] && { + json_get_vars roam_rssi_threshold + append network_data "bgscan=\"simple:120:${roam_rssi_threshold}:600\"" "$N$T" + } + [ -n "$basic_rate" ] && { local br rate_list= for br in $basic_rate; do diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index 982f4d5534..d39ee74a8d 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -527,9 +527,9 @@ CONFIG_WNM=y # # Enabling directly a module will enable autoscan support. # For exponential module: -#CONFIG_AUTOSCAN_EXPONENTIAL=y +CONFIG_AUTOSCAN_EXPONENTIAL=y # For periodic module: -#CONFIG_AUTOSCAN_PERIODIC=y +CONFIG_AUTOSCAN_PERIODIC=y # Password (and passphrase, etc.) backend for external storage # These optional mechanisms can be used to add support for storing passwords @@ -600,7 +600,7 @@ CONFIG_IBSS_RSN=y # operations for roaming within an ESS (same SSID). See the bgscan parameter in # the wpa_supplicant.conf file for more details. # Periodic background scans based on signal strength -#CONFIG_BGSCAN_SIMPLE=y +CONFIG_BGSCAN_SIMPLE=y # Learn channels used by the network and try to avoid bgscans on other # channels (experimental) #CONFIG_BGSCAN_LEARN=y diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 8f94dce782..8c264854d7 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git