Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2262628rwr; Fri, 28 Apr 2023 08:09:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6chmaQ8bbZj7vwNrQcN1h4g0+CsVeqb+OC2sTFpUMmdyJLAHeZ2w9N8Wn1LIjezeJihxxS X-Received: by 2002:a17:90a:a010:b0:249:6098:b068 with SMTP id q16-20020a17090aa01000b002496098b068mr5724616pjp.45.1682694561909; Fri, 28 Apr 2023 08:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682694561; cv=none; d=google.com; s=arc-20160816; b=kzquwpBBF5Bx3yz1/99w7nK/afI5D8uOrtjtX7TewYK7K4CKogMI+r7hVjqnnqHnHF 5WA0I1Ke1rgKeB/DbjXvDMrHwizlYgN/X3s6piCX4CKI8zETn0NxJWRbfyQ8pUNgVEBL NWf2Eh0PaXY+d+S2XeysBHWweAnZulemTR89iDeNFwvAR484YqKVNyUMqUPBSyggdn4H n1zLoIzuUVm+KlRPZLPTCFdAW3iJdr0ZZBFWg22qUfLT5mLeQfewu9Y55F06y5zfu5st PkqnaYhXaRqOl3xOq2VtzK768udTk3sPId9GUdXBkaD41aX/dLwNtZVQZMLcOVWzMyDb K7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=ripM994YwH2FpgLTQOpO03asnDM15s7kyKZMntGjDOY=; b=n1EhphFFrBjK+osPt0HPTer//z12k7ow/MaubB49qha00daTM5uv0UEU6HxwsXmyxw ShYs1Wib6BE07SMVDzKOnuNmcdJGcXBdOtr174yPy69dU9XwlJ9D0gVWFtiXqD/aMtLk kjyEZesIC1diKV17WpwpjMRdenVRBx82BBDX91muFec7daZ50GTZdvmRfFjOs1q5PyhF ibC9gM0WATecgGBVDimgiAz5Z7nX5AGjpzWPmBa1r5vJGyHPj6vZA7eaj+Skq/K8GWSL ZfOee61qruPn/cZ3N+ev/EyLqVvGRl9hMv9Iq8tbj7KTjxlg/fbWSK80KdlJH8EQhN/z eyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zyHAawzS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=6YRQwQgQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a170903125100b00192721d6a97si13966593plh.499.2023.04.28.08.09.13; Fri, 28 Apr 2023 08:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zyHAawzS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=6YRQwQgQ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346303AbjD1PI6 (ORCPT + 62 others); Fri, 28 Apr 2023 11:08:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346272AbjD1PIw (ORCPT ); Fri, 28 Apr 2023 11:08:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E543C33 for ; Fri, 28 Apr 2023 08:08:50 -0700 (PDT) From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682694520; 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=ripM994YwH2FpgLTQOpO03asnDM15s7kyKZMntGjDOY=; b=zyHAawzSDmTnZJyK8k1GMMW5s8hYRcjxJmMpOrVt/xiBS6sTRkkLOAfSqlX6MT82EE+rvF lBwdv/DZ5vWySEs14cc70tQQUiVf9OXrZwWnB4W7Qj/CthERE4iFuoC+p54qHwSeO40LV2 +csAUS4eO//GoQDD726UgJ5HsXPyqjD6jiy7PBu51imhakKoiOgphy4VT2FDSRRWSEQWCI ob7t+f+9I3DO69ZfzM9uNp4O9IwEu0MAD7iab4us3HHZ/M0QB36guXYeQza1tqJQCzhfjR h05E+tTvcBKqITcXvKb1ZYhGBp1BSvsqetVqw7mLiNxYmlhBtoDO9uoQrXHk/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682694520; 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=ripM994YwH2FpgLTQOpO03asnDM15s7kyKZMntGjDOY=; b=6YRQwQgQeGLNODUZM4Q/69MfzmlsML+p80+s5Lbw2MGhUlkN1VhQjQWsjTxR3Fy2x3+Jg7 jtd0MrHTJ5ILZuDQ== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v4 09/18] wifi: rtl8xxxu: Add parameter force to rtl8xxxu_refresh_rate_mask Date: Fri, 28 Apr 2023 17:08:24 +0200 Message-Id: <20230428150833.218605-10-martin.kaistra@linutronix.de> In-Reply-To: <20230428150833.218605-1-martin.kaistra@linutronix.de> References: <20230428150833.218605-1-martin.kaistra@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In AP mode, when multiple STAs connect to us, we need to set an initial rate mask for each of them. This initialisation should happen regardless of the rssi_level saved in the priv struct. Add a parameter called force to rtl8xxxu_refresh_rate_mask() which will be used for this initialisation. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 0e951dee127ec..a3ca6ea9b2d66 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6830,7 +6830,8 @@ static u8 rtl8xxxu_signal_to_snr(int signal) } static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv, - int signal, struct ieee80211_sta *sta) + int signal, struct ieee80211_sta *sta, + bool force) { struct ieee80211_hw *hw = priv->hw; u16 wireless_mode; @@ -6864,7 +6865,7 @@ static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv, else rssi_level = RTL8XXXU_RATR_STA_LOW; - if (rssi_level != priv->rssi_level) { + if (rssi_level != priv->rssi_level || force) { int sgi = 0; u32 rate_bitmap = 0; @@ -7080,7 +7081,7 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work) if (priv->fops->set_crystal_cap) rtl8xxxu_track_cfo(priv); - rtl8xxxu_refresh_rate_mask(priv, signal, sta); + rtl8xxxu_refresh_rate_mask(priv, signal, sta, false); } out: -- 2.30.2