Skip to contentSkip to conversation

staging: r8188eu: clean up GetHwReg8188EU()

PATCH New Michael Straube 1 participant 7 messages Jan 7, 2022 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: clean up GetHwReg8188EU()

This series removes unused cases from GetHwReg8188EU(). Some of the cases are also unused in SetHwReg8188EU() and removed there as well.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (6):
staging: r8188eu: remove HW_VAR_BASIC_RATE from GetHwReg8188EU()
staging: r8188eu: remove HW_VAR_TXPAUSE
staging: r8188eu: remove HW_VAR_CURRENT_ANTENNA from GetHwReg8188EU()
staging: r8188eu: remove HW_VAR_EFUSE_BYTES from GetHwReg8188EU()
staging: r8188eu: EfuseUsedBytes is set but never used
staging: r8188eu: remove HW_VAR_APFM_ON_MAC

 .../staging/r8188eu/hal/rtl8188e_hal_init.c   |  3 ---
 drivers/staging/r8188eu/hal/usb_halinit.c     | 25 -------------------
 drivers/staging/r8188eu/include/hal_intf.h    |  5 ----
 .../staging/r8188eu/include/rtl8188e_hal.h    |  2 --
 4 files changed, 35 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/6 staging: r8188eu: remove HW_VAR_BASIC_RATE from GetHwReg8188EU()

GetHwReg8188EU() is never called with HW_VAR_BASIC_RATE. Remove that case from the function.

---
 drivers/staging/r8188eu/hal/usb_halinit.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -3
index 96db9a8e7667..b996580b30ba 100644
@@ -1592,9 +1592,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 	struct odm_dm_struct *podmpriv = &haldata->odmpriv;
 
 	switch (variable) {
-	case HW_VAR_BASIC_RATE:
-		*((u16 *)(val)) = haldata->BasicRateSet;
-		fallthrough;
 	case HW_VAR_TXPAUSE:
 		val[0] = rtw_read8(Adapter, REG_TXPAUSE);
 		break;
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/6 staging: r8188eu: remove HW_VAR_TXPAUSE

In reply to Michael Straube

SetHwReg8188EU() and GetHwReg8188EU() are never called with HW_VAR_TXPAUSE. Remove that case from both functions.

---
 drivers/staging/r8188eu/hal/usb_halinit.c  | 6 ------
 drivers/staging/r8188eu/include/hal_intf.h | 1 -
 2 files changed, 7 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -6
index b996580b30ba..72b008a78d75 100644
@@ -1138,9 +1138,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			rtw_write8(Adapter, REG_INIRTS_RATE_SEL, RateIndex);
 		}
 		break;
-	case HW_VAR_TXPAUSE:
-		rtw_write8(Adapter, REG_TXPAUSE, *((u8 *)val));
-		break;
 	case HW_VAR_BCN_FUNC:
 		hw_var_set_bcn_func(Adapter, variable, val);
 		break;
