All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] staging: r8188eu: another round of cleanups
@ 2022-01-08 12:49 Martin Kaiser
  2022-01-08 12:49 ` [PATCH 01/12] staging: r8188eu: ODM_MAC_EDCA_TURBO is always set Martin Kaiser
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Here's another set with simple cleanups in several places.

Tested with Edimax V2 on an arm32 embedded system, using staging-testing
plus the recent patchsets by Michael and Phil.

Martin Kaiser (12):
  staging: r8188eu: ODM_MAC_EDCA_TURBO is always set
  staging: r8188eu: ODM_BB_FA_CNT is always set
  staging: r8188eu: ODM_BB_CCK_PD is always set
  staging: r8188eu: remove unused chip type settings
  staging: r8188eu: remove obsolete defines and comments
  staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used
  staging: r8188eu: CurrentBW2024GTxPwrIdx is set but not used
  staging: r8188eu: CurrentOfdm24GTxPwrIdx is set but not used
  staging: r8188eu: CurrentCckTxPwrIdx is set but not used
  staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set
  staging: r8188eu: remove HAL_*_ENABLE defines
  staging: r8188eu: we always enqueue in rtw_set_chplan_cmd

 drivers/staging/r8188eu/core/rtw_cmd.c        | 26 ++++++---------
 drivers/staging/r8188eu/hal/odm.c             | 11 -------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c     |  5 +--
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 32 -------------------
 drivers/staging/r8188eu/hal/usb_halinit.c     | 19 -----------
 drivers/staging/r8188eu/include/HalVerDef.h   |  5 ---
 drivers/staging/r8188eu/include/hal_intf.h    |  1 -
 drivers/staging/r8188eu/include/odm.h         |  5 ---
 .../staging/r8188eu/include/rtl8188e_hal.h    |  6 ----
 drivers/staging/r8188eu/include/rtw_cmd.h     |  2 +-
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  2 +-
 11 files changed, 12 insertions(+), 102 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 01/12] staging: r8188eu: ODM_MAC_EDCA_TURBO is always set
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 02/12] staging: r8188eu: ODM_BB_FA_CNT " Martin Kaiser
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The ODM_MAC_EDCA_TURBO flag is always set for chips that are supported by
this driver. Remove the flag and the one place where it's checked.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/odm.c         | 3 ---
 drivers/staging/r8188eu/hal/rtl8188e_dm.c | 1 -
 drivers/staging/r8188eu/include/odm.h     | 3 ---
 3 files changed, 7 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index d8fa587ff286..77ece1950b63 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -563,9 +563,6 @@ static void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm)
 	struct mlme_ext_priv	*pmlmeext = &Adapter->mlmeextpriv;
 	struct mlme_ext_info	*pmlmeinfo = &pmlmeext->mlmext_info;
 
-	if (!(pDM_Odm->SupportAbility & ODM_MAC_EDCA_TURBO))
-		return;
-
 	if (pregpriv->wifi_spec == 1)
 		goto dm_CheckEdcaTurbo_EXIT;
 
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index bd6eb3878060..5118d0e3045b 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -56,7 +56,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	pdmpriv->InitODMFlag = ODM_BB_FA_CNT |
 				ODM_BB_RSSI_MONITOR |
 				ODM_BB_CCK_PD |
-				ODM_MAC_EDCA_TURBO |
 				ODM_RF_CALIBRATION |
 				ODM_RF_TX_PWR_TRACK;
 	if (hal_data->AntDivCfg)
diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
index 23a151c558dc..616a862180b2 100644
--- a/drivers/staging/r8188eu/include/odm.h
+++ b/drivers/staging/r8188eu/include/odm.h
@@ -154,9 +154,6 @@ enum odm_ability_def {
 	ODM_BB_ANT_DIV			= BIT(6),
 	ODM_BB_PWR_TRA			= BIT(8),
 
-	/*  MAC DM section BIT 16-23 */
-	ODM_MAC_EDCA_TURBO		= BIT(16),
-
 	/*  RF ODM section BIT 24-31 */
 	ODM_RF_TX_PWR_TRACK		= BIT(24),
 	ODM_RF_CALIBRATION		= BIT(26),
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 02/12] staging: r8188eu: ODM_BB_FA_CNT is always set
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
  2022-01-08 12:49 ` [PATCH 01/12] staging: r8188eu: ODM_MAC_EDCA_TURBO is always set Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 03/12] staging: r8188eu: ODM_BB_CCK_PD " Martin Kaiser
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The ODM_BB_FA_CNT flag is always set.

