From patchwork Mon Oct 19 19:56:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1384493 X-Patchwork-Delegate: mail@david-bauer.net 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=david-bauer.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=sLJt4TKv; 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 4CFSHf5kVYz9sSs for ; Tue, 20 Oct 2020 06:58:38 +1100 (AEDT) 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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=lM4KR0Zb5EFxoVKThTtv9onagaJmhhSw8VaJasTbgVM=; b=sLJt4TKvcbFtEI2k5L5WV/Lnv3 o2v7CnraO1ZfR8JCIAKSR8BKHLA50kbdjHbzF9pT23f96cZNayR3e17sFXO15BTtROllT9Dm34w2K 8W25cBwJ1j3OJz23NwpJ5VnuVSzymaXrqnGLmykdk2j8NK+7O5ZXmORPjKQiIi37M2hj2lIDCDQJd /WCUvuZEzZXVugeXXQjfKeCL3hoPgJWs2Da+qeL34ZszRCZ/9S5CVbicnHI0hejud0L8T1cUlt2Xq cXQlaHqjknQ5bBLLXuu68sTL3lzSX+H4C45uF+1v38aQS2WRpB/qOYs4B5NXAx9LNoBB9WlwffDt6 +mMNW7Hw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUbH4-0000zg-Mo; Mon, 19 Oct 2020 19:56:54 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUbH0-0000yZ-Ro for openwrt-devel@lists.openwrt.org; Mon, 19 Oct 2020 19:56:52 +0000 Received: from localhost.localdomain (p200300e53f0943008b50adffe4e35b44.dip0.t-ipconnect.de [IPv6:2003:e5:3f09:4300:8b50:adff:e4e3:5b44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 82A1D23916 for ; Mon, 19 Oct 2020 21:56:46 +0200 (CEST) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] mac80211: pass phy name to hostapd_set_bss_options Date: Mon, 19 Oct 2020 21:56:27 +0200 Message-Id: <20201019195628.31747-1-mail@david-bauer.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201019_155651_007278_DB62A051 X-CRM114-Status: GOOD ( 13.88 ) 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_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org hostapd_set_bss_options expects the PHY as second and the VIF as third argument. However, only the VIF was passed as second argument without a third argument at all. This was never a problem, as both PHY and VIF were never accessed. However, with FTM support the PHY is needed to determine the HW support when configuring the BSS. Signed-off-by: David Bauer --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 42144375b4..11ea700b98 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -372,7 +372,7 @@ mac80211_hostapd_setup_bss() { hostapd_cfg= append hostapd_cfg "$type=$ifname" "$N" - hostapd_set_bss_options hostapd_cfg "$vif" || return 1 + hostapd_set_bss_options hostapd_cfg "$phy" "$vif" || return 1 json_get_vars wds wds_bridge dtim_period max_listen_int start_disabled set_default wds 0 From patchwork Mon Oct 19 19:56:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1384494 X-Patchwork-Delegate: mail@david-bauer.net 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=david-bauer.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=ZNQSeh5K; 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 4CFSHf54K8z9sSC for ; Tue, 20 Oct 2020 06:58:38 +1100 (AEDT) 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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7ZCwqL0d0E67aQYMcaIjj/XyoJAa7/NIdp5EDsrtFTc=; b=ZNQSeh5Km8u/O66geSkLwm9rsH Rlxq9g13m0ucF7QIvu1UApDrFY8kEBrNGNfp4Z/k3OXbQ460U1HSYCRurBBqINZOjZC25eizRn7NO MseHaJs+IGKemLUFc25D3uwCgqa8HNOyreIPDuIqoTt//ZrwFy7PjYNQaBDbH2mwAIhWNw9s3Ajkv FE1uSTUWDRMAjAEj/VL37wb0+hxP5HDV7ocv/rh8dPBQU2oemfy9nwVBr6bLWChctUV+h/a2GE2it yGdAn5uPcp7yvEug59cN98BkEh9f7HfCD60XH25EIST3LGG1tog+GjQ8cKajf+9JZWlm7EI3aXLr8 sIeWHFlA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUbH6-0000zw-9v; Mon, 19 Oct 2020 19:56:56 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUbH0-0000ya-Ul for openwrt-devel@lists.openwrt.org; Mon, 19 Oct 2020 19:56:52 +0000 Received: from localhost.localdomain (p200300e53f0943008b50adffe4e35b44.dip0.t-ipconnect.de [IPv6:2003:e5:3f09:4300:8b50:adff:e4e3:5b44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 097E823ADA for ; Mon, 19 Oct 2020 21:56:47 +0200 (CEST) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/2] hostapd: add FTM responder support Date: Mon, 19 Oct 2020 21:56:28 +0200 Message-Id: <20201019195628.31747-2-mail@david-bauer.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201019195628.31747-1-mail@david-bauer.net> References: <20201019195628.31747-1-mail@david-bauer.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201019_155651_117700_71027A1E X-CRM114-Status: GOOD ( 13.85 ) 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_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This adds support for enabling the FTM responder flag for the APs extended capabilities. On supported hardware, enabling the ftm_responder config key for a given AP will enable the FTM responder bit. FTM support itself is unconditionally implemented in the devices firmware (ath10k 2nd generation with 3.2.1.1 firmware). There's currently no softmac implementation. Also allow to configure LCI and civic location information which can be transmitted to a FTM initiator. Signed-off-by: David Bauer --- package/network/services/hostapd/files/hostapd.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index fcf989ca23..45c8718a98 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -245,6 +245,9 @@ hostapd_common_add_bss_config() { config_add_boolean ieee80211k rrm_neighbor_report rrm_beacon_report + config_add_boolean ftm_responder stationary_ap + config_add_string lci civic + config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds config_add_int r0_key_lifetime reassociation_deadline config_add_string mobility_domain r1_key_holder @@ -669,6 +672,16 @@ hostapd_set_bss_options() { [ "$rrm_neighbor_report" -eq "1" ] && append bss_conf "rrm_neighbor_report=$rrm_neighbor_report" "$N" [ "$rrm_beacon_report" -eq "1" ] && append bss_conf "rrm_beacon_report=$rrm_beacon_report" "$N" + json_get_vars ftm_responder stationary_ap lci civic + if [ "$ftm_responder" -eq "1" ]; then + iw phy "$phy" info | grep -q "ENABLE_FTM_RESPONDER" && { + append bss_conf "ftm_responder=1" "$N" + [ "$stationary_ap" -eq "1" ] && append bss_conf "stationary_ap=1" "$N" + [ -n "$lci" ] && append bss_conf "lci=$lci" "$N" + [ -n "$civic" ] && append bss_conf "lci=$civic" "$N" + } + fi + if [ "$wpa" -ge "1" ]; then json_get_vars ieee80211r set_default ieee80211r 0