Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp2643371rbd; Tue, 9 Apr 2024 12:48:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOG54gBjZlA9hA8NBmwS/jcwvu8rRhmJVsq7zTYvRNbcl2MpeBQMkI6F/qhMfXH2UK4zoLY2sMPJjJJozA7tDCF+ffhPSj5tYMdRH07A== X-Google-Smtp-Source: AGHT+IHY2CY29HggJ3HKPvaT7eASpDvIjLqg4Er2ZoXGNJosSXkrF0KztNUQmacXR8WwTD2/5ukJ X-Received: by 2002:a05:6a00:181b:b0:6ea:950f:7d29 with SMTP id y27-20020a056a00181b00b006ea950f7d29mr638194pfa.20.1712692117284; Tue, 09 Apr 2024 12:48:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712692117; cv=pass; d=google.com; s=arc-20160816; b=v6RGN1s/47uuq6IjZAm7KKEAEvf7FDEIAd03ytEjGXT18ZCwA5OC1mZxwK9Lcb5zVc S5fyp7v7wHL+/cvr85Fm8B0Nod8DgktWmzyoePeVO+jaMzlBgPXTK+DiCtr/+KW3zmfI 3cQNttrneF1ckj1XgpaC/TmAUvT1rqSSV8lAOyeC3swKnnGs0BhtlY58j/A0VKM+/me9 B+jAQTsgaaCk2WWmlemTE5Nbel9TV0peA09Yq64uOcwZ3Nl6/BkovEs7EYhTTHqjL9pE YGRhv0spHMtRrE5CCg9nL7xuUefMbzHxsDiuYFl8a1MvEbqaAwyC1EhG90V/8m0/AKvP pXig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ZYg/gvZwcx3MAcXs0h3Q9eqiJ0H12k2ZcTxoXisnt/I=; fh=GVnelbfE/v+aJ1A3hiU26TlnzEfbdVxjje3TgjMIPHs=; b=XPlYCZo4g+W+UtwY3o6fOzAhzIuzI1a7ykBlcOklO1pR27m1G5N4uL67snd/IRzANf caMHYIJXb9I8UGUBda6aflE3FKY/0pzpkF/sHnzpj597pGzrrrcxqVFBxqoZnSGMg7qo wKFNC+53T9w2QNOj+gm8qocmHJ91x+pchi6GL3EiKmnIQoCg4iE0XuljcDDdXF8Usc1A vog00nsXRIfYr1Iozy9xPbpKZibxOOhI3WWgzRQQKDksJkDHrIJNeyDxvN4jalhQnh4x WPJJRymxVElT5x01+U5Nyl2+HOMJnyBmtJB4/n4ri4xyOwCMLehj5ZsN5VFa7xF8njqi SbvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ML5pzFHz; 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-6039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y3-20020a62f243000000b006ed5f889124si3244808pfl.133.2024.04.09.12.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 12:48:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ML5pzFHz; 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-6039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6039-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 32158B21E0E for ; Tue, 9 Apr 2024 19:46:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49000157A44; Tue, 9 Apr 2024 19:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ML5pzFHz" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 89A231E89E for ; Tue, 9 Apr 2024 19:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712692006; cv=none; b=LOGeJjNM9jaqViHuX9NPM/GD9rJ3TOavPsEAGSHjcNHqDPyPV3AcwkJYxB1xcAqCcNzWnJG7lth1S0xbMKiL+qeSXaWMtcSZM1jdC/kCZZn6TBfhTOcE48yB2Cjr4SMrPIYkqwZM+8G06flVVbYniOx8+IR3eolWMtkocIKwUZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712692006; c=relaxed/simple; bh=CBOhLK/uao1vokigYOTH9RJEgSWlg5ABsNtjSutPt1A=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=tf11qukClUaVKmCKyvKHPdbwKprtQAmJ6oIILvs2vtbNDLFpM0g9TKf2D9gPUqhGnhqm7m35PFu6wsRsvcmEFFNZ4IGiARqMtsKm9FkZN2MSITZaneVByXT8rVOhGK8uHZ3Kf4E8yTyUeeBnn80MevfWKq/Kr+SbeMNPmTCeEBY= 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=ML5pzFHz; arc=none smtp.client-ip=209.85.218.52 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-ej1-f52.google.com with SMTP id a640c23a62f3a-a46a7208eedso872652366b.0 for ; Tue, 09 Apr 2024 12:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712692003; x=1713296803; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=ZYg/gvZwcx3MAcXs0h3Q9eqiJ0H12k2ZcTxoXisnt/I=; b=ML5pzFHzl0kiBsk7uC4xPvbmClt6Vm0MTxCi086Z6XEdLF+eeF2Yd7dGXpEGZTqZHU +gzgbpbi4goVCzW3Zg/zOXqK9RzFr971QyRGq4V7MjuWdqjplZvxxUGtbF5AjZ6VHb7Z c4SUp8EDekxE4nkTNS16Mn1wDyle9a1DiqWfaIERpR0JGiDxz6wFvsBlt7pnsJzJYzE7 JJeoZRxTSXUBkQT1XPrL4iFXZ6TVUSSh3lYLnKUwiSI06ml9WBl+lzQsxVxfRvH/AKuo rkDz6C0cDICxmlxFrFH6Uc/A9Tq3bsbdfa80hK2E8J4HLCbDRHH0U9FuZxLvB0Bt0Zgn WGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712692003; x=1713296803; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZYg/gvZwcx3MAcXs0h3Q9eqiJ0H12k2ZcTxoXisnt/I=; b=EM928tiF5ZvvTZGZQJnE1KKWlE/AHxxt0xc3HH9Hcaaug6ilAmFVQfhQDk9uNgeCZu PbviXuaBpqCJZkSKBf5jxuVfqlNPEdrVN+dsoSuICmBkKGh02ux8c7GnCeedaAb6QTZq LeCuDfwucErnpV19U59p8tT1v1mr9xHEI3SUi2lpsn7hlVCg3HmTxjX91eCZIQZzJhW6 Yq3oqvSOXFkks+eDFpJ2ZLcUvEZlLkzlBu6hmtHM5DEbkP2rSHl8ge1eh3YRhvgq/L+G Mo8TjEJZWxGoLO7YKgNud7xX9CMO7UmOn0B3zxSKMXRRHXFQiR/0N65GTu6d8biP2+lb qoSA== X-Gm-Message-State: AOJu0YwXFa5OavlwJ1OAt2dJ+aXA12CQgxzdLUBSOa4JZRKNdzsHXnAO dHkzI2jHEwiMZSzXliPBplcyJkcU4GqvQYpTdm3fxGL3inK6RZ4KAFEglqBDAR0= X-Received: by 2002:a17:906:e09a:b0:a51:d1f6:393b with SMTP id gh26-20020a170906e09a00b00a51d1f6393bmr242088ejb.40.1712692002634; Tue, 09 Apr 2024 12:46:42 -0700 (PDT) Received: from [192.168.1.50] ([79.113.154.240]) by smtp.gmail.com with ESMTPSA id xi1-20020a170906dac100b00a51d3785c7bsm3140884ejb.196.2024.04.09.12.46.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Apr 2024 12:46:42 -0700 (PDT) Message-ID: <4bc08a14-4b6f-463f-a913-ad7f11b89d4f@gmail.com> Date: Tue, 9 Apr 2024 22:46:40 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 01/14] wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih , Larry Finger , Stefan Lippers-Hollmann , Christian Hewitt References: <91d932b3-5c72-4416-920e-f2bf4fc9b039@gmail.com> Content-Language: en-US In-Reply-To: <91d932b3-5c72-4416-920e-f2bf4fc9b039@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Different channels have different TX power settings. rtl8192de is using the TX power setting from the wrong channel in the 5 GHz band because _rtl92c_phy_get_rightchnlplace expects an array which includes all the channel numbers, but it's using an array which includes only the 5 GHz channel numbers. Use the array channel_all (defined in rtl8192de/phy.c) instead of the incorrect channel5g (defined in core.c). Tested only with rtl8192du, which will use the same TX power code. Cc: stable@vger.kernel.org Signed-off-by: Bitterblue Smith --- v4: - CC stable. v3: - No change. v2: - No change from v1, which was originally sent separately: https://lore.kernel.org/linux-wireless/9995b805-ef8b-47c9-b176-ff540066039a@gmail.com/ --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c index d835a27429f0..56b5cd032a9a 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c @@ -892,8 +892,8 @@ static u8 _rtl92c_phy_get_rightchnlplace(u8 chnl) u8 place = chnl; if (chnl > 14) { - for (place = 14; place < ARRAY_SIZE(channel5g); place++) { - if (channel5g[place] == chnl) { + for (place = 14; place < ARRAY_SIZE(channel_all); place++) { + if (channel_all[place] == chnl) { place++; break; } -- 2.44.0