Remove the flag and the code to check if ODM_BB_FA_CNT is not set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/odm.c         | 8 +-------
 drivers/staging/r8188eu/hal/rtl8188e_dm.c | 3 +--
 drivers/staging/r8188eu/include/odm.h     | 1 -
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index 77ece1950b63..7cc9ab4b1a59 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -169,9 +169,6 @@ static void odm_DIG(struct odm_dm_struct *pDM_Odm)
 	u8 dm_dig_max, dm_dig_min;
 	u8 CurrentIGI = pDM_DigTable->CurIGValue;
 
-	if (!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))
-		return;
-
 	if (*pDM_Odm->pbScanInProcess)
 		return;
 
@@ -367,9 +364,6 @@ static void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)
 	struct false_alarm_stats *FalseAlmCnt = &pDM_Odm->FalseAlmCnt;
 	struct adapter *adapter = pDM_Odm->Adapter;
 
-	if (!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT))
-		return;
-
 	/* hold ofdm counter */
 	rtl8188e_PHY_SetBBReg(adapter, ODM_REG_OFDM_FA_HOLDC_11N, BIT(31), 1); /* hold page C counter */
 	rtl8188e_PHY_SetBBReg(adapter, ODM_REG_OFDM_FA_RSTD_11N, BIT(31), 1); /* hold page D counter */
@@ -422,7 +416,7 @@ static void odm_CCKPacketDetectionThresh(struct odm_dm_struct *pDM_Odm)
 	u8 CurCCK_CCAThres;
 	struct false_alarm_stats *FalseAlmCnt = &pDM_Odm->FalseAlmCnt;
 
