Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4348285rwr; Sun, 30 Apr 2023 05:42:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66Q7VuBNIEZCXW5kEs7Uradv+IPnDMC7rqn5zSNAC5qpA1QWMTHLdlQk70qAr+Y6+WyjmY X-Received: by 2002:a05:6a20:258d:b0:ef:bd:3b with SMTP id k13-20020a056a20258d00b000ef00bd003bmr15117951pzd.55.1682858572225; Sun, 30 Apr 2023 05:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682858572; cv=none; d=google.com; s=arc-20160816; b=svc9Y9fF2NAWl4vSih3nK1QD4fMqQx6+IULRW+3ZKKTNcYITE4RilhjY2syqzglj70 jUB7sXhKicHIE+xkq6RL+iC7NEpSUVNCO0PKaAH2xanhPapLl/T4XjfrKvlIMBHRN35p do31OsYcbx7MCga0IycvQJqVlNayU6zbyRT9IWaCXm5aF0K+J3HyNUZ/Gpyz3IwfCoVk q+b7yHuSiSog3HAH/aRtBC+I47ny8EKo3cEbhYAmeBnP0GU9AsqRJrDIjS7kE6u9Ktft 9o68vK78xoMyVfUq5y4I2Xb3CuNBvG+xx0OlGSEoHOXMAzarOTA9mxROPiZdc9/xLeE1 GW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WPN08GMxG9oyeuGHMn9O683hVvfH1MNboyZa1x+5IE8=; b=MzWsVv1eF3SKeHrcjv0ePOKar0upJI7SPD/INXtwQM+uEN7hs5HB54xybavgCVpzhV ZvBeLQ6+9nNh5OdSCSsqkaJUdqwvdEDRRQAqpqFvsMaKVhKzgQnprW0i7Ia5k9j0e0oa wHo5ppmdLv54PF/DpK+XBITUms6fk6/3Bn+7uP+dNYhLHIrTZIhylqTq+HC0dOtutSe1 4zoDmsdqKu6WKSm6i2t8FqVYaE6Nm45FQGxRUmOMDAhbvjDI0hlwOvzJeF7V0go6jvUQ Y3mn+yzeEtMdSVioRT72VCDXQcf2k4/Od5MEw4TbN8P2q5O/nwmk7oCYKKQr4W9NTm08 BOfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NkqT41M4; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i69-20020a638748000000b005139edd3958si19736912pge.6.2023.04.30.05.42.28; Sun, 30 Apr 2023 05:42:52 -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=@gmail.com header.s=20221208 header.b=NkqT41M4; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbjD3M0Q (ORCPT + 63 others); Sun, 30 Apr 2023 08:26:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjD3M0P (ORCPT ); Sun, 30 Apr 2023 08:26:15 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E24271736 for ; Sun, 30 Apr 2023 05:26:10 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f315735514so106404735e9.1 for ; Sun, 30 Apr 2023 05:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682857569; x=1685449569; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WPN08GMxG9oyeuGHMn9O683hVvfH1MNboyZa1x+5IE8=; b=NkqT41M461hfje7P/Fi3FCNiAJXhCMIMxCvtD/0L0xGkCNIZ5IdZlNTRuhtXMRzqZ0 DFG+MrRANszjvXo8lZx09L/V1Hk5I7B9/TBpR6Mcwy8cpC3YJJRG1UoFb7IPHZ/6sLrs TvxBytYnXx2jHkb4vWQogxeWK3SnKTtOoG/MQ7Vjiv9UhMP4+gzLB8ty1gbC9LPBhi9F xQbhxwMJjS/FvkQ6cJkh3NUa+35ysdwpSvoRjrC/Y3+C0PDzCedRbTkBvgWg05ngEQIW fgppNSvoTtM1Ppe3Txcdgykk5foaJm77fzaUhcnQ3wDHinidCuhrD+1qVHhUxvACYJBB ziPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682857569; x=1685449569; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WPN08GMxG9oyeuGHMn9O683hVvfH1MNboyZa1x+5IE8=; b=eSN6r8jSxM/puqMN75GxK+ymd6oK7POnyeWMxV4QArnGGMC8YuQWWB2RUCmvB4Z7GN 5xN+caR+MMHaReAs9U2HQATWcyPesB2v5eCoGk3GvVxBvSDV5j1bPsT2MxISjGfuUVzK U2uUilh0iXJOTDTqB8vzWi+j8yzb2NUDQzxPApqbmgJPyOzstb4yjvlp6q9Fj6n7OTjt aUsui00nbEbSKREE3In1z7hOUkGCd/Gg9vWkmBdi/N4HcyJicstUdGDC9aZyLn2ZrOA7 hZwORwZbrM5k5E2dT/WjUxeDOmbNxw7s8yof7Y9Fa9xB6SvxPRykkRArdXQUmYzdVo31 VBuA== X-Gm-Message-State: AC+VfDx/4wVqlTvSS5LxY/qGAHHtPzLp9dEaIiraAJ3ooOumCbBG9ZX2 ORc9/eix1IfwYrwu1QUz91g= X-Received: by 2002:a5d:66d2:0:b0:2ef:eb45:2317 with SMTP id k18-20020a5d66d2000000b002efeb452317mr10805548wrw.9.1682857569167; Sun, 30 Apr 2023 05:26:09 -0700 (PDT) Received: from [192.168.1.50] ([81.196.40.55]) by smtp.gmail.com with ESMTPSA id s4-20020adfeb04000000b003047f7a7ad1sm16468848wrn.71.2023.04.30.05.26.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Apr 2023 05:26:08 -0700 (PDT) Message-ID: Date: Sun, 30 Apr 2023 15:26:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] wifi: rtl8xxxu: Support new chip RTL8192FU To: Ping-Ke Shih , "linux-wireless@vger.kernel.org" Cc: Jes Sorensen References: <90102fa5-5065-9598-d21f-3624629a0cb5@gmail.com> <867b2c35f606434bb82ecc17d0fd9336@realtek.com> Content-Language: en-US From: Bitterblue Smith In-Reply-To: <867b2c35f606434bb82ecc17d0fd9336@realtek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 On 28/04/2023 09:21, Ping-Ke Shih wrote: > > >> -----Original Message----- >> From: Bitterblue Smith >> Sent: Wednesday, April 26, 2023 1:28 AM >> To: linux-wireless@vger.kernel.org >> Cc: Jes Sorensen ; Ping-Ke Shih >> Subject: [PATCH] wifi: rtl8xxxu: Support new chip RTL8192FU >> >> This is a newer chip, similar to the RTL8710BU in that it uses the same >> PHY status structs. >> >> Features: 2.4 GHz, b/g/n mode, 2T2R, 300 Mbps. >> >> It can allegedly have Bluetooth, but that's not implemented here. >> >> This chip can have many RFE (RF front end) types, of which type 5 is >> the only one tested. Many of the other types need different >> initialisation tables. They can be added if someone wants them. >> >> The vendor driver v5.8.6.2_35538.20191028_COEX20190910-0d02 from >> https://github.com/BrightX/rtl8192fu was used as reference. >> >> Signed-off-by: Bitterblue Smith >> --- >> drivers/net/wireless/realtek/rtl8xxxu/Kconfig | 3 +- >> .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 47 + >> .../realtek/rtl8xxxu/rtl8xxxu_8188f.c | 3 +- >> .../realtek/rtl8xxxu/rtl8xxxu_8192f.c | 2081 +++++++++++++++++ >> .../realtek/rtl8xxxu/rtl8xxxu_8710b.c | 1 + >> .../realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 + >> .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 104 +- >> .../wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 15 + >> 8 files changed, 2225 insertions(+), 30 deletions(-) >> create mode 100644 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c >> > > [...] > >> +static void rtl8192fu_config_kfree(struct rtl8xxxu_priv *priv, u8 channel) >> +{ >> + u8 bb_gain[3] = { EFUSE_UNDEFINED, EFUSE_UNDEFINED, EFUSE_UNDEFINED }; >> + u8 bb_gain_path_mask[2] = { 0x0f, 0xf0 }; >> + enum rtl8xxxu_rfpath rfpath; >> + u8 bb_gain_for_path; >> + u8 channel_idx; >> + >> + if (channel >= 1 && channel <= 3) >> + channel_idx = 0; >> + if (channel >= 4 && channel <= 9) >> + channel_idx = 1; >> + if (channel >= 10 && channel <= 14) >> + channel_idx = 2; >> + >> + rtl8xxxu_read_efuse8(priv, 0x1ee, &bb_gain[1]); >> + rtl8xxxu_read_efuse8(priv, 0x1ec, &bb_gain[0]); >> + rtl8xxxu_read_efuse8(priv, 0x1ea, &bb_gain[2]); > > Can you define these fields in struct rtl8192fu_efuse, and access via > the struct? > > >> + >> + if (bb_gain[1] == EFUSE_UNDEFINED) >> + return; >> + >> + if (bb_gain[0] == EFUSE_UNDEFINED) >> + bb_gain[0] = bb_gain[1]; >> + >> + if (bb_gain[2] == EFUSE_UNDEFINED) >> + bb_gain[2] = bb_gain[1]; >> + >> + for (rfpath = RF_A; rfpath < priv->rf_paths; rfpath++) { >> + /* power_trim based on 55[19:14] */ >> + rtl8xxxu_write_rfreg_mask(priv, rfpath, RF6052_REG_UNKNOWN_55, >> + BIT(5), 1); >> + >> + /* enable 55[14] for 0.5db step */ >> + rtl8xxxu_write_rfreg_mask(priv, rfpath, 0xf5, BIT(18), 1); > > #define RF6052_REG_GAIN_CTRL 0x55 > Just to be sure, this is the name for 0x55 or 0xf5 ?