Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp356892rwr; Thu, 27 Apr 2023 02:13:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51xGzb3SAw9bHUOo+2OigXZOBGjrJl5ay2selmrLSZC49dEufE2z6urJ8xqYhCMVE3IK3h X-Received: by 2002:a17:902:8e8c:b0:1a9:826c:8f44 with SMTP id bg12-20020a1709028e8c00b001a9826c8f44mr766715plb.32.1682586821594; Thu, 27 Apr 2023 02:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682586821; cv=none; d=google.com; s=arc-20160816; b=v5oZrb/Fc0pGzFlaUK83X2wGDuQ/pBMcdPLsmJrqffuMlv6QhFQXPnpf+wx+POztF3 k9yYdk3WqEdssxrYBsO8Ae3c0Faqve51a856igIXYM72e4ChSMl96YqE9caSaXqLFomT pXhszsnJMHhNw1HK5PKTXVcdm2DxTCsiZcON+otcb5TclOkydGt7LwBRzRxzahR0kilL KVretuLvvoCYMfAcIj0A4eJdtkDRL5cSfnORKyLzrsfnuITf7bq7RN+a5BfF7/U2VNOk CSgwdG1rb1mlcYu+qJwCsJPpmDh5uDunbFhP6Gia9iNDsL2dRBuKgBaGHxRShrmwX3s7 Kl7g== 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=y3VCne1HeKL1oLNsS7YEfA7+Q2fI/jmvUfc0Ixzjb5Y=; b=b9Fzp10Jl1Q9UirHYMPXSFV0iNuce6PNrfyZNNptpt1eOi1gfHkt5xpkVqXpxdnJPn ihN2yecGD0/EUrUTF0ZF5GpctGNSPUHASWr90eDRpFiyGJa0b1NKin6n3Q7uSyDDQsJ/ nSY0zfbVyDlfD/JPJO5zDSE2dvnPKQGwxzNcVIECYMTNQCrs2U4lKb77FpAWY0/aXmMd AYGa8lZCZcl4x6uOCxifi1jSGH1jwo0HvADvVz20vmRxbuEGB7C+v6kx23UWGcpoPslb mLfk/gnVw77XIq8vVOtfu3PS9X3dYT8bnEPi/hFf7rKSHwmPLYWPrHK8QNWIQ8QwS74P 2MWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=osBVUTQ+; dkim=neutral (no key) header.i=@linutronix.de; 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 p9-20020a170902ebc900b001a922c7f51dsi17914836plg.172.2023.04.27.02.13.32; Thu, 27 Apr 2023 02:13:41 -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=osBVUTQ+; dkim=neutral (no key) header.i=@linutronix.de; 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 S243294AbjD0JKK (ORCPT + 62 others); Thu, 27 Apr 2023 05:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243379AbjD0JJy (ORCPT ); Thu, 27 Apr 2023 05:09:54 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CF02120 for ; Thu, 27 Apr 2023 02:09:53 -0700 (PDT) From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682586586; 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=y3VCne1HeKL1oLNsS7YEfA7+Q2fI/jmvUfc0Ixzjb5Y=; b=osBVUTQ+Lh2ruZVGBXgOMI68zegersrZttkVJATnyvg8O4JeYYDEH1EPoRnBtcFh88LvuH +uSogMcVa+ZsfNxhPmV0asNZH5qtLqFp2Pmfkkrhz2URIUmZxYPDWWFbkSBkDwj1LWIkhV OktaylGaphc2vcbLw3T6tjHpLSKbxKQ38DrjxifWdwbn0YgMrwY1DLRiZNOd4TRS8XHMHK Kq2erw8hlEwaWzJxfm6FQaBoYGhk9tvIlrv/xOIL96AAQ7ldUX8EO9MVJuu5ksEduR8GIX r2aboOcXkOjaULMIIYgoEw+EgBTZWJJ45F/13CVk2EnIOu7K8CP9dMXw0vlVEA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682586586; 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=y3VCne1HeKL1oLNsS7YEfA7+Q2fI/jmvUfc0Ixzjb5Y=; b=8nOh3oiHBJ9Uxl+32FlKOM3gSgVhzvgbNdyWshG/t9SZcHj5q5GxRtwmYMM8ZI1AbM5Nzh 9TmrO39kYxzqbdAQ== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v3 12/18] wifi: rtl8xxxu: Add parameter macid to update_rate_mask Date: Thu, 27 Apr 2023 11:09:16 +0200 Message-Id: <20230427090922.165088-13-martin.kaistra@linutronix.de> In-Reply-To: <20230427090922.165088-1-martin.kaistra@linutronix.de> References: <20230427090922.165088-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 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 The HW maintains a rate_mask for each connection, referenced by the macid. Add a parameter to update_rate_mask and add the macid to the h2c call in the gen2 implementation. Also extend refresh_rate_mask to get the macid from sta_info. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 7 ++++--- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 3 ++- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 13 +++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h index 688168e0723c0..1cf2ea4b02655 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h @@ -1916,7 +1916,8 @@ struct rtl8xxxu_fileops { void (*set_tx_power) (struct rtl8xxxu_priv *priv, int channel, bool ht40); void (*update_rate_mask) (struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz); + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, + u8 macid); void (*report_connect) (struct rtl8xxxu_priv *priv, u8 macid, u8 role, bool connect); void (*report_rssi) (struct rtl8xxxu_priv *priv, u8 macid, u8 rssi); @@ -2035,9 +2036,9 @@ void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw); void rtl8xxxu_gen1_usb_quirks(struct rtl8xxxu_priv *priv); void rtl8xxxu_gen2_usb_quirks(struct rtl8xxxu_priv *priv); void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz); + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, u8 macid); void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz); + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, u8 macid); void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, u8 macid, u8 role, bool connect); void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c index 8986783ae8fa7..6d0f975f891b7 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c @@ -1794,7 +1794,8 @@ static void rtl8188e_arfb_refresh(struct rtl8xxxu_ra_info *ra) static void rtl8188e_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz) + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, + u8 macid) { struct rtl8xxxu_ra_info *ra = &priv->ra_info; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 55f935a851c57..bd01a61a83036 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4566,7 +4566,8 @@ static void rtl8xxxu_sw_scan_complete(struct ieee80211_hw *hw, } void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz) + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, + u8 macid) { struct h2c_cmd h2c; @@ -4586,7 +4587,8 @@ void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, } void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi, int txbw_40mhz) + u32 ramask, u8 rateid, int sgi, int txbw_40mhz, + u8 macid) { struct h2c_cmd h2c; u8 bw; @@ -4603,6 +4605,7 @@ void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, h2c.b_macid_cfg.ramask1 = (ramask >> 8) & 0xff; h2c.b_macid_cfg.ramask2 = (ramask >> 16) & 0xff; h2c.b_macid_cfg.ramask3 = (ramask >> 24) & 0xff; + h2c.b_macid_cfg.macid = macid; h2c.b_macid_cfg.data1 = rateid; if (sgi) @@ -4968,7 +4971,8 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, priv->vif = vif; priv->rssi_level = RTL8XXXU_RATR_STA_INIT; - priv->fops->update_rate_mask(priv, ramask, 0, sgi, bw == RATE_INFO_BW_40); + priv->fops->update_rate_mask(priv, ramask, 0, sgi, + bw == RATE_INFO_BW_40, 0); rtl8xxxu_write8(priv, REG_BCN_MAX_ERR, 0xff); @@ -6874,6 +6878,7 @@ static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv, u8 txbw_40mhz; u8 snr, snr_thresh_high, snr_thresh_low; u8 go_up_gap = 5; + u8 macid = rtl8xxxu_get_macid(priv, sta); rssi_level = priv->rssi_level; snr = rtl8xxxu_signal_to_snr(signal); @@ -6993,7 +6998,7 @@ static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv, } priv->rssi_level = rssi_level; - priv->fops->update_rate_mask(priv, rate_bitmap, ratr_idx, sgi, txbw_40mhz); + priv->fops->update_rate_mask(priv, rate_bitmap, ratr_idx, sgi, txbw_40mhz, macid); } } -- 2.30.2