Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3084783rdb; Tue, 13 Feb 2024 06:33:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/zeYkrPZjlybgPQJep0W9Nqw69q8qWMEhbFpxkXDhTDXnUoeZvVAOJNSRbY62HlQDFPKUNnyQ+ml2KZeJLaZMPKnOl//zVeX/eG7MkQ== X-Google-Smtp-Source: AGHT+IEiLNFmKdxYaNuOFzUXG0w5BTpRL+f83u4XxP4r2DnA8MVUajRPn22lIJz1U7upvyowbFR2 X-Received: by 2002:a05:6402:14c1:b0:561:1255:6237 with SMTP id f1-20020a05640214c100b0056112556237mr7224838edx.30.1707834790980; Tue, 13 Feb 2024 06:33:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707834790; cv=pass; d=google.com; s=arc-20160816; b=ifbH1ohbP/MRbRf7fJ2uSVT170qdNHQfChVve3DUFPkpDxd4YG8gVTg8mL14s+D5WX NXw778IW4jVMxViLX5s26AjdN3AGAz+l1D8N5BLcTkQ1e8XkvlueA5lTPQ+Lpj5D2YWA eiPguPLa1qYovdPXHqZ3bW1AeF4cvtej4DJfaMSzr54alsIfubhR/8fv1vd+AomVuNfL bf3N2TFJMbqY38a3PZw7AtZw2YyzWQ4DEEyHMRLL7IsQPoQv6JFd4Cgv4lo3Omh5khaS xaYDj0LDH4MiBOB8GzRmiSDr3k3qCQfp2Dsc6/8SyOpO6FzAMTS1rDZQtLJOa5Ggxk/+ S06A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=vWhGIjLRDOkfCrZpzLrIvkBOBQzhv1S2YHh3isTZznc=; fh=Kcat+lETqqT5HhnlGnJDdXf85Aae9wMllxw9bQBFdPI=; b=eBB8nyyApfUPIxZt+CaYsdLuDMDJtFTV5bmDPF1zeCGSCI2fNQVZnJCFdMY5nkb5E2 wAU/h65FKj/Y57cDaj546ZomWZ+mgySDZs6IlH+KO1anloFQu4TiIWgOzW/BoTe0xeTR vwY0zhvMJp3A6xNmltiQANMfubt5u7XhiJsioIVIKRvgez3LAVdbSWHRbJ42uWAj9lT9 9XrKajf1NqIuFu4kzIN2usx0kM/t6+Su1+YUM11OyzktXqyvLtlTVqyWe1CUao50uL59 HAjijO4pR03pgg9fJVIXVHAE5bRyS0N1sIBcbM/e5dWxmYYGiif5UzSFulcW6qG/0I0X YMFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a2vIjfRJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-3548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXy+vdLFHfB+Xukueq2BkX2NeCSXXW6QkmpUj+8uw1CNCeAg67F6mM/PcJh4iDTAgil6ZXkpfKPQOzrbys1NYVJLxpeRDz/6jC6bg3Sgw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bd28-20020a056402207c00b005612b14fd48si3992447edb.313.2024.02.13.06.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a2vIjfRJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-3548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 B67F31F20F40 for ; Tue, 13 Feb 2024 14:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ED561E523; Tue, 13 Feb 2024 14:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a2vIjfRJ" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 DC9441E51E for ; Tue, 13 Feb 2024 14:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834786; cv=none; b=fZPabtxsaIP2hxPavWqPwgPVIWRha0FTgvvvthsEHUIdm9MpWN0PpnRb0z/rnn6KHIOncokwD5JdZsiC4pKJIaaxy7cIQ8bUrzOWv5wKfknX0JTIuieF4bT8e0SqyxIg+DrB6m3ADB2Bcp4xIU1xDc3i1aSgISE4nf9CcV8Upd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834786; c=relaxed/simple; bh=l/LEe8+NTi1Qtmf5+9ALlf3JGrcmLInhdbXN+9cvjrE=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:Content-Type; b=tQSEpLwRyJ3lnBjVpKN1boljgw2gUpNaonPA2Agut0Lwbx0mBtcaKLgX+0R/T1qvv5aL6r0CWD5whTQlOYEtn8/q2nb10JP/CPbNNjLhWfBWqhN1aICxorIZGAy27LZC/TI9MzmJTJR5eWeaXYwJDIfHhvpX5adBDOjDW8jnczM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a2vIjfRJ; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-33b0e5d1e89so2945484f8f.0 for ; Tue, 13 Feb 2024 06:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707834783; x=1708439583; darn=vger.kernel.org; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vWhGIjLRDOkfCrZpzLrIvkBOBQzhv1S2YHh3isTZznc=; b=a2vIjfRJcO8Y+Hh4AF4k904w5Rqlg9YOaGTkYv/pYwnNpCx6oB5NrIczPfliBvVBO5 Ze1PKiN2/hDgJyeIO+1OAl1WR4VL02VKg/SMVYaj5Nvtq222irsIPQ4DQMrDJw5RNplz Ygsi9dRQX2BMl07hjTze9XgYDfdCwn7XbN81BnWNwKGjmrdHOk63y9UokSaXkNHKWeS4 N6Wbg9FaKkZ622mNF3W7o9P7TdrM9So9SM8jXHkBHF8e5LWyDpD5WbltjKPQoG/G3IPA fMhGTJFOUfglxDVf9se6bwFQjwWDQa/V4Q3V88A9TMVonaI8JcfZmietzUV73TLbueNv RrLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707834783; x=1708439583; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=vWhGIjLRDOkfCrZpzLrIvkBOBQzhv1S2YHh3isTZznc=; b=LIu+6cFU+Z8YNIB6ikKcZvfgMUhnQjM2HtKlvGSVSD256uVgtwjInySouJk51IbSkY ot8gBKmGRZOLahG9dWsEVwI8y2hVv7ZjRLdafbmH7RPQW9wogOZ6ghXXhR9l8H508g1J QHN/bLDKLbAD5Py+GqsyNrY0L3E0QPzPASCRiQlUiP57J3ZOXla5opWbgyJvp+/iZzNL 6ucGJUdpBMOHEHEh56PzlyUNV6leZE4pL0YsZBcd3vYlqEAn6aHjJwZ3mw8uOjsZILeG ewVMKrUcABirOTpHr85YQgCTPL0VVdXxP9Y9X/Iw1CIUQ1UsSkGSWxR4WDEOignmHUNi g28g== X-Gm-Message-State: AOJu0Yzm7/yyYa2HBmEzPyYkLKt6RWWUd6ees9wyIudTfB6eVUyoGNav CDYXidQr4mTQ1O96Sx1iU/P9N34dJGTqTOjKqcgviJ4BSjl0b/AI1S4KOUex X-Received: by 2002:adf:e6cc:0:b0:33a:ff0f:2416 with SMTP id y12-20020adfe6cc000000b0033aff0f2416mr6289530wrm.69.1707834783028; Tue, 13 Feb 2024 06:33:03 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXZcepH8FggtVf1zkY2oTYtqTqYqLLW7PGunL9lopij3FGEZu6sbVHU9VjH52pmltQokbH6qU+XmR3DHNC2zWNouH6JshkXEHz+ Received: from [192.168.1.50] ([79.119.240.211]) by smtp.gmail.com with ESMTPSA id z11-20020a5d44cb000000b0033b43a5f53csm9623995wrr.103.2024.02.13.06.33.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 06:33:02 -0800 (PST) Message-ID: Date: Tue, 13 Feb 2024 16:33:02 +0200 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Bitterblue Smith Subject: [PATCH] wifi: rtlwifi: rtl8192cu: Fix 2T2R chip type detection To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih , Larry Finger Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit rtl8192cu handles 1T1R devices (RTL8188CUS), 1T2R devices (RTL8191CU), and 2T2R devices (RTL8192CU). The 2T2R devices were incorrectly detected as 1T2R because of a mistake in the IS_92C_1T2R macro. The visible effect of this is that the firmware was allowed to use TX rates only up to MCS7. Fix the IS_92C_1T2R macro. Now my 2T2R device has much better upload speed. Before: 46 Mbps. After: 82 Mbps. Also fix a debug message which was printing "RF_1T1R" even for 1T2R chips. Signed-off-by: Bitterblue Smith --- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/def.h | 2 +- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/def.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/def.h index 91e4427ab022..4757f93b84e4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/def.h +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/def.h @@ -11,7 +11,7 @@ #define CHIP_VENDOR_UMC_B_CUT BIT(6) #define IS_92C_1T2R(version) \ - (((version) & CHIP_92C) && ((version) & CHIP_92C_1T2R)) + (((version) & CHIP_92C_1T2R) == CHIP_92C_1T2R) #define IS_VENDOR_UMC(version) \ (((version) & CHIP_VENDOR_UMC) ? true : false) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c index 4ff0d4118193..a76f2dc8a977 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c @@ -101,7 +101,8 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw) rtlphy->rf_type = RF_1T1R; rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "Chip RF Type: %s\n", - rtlphy->rf_type == RF_2T2R ? "RF_2T2R" : "RF_1T1R"); + rtlphy->rf_type == RF_2T2R ? "RF_2T2R" : + rtlphy->rf_type == RF_1T2R ? "RF_1T2R" : "RF_1T1R"); if (get_rf_type(rtlphy) == RF_1T1R) rtlpriv->dm.rfpath_rxenable[0] = true; else -- 2.43.0