-	if (!(pDM_Odm->SupportAbility & (ODM_BB_CCK_PD | ODM_BB_FA_CNT)))
+	if (!(pDM_Odm->SupportAbility & ODM_BB_CCK_PD))
 		return;
 	if (pDM_Odm->bLinked) {
 		if (pDM_Odm->RSSI_Min > 25) {
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index 5118d0e3045b..2ff9c7d84dbf 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -53,8 +53,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	struct dm_priv	*pdmpriv = &hal_data->dmpriv;
 	int i;
 
-	pdmpriv->InitODMFlag = ODM_BB_FA_CNT |
-				ODM_BB_RSSI_MONITOR |
+	pdmpriv->InitODMFlag = ODM_BB_RSSI_MONITOR |
 				ODM_BB_CCK_PD |
 				ODM_RF_CALIBRATION |
 				ODM_RF_TX_PWR_TRACK;
diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
index 616a862180b2..664e75c3a7c2 100644
--- a/drivers/staging/r8188eu/include/odm.h
+++ b/drivers/staging/r8188eu/include/odm.h
@@ -148,7 +148,6 @@ enum odm_common_info_def {
 
 enum odm_ability_def {
 	/*  BB ODM section BIT 0-15 */
-	ODM_BB_FA_CNT			= BIT(3),
 	ODM_BB_RSSI_MONITOR		= BIT(4),
 	ODM_BB_CCK_PD			= BIT(5),
 	ODM_BB_ANT_DIV			= BIT(6),
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 03/12] staging: r8188eu: ODM_BB_CCK_PD is always set
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
  2022-01-08 12:49 ` [PATCH 01/12] staging: r8188eu: ODM_MAC_EDCA_TURBO is always set Martin Kaiser
  2022-01-08 12:49 ` [PATCH 02/12] staging: r8188eu: ODM_BB_FA_CNT " Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 04/12] staging: r8188eu: remove unused chip type settings Martin Kaiser
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The ODM_BB_CCK_PD flag is always set.

Remove the flag and the check if ODM_BB_CCK_PD is not set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/odm.c         | 2 --
 drivers/staging/r8188eu/hal/rtl8188e_dm.c | 1 -
 drivers/staging/r8188eu/include/odm.h     | 1 -
 3 files changed, 4 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index 7cc9ab4b1a59..8156e4acaa09 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -416,8 +416,6 @@ static void odm_CCKPacketDetectionThresh(struct odm_dm_struct *pDM_Odm)
 	u8 CurCCK_CCAThres;
 	struct false_alarm_stats *FalseAlmCnt = &pDM_Odm->FalseAlmCnt;
 
-	if (!(pDM_Odm->SupportAbility & ODM_BB_CCK_PD))
-		return;
 	if (pDM_Odm->bLinked) {
 		if (pDM_Odm->RSSI_Min > 25) {
 			CurCCK_CCAThres = 0xcd;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index 2ff9c7d84dbf..adf87c1721ee 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -54,7 +54,6 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
 	int i;
 
 	pdmpriv->InitODMFlag = ODM_BB_RSSI_MONITOR |
-				ODM_BB_CCK_PD |
 				ODM_RF_CALIBRATION |
 				ODM_RF_TX_PWR_TRACK;
 	if (hal_data->AntDivCfg)
diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
index 664e75c3a7c2..50960e7daf1d 100644
--- a/drivers/staging/r8188eu/include/odm.h
+++ b/drivers/staging/r8188eu/include/odm.h
@@ -149,7 +149,6 @@ enum odm_common_info_def {
 enum odm_ability_def {
 	/*  BB ODM section BIT 0-15 */
 	ODM_BB_RSSI_MONITOR		= BIT(4),
-	ODM_BB_CCK_PD			= BIT(5),
 	ODM_BB_ANT_DIV			= BIT(6),
 	ODM_BB_PWR_TRA			= BIT(8),
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 04/12] staging: r8188eu: remove unused chip type settings
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (2 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 03/12] staging: r8188eu: ODM_BB_CCK_PD " Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 05/12] staging: r8188eu: remove obsolete defines and comments Martin Kaiser
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove some unused defines and macros related to chip type.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/HalVerDef.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/r8188eu/include/HalVerDef.h b/drivers/staging/r8188eu/include/HalVerDef.h
index 62b94c993f0d..f4816ac765e5 100644
--- a/drivers/staging/r8188eu/include/HalVerDef.h
+++ b/drivers/staging/r8188eu/include/HalVerDef.h
@@ -6,7 +6,6 @@
 enum HAL_CHIP_TYPE {
 	TEST_CHIP	=	0,
 	NORMAL_CHIP	=	1,
-	FPGA		=	2,
 };
 
 enum HAL_CUT_VERSION {
@@ -40,8 +39,6 @@ struct HAL_VERSION {
 /* HAL_VERSION VersionID */
 
 /* HAL_CHIP_TYPE_E */
-#define IS_TEST_CHIP(version)				\
-	((GET_CVID_CHIP_TYPE(version) == TEST_CHIP) ? true : false)
 #define IS_NORMAL_CHIP(version)				\
 	((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? true : false)
 
@@ -60,7 +57,5 @@ struct HAL_VERSION {
 /* HAL_VENDOR_E */
 #define IS_CHIP_VENDOR_TSMC(version)			\
 	((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC) ? true : false)
-#define IS_CHIP_VENDOR_UMC(version)			\
-	((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC) ? true : false)
 
 #endif
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 05/12] staging: r8188eu: remove obsolete defines and comments
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (3 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 04/12] staging: r8188eu: remove unused chip type settings Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 06/12] staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used Martin Kaiser
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove some unused phycfg defines and obsolete comments.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 302b15b2874d..c06a332f6b20 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -8,25 +8,6 @@
 #include "../include/rtw_iol.h"
 #include "../include/rtl8188e_hal.h"
 
-/*---------------------------Define Local Constant---------------------------*/
-/* Channel switch:The size of command tables for switch channel*/
-#define MAX_PRECMD_CNT 16
-#define MAX_RFDEPENDCMD_CNT 16
-#define MAX_POSTCMD_CNT 16
-
-#define MAX_DOZE_WAITING_TIMES_9x 64
-
-/*---------------------------Define Local Constant---------------------------*/
-
-/*------------------------Define global variable-----------------------------*/
-
-/*------------------------Define local variable------------------------------*/
-
-/*--------------------Define export function prototype-----------------------*/
-/*  Please refer to header file */
-/*--------------------Define export function prototype-----------------------*/
-
-/*----------------------------Function Body----------------------------------*/
 /*  */
 /*  1. BB register R/W API */
 /*  */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 06/12] staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (4 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 05/12] staging: r8188eu: remove obsolete defines and comments Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 07/12] staging: r8188eu: CurrentBW2024GTxPwrIdx " Martin Kaiser
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

CurrentBW4024GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c  | 1 -
 drivers/staging/r8188eu/include/rtl8188e_hal.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index c06a332f6b20..fe15b15ab951 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -589,7 +589,6 @@ static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckP
 	pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
 	pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0];
 	pHalData->CurrentBW2024GTxPwrIdx = BW20PowerLevel[0];
-	pHalData->CurrentBW4024GTxPwrIdx = BW40PowerLevel[0];
 }
 
 /*-----------------------------------------------------------------------------
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 66eadd170c9b..1c52dd9d9721 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -180,7 +180,6 @@ struct hal_data_8188e {
 	u8	CurrentCckTxPwrIdx;
 	u8	CurrentOfdm24GTxPwrIdx;
 	u8	CurrentBW2024GTxPwrIdx;
-	u8	CurrentBW4024GTxPwrIdx;
 
 	/*  Read/write are allow for following hardware information variables */
 	u8	pwrGroupCnt;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 07/12] staging: r8188eu: CurrentBW2024GTxPwrIdx is set but not used
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (5 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 06/12] staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 08/12] staging: r8188eu: CurrentOfdm24GTxPwrIdx " Martin Kaiser
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

CurrentBW2024GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c  | 1 -
 drivers/staging/r8188eu/include/rtl8188e_hal.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index fe15b15ab951..24b5604afbc9 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -588,7 +588,6 @@ static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckP
 
 	pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
 	pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0];
-	pHalData->CurrentBW2024GTxPwrIdx = BW20PowerLevel[0];
 }
 
 /*-----------------------------------------------------------------------------
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 1c52dd9d9721..0c7f5e078bed 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -179,7 +179,6 @@ struct hal_data_8188e {
 	/*  The current Tx Power Level */
 	u8	CurrentCckTxPwrIdx;
 	u8	CurrentOfdm24GTxPwrIdx;
