Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp645167lqt; Fri, 19 Apr 2024 06:35:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVC9NHKsmVb4yEUQscHb7GQ4+q1R6XK1x0yN/lx27992faDWrIjp1ZSMyRH/7ToMCJDXegJFjiJDLZvw8K7ecf5yzXgvU9d1r512x089w== X-Google-Smtp-Source: AGHT+IH0Nc6NQThMMc5472HZemB9AtNsD2hX4gowJRn4SHLEc234oKaoylU6YjnjxCkUiO8QUHbl X-Received: by 2002:a05:6a21:328f:b0:1a7:5203:c002 with SMTP id yt15-20020a056a21328f00b001a75203c002mr2762335pzb.19.1713533736826; Fri, 19 Apr 2024 06:35:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713533736; cv=pass; d=google.com; s=arc-20160816; b=OPWgxIA57Eb8gVhLitob96HLN3BB5RmuYGqRTkJ5Uve982CAOl2G4JfKnEHCULPQaB hmky/vMLVL2OxAYPLMYUtxTcfHsJJ0w4hI8iXjYke++qMMKBJurfrABXygW3WNbKIZho TST7aKKFK0Uv/M+5+lRqZ2A3fBOtVI+dXDadOVauuaUuC2Z0Q1g0e53bzS75gXl18oDa twNgGYQ6uzvNrUpcgTRuJcKGT2buglJKI0Jce5JSWs3b/qsXb3+QejfZdiZ4vlfKV35e 40Zp0ciLqnxfePEY45877kMdRMB20OSK+LoLvFx8j02cnzGRkSVA72MI7HCZbrz/Dnm4 f4+A== 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=gBljUc3bw1ZS7D54uJZ73TdtHGyoEfUNbBgUPCRQMwU=; fh=GVnelbfE/v+aJ1A3hiU26TlnzEfbdVxjje3TgjMIPHs=; b=0jBMe7+VHyVt5M2bqVxh5TjzgWESS/fsxHdkjAD0OBnLq4WclzanXmuRfJCRTVNMBf CHmRJiMhGi/9ZXCMIZubCyga6U8FICvRRQsWNYn+L5UnJgYdFgRMrHbJp0k/3/rhTVwM PGt165sQDsTzUcroa5QRa2dZT0w6dZ2AgBxzz6StlR/sllrpDuR5JYALubfBhDnUxOK9 40ngQQN6oVKQ6de8p0Q/TAY6mayJJE8uJaaew5+IBDsklWqxQVyQQWku97uVOAyH5lcx DoMnxTr6imd2fk7pYGmTI08496ntpqE8MCQPY5s9byXCnSLaKJk59uQRYFc+xnl6Wpaq z6Ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZsEi5DnS; 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-6570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s3-20020a056a00178300b006f01771dab6si3348062pfg.190.2024.04.19.06.35.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 06:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZsEi5DnS; 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-6570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6570-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 318F32828D2 for ; Fri, 19 Apr 2024 13:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47FBD128811; Fri, 19 Apr 2024 13:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZsEi5DnS" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 A32BC12837C for ; Fri, 19 Apr 2024 13:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713533733; cv=none; b=dCAVPfAq14kQ7PlHHO35NZCqwCDftay8HOKV/xs8XVjgKXbPsc3jenTWeqqSfq6rlWu/2SVtHMUqZL4evoGWCtZtepPc4UKDzduQVkH9qDnsGGM4y3dm89Mu0+lweUijEwc75M4fcLz142omVBykElkZvJfBVCzRhvXnRgPWE48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713533733; c=relaxed/simple; bh=6s/Rmiu2USiiXFlqpX9fg8GbZb5efJl6r2wvvHiDilc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=T2MYyC4QQ6vlZSDTSI9HUtIx0/MJL8VlfAfH2xRDe8csO6vHmb8nJEb3iJTxo3M125SEwLdTzRznqp6wPT6UveWUKv55/CVdnj4QzWvV+lfPqaDd1gejyzR7i+47Cj7Aoao+9W9mxF2x+astnCweaEX4tDAXISeNEA60cqytOyc= 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=ZsEi5DnS; arc=none smtp.client-ip=209.85.208.49 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-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-571e1744893so122198a12.1 for ; Fri, 19 Apr 2024 06:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713533730; x=1714138530; 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=gBljUc3bw1ZS7D54uJZ73TdtHGyoEfUNbBgUPCRQMwU=; b=ZsEi5DnSfgh1WNjFXvD0UA9NmlyAjq8dvNbw5LDQLrHuZVtuH7oL5zHCNkNSxRMwZW ZtSf4S5bYXg/dtFOPWhh6C6hr6sAovFQl2HSmEW1TlNr8rBHNwT1fc3y47SFYM9wtHLP uio+iMgoKBtfxkXcwcuLYpCD9qirpk56N3YjgEM7llR35zOucw2z0wJZEMorLxWKN5rb A3A+/YCBNrnvsA1vxiOA55e2wUY9h8O4ecnpILpAWQw5gjDTxUz4tDUo3OCjI86QXQn5 QWl0wd2n7vHAkM6cEqjwOUgznej1NGl/J/6ccCyTDmS7ZcSHARuqIUMtsORYqqXKMuba mm0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713533730; x=1714138530; 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=gBljUc3bw1ZS7D54uJZ73TdtHGyoEfUNbBgUPCRQMwU=; b=WFoEa97Sx1oicqjD0+7UWf7nKNfsvAs8sRwlstL9ZsDF1iKkZJA2TP6K9UKS32kgiQ vH5lWOgp8XZw0wKyNmBzUEo0zUtXAEjZC9f4DcCob8PG3z7MTXTatE123cYqPWA9c7p7 RJYJEaas1XN3Ww9iELoV6tTOdsiA6+pSjvO/h4kf8b6iXizhB/KdcfAoNXX81I4NPASz HosdTcAq+1FgY3khL/4gm3k2r6kZ/+FWn0gHJkX8RIfNtGyu179azuqQur3fcWgK33iV 7ZfCsxlBN1DheTHSFaNMyuSg6XjZP6Ja6gemCkfDgCGx2HVa366NORq0Wr0jHuEFvC1s Nbdw== X-Gm-Message-State: AOJu0YzLRq01Dlw6ll9fpkKcSz5I/WWlclYRYxpC0jc+VNI/f4uYd/H7 5orE9dfzwZfQBOFyVrDnpHTvK5Tb6ovEtDUL5zaQfivfzOgcgs3X17igPmk7 X-Received: by 2002:a50:cdc4:0:b0:56c:24e6:ca7e with SMTP id h4-20020a50cdc4000000b0056c24e6ca7emr1418084edj.2.1713533729672; Fri, 19 Apr 2024 06:35:29 -0700 (PDT) Received: from [192.168.1.50] ([79.113.154.240]) by smtp.gmail.com with ESMTPSA id e19-20020a056402089300b0057016d010f9sm2119828edy.16.2024.04.19.06.35.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Apr 2024 06:35:29 -0700 (PDT) Message-ID: <52548427-02c2-4871-89af-d72b64798b08@gmail.com> Date: Fri, 19 Apr 2024 16:35:28 +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 v6 1/6] 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: <9d54a192-d389-4a56-9286-2e7721cbbc27@gmail.com> Content-Language: en-US In-Reply-To: <9d54a192-d389-4a56-9286-2e7721cbbc27@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 --- v6: - No change. v5: - No change. 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