@@ -1592,9 +1589,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 	struct odm_dm_struct *podmpriv = &haldata->odmpriv;
 
 	switch (variable) {
-	case HW_VAR_TXPAUSE:
-		val[0] = rtw_read8(Adapter, REG_TXPAUSE);
-		break;
 	case HW_VAR_BCN_VALID:
 		/* BCN_VALID, BIT(16) of REG_TDECTRL = BIT(0) of REG_TDECTRL+2 */
 		val[0] = (BIT(0) & rtw_read8(Adapter, REG_TDECTRL + 2)) ? true : false;
drivers/staging/r8188eu/include/hal_intf.h +0 -1
index b4a7e0ce3116..77149eda7edf 100644
@@ -16,7 +16,6 @@ enum hw_variables {
 	HW_VAR_BSSID,
 	HW_VAR_INIT_RTS_RATE,
 	HW_VAR_BASIC_RATE,
-	HW_VAR_TXPAUSE,
 	HW_VAR_BCN_FUNC,
 	HW_VAR_CORRECT_TSF,
 	HW_VAR_CHECK_BSSID,
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/6 staging: r8188eu: remove HW_VAR_CURRENT_ANTENNA from GetHwReg8188EU()

In reply to Michael Straube

GetHwReg8188EU() is never called with HW_VAR_CURRENT_ANTENNA. Remove that case from the function.

---
 drivers/staging/r8188eu/hal/usb_halinit.c  | 3 ---
 drivers/staging/r8188eu/include/hal_intf.h | 1 -
 2 files changed, 4 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -3
index 72b008a78d75..33523ca90ee5 100644
@@ -1614,9 +1614,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_CURRENT_ANTENNA:
-		val[0] = haldata->CurAntenna;
-		break;
 	case HW_VAR_EFUSE_BYTES: /*  To get EFUE total used bytes, added by Roger, 2008.12.22. */
 		*((u16 *)(val)) = haldata->EfuseUsedBytes;
 		break;
drivers/staging/r8188eu/include/hal_intf.h +0 -1
index 77149eda7edf..37c2d2b82ea8 100644
@@ -55,7 +55,6 @@ enum hw_variables {
 	HW_VAR_INITIAL_GAIN,
 	HW_VAR_BT_SET_COEXIST,
 	HW_VAR_BT_ISSUE_DELBA,
-	HW_VAR_CURRENT_ANTENNA,
 	HW_VAR_ANTENNA_DIVERSITY_LINK,
 	HW_VAR_ANTENNA_DIVERSITY_SELECT,
 	HW_VAR_SWITCH_EPHY_WoWLAN,
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/6 staging: r8188eu: remove HW_VAR_EFUSE_BYTES from GetHwReg8188EU()

In reply to Michael Straube

GetHwReg8188EU() is never called with HW_VAR_EFUSE_BYTES. Remove that case from the function.

---
 drivers/staging/r8188eu/hal/usb_halinit.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -3
index 33523ca90ee5..c1129c83ebf7 100644
@@ -1614,9 +1614,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_EFUSE_BYTES: /*  To get EFUE total used bytes, added by Roger, 2008.12.22. */
-		*((u16 *)(val)) = haldata->EfuseUsedBytes;
-		break;
 	case HW_VAR_APFM_ON_MAC:
 		*val = haldata->bMacPwrCtrlOn;
 		break;
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/6 staging: r8188eu: EfuseUsedBytes is set but never used

In reply to Michael Straube

The field EfuseUsedBytes of struct hal_data_8188e is set but never used. Remove it.

---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 3 ---
 drivers/staging/r8188eu/hal/usb_halinit.c       | 3 ---
 drivers/staging/r8188eu/include/hal_intf.h      | 1 -
 drivers/staging/r8188eu/include/rtl8188e_hal.h  | 2 --
 4 files changed, 9 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +0 -3
index b818872e0d19..53328c4b1fd1 100644
@@ -797,9 +797,6 @@ static void Hal_EfuseReadEFuse88E(struct adapter *Adapter,
 	for (i = 0; i < _size_byte; i++)
 		pbuf[i] = efuseTbl[_offset + i];
 
-	/*  5. Calculate Efuse utilization. */
-	SetHwReg8188EU(Adapter, HW_VAR_EFUSE_BYTES, (u8 *)&eFuse_Addr);
-
 exit:
 	kfree(efuseTbl);
 	kfree(eFuseWord);
drivers/staging/r8188eu/hal/usb_halinit.c +0 -3
index c1129c83ebf7..10e40e654775 100644
@@ -1528,9 +1528,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_EFUSE_BYTES: /*  To set EFUE total used bytes, added by Roger, 2008.12.22. */
-		haldata->EfuseUsedBytes = *((u16 *)val);
-		break;
 	case HW_VAR_FIFO_CLEARN_UP:
 		{
 			struct pwrctrl_priv *pwrpriv = &Adapter->pwrctrlpriv;
drivers/staging/r8188eu/include/hal_intf.h +0 -1
index 37c2d2b82ea8..a86cb376a125 100644
@@ -59,7 +59,6 @@ enum hw_variables {
 	HW_VAR_ANTENNA_DIVERSITY_SELECT,
 	HW_VAR_SWITCH_EPHY_WoWLAN,
 	HW_VAR_EFUSE_USAGE,
-	HW_VAR_EFUSE_BYTES,
 	HW_VAR_EFUSE_BT_USAGE,
 	HW_VAR_EFUSE_BT_BYTES,
 	HW_VAR_FIFO_CLEARN_UP,
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -2
index 8134a173ea07..837b633cf98a 100644
@@ -232,8 +232,6 @@ struct hal_data_8188e {
 	u8	OutEpQueueSel;
 	u8	OutEpNumber;
 
-	u16	EfuseUsedBytes;
-
 	struct P2P_PS_Offload_t	p2p_ps_offload;
 
 	/*  Auto FSM to Turn On, include clock, isolation, power control
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/6 staging: r8188eu: remove HW_VAR_APFM_ON_MAC

In reply to Michael Straube

SetHwReg8188EU() and GetHwReg8188EU() are never called with HW_VAR_APFM_ON_MAC. Remove that case from both functions.

---
 drivers/staging/r8188eu/hal/usb_halinit.c  | 7 -------
 drivers/staging/r8188eu/include/hal_intf.h | 2 --
 2 files changed, 9 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -7
index 10e40e654775..91610e2adae2 100644
@@ -1556,10 +1556,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_APFM_ON_MAC:
-		haldata->bMacPwrCtrlOn = *val;
-		DBG_88E("%s: bMacPwrCtrlOn=%d\n", __func__, haldata->bMacPwrCtrlOn);
-		break;
 	case HW_VAR_TX_RPT_MAX_MACID:
 		{
 			u8 maxMacid = *val;
@@ -1611,9 +1607,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_APFM_ON_MAC:
-		*val = haldata->bMacPwrCtrlOn;
-		break;
 	case HW_VAR_CHK_HI_QUEUE_EMPTY:
 		*val = ((rtw_read32(Adapter, REG_HGQ_INFORMATION) & 0x0000ff00) == 0) ? true : false;
 		break;
drivers/staging/r8188eu/include/hal_intf.h +0 -2
index a86cb376a125..120b32994e1f 100644
@@ -62,8 +62,6 @@ enum hw_variables {
 	HW_VAR_EFUSE_BT_USAGE,
 	HW_VAR_EFUSE_BT_BYTES,
 	HW_VAR_FIFO_CLEARN_UP,
-	HW_VAR_APFM_ON_MAC, /* Auto FSM to Turn On, include clock, isolation,
-			     * power control for MAC only */
 	/*  The valid upper nav range for the HW updating, if the true value is
 	 *  larger than the upper range, the HW won't update it. */
 	/*  Unit in microsecond. 0 means disable this function. */
Signature · 1 line
2.34.1