Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp273063rdb; Thu, 21 Dec 2023 08:45:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcLD5ztCI0M4wVcCwP17eJLGfy5Fpnyiw5qg34hLHMIjgzWaaSWnD9upugMj4Xr9ujo7PL X-Received: by 2002:a50:d587:0:b0:553:aa33:7876 with SMTP id v7-20020a50d587000000b00553aa337876mr1462244edi.31.1703177130554; Thu, 21 Dec 2023 08:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703177130; cv=none; d=google.com; s=arc-20160816; b=RGVErKKQrVeaAiv5cWmjz6i2HOF5Ga4JMtpSxw+ggDsNyGo6v5gOU4OeuyI4Sj1uic KFmFclHjYVO46e20zXoyWlPJlApozEkXR2cNESqVOnhsM/g8Q2LbcoNUpvbTwWRXyAGe oBlSBO98NT9zluIOlVFV61wn2/qEHz9T+ObHteNKb9WYmMg3KGHUZmsVJnDQG/nPUNpk E7Mvm8/hXKhlQUJk4x0KYGZJy1kEnCE0axk3sGRcsmNs4LEk+2XfpMFMSPk+fHxSNZrX dSGJpD2iZiR/Tm1ipvl9N4gmAqDuM3y3cKjj/KQdUdtuTOplKKtLAqcJsKr1+rCQlbrM XRpA== 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=r0yo6wUPMjlWISpPYo4osApNu94NIJzCy0g+vJ50WnU=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=hqx1TekiHMRW4NHgOzQ76mYVJ4u+njD8NF2S1KofWKj/TnA2qS0e2YHAmJVKfehzwt a3Yfokz3arykKRMIhla/PbmZjlxnT3lq7axVzl3bygbUQ8fdSUJM1HfNgoODXTZBIafY u5MZujzpAPmZb9ajFAGLAtdwduxF+351libmlzuc5fn2PLjPQEDwSxx3/y4TFDAEPFN3 ays3lmfFHMcM6NnepUUSIAdRRdr/smq5aDfg8q8BMd9ET89nfDP5BhwYm8GvvYFg7ncu SuSS+/AdHrU2ed6ofhN5qkkStbvs7z6m+mygNHg+IEUuohK/x1P2aS2ozeLh5C4sRdA2 j3Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GPm08bxy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1167-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 h28-20020a056402095c00b005533a9934a8si965927edz.459.2023.12.21.08.45.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:45:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1167-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=GPm08bxy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1167-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1167-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 CBB0A1F22031 for ; Thu, 21 Dec 2023 16:45:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19A13634F6; Thu, 21 Dec 2023 16:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GPm08bxy"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="E5waxjo/" 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 99B996280B for ; Thu, 21 Dec 2023 16:44:16 +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=1703177045; 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=r0yo6wUPMjlWISpPYo4osApNu94NIJzCy0g+vJ50WnU=; b=GPm08bxyWhQI9QLBkcKCI6F0IU6FZMjgptBBF/UxOk5VieLzQ1CldHt0jdBLw6rWz+gRJt QpX2HNszgVJ2Mc+oWA/pWmEzsKjg1QDV93TykC8fsDd/0It830VnuuNGipXHfXQme+XdCu cV1LNfm+IMYgAfAK8gZbBXw+EDvukDj/iRZRchoac0cL2Ea4cV+RoT8g5HcZ1G8IwDeiZ6 vl/t5aLMTb8FlRC+LF4oW9yEHKzBG+IN00+G7uSqe9owSElKBUFv0tkc6zC46DKTpQ72x6 ELKYrxw0VaCUxZL1IEal7oSa3u3qBdD0TF2FCvQ/kEJ7HLAuuJD4FK/ANdgg2Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703177045; 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=r0yo6wUPMjlWISpPYo4osApNu94NIJzCy0g+vJ50WnU=; b=E5waxjo/wuwgI6W4shjcjC9+VYzH9W0U635pgdVN3wEGezDf0V/XzBZxP8NnkrXpLENKzC DZnzNhwd8MMOY4DQ== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v2 15/21] wifi: rtl8xxxu: support multiple interfaces in bss_info_changed() Date: Thu, 21 Dec 2023 17:43:47 +0100 Message-Id: <20231221164353.603258-16-martin.kaistra@linutronix.de> In-Reply-To: <20231221164353.603258-1-martin.kaistra@linutronix.de> References: <20231221164353.603258-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 and set_bssid now with correct port_num. Call stop_tx_beacon only for port 0, as we don't support beacons on port 1. Explicit changes to BEACON will only happen for AP type interfaces, so we don't need an additional check there. Signed-off-by: Martin Kaistra --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 4090db8abba7b..aa88e66c64d67 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4983,6 +4983,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; @@ -4995,7 +4996,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; @@ -5042,7 +5043,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, @@ -5084,7 +5086,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) { -- 2.39.2