Skip to contentSkip to conversation

staging: rtl8192e: remove RF90_PATH_{C,D}

PATCH In review Michael Straube 2 participants 7 messages Aug 31, 2024 – Sep 2, 2024 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: rtl8192e: remove RF90_PATH_{C,D}

This series removes the unsed RF90_PATH_C and RF90_PATH_D from the enum rf90_radio_path and adjusts the size of arrays that are indexed by values from rf90_radio_path.

Compile-tested only.

Michael Straube (5):
staging: rtl8192e: remove RF90_PATH_{C,D} from enum rf90_radio_path
staging: rtl8192e: adjust size of rx_pwr for new RF90_PATH_MAX
staging: rtl8192e: adjust size of trsw_gain_X for new RF90_PATH_MAX
staging: rtl8192e: adjust size of brfpath_rxenable for new

    RF90_PATH_MAX

staging: rtl8192e: adjust size of RxMIMOSignalStrength

 drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 3 ++-
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +-
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h   | 2 +-
 drivers/staging/rtl8192e/rtllib.h              | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)
Signature · 1 line
2.46.0
#1 lore raw

PATCH 1/5 staging: rtl8192e: remove RF90_PATH_{C,D} from enum rf90_radio_path

RF90_PATH_C and RF90_PATH_D are unused in this driver. Remove them from enum rf90_radio_path.

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h +0 -2
index ff4b4004b0d0..c928bc2b218b 100644
@@ -20,8 +20,6 @@ enum hw90_block {
 enum rf90_radio_path {
 	RF90_PATH_A = 0,
 	RF90_PATH_B = 1,
-	RF90_PATH_C = 2,
-	RF90_PATH_D = 3,
 	RF90_PATH_MAX
 };
 
Signature · 1 line
2.46.0
#2 lore raw

PATCH 2/5 staging: rtl8192e: adjust size of rx_pwr for new RF90_PATH_MAX

In reply to Michael Straube

The local array rx_pwr in the function _rtl92e_query_rxphystatus() is always accessed by indices in the range i = 0; i < RF90_PATH_MAX. A previous patch changed the value of RF90_PATH_MAX from 4 to 2, so we can reduce the size of rx_pwr to 2. Use RF90_PATH_MAX instead of a hard-coded size.

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -1
index 519cad9e1106..5646bd498871 100644
@@ -1159,7 +1159,7 @@ static void _rtl92e_query_rxphystatus(struct r8192_priv *priv,
 	struct phy_sts_cck_819xpci *pcck_buf;
 	u8 *prxpkt;
 	u8 i, max_spatial_stream, tmp_rxevm;
-	s8 rx_pwr[4], rx_pwr_all = 0;
+	s8 rx_pwr[RF90_PATH_MAX], rx_pwr_all = 0;
 	s8 rx_evmX;
 	u8 evm, pwdb_all;
 	u32 RSSI, total_rssi = 0;
Signature · 1 line
2.46.0
#3 lore raw

PATCH 3/5 staging: rtl8192e: adjust size of trsw_gain_X for new RF90_PATH_MAX

In reply to Michael Straube

The array trsw_gain_X in struct phy_sts_ofdm_819xpci is always accessed by indices in the range i = 0; i < RF90_PATH_MAX. A previous patch changed the value of RF90_PATH_MAX from 4 to 2, so we can reduce the size of trsw_gain_X to 2. Use RF90_PATH_MAX instead of a hard-coded size.

---
 drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h +2 -1
index d87bace0a19b..de0cd40df25f 100644
@@ -8,6 +8,7 @@
 #define R8190P_DEF_H
 
 #include <linux/types.h>
+#include "r8192E_phy.h"
 
 #define		MAX_SILENT_RESET_RX_SLOT_NUM	10
 
@@ -137,7 +138,7 @@ struct tx_fwinfo_8190pci {
 };
 
 struct phy_sts_ofdm_819xpci {
-	u8	trsw_gain_X[4];
+	u8	trsw_gain_X[RF90_PATH_MAX];
 	u8	pwdb_all;
 	u8	cfosho_X[4];
 	u8	cfotail_X[4];
Signature · 1 line
2.46.0
#4 lore raw

PATCH 4/5 staging: rtl8192e: adjust size of brfpath_rxenable for new RF90_PATH_MAX

In reply to Michael Straube

The array brfpath_rxenable in struct r8192_priv is always accessed by indices in the range i = 0; i < RF90_PATH_MAX. A previous patch changed the value of RF90_PATH_MAX from 4 to 2, so we can reduce the size of brfpath_rxenable to 2. Use RF90_PATH_MAX instead of a hard-coded size.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +1 -1
index 1d6d31292f41..8297d7e59415 100644
@@ -300,7 +300,7 @@ struct r8192_priv {
 
 	u32 rf_reg_0value[4];
 	u8 num_total_rf_path;
-	bool brfpath_rxenable[4];
+	bool brfpath_rxenable[RF90_PATH_MAX];
 
 	bool tx_pwr_data_read_from_eeprom;
 
Signature · 1 line
2.46.0
#5 lore raw

PATCH 5/5 staging: rtl8192e: adjust size of RxMIMOSignalStrength

In reply to Michael Straube

The array RxMIMOSignalStrength in struct rtllib_rx_stats is always accessed with indices in the range i = 0; i < 2. We can reduce the size from 4 to 2.

---
 drivers/staging/rtl8192e/rtllib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib.h +1 -1
index 7a1a68317a49..0eb987e999c5 100644
@@ -480,7 +480,7 @@ struct rtllib_rx_stats {
 	bool  bFirstMPDU;
 	bool  contain_htc;
 	u32   RxPWDBAll;
-	u8    RxMIMOSignalStrength[4];
+	u8    RxMIMOSignalStrength[2];
 	s8    RxMIMOSignalQuality[2];
 	bool  bPacketMatchBSSID;
 	bool  bIsCCK;
Signature · 1 line
2.46.0
Tested-by on the v1 series
#6 lore raw
In reply to Michael Straube
Quoted 12 lines · Michael Straube

This series removes the unsed RF90_PATH_C and RF90_PATH_D from the enum rf90_radio_path and adjusts the size of arrays that are indexed by values from rf90_radio_path.

Compile-tested only.

Michael Straube (5):
staging: rtl8192e: remove RF90_PATH_{C,D} from enum rf90_radio_path
staging: rtl8192e: adjust size of rx_pwr for new RF90_PATH_MAX
staging: rtl8192e: adjust size of trsw_gain_X for new RF90_PATH_MAX
staging: rtl8192e: adjust size of brfpath_rxenable for new

     RF90_PATH_MAX
Quoted 9 lines

staging: rtl8192e: adjust size of RxMIMOSignalStrength

  drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 3 ++-
  drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +-
  drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
  drivers/staging/rtl8192e/rtl8192e/rtl_core.h   | 2 +-
  drivers/staging/rtl8192e/rtllib.h              | 2 +-
  5 files changed, 5 insertions(+), 6 deletions(-)