-	u8	CurrentBW2024GTxPwrIdx;
 
 	/*  Read/write are allow for following hardware information variables */
 	u8	pwrGroupCnt;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 08/12] staging: r8188eu: CurrentOfdm24GTxPwrIdx is set but not used
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (6 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 07/12] staging: r8188eu: CurrentBW2024GTxPwrIdx " Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 09/12] staging: r8188eu: CurrentCckTxPwrIdx " Martin Kaiser
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

CurrentOfdm24GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c  | 1 -
 drivers/staging/r8188eu/include/rtl8188e_hal.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 24b5604afbc9..a80f40fccf09 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -587,7 +587,6 @@ static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckP
 	struct hal_data_8188e *pHalData = &Adapter->haldata;
 
 	pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
-	pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0];
 }
 
 /*-----------------------------------------------------------------------------
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 0c7f5e078bed..fd2ee1739f88 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -178,7 +178,6 @@ struct hal_data_8188e {
 
 	/*  The current Tx Power Level */
 	u8	CurrentCckTxPwrIdx;
-	u8	CurrentOfdm24GTxPwrIdx;
 
 	/*  Read/write are allow for following hardware information variables */
 	u8	pwrGroupCnt;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 09/12] staging: r8188eu: CurrentCckTxPwrIdx is set but not used
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (7 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 08/12] staging: r8188eu: CurrentOfdm24GTxPwrIdx " Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 10/12] staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set Martin Kaiser
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

CurrentCckTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

The phy_PowerIndexCheck88E function is now empty. Remove it as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c  | 10 ----------
 drivers/staging/r8188eu/include/rtl8188e_hal.h |  3 ---
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index a80f40fccf09..c1639df8b1e7 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -581,14 +581,6 @@ static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPower
 	BW40PowerLevel[RF_PATH_A] = pHalData->Index24G_BW40_Base[index];
 }
 
