Received: by 2002:ac8:4f0c:0:b0:427:7d78:cd45 with SMTP id b12csp239437qte; Thu, 21 Dec 2023 00:24:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKRYVW6yy21+QGrs7DyO4/3KvDSQiPjt/SXsVuAdWRnXPhZu/QduXNUfhdwfhP56vsfZDx X-Received: by 2002:a05:6a20:40a7:b0:194:f793:cb42 with SMTP id a39-20020a056a2040a700b00194f793cb42mr871697pzf.9.1703147061794; Thu, 21 Dec 2023 00:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703147061; cv=none; d=google.com; s=arc-20160816; b=OnTV+GzGHgL7f8RN2T03WKDjObzLPj3tE744GAiNpfMte8WT4MpIiM22Qkcyv0POXN kg2QozRhB5DMn9AQfGZUU/e7lO5j4dShOKZ9cO56h/u4tuKBX26odymVSn2QTeqhFdCa esrzRiCqlNAavbWY9mtno9WtV3I6OrMlKMttalhqlk6cUAclSurnJoIAOpCu+yQDPFvu xXsk5jKamtM93SGR0kVGWEoro7Rs70ewY23zHQQnJjHXUUqorrXmQem639vTCT/qRTQ8 3dO9IPywOfTwdW6TviH2jYMZbYz5bVO/IBw9VKtIb20Nv3Ymt5LHSiPXMJwFdBMtcpcF hMlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature :dkim-signature:message-id; bh=CiFBnrL6KnGT6743ssQHaFK9cmfzOm3UwNDaHRlRR+E=; fh=B8o+z0BrKEPgpj9MKmYUFYnGwr+ws6ED0wqC2zV4cSs=; b=J7Cli3O8+CxHVckhadNN+7fzCGIH/tluT6c01Llh3EZ+zweqSG3BliQZmPSFQdZddp id5Y4EBl2zrUxQLxSqJeQn5+5SZsBgsVTYcPvWGFjTfzQVdI4P2PNEdWnThRAw6eqXtX 9EOOIbwheqbuyC+cE5m2Y/dQ5rU2M6gCamGGtv24ZGKZm906PutW6ttATlAkzNfWBQG5 FRVpMKnvycnUupy+8p2wtfkma2KisqARqt41gWP2qSAhJ+eiet1xIoGegjbUiE7yIuwN RaBfRydlvkD3b8jXBCmCTG/9Er0tuymOsAaTnQA7mkO8tEMdyMCnG/P9Vue2B3d1Q7fi z7+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NBSzFjnA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1138-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a4-20020a17090a8c0400b0028bce5c7247si2911994pjo.95.2023.12.21.00.24.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 00:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NBSzFjnA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1138-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EFD302859BE for ; Thu, 21 Dec 2023 08:24:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B7F016420; Thu, 21 Dec 2023 08:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NBSzFjnA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7o2IdVWi" 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 5FADD16401 for ; Thu, 21 Dec 2023 08:24: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 Message-ID: <6cd6ff5b-3308-444b-bc68-62b85cfabd4b@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703147051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CiFBnrL6KnGT6743ssQHaFK9cmfzOm3UwNDaHRlRR+E=; b=NBSzFjnAu+xtDvr/ja+WivFKHVX1S2ax/Dt4z01MYAiJXzZZcb0TZl8Ub6EfeozfneYosG aF+GkMVFGJ/2KvqaXVsA/lYQGbbZFGYKFaykaG0tsO42oe2o6OGtNJMmGofLdAyXt7LLPH LnqmRU6h0Fbgve1NagCIlY8qLEUypSsv1ud9bcykeGozEvd2hkY39E7g2L67m1Xe9j9DsS ssY/LB+yvl1Waz9DqgkgQdaLCuPqt4mO5eJriByaYIcKRvEiiVyEIjZ/k1r/rJ+MgKD75v dnlQudFBAfBYAOPSDqqOPVkKGR/WK+SYlGCX+XAAFuaHR+fgDIJDqWZH2tUCmA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703147051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CiFBnrL6KnGT6743ssQHaFK9cmfzOm3UwNDaHRlRR+E=; b=7o2IdVWilLVRdedgwHsvHgAjY4I65tMY6NPaZvfzXNalmobbuITC6pwckgDRXGUIMDs3v0 X0E2yYo9p8kWlrBA== Date: Thu, 21 Dec 2023 09:24:11 +0100 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 14/20] wifi: rtl8xxxu: support multiple interfaces in bss_info_changed() Content-Language: de-DE To: Ping-Ke Shih , "linux-wireless@vger.kernel.org" Cc: Jes Sorensen , Kalle Valo , Bitterblue Smith , Sebastian Andrzej Siewior References: <20231218143645.433356-1-martin.kaistra@linutronix.de> <20231218143645.433356-15-martin.kaistra@linutronix.de> <32b2f2efe2834578809303c9960fba6d@realtek.com> From: Martin Kaistra In-Reply-To: <32b2f2efe2834578809303c9960fba6d@realtek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Am 20.12.23 um 07:09 schrieb Ping-Ke Shih: > > >> -----Original Message----- >> From: Martin Kaistra >> Sent: Monday, December 18, 2023 10:37 PM >> 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() >> >> 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 > > [...] > >> @@ -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) { > > As your design, AP mode must play on port 0. Could mac80211 notify driver BEACON > changed on port 1? Looking at mac80211 code, there is an explicit check for vif.type when changed contains BSS_CHANGED_BEACON or BSS_CHANGED_BEACON_ENABLED. As rtl8xxxu driver only allows to add NL80211_IFTYPE_AP on port_num = 0, a notification on port 1 will never happen. I will remove this check for v2. > >> + 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; >> } > > Ping-Ke >