Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp138894rdh; Mon, 18 Dec 2023 06:38:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwyIKRZEs4jKxfsvZPUxuCMBF0mOL598djFYj1vosk9HGllblJIQ8Z6J3DN/9TpyiGsBVf X-Received: by 2002:a17:906:c116:b0:a19:d0b:b3c9 with SMTP id do22-20020a170906c11600b00a190d0bb3c9mr11673943ejc.34.1702910307329; Mon, 18 Dec 2023 06:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702910307; cv=none; d=google.com; s=arc-20160816; b=Ut3MLrhEKff/oJsMEwnKCiDTf3zJSbR+BNg+1awJaICfqAWZ7ZzDiTqeAnRZcr20ef kSsFP0ZQTztLmV/RWLP/ldXs1fDFVJXfJ6MqKQUln+GtpsEYrEOaC0dF2t/WmeoMJcKz C0ULCbsEeaaU22wX6vw7KAc9Prc8d6K6k41PzKAmJs2JBaqBJm1Tl/paerLvJMtoTid5 E1PRBmtzp3tZQdiJqqgXTB6Bomj53q05ctBZwBdrB+Xeg3ni5lMXlseqVk7XoFDjwX8E dCNDspyatWb2IOW1JANIiT/cpJnVCRpdg3A/w6oaAhsH/Y0iMF4FCW/H2C6DfVmoFgkW iCxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=C4bcRKTY9GAPu5NO1zkb4kunZ+++ym2dwCU56rp2fjU=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=Gw1Gh2A/u2ZQD6FIpt/9idu2jk8BQ+k2VHDr03Ha2RbHI2nINTjJkaf4IJaHrPUa/F LT/4WKa5TSNmOOj59+jBLKhUcTIutFmrj9sZJ8nRAb1ZQ1pn1GggU95xbaxyJGe+ToU2 pDlyqjI8JXH2zLrQOtse5p9czEnEGH3gz6GZ7XkXWvZMIA8okUIJANeT2SUwXTeDzJJt P9uvi+SM8HLOrI0woNp0+wDTf5NbuPncIxen9rvkcqtFGui//GBExLPun5Guklyz+VRX zDLO7vmkqqP0J/FJ9KWu0yRuVaM6rBQG+09Q8h42Ose6Utf9hamkIkasmm+Muqh0YgdU dVQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IKARBYYY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QsyvZC+I; spf=pass (google.com: domain of linux-wireless+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dx5-20020a170906a84500b00a235eb9e414si608465ejb.743.2023.12.18.06.38.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 06:38:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IKARBYYY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QsyvZC+I; spf=pass (google.com: domain of linux-wireless+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E0DC81F2408A for ; Mon, 18 Dec 2023 14:38:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8FD23A1DC; Mon, 18 Dec 2023 14:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IKARBYYY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QsyvZC+I" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91D0C3A1B4 for ; Mon, 18 Dec 2023 14:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702910229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C4bcRKTY9GAPu5NO1zkb4kunZ+++ym2dwCU56rp2fjU=; b=IKARBYYYs4qyLUv3dxMghYqsrP3hkbOzhwhN4JNzRa4WeTg0/PPfAXv+SEcYUzjmoFUS9E 2r+jZtHXCAjGrm7sK/GkUT4eOAQdCQKXv59m/xR+VktSisKCDVvSyye72hYY+z4s2WlrqN +sz1pSvHDXcrJXDAxo+EjkrSi8ERECJfvYe3gEens3Px1DOr0BzRMpozPsubTfO2jO630l 5j1ReSSGUqqKgck71GPNwHXiVNOWWoBTOaVfJyuVwLbpSnRXApLv5jNVzx0XyVkWSEBWqc N+MhzC3BDUQ11h9ZUBuIISniwfyCPhgVi17PQh8APWGLtx4cnxrwoApnSxCpkA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702910229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C4bcRKTY9GAPu5NO1zkb4kunZ+++ym2dwCU56rp2fjU=; b=QsyvZC+IoklSSw8+cJAgc88qyyr7l9bGMRgD8tuDTXSt1qTDtooddcEErTpOICdwfXw/8X Ji1Day44dw8cG7Dg== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH 14/20] wifi: rtl8xxxu: support multiple interfaces in bss_info_changed() Date: Mon, 18 Dec 2023 15:36:39 +0100 Message-Id: <20231218143645.433356-15-martin.kaistra@linutronix.de> In-Reply-To: <20231218143645.433356-1-martin.kaistra@linutronix.de> References: <20231218143645.433356-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Call set_linktype now with correct port_num. Only react to beacon changes if port_num == 0, as we only support AP mode on this port. Signed-off-by: Martin Kaistra --- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 59dd50844f1ae..f929b01615d00 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4981,6 +4981,7 @@ static void rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u64 changed) { + struct rtl8xxxu_vif *rtlvif = (struct rtl8xxxu_vif *)vif->drv_priv; struct rtl8xxxu_priv *priv = hw->priv; struct device *dev = &priv->udev->dev; struct ieee80211_sta *sta; @@ -4993,7 +4994,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (changed & BSS_CHANGED_ASSOC) { dev_dbg(dev, "Changed ASSOC: %i!\n", vif->cfg.assoc); - rtl8xxxu_set_linktype(priv, vif->type, 0); + rtl8xxxu_set_linktype(priv, vif->type, rtlvif->port_num); if (vif->cfg.assoc) { u32 ramask; @@ -5040,7 +5041,8 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, rtl8xxxu_write8(priv, REG_BCN_MAX_ERR, 0xff); - rtl8xxxu_stop_tx_beacon(priv); + if (rtlvif->port_num == 0) + rtl8xxxu_stop_tx_beacon(priv); /* joinbss sequence */ rtl8xxxu_write16(priv, REG_BCN_PSR_RPT, @@ -5082,7 +5084,7 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, if (changed & BSS_CHANGED_BSSID) { dev_dbg(dev, "Changed BSSID!\n"); - rtl8xxxu_set_bssid(priv, bss_conf->bssid, 0); + rtl8xxxu_set_bssid(priv, bss_conf->bssid, rtlvif->port_num); } if (changed & BSS_CHANGED_BASIC_RATES) { @@ -5090,16 +5092,18 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, rtl8xxxu_set_basic_rates(priv, bss_conf->basic_rates); } - if (changed & BSS_CHANGED_BEACON_ENABLED) { - if (bss_conf->enable_beacon) - rtl8xxxu_start_tx_beacon(priv); - else - rtl8xxxu_stop_tx_beacon(priv); + /* beacon only supported for port_num = 0 */ + if (rtlvif->port_num == 0) { + if (changed & BSS_CHANGED_BEACON_ENABLED) { + if (bss_conf->enable_beacon) + rtl8xxxu_start_tx_beacon(priv); + else + rtl8xxxu_stop_tx_beacon(priv); + } + if (changed & BSS_CHANGED_BEACON) + schedule_work(&priv->update_beacon_work); } - if (changed & BSS_CHANGED_BEACON) - schedule_work(&priv->update_beacon_work); - error: return; } -- 2.39.2