-static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
-				   u8 *ofdmPowerLevel, u8 *BW20PowerLevel, u8 *BW40PowerLevel)
-{
-	struct hal_data_8188e *pHalData = &Adapter->haldata;
-
-	pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
-}
-
 /*-----------------------------------------------------------------------------
  * Function:    SetTxPowerLevel8190()
  *
@@ -619,8 +611,6 @@ PHY_SetTxPowerLevel8188E(
 
 	getTxPowerIndex88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]);
 
-	phy_PowerIndexCheck88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]);
-
 	rtl8188e_PHY_RF6052SetCckTxPower(Adapter, &cckPowerLevel[0]);
 	rtl8188e_PHY_RF6052SetOFDMTxPower(Adapter, &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0], channel);
 }
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index fd2ee1739f88..a24cdbfa83de 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -176,9 +176,6 @@ struct hal_data_8188e {
 	u8	PwrGroupHT20[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
 	u8	PwrGroupHT40[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
 
-	/*  The current Tx Power Level */
-	u8	CurrentCckTxPwrIdx;
-
 	/*  Read/write are allow for following hardware information variables */
 	u8	pwrGroupCnt;
 	u32	MCSTxPowerLevelOriginalOffset[MAX_PG_GROUP][16];
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 10/12] staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (8 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 09/12] staging: r8188eu: CurrentCckTxPwrIdx " Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 11/12] staging: r8188eu: remove HAL_*_ENABLE defines Martin Kaiser
  2022-01-08 12:49 ` [PATCH 12/12] staging: r8188eu: we always enqueue in rtw_set_chplan_cmd Martin Kaiser
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The HW_VAR_MEDIA_STATUS1 hal variable is never set. Remove its define
and the code to set it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_halinit.c  | 9 ---------
 drivers/staging/r8188eu/include/hal_intf.h | 1 -
 2 files changed, 10 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 38b88e6b7bdb..21cb505036b7 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1087,15 +1087,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			rtw_write8(Adapter, MSR, val8);
 		}
 		break;
-	case HW_VAR_MEDIA_STATUS1:
-		{
-			u8 val8;
-
-			val8 = rtw_read8(Adapter, MSR) & 0x03;
-			val8 |= *((u8 *)val) << 2;
-			rtw_write8(Adapter, MSR, val8);
-		}
-		break;
 	case HW_VAR_SET_OPMODE:
 		hw_var_set_opmode(Adapter, variable, val);
 		break;
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index 120b32994e1f..6728cb506303 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -10,7 +10,6 @@
 
 enum hw_variables {
 	HW_VAR_MEDIA_STATUS,
-	HW_VAR_MEDIA_STATUS1,
 	HW_VAR_SET_OPMODE,
 	HW_VAR_MAC_ADDR,
 	HW_VAR_BSSID,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 11/12] staging: r8188eu: remove HAL_*_ENABLE defines
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (9 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 10/12] staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  2022-01-08 12:49 ` [PATCH 12/12] staging: r8188eu: we always enqueue in rtw_set_chplan_cmd Martin Kaiser
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

HAL_(MAC|BB|RF)_ENABLE are always set. Remove the defines and the
checks where they are used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_halinit.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 21cb505036b7..cc8f8c7d0734 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -13,10 +13,6 @@
 #include "../include/usb_osintf.h"
 #include "../include/Hal8188EPwrSeq.h"
 
