public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: gregkh@linuxfoundation.org
Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 19/21] staging: rtl8723bs: use MAX_RF_PATH_NUM as ceiling to rf path index
Date: Sat,  7 Aug 2021 11:48:11 +0200	[thread overview]
Message-ID: <88da23cef57131b39a63b2757b91f959553dd65d.1628329348.git.fabioaiuto83@gmail.com> (raw)
In-Reply-To: <cover.1628329348.git.fabioaiuto83@gmail.com>

use MAX_RF_PATH_NUM as ceiling to rf path index.
Only 2 rf paths are used, not 4. Remove also
TX_POWER_BY_RATE_NUM_RF left unused.

Use RF_PATH_A as loop starting point instead of
hardcoded 0, as in other places.

Related comments modified accordingly.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c |  2 +-
 drivers/staging/rtl8723bs/include/hal_data.h   | 12 +++++-------
 drivers/staging/rtl8723bs/include/hal_pg.h     |  8 +++-----
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 272a9ec7a2d3..14f34e38a327 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -347,7 +347,7 @@ void PHY_InitTxPowerByRate(struct adapter *padapter)
 	struct hal_com_data	*pHalData = GET_HAL_DATA(padapter);
 	u8 rfPath, rate;
 
-	for (rfPath = 0; rfPath < TX_PWR_BY_RATE_NUM_RF; ++rfPath)
+	for (rfPath = RF_PATH_A; rfPath < MAX_RF_PATH_NUM; ++rfPath)
 		for (rate = 0; rate < TX_PWR_BY_RATE_NUM_RATE; ++rate)
 			pHalData->TxPwrByRateOffset[rfPath][rate] = 0;
 }
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index 7bbf81ce3045..db9d7587c20e 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -234,14 +234,12 @@ struct hal_com_data {
 	u8 TxPwrInPercentage;
 
 	u8 TxPwrCalibrateRate;
-	/*  TX power by rate table at most 4RF path. */
-	/*  The register is */
-	/*  VHT TX power by rate off setArray = */
-	/*  RF: at most 4*4 = ABCD = 0/1/2/3 */
-	/*  CCK = 0 OFDM = 1/2 HT-MCS 0-15 =3/4/56 VHT =7/8/9/10/11 */
+	/*  TX power by rate table */
+	/*  RF: at most 2 = AB = 0/1 */
+	/*  CCK = 0 OFDM = 1 HT-MCS 0-7 = 2 */
 	u8 TxPwrByRateTable;
 	u8 TxPwrByRateBand;
-	s8 TxPwrByRateOffset[TX_PWR_BY_RATE_NUM_RF][TX_PWR_BY_RATE_NUM_RATE];
+	s8 TxPwrByRateOffset[MAX_RF_PATH_NUM][TX_PWR_BY_RATE_NUM_RATE];
 	/*  */
 
 	/* 2 Power Limit Table */
@@ -259,7 +257,7 @@ struct hal_com_data {
 						[MAX_RF_PATH_NUM];
 
 	/*  Store the original power by rate value of the base of each rate section of rf path A & B */
-	u8 TxPwrByRateBase2_4G[TX_PWR_BY_RATE_NUM_RF][MAX_BASE_NUM_IN_PHY_REG_PG_2_4G];
+	u8 TxPwrByRateBase2_4G[MAX_RF_PATH_NUM][MAX_BASE_NUM_IN_PHY_REG_PG_2_4G];
 
 	/*  For power group */
 	u8 PwrGroupHT20[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
diff --git a/drivers/staging/rtl8723bs/include/hal_pg.h b/drivers/staging/rtl8723bs/include/hal_pg.h
index 2d8ccc9ddebb..7cb9c441fc01 100644
--- a/drivers/staging/rtl8723bs/include/hal_pg.h
+++ b/drivers/staging/rtl8723bs/include/hal_pg.h
@@ -14,11 +14,9 @@
  */
 #define MAX_TX_COUNT				4
 
-/*  For VHT series TX power by rate table. */
-/*  VHT TX power by rate off setArray = */
-/*  RF: at most 4*4 = ABCD = 0/1/2/3 */
-/*  CCK = 0 OFDM = 1/2 HT-MCS 0-15 =3/4/56 VHT =7/8/9/10/11 */
-#define TX_PWR_BY_RATE_NUM_RF			4
+/*  TX power by rate table. */
+/*  RF: = AB = 0/1 */
+/*  CCK = 0 OFDM = 1 HT-MCS 0-7 = 2 */
 #define TX_PWR_BY_RATE_NUM_RATE			84
 #define MAX_RF_PATH_NUM				2
 #define	MAX_CHNL_GROUP_24G			6
-- 
2.20.1


  parent reply	other threads:[~2021-08-07  9:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07  9:47 [PATCH 00/21] staging: rtl8723b: remove some code related to other chips Fabio Aiuto
2021-08-07  9:47 ` [PATCH 01/21] staging: rtl8723bs: remove code related to unsupported MCS index values Fabio Aiuto
2021-08-07  9:47 ` [PATCH 02/21] staging: rtl8723bs: remove unneeded loop Fabio Aiuto
2021-08-07  9:47 ` [PATCH 03/21] staging: rtl8723bs: do some code cleaning in modified function Fabio Aiuto
2021-08-07  9:47 ` [PATCH 04/21] staging: rtl8723bs: move function to file hal/odm_HWConfig.c Fabio Aiuto
2021-08-07  9:47 ` [PATCH 05/21] staging: rtl8723bs: remove empty files Fabio Aiuto
2021-08-07  9:47 ` [PATCH 06/21] staging: rtl8723bs: remove wrapping static function Fabio Aiuto
2021-08-07  9:47 ` [PATCH 07/21] staging: rtl8723bs: beautify function ODM_PhyStatusQuery() Fabio Aiuto
2021-08-07  9:48 ` [PATCH 08/21] staging: rtl8723bs: fix right side of condition Fabio Aiuto
2021-08-07  9:48 ` [PATCH 09/21] staging: rtl8723bs: clean driver from unused RF paths Fabio Aiuto
2021-08-07  9:48 ` [PATCH 10/21] staging: rtl8723bs: remove unused macros Fabio Aiuto
2021-08-07  9:48 ` [PATCH 11/21] staging: rtl8723bs: remove unused struct member Fabio Aiuto
2021-08-07  9:48 ` [PATCH 12/21] staging: rtl8723bs: remove rf type branching (first patch) Fabio Aiuto
2021-08-07  9:48 ` [PATCH 13/21] staging: rtl8723bs: remove rf type branching (second patch) Fabio Aiuto
2021-08-07  9:48 ` [PATCH 14/21] staging: rtl8723bs: remove rf type branching (third patch) Fabio Aiuto
2021-08-07  9:48 ` [PATCH 15/21] staging: rtl8723bs: remove rf type branching (fourth patch) Fabio Aiuto
2021-08-07  9:48 ` [PATCH 16/21] staging: rtl8723bs: remove unused rtw_rf_config module param Fabio Aiuto
2021-08-07  9:48 ` [PATCH 17/21] staging: rtl8723bs: remove unused macro in include/hal_data.h Fabio Aiuto
2021-08-07  9:48 ` [PATCH 18/21] staging: rtl8723bs: remove RF_*TX enum Fabio Aiuto
2021-08-07  9:48 ` Fabio Aiuto [this message]
2021-08-07  9:48 ` [PATCH 20/21] staging: rtl8723bs: fix tx power tables size Fabio Aiuto
2021-08-07  9:48 ` [PATCH 21/21] staging: rtl8723bs: remove unused RF_*T*R enum Fabio Aiuto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88da23cef57131b39a63b2757b91f959553dd65d.1628329348.git.fabioaiuto83@gmail.com \
    --to=fabioaiuto83@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox