Skip to contentSkip to conversation

staging: r8188eu: clean up PatchID / customer id

PATCH In review Martin Kaiser 2 participants 5 messages Oct 6, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: clean up PatchID / customer id

This series should be applied on top of the series I sent yesterday (starting with Message-Id: <[email protected]>)

Thanks,
Martin

Martin Kaiser (3):
staging: r8188eu: hal data's customer id is always 0
staging: r8188eu: Odm PatchID is always 0
staging: r8188eu: merge two signal scale mapping functions

 drivers/staging/r8188eu/hal/odm.c             |  7 --
 drivers/staging/r8188eu/hal/odm_HWConfig.c    | 65 +++++--------------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  1 -
 drivers/staging/r8188eu/hal/usb_halinit.c     |  2 +-
 drivers/staging/r8188eu/include/odm.h         |  2 -
 .../staging/r8188eu/include/rtl8188e_hal.h    |  2 -
 drivers/staging/r8188eu/include/rtw_eeprom.h  | 55 ----------------
 7 files changed, 19 insertions(+), 115 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/3 staging: r8188eu: hal data's customer id is always 0

CustomerID in struct hal_data_8188e is never set, it remains at the default value 0.

Remove CustomerID and fix the two places where it was used.

---
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  2 +-
 drivers/staging/r8188eu/hal/usb_halinit.c     |  2 +-
 .../staging/r8188eu/include/rtl8188e_hal.h    |  2 -
 drivers/staging/r8188eu/include/rtw_eeprom.h  | 55 -------------------
 4 files changed, 2 insertions(+), 59 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_dm.c +1 -1
index 1a0176a60704..1bfe12b5fefb 100644
@@ -52,7 +52,7 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
 
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, IS_NORMAL_CHIP(hal_data->VersionID));
 
-	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, hal_data->CustomerID);
+	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, 0);
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_BWIFI_TEST, Adapter->registrypriv.wifi_spec);
 
 	if (hal_data->rf_type == RF_1T1R)
drivers/staging/r8188eu/hal/usb_halinit.c +1 -1
index 1e6885d75bf3..61d3209953f7 100644
@@ -1420,7 +1420,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 				}
 
 				if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
-					RetryLimit = (haldata->CustomerID == RT_CID_CCX) ? 7 : 48;
+					RetryLimit = 48;
 				else /*  Ad-hoc Mode */
 					RetryLimit = 0x7;
 			} else if (type == 1) {
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -2
index b374398bad24..66ecd3c3ac13 100644
@@ -209,8 +209,6 @@ struct txpowerinfo24g {
 
 struct hal_data_8188e {
 	struct HAL_VERSION	VersionID;
-	u16	CustomerID;
-
 	u16	FirmwareVersion;
 	u16	FirmwareVersionRev;
 	u16	FirmwareSubVersion;
drivers/staging/r8188eu/include/rtw_eeprom.h +0 -55

61 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/3 staging: r8188eu: Odm PatchID is always 0

In reply to Martin Kaiser

PatchID is a copy of the hal customer id that is always 0.

Remove PatchID from struct odm_dm_struct and the code that is executed only for PatchID != 0.

---
 drivers/staging/r8188eu/hal/odm.c          |  7 ---
 drivers/staging/r8188eu/hal/odm_HWConfig.c | 60 +++++++---------------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c  |  1 -
 drivers/staging/r8188eu/include/odm.h      |  2 -
 4 files changed, 18 insertions(+), 52 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -7
index bc49dc856a60..d15d62927db1 100644
@@ -262,9 +262,6 @@ void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
 	case	ODM_CMNINFO_EXT_TRSW:
 		pDM_Odm->ExtTRSW = (u8)Value;
 		break;
-	case	ODM_CMNINFO_PATCH_ID:
-		pDM_Odm->PatchID = (u8)Value;
-		break;
 	case	ODM_CMNINFO_BINHCT_TEST:
 		pDM_Odm->bInHctTest = (bool)Value;
 		break;
@@ -863,10 +860,6 @@ void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal)
 	u8 Rssi_Up_bound = 30;
 	u8 Rssi_Low_bound = 25;
 
-	if (pDM_Odm->PatchID == 40) { /* RT_CID_819x_FUNAI_TV */
-		Rssi_Up_bound = 50;
-		Rssi_Low_bound = 45;
-	}
 	if (pDM_PSTable->initialize == 0) {
 		pDM_PSTable->reg_874 = (ODM_GetBBReg(pDM_Odm, 0x874, bMaskDWord) & 0x1CC000) >> 14;
 		pDM_PSTable->reg_c70 = (ODM_GetBBReg(pDM_Odm, 0xc70, bMaskDWord) & BIT(3)) >> 3;
drivers/staging/r8188eu/hal/odm_HWConfig.c +18 -42

84 lines not on this page · raw message

drivers/staging/r8188eu/hal/rtl8188e_dm.c +0 -1
index 1bfe12b5fefb..d5fd97268145 100644
@@ -52,7 +52,6 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
 
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_MP_TEST_CHIP, IS_NORMAL_CHIP(hal_data->VersionID));
 
-	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_PATCH_ID, 0);
 	ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_BWIFI_TEST, Adapter->registrypriv.wifi_spec);
 
 	if (hal_data->rf_type == RF_1T1R)
drivers/staging/r8188eu/include/odm.h +0 -2
index 48d383f91c16..2a65c3dfad3a 100644
@@ -285,7 +285,6 @@ enum odm_common_info_def {
 	ODM_CMNINFO_EXT_LNA,		/* true */
 	ODM_CMNINFO_EXT_PA,
 	ODM_CMNINFO_EXT_TRSW,
-	ODM_CMNINFO_PATCH_ID,		/* CUSTOMER ID */
 	ODM_CMNINFO_BINHCT_TEST,
 	ODM_CMNINFO_BWIFI_TEST,
 	ODM_CMNINFO_SMART_CONCURRENT,
@@ -693,7 +692,6 @@ struct odm_dm_struct {
 	u8	ExtPA;
 	/*  with external TRSW  NO/Yes = 0/1 */
 	u8	ExtTRSW;
-	u8	PatchID; /* Customer ID */
 	bool	bInHctTest;
 	bool	bWIFITest;
 
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/3 staging: r8188eu: merge two signal scale mapping functions

In reply to Martin Kaiser

Keep the odm_SignalScaleMapping function and remove odm_SignalScaleMapping_92CSeries.

---
 drivers/staging/r8188eu/hal/odm_HWConfig.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/staging/r8188eu/hal/odm_HWConfig.c +1 -6
index c9c2bc35906c..2ae1a001d339 100644
@@ -17,7 +17,7 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)
 		return 100 + AntPower;
 }
 
-static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 CurrSig)
+static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
 {
 	s32 RetSig = 0;
 
@@ -41,11 +41,6 @@ static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 Cu
 	return RetSig;
 }
 
-static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
-{
-	return odm_SignalScaleMapping_92CSeries(dm_odm, CurrSig);
-}
-
 static u8 odm_evm_db_to_percentage(s8 value)
 {
 	/*  -33dB~0dB to 0%~99% */
Signature · 1 line
2.20.1
Acked-by on the v1 series
#4 lore raw
In reply to Martin Kaiser
Quoted 11 lines · Martin Kaiser

This series should be applied on top of the series I sent yesterday (starting with Message-Id: <[email protected]>)

Thanks,
Martin

Martin Kaiser (3):
staging: r8188eu: hal data's customer id is always 0
staging: r8188eu: Odm PatchID is always 0
staging: r8188eu: merge two signal scale mapping functions

Quoted 9 lines
  drivers/staging/r8188eu/hal/odm.c             |  7 --
  drivers/staging/r8188eu/hal/odm_HWConfig.c    | 65 +++++--------------
  drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  1 -
  drivers/staging/r8188eu/hal/usb_halinit.c     |  2 +-
  drivers/staging/r8188eu/include/odm.h         |  2 -
  .../staging/r8188eu/include/rtl8188e_hal.h    |  2 -
  drivers/staging/r8188eu/include/rtw_eeprom.h  | 55 ----------------
  7 files changed, 19 insertions(+), 115 deletions(-)

Builds and looks good to me.
For all 3 patches:

Thanks,
Michael