Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723bs: use MAX_RF_PATH_NUM as ceiling to rf path index

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>
Link: https://lore.kernel.org/r/88da23cef57131b39a63b2757b91f959553dd65d.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fabio Aiuto and committed by
Greg Kroah-Hartman
c4c7c718 da4c99c2

+9 -13
+1 -1
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
··· 347 347 struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 348 348 u8 rfPath, rate; 349 349 350 - for (rfPath = 0; rfPath < TX_PWR_BY_RATE_NUM_RF; ++rfPath) 350 + for (rfPath = RF_PATH_A; rfPath < MAX_RF_PATH_NUM; ++rfPath) 351 351 for (rate = 0; rate < TX_PWR_BY_RATE_NUM_RATE; ++rate) 352 352 pHalData->TxPwrByRateOffset[rfPath][rate] = 0; 353 353 }
+5 -7
drivers/staging/rtl8723bs/include/hal_data.h
··· 234 234 u8 TxPwrInPercentage; 235 235 236 236 u8 TxPwrCalibrateRate; 237 - /* TX power by rate table at most 4RF path. */ 238 - /* The register is */ 239 - /* VHT TX power by rate off setArray = */ 240 - /* RF: at most 4*4 = ABCD = 0/1/2/3 */ 241 - /* CCK = 0 OFDM = 1/2 HT-MCS 0-15 =3/4/56 VHT =7/8/9/10/11 */ 237 + /* TX power by rate table */ 238 + /* RF: at most 2 = AB = 0/1 */ 239 + /* CCK = 0 OFDM = 1 HT-MCS 0-7 = 2 */ 242 240 u8 TxPwrByRateTable; 243 241 u8 TxPwrByRateBand; 244 - s8 TxPwrByRateOffset[TX_PWR_BY_RATE_NUM_RF][TX_PWR_BY_RATE_NUM_RATE]; 242 + s8 TxPwrByRateOffset[MAX_RF_PATH_NUM][TX_PWR_BY_RATE_NUM_RATE]; 245 243 /* */ 246 244 247 245 /* 2 Power Limit Table */ ··· 257 259 [MAX_RF_PATH_NUM]; 258 260 259 261 /* Store the original power by rate value of the base of each rate section of rf path A & B */ 260 - u8 TxPwrByRateBase2_4G[TX_PWR_BY_RATE_NUM_RF][MAX_BASE_NUM_IN_PHY_REG_PG_2_4G]; 262 + u8 TxPwrByRateBase2_4G[MAX_RF_PATH_NUM][MAX_BASE_NUM_IN_PHY_REG_PG_2_4G]; 261 263 262 264 /* For power group */ 263 265 u8 PwrGroupHT20[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
+3 -5
drivers/staging/rtl8723bs/include/hal_pg.h
··· 14 14 */ 15 15 #define MAX_TX_COUNT 4 16 16 17 - /* For VHT series TX power by rate table. */ 18 - /* VHT TX power by rate off setArray = */ 19 - /* RF: at most 4*4 = ABCD = 0/1/2/3 */ 20 - /* CCK = 0 OFDM = 1/2 HT-MCS 0-15 =3/4/56 VHT =7/8/9/10/11 */ 21 - #define TX_PWR_BY_RATE_NUM_RF 4 17 + /* TX power by rate table. */ 18 + /* RF: = AB = 0/1 */ 19 + /* CCK = 0 OFDM = 1 HT-MCS 0-7 = 2 */ 22 20 #define TX_PWR_BY_RATE_NUM_RATE 84 23 21 #define MAX_RF_PATH_NUM 2 24 22 #define MAX_CHNL_GROUP_24G 6