Skip to contentSkip to conversation

staging: r8192e: Rename macro defined in rtl_dm.h

PATCH In review Dragan Cvetic 2 participants 5 messages Oct 10, 2022 – Oct 11, 2022 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8192e: Rename macro defined in rtl_dm.h

Rename macro definitions to avoid CamelCase which is not accepted by checkpatch.

No test performed on HW, just build.

Dragan Cvetic (3):
staging: rtl8192e: Rename RateAdapt..., RxPath...TH_low, RxPath..._TH
staging: rtl8192e: Rename RateAdap...20M, RateAdap...40M, VeryLowRSSI
staging: rtl8192e: Rename WAIotTHVal, RegC38_TH

 .../staging/rtl8192e/rtl8192e/r8192E_dev.c    | 14 ++++++------
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c    | 22 +++++++++----------
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h    | 16 +++++++-------
 3 files changed, 26 insertions(+), 26 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 staging: rtl8192e: Rename RateAdapt..., RxPath...TH_low, RxPath..._TH

Rename macros: RateAdaptiveTH_High to RATE_ADAPTIVE_TH_HIGH, RxPathSelection_SS_TH_low to RX_PATH_SELECTION_SS_TH_LOW and RxPathSelection_diff_TH to RX_PATH_SELECTION_DIFF_TH to avoid CamelCase which is not accepted by checkpatch.

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 4 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     | 8 ++++----
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h     | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +2 -2
index 18e4e5d84878..3a2e89f6f683 100644
@@ -2109,9 +2109,9 @@ bool rtl92e_is_rx_stuck(struct net_device *dev)
 	u8		SilentResetRxSoltNum = 4;
 
 	rx_chk_cnt++;
-	if (priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5)) {
+	if (priv->undecorated_smoothed_pwdb >= (RATE_ADAPTIVE_TH_HIGH + 5)) {
 		rx_chk_cnt = 0;
-	} else if ((priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High + 5))
+	} else if ((priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH + 5))
 	  && (((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) &&
 	  (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M))
 	  || ((priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) &&
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4 -4
index d7bfaf68291c..fab427e3597e 100644
@@ -284,11 +284,11 @@ void rtl92e_init_adaptive_rate(struct net_device *dev)
 	struct rate_adaptive *pra = &priv->rate_adaptive;
 
 	pra->ratr_state = DM_RATR_STA_MAX;
-	pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High;
+	pra->high2low_rssi_thresh_for_ra = RATE_ADAPTIVE_TH_HIGH;
 	pra->low2high_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M+5;
 	pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5;
 
-	pra->high_rssi_thresh_for_ra = RateAdaptiveTH_High+5;
+	pra->high_rssi_thresh_for_ra = RATE_ADAPTIVE_TH_HIGH + 5;
 	pra->low_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M;
 	pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M;
 
@@ -1734,8 +1734,8 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev)
 	struct r8192_priv *priv = rtllib_priv(dev);
 
 	DM_RxPathSelTable.Enable = 1;
-	DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low;
-	DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;
+	DM_RxPathSelTable.SS_TH_low = RX_PATH_SELECTION_SS_TH_LOW;
+	DM_RxPathSelTable.diff_TH = RX_PATH_SELECTION_DIFF_TH;
 	if (priv->CustomerID == RT_CID_819x_Netcore)
 		DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
 	else
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
index 51e295d389a8..bf96eb25d808 100644
@@ -26,10 +26,10 @@
 #define		DM_DIG_MIN					0x1c
 #define		DM_DIG_MIN_Netcore			0x12
 
-#define		RxPathSelection_SS_TH_low		30
-#define		RxPathSelection_diff_TH			18
+#define		RX_PATH_SELECTION_SS_TH_LOW		30
+#define		RX_PATH_SELECTION_DIFF_TH		18
 
-#define		RateAdaptiveTH_High			50
+#define		RATE_ADAPTIVE_TH_HIGH			50
 #define		RateAdaptiveTH_Low_20M		30
 #define		RateAdaptiveTH_Low_40M		10
 #define		VeryLowRSSI					15
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 staging: rtl8192e: Rename RateAdap...20M, RateAdap...40M, VeryLowRSSI

In reply to Dragan Cvetic

Rename macros: VeryLowRSSI to VERI_LOW_RSSI, RateAdaptiveTH_Low_20M to RATE_ADAPTIVE_TH_LOW_20M and RateAdaptiveTH_Low_40M to RATE_ADAPTIVE_TH_LOW_40M to avoid CamelCase which is not accepted by checkpatch.

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 10 +++++-----
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     |  8 ++++----
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h     |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +5 -5
index 3a2e89f6f683..a0d918899392 100644
@@ -2113,17 +2113,17 @@ bool rtl92e_is_rx_stuck(struct net_device *dev)
 		rx_chk_cnt = 0;
 	} else if ((priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH + 5))
 	  && (((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) &&
-	  (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M))
+	  (priv->undecorated_smoothed_pwdb >= RATE_ADAPTIVE_TH_LOW_40M))
 	  || ((priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) &&
-	  (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M)))) {
+	  (priv->undecorated_smoothed_pwdb >= RATE_ADAPTIVE_TH_LOW_20M)))) {
 		if (rx_chk_cnt < 2)
 			return bStuck;
 		rx_chk_cnt = 0;
 	} else if ((((priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) &&
-		  (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) ||
+		  (priv->undecorated_smoothed_pwdb < RATE_ADAPTIVE_TH_LOW_40M)) ||
 		((priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) &&
-		 (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_20M))) &&
-		priv->undecorated_smoothed_pwdb >= VeryLowRSSI) {
+		 (priv->undecorated_smoothed_pwdb < RATE_ADAPTIVE_TH_LOW_20M))) &&
+		priv->undecorated_smoothed_pwdb >= VERI_LOW_RSSI) {
 		if (rx_chk_cnt < 4)
 			return bStuck;
 		rx_chk_cnt = 0;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4 -4
index fab427e3597e..c7ce1cab619d 100644
@@ -285,12 +285,12 @@ void rtl92e_init_adaptive_rate(struct net_device *dev)
 
 	pra->ratr_state = DM_RATR_STA_MAX;
 	pra->high2low_rssi_thresh_for_ra = RATE_ADAPTIVE_TH_HIGH;
-	pra->low2high_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M+5;
-	pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5;
+	pra->low2high_rssi_thresh_for_ra20M = RATE_ADAPTIVE_TH_LOW_20M + 5;
+	pra->low2high_rssi_thresh_for_ra40M = RATE_ADAPTIVE_TH_LOW_40M + 5;
 
 	pra->high_rssi_thresh_for_ra = RATE_ADAPTIVE_TH_HIGH + 5;
-	pra->low_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M;
-	pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M;
+	pra->low_rssi_thresh_for_ra20M = RATE_ADAPTIVE_TH_LOW_20M;
+	pra->low_rssi_thresh_for_ra40M = RATE_ADAPTIVE_TH_LOW_40M;
 
 	if (priv->CustomerID == RT_CID_819x_Netcore)
 		pra->ping_rssi_enable = 1;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
index bf96eb25d808..a643ff5ad597 100644
@@ -30,9 +30,9 @@
 #define		RX_PATH_SELECTION_DIFF_TH		18
 
 #define		RATE_ADAPTIVE_TH_HIGH			50
-#define		RateAdaptiveTH_Low_20M		30
-#define		RateAdaptiveTH_Low_40M		10
-#define		VeryLowRSSI					15
+#define		RATE_ADAPTIVE_TH_LOW_20M		30
+#define		RATE_ADAPTIVE_TH_LOW_40M		10
+#define		VERI_LOW_RSSI				15
 
 #define		WAIotTHVal						25
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 staging: rtl8192e: Rename WAIotTHVal, RegC38_TH

In reply to Dragan Cvetic

Rename macros: WAIotTHVal to WA_IOT_TH_VAL and RegC38_TH to REG_38_TH to avoid CamelCase which is not accepted by checkpatch.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 +++---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +3 -3
index c7ce1cab619d..f4f7820ad35d 100644
@@ -1651,7 +1651,7 @@ static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev)
 	struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
 
 	pHTInfo->bWAIotBroadcom = false;