-#define		HAL_MAC_ENABLE	1
-#define		HAL_BB_ENABLE		1
-#define		HAL_RF_ENABLE		1
-
 static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
 {
 	struct hal_data_8188e *haldata = &adapt->haldata;
@@ -640,32 +636,26 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
 	Adapter->pwrctrlpriv.bFwCurrentInPSMode = false;
 	haldata->LastHMEBoxNum = 0;
 
-#if (HAL_MAC_ENABLE == 1)
 	status = PHY_MACConfig8188E(Adapter);
 	if (status == _FAIL) {
 		DBG_88E(" ### Failed to init MAC ......\n ");
 		goto exit;
 	}
-#endif
 
 	/*  */
 	/* d. Initialize BB related configurations. */
 	/*  */
-#if (HAL_BB_ENABLE == 1)
 	status = PHY_BBConfig8188E(Adapter);
 	if (status == _FAIL) {
 		DBG_88E(" ### Failed to init BB ......\n ");
 		goto exit;
 	}
-#endif
 
-#if (HAL_RF_ENABLE == 1)
 	status = PHY_RFConfig8188E(Adapter);
 	if (status == _FAIL) {
 		DBG_88E(" ### Failed to init RF ......\n ");
 		goto exit;
 	}
-#endif
 
 	status = rtl8188e_iol_efuse_patch(Adapter);
 	if (status == _FAIL) {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 12/12] staging: r8188eu: we always enqueue in rtw_set_chplan_cmd
  2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
                   ` (10 preceding siblings ...)
  2022-01-08 12:49 ` [PATCH 11/12] staging: r8188eu: remove HAL_*_ENABLE defines Martin Kaiser
@ 2022-01-08 12:49 ` Martin Kaiser
  11 siblings, 0 replies; 13+ messages in thread
From: Martin Kaiser @ 2022-01-08 12:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The only caller of rtw_set_chplan_cmd requests that the message be
enqueued and not sent directly.

Remove the enqueue parameter and the code for direct sending.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_cmd.c       | 26 +++++++-------------
 drivers/staging/r8188eu/include/rtw_cmd.h    |  2 +-
 drivers/staging/r8188eu/os_dep/ioctl_linux.c |  2 +-
 3 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 712fd6e536c4..3d22a8888ea7 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -836,7 +836,7 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)
 	return res;
 }
 
-u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue)
+u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan)
 {
 	struct	cmd_obj *pcmdobj;
 	struct	SetChannelPlan_param *setChannelPlan_param;
@@ -859,25 +859,17 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue)
 	}
 	setChannelPlan_param->channel_plan = chplan;
 
-	if (enqueue) {
-		/* need enqueue, prepare cmd_obj and enqueue */
-		pcmdobj = kzalloc(sizeof(struct	cmd_obj), GFP_KERNEL);
-		if (!pcmdobj) {
-			kfree(setChannelPlan_param);
-			res = _FAIL;
-			goto exit;
-		}
-
-		init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan));
-		res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
-	} else {
-		/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
-		if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param))
-			res = _FAIL;
-
+	/* need enqueue, prepare cmd_obj and enqueue */
+	pcmdobj = kzalloc(sizeof(struct	cmd_obj), GFP_KERNEL);
+	if (!pcmdobj) {
 		kfree(setChannelPlan_param);
+		res = _FAIL;
+		goto exit;
 	}
 
+	init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan));
+	res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
+
 	/* do something based on res... */
 	if (res == _SUCCESS)
 		padapter->mlmepriv.ChannelPlan = chplan;
diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h
index cf0945ae11c1..60cecdd4ee0e 100644
--- a/drivers/staging/r8188eu/include/rtw_cmd.h
+++ b/drivers/staging/r8188eu/include/rtw_cmd.h
@@ -772,7 +772,7 @@ u8 rtw_ps_cmd(struct adapter*padapter);
 
 u8 rtw_chk_hi_queue_cmd(struct adapter*padapter);
 
-u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue);
+u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan);
 
 u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt);
 
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 41b457838a5b..b9f9698d70cf 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -2098,7 +2098,7 @@ static int rtw_wx_set_channel_plan(struct net_device *dev,
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 	u8 channel_plan_req = (u8)(*((int *)wrqu));
 
-	if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1))
+	if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req))
 		DBG_88E("%s set channel_plan = 0x%02X\n", __func__, pmlmepriv->ChannelPlan);
 	else
 		return -EPERM;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-01-08 12:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 12:49 [PATCH 00/12] staging: r8188eu: another round of cleanups Martin Kaiser
2022-01-08 12:49 ` [PATCH 01/12] staging: r8188eu: ODM_MAC_EDCA_TURBO is always set Martin Kaiser
2022-01-08 12:49 ` [PATCH 02/12] staging: r8188eu: ODM_BB_FA_CNT " Martin Kaiser
2022-01-08 12:49 ` [PATCH 03/12] staging: r8188eu: ODM_BB_CCK_PD " Martin Kaiser
2022-01-08 12:49 ` [PATCH 04/12] staging: r8188eu: remove unused chip type settings Martin Kaiser
2022-01-08 12:49 ` [PATCH 05/12] staging: r8188eu: remove obsolete defines and comments Martin Kaiser
2022-01-08 12:49 ` [PATCH 06/12] staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used Martin Kaiser
2022-01-08 12:49 ` [PATCH 07/12] staging: r8188eu: CurrentBW2024GTxPwrIdx " Martin Kaiser
2022-01-08 12:49 ` [PATCH 08/12] staging: r8188eu: CurrentOfdm24GTxPwrIdx " Martin Kaiser
2022-01-08 12:49 ` [PATCH 09/12] staging: r8188eu: CurrentCckTxPwrIdx " Martin Kaiser
2022-01-08 12:49 ` [PATCH 10/12] staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set Martin Kaiser
2022-01-08 12:49 ` [PATCH 11/12] staging: r8188eu: remove HAL_*_ENABLE defines Martin Kaiser
2022-01-08 12:49 ` [PATCH 12/12] staging: r8188eu: we always enqueue in rtw_set_chplan_cmd Martin Kaiser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.