Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp156365rdb; Wed, 20 Dec 2023 08:40:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCQGXfWajrni595ZiSIi3yNgFcKkGfojZKgTIWCND0ZYgQrPQkWLruNfjgINT/Y8PUGXa6 X-Received: by 2002:a17:903:32c5:b0:1d0:6ffd:835c with SMTP id i5-20020a17090332c500b001d06ffd835cmr10704286plr.103.1703090435683; Wed, 20 Dec 2023 08:40:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703090435; cv=none; d=google.com; s=arc-20160816; b=N/+XLTlP0AL4aFO5H/1UNtDBOWHrFXNvvjXBkFNvnB5OQafI1FCW4kDOMOYZuo7pG5 wQGFIHZUqmhjII5eRtJgvsY5Nczmql7AN3kASsKUJiGKhsqqTLNN1rQuxcHNRxb7wjXl OF34xus6EmaHItKTvInYH+EGmVzqsANv+No7xHO1BFyNNgh1mCPqIyEvTf3LEwDBrddM UdYCLWYaw1BPRpV7u3xKwgyK7VnJiGjfFnuGjsWBPenNNCyhlaxaMCF3EJc6NQBaFAJ2 /jM+8wfH0jBdVYkDZ6PF0clMaSysdUWeBHxQaqMgTVcM12oDAaZhixGAumhAWGmYpd3r upnw== 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=u92ZxIQJkDos8cFnZ2sX33Ct3mdYCPlQyuWQAoBHKCc=; fh=B8o+z0BrKEPgpj9MKmYUFYnGwr+ws6ED0wqC2zV4cSs=; b=pnt74saegwKBl6F3cn7T7YRDFUhTEWV7wMB+kWH0oolh7e+kkMPfD0LXQH7B1yq6an a3x0l2RrNrUwtkudKvLdI0ZW1wrSqX8JmvnLWYXCBje2MVqEugflLw1Ph1Vcw85Ucxw6 ml2gTuAFa5vosD8z5o5QcwCv7qOUdP9QppHg0M7LoW8wS3+V8jZR0Cnn8ciT5qULpx/i vxURo81X6vXVCG7uyIFlJdVVyC5i4weqMdghqWW0LJNInpozbDB7hTQn9w3l55yQ8mxE Nu2TM/qVHpN81cp4NSBUi9WjEA5U1kJt4DXoBHJzRYCp2it1i9wCFDcozZa9VCPddiIf p/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=h3U9G0ON; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless+bounces-1108-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1108-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 x15-20020a170902a38f00b001cfb4bd0b83si602597pla.439.2023.12.20.08.40.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 08:40:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1108-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=h3U9G0ON; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless+bounces-1108-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1108-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 F1ECE285803 for ; Wed, 20 Dec 2023 16:40:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 501EC41763; Wed, 20 Dec 2023 16:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="h3U9G0ON"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2HkWUnEh" 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 DD9F441854 for ; Wed, 20 Dec 2023 16:40:29 +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: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703090427; 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=u92ZxIQJkDos8cFnZ2sX33Ct3mdYCPlQyuWQAoBHKCc=; b=h3U9G0ONbnYyJscwA+cKW53llyoexFBaawaL0cVSkSSCODvVgF8UozQLEOEtquVhuKSFLi RYHC1w6NxJbC43t/LzYUrwwJ9b+TxdEo2dvzx99e9WpChkOvAkQy2bkN9bV5k1kHKGVOeW g09+xaKp1IAPNK+8DjVX+FRmcdfZxeKFIp3BPYNIBTW9si0BX1868VKR9lApr3pUh5Lfdd Yrv2VVG9HqjgVnn4WgkWJjg/HbPaM1L2I2VQxjOGj9IGe9YQ4QL/mYSoEDoIF8jjbBqZVC MoEJaZE8dXr+W2Z4phQ4TRqkm61Mrk2HgvjaPt2U502BrvIt1hR7Z9K5+PEQ/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703090427; 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=u92ZxIQJkDos8cFnZ2sX33Ct3mdYCPlQyuWQAoBHKCc=; b=2HkWUnEh62W/IUPTLTz2UxLvysVOjuTVCfHOsi7KkkdI8ugLA89gepcQxf8QHzcNfKrHvj Nr4iLe4fFJx63NAg== Date: Wed, 20 Dec 2023 17:40:27 +0100 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 16/20] wifi: rtl8xxxu: support multiple interfaces in get_macid() 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-17-martin.kaistra@linutronix.de> <3514e2620c734baaab8dbd8e34aaa5c5@realtek.com> From: Martin Kaistra In-Reply-To: <3514e2620c734baaab8dbd8e34aaa5c5@realtek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Am 20.12.23 um 07:14 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 16/20] wifi: rtl8xxxu: support multiple interfaces in get_macid() >> >> As sta_info->macid does not get set in station mode, we can simplify >> this function by directly returning 0 if sta itself or sta_info is not >> set. >> >> Signed-off-by: Martin Kaistra >> --- >> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c >> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c >> index 3851fc90339e0..ad76cddef81b2 100644 >> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c >> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c >> @@ -4053,10 +4053,13 @@ static inline u8 rtl8xxxu_get_macid(struct rtl8xxxu_priv *priv, >> { >> struct rtl8xxxu_sta_info *sta_info; >> >> - if (!priv->vif || priv->vif->type == NL80211_IFTYPE_STATION || !sta) >> + if (!sta) >> return 0; >> >> sta_info = (struct rtl8xxxu_sta_info *)sta->drv_priv; >> + if (!sta_info) >> + return 0; >> + >> return sta_info->macid; > > I checked where driver assign macid, and only > > if (vif->type == NL80211_IFTYPE_AP) { > sta_info->macid = rtl8xxxu_acquire_macid(priv); > > That means STA mode can be macid == 0 always, right? > This will be a problem. At least TX rate will be incorrect. Yes, currently macid for STA mode is always 0. Would it be enough to set macid in STA mode to either 0 or 1 depending on port_num? > > Ping-Ke >