Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp372886rdb; Tue, 19 Dec 2023 22:14:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMwu8Qem4wssufP/THU/pSNtzqIwsipqP7sVpp/4nI3tbvu8wcow7CdlLfIaw/auDhTCYG X-Received: by 2002:a17:906:1d7:b0:a23:6bc9:40ac with SMTP id 23-20020a17090601d700b00a236bc940acmr1457851ejj.102.1703052899713; Tue, 19 Dec 2023 22:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703052899; cv=none; d=google.com; s=arc-20160816; b=EzsC9qp4X0coz28fUrQMVM3Tq5N1MoxNXHCSl3Q4Wnje9uva1j/85V66D3eBsTdQIM UpYzkn3bPD6/n6SBSEXOkFoq2R02WAIjCySZ592e/jl9c8+madSYproJkZq2st4kZOLK puqvBkqjhspwjJRZ+v2h8oYhNtrbnnB4bC6KW9P47DX424TZhdUpWJR/eNCjuEJ4rDEJ oLWxuuTpBSXlY141R/dgpxNL2sWoJh0fMPrMChtH3GDiSMBV4FzwCGWeGelHSJNc5a/8 meoWFXxELMphY+4s28tbho3YSJjOgdygzH0XDqtFvFBXkgX1gLuzO0fXzo2pAYvkfB4z dNUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=JjVLRLb2v3WWcjSzbB75WpWyrgnr7JsFl0JrS+FLZzg=; fh=LQGtYe9vP0onFiP/6l3tkQw/DADLCp+GjsQcHD3gn8k=; b=Yi6/CEosIww5M0oBZMGPJ0aJ0TeU/QcfZuNaZHov43OrRKFaHOLFp+nB7o2L2ztr7N 6GE9pd9cD/7KY3OE0wtS8lj9lB5A1pyWnEpbZhm4GUQsZsGHHn+RUTbHTi5I8UUDeUOG 9VdvbPdaqS1rEpryTAEqoReo9Dght1O0DoGYSNooXgiqWaZ4i6K2RUj8KrlWMbUMMCh0 lwFDDd4Gc4lIORNuIgplULmx6E3s6y3h6qNxhodJwaNe9q+Y+4++YpCYxutHWFmaJ0st kvcEz5R+T/Db2ZE/7mwDKsWDNmXS9td8L43fm945q2sW7y6V2MzWS5bEr5UaZC0QUsPF 9+xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-1065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1065-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h13-20020a170906590d00b00a2362147bd7si1881834ejq.977.2023.12.19.22.14.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 22:14:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1065-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; spf=pass (google.com: domain of linux-wireless+bounces-1065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1065-linux.lists.archive=gmail.com@vger.kernel.org" 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 6B8661F21BC7 for ; Wed, 20 Dec 2023 06:14:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E28A1DA2A; Wed, 20 Dec 2023 06:14:54 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE90A1DA24 for ; Wed, 20 Dec 2023 06:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3BK6EfDgA512652, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3BK6EfDgA512652 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Dec 2023 14:14:41 +0800 Received: from RTEXDAG01.realtek.com.tw (172.21.6.100) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 20 Dec 2023 14:14:42 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXDAG01.realtek.com.tw (172.21.6.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 20 Dec 2023 14:14:41 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7]) by RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7%5]) with mapi id 15.01.2375.007; Wed, 20 Dec 2023 14:14:41 +0800 From: Ping-Ke Shih To: Martin Kaistra , "linux-wireless@vger.kernel.org" CC: Jes Sorensen , Kalle Valo , Bitterblue Smith , Sebastian Andrzej Siewior Subject: RE: [PATCH 16/20] wifi: rtl8xxxu: support multiple interfaces in get_macid() Thread-Topic: [PATCH 16/20] wifi: rtl8xxxu: support multiple interfaces in get_macid() Thread-Index: AQHaMb/ihD8TykSy2kSZONBmOCWKE7Cxs6Vw Date: Wed, 20 Dec 2023 06:14:41 +0000 Message-ID: <3514e2620c734baaab8dbd8e34aaa5c5@realtek.com> References: <20231218143645.433356-1-martin.kaistra@linutronix.de> <20231218143645.433356-17-martin.kaistra@linutronix.de> In-Reply-To: <20231218143645.433356-17-martin.kaistra@linutronix.de> Accept-Language: en-US, zh-TW Content-Language: zh-TW x-kse-serverinfo: RTEXDAG01.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback > -----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 ; Sebasti= an Andrzej Siewior > > Subject: [PATCH 16/20] wifi: rtl8xxxu: support multiple interfaces in get= _macid() >=20 > 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. >=20 > Signed-off-by: Martin Kaistra > --- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > 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 rtl8xx= xu_priv *priv, > { > struct rtl8xxxu_sta_info *sta_info; >=20 > - if (!priv->vif || priv->vif->type =3D=3D NL80211_IFTYPE_STATION |= | !sta) > + if (!sta) > return 0; >=20 > sta_info =3D (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 =3D=3D NL80211_IFTYPE_AP) { sta_info->macid =3D rtl8xxxu_acquire_macid(priv); That means STA mode can be macid =3D=3D 0 always, right? This will be a problem. At least TX rate will be incorrect.=20 Ping-Ke=20