-	pHTInfo->WAIotTH = WAIotTHVal;
+	pHTInfo->WAIotTH = WA_IOT_TH_VAL;
 }
 
 static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
@@ -2221,7 +2221,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
 		if (priv->framesyncMonitor) {
 			if (priv->rtllib->state == RTLLIB_LINKED) {
 				if (priv->undecorated_smoothed_pwdb <=
-				    RegC38_TH) {
+				    REG_C38_TH) {
 					if (reg_c38_State !=
 					    RegC38_NonFsync_Other_AP) {
 						rtl92e_writeb(dev,
@@ -2232,7 +2232,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
 						     RegC38_NonFsync_Other_AP;
 					}
 				} else if (priv->undecorated_smoothed_pwdb >=
-					   (RegC38_TH+5)) {
+					   (REG_C38_TH + 5)) {
 					if (reg_c38_State) {
 						rtl92e_writeb(dev,
 							rOFDM0_RxDetector3,
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +2 -2
index a643ff5ad597..9fadb1ea231c 100644
@@ -34,7 +34,7 @@
 #define		RATE_ADAPTIVE_TH_LOW_40M		10
 #define		VERI_LOW_RSSI				15
 
-#define		WAIotTHVal						25
+#define		WA_IOT_TH_VAL				25
 
 #define		E_FOR_TX_POWER_TRACK	       300
 #define		TX_POWER_NEAR_FIELD_THRESH_HIGH		68
@@ -45,7 +45,7 @@
 #define		CURRENT_TX_RATE_REG		0x1e0
 #define		INITIAL_TX_RATE_REG		0x1e1
 #define		TX_RETRY_COUNT_REG		0x1ac
-#define		RegC38_TH				 20
+#define		REG_C38_TH				20
 
 #define		DM_Type_ByDriver		1
 
Signature · 1 line
2.25.1
Tested-by on the v1 series
#4 lore raw
In reply to Dragan Cvetic
Quoted 6 lines · Dragan Cvetic

Rename macro definitions to avoid CamelCase which is not accepted by checkpatch.

No test performed on HW, just build.

Dragan Cvetic (3):

Quoted 9 lines
   staging: rtl8192e: Rename RateAdapt..., RxPath...TH_low, RxPath..._TH
   staging: rtl8192e: Rename RateAdap...20M, RateAdap...40M, VeryLowRSSI
   staging: rtl8192e: Rename WAIotTHVal, RegC38_TH
  .../staging/rtl8192e/rtl8192e/r8192E_dev.c    | 14 ++++++------
  drivers/staging/rtl8192e/rtl8192e/rtl_dm.c    | 22 +++++++++----------
  drivers/staging/rtl8192e/rtl8192e/rtl_dm.h    | 16 +++++++-------
  3 files changed, 26 insertions(+), 26 deletions(-)