linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU()
@ 2022-03-31 13:05 Michael Straube
  2022-03-31 13:05 ` [PATCH 1/5] staging: r8188eu: rename clear_bacon_valid_bit() Michael Straube
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

This series remove the function GetHwReg8188EU(). This is part of the
ongoing effort to get rid of the unwanted hal layer.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (5):
  staging: r8188eu: rename clear_bacon_valid_bit()
  staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU()
  staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from
    GetHwReg8188EU()
  staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()
  staging: r8188eu: remove GetHwReg8188EU()

 drivers/staging/r8188eu/core/rtw_cmd.c        | 14 +++----
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 14 +++++--
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 19 +++++++--
 drivers/staging/r8188eu/hal/rtl8188e_cmd.c    |  6 +--
 drivers/staging/r8188eu/hal/usb_halinit.c     | 40 -------------------
 drivers/staging/r8188eu/include/hal_intf.h    |  4 --
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  3 +-
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  4 +-
 8 files changed, 39 insertions(+), 65 deletions(-)

-- 
2.35.1


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

* [PATCH 1/5] staging: r8188eu: rename clear_bacon_valid_bit()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
@ 2022-03-31 13:05 ` Michael Straube
  2022-03-31 13:05 ` [PATCH 2/5] staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU() Michael Straube
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

Rename clear_bacon_valid_bit(). Actually it should be
clear_beacon_valid_bit().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c    | 4 ++--
 drivers/staging/r8188eu/hal/rtl8188e_cmd.c     | 4 ++--
 drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 643f9f8a7a3d..15a91c5fc852 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -5761,7 +5761,7 @@ unsigned int send_beacon(struct adapter *padapter)
 
 	u32 start = jiffies;
 
-	clear_bacon_valid_bit(padapter);
+	clear_beacon_valid_bit(padapter);
 
 	do {
 		issue_beacon(padapter, 100);
@@ -5784,7 +5784,7 @@ unsigned int send_beacon(struct adapter *padapter)
 	}
 }
 
-void clear_bacon_valid_bit(struct adapter *adapter)
+void clear_beacon_valid_bit(struct adapter *adapter)
 {
 	/* BIT(16) of REG_TDECTRL = BIT(0) of REG_TDECTRL+2, write 1 to clear, Clear by sw */
 	rtw_write8(adapter, REG_TDECTRL + 2, rtw_read8(adapter, REG_TDECTRL + 2) | BIT(0));
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
index a7337954891a..2e252562e48c 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
@@ -557,7 +557,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
 		rtw_write8(adapt, REG_FWHW_TXQ_CTRL + 2, (haldata->RegFwHwTxQCtrl & (~BIT(6))));
 		haldata->RegFwHwTxQCtrl &= (~BIT(6));
 
-		clear_bacon_valid_bit(adapt);
+		clear_beacon_valid_bit(adapt);
 		DLBcnCount = 0;
 		poll = 0;
 		do {
@@ -596,7 +596,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
 
 		/*  Update RSVD page location H2C to Fw. */
 		if (bcn_valid)
-			clear_bacon_valid_bit(adapt);
+			clear_beacon_valid_bit(adapt);
 
 		/*  Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli. */
 		/*  Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index 66f7361e7a19..a00da19c4b88 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -538,7 +538,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr,
 		     unsigned char action, unsigned short status);
 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
 unsigned int send_beacon(struct adapter *padapter);
-void clear_bacon_valid_bit(struct adapter *adapter);
+void clear_beacon_valid_bit(struct adapter *adapter);
 
 void start_clnt_assoc(struct adapter *padapter);
 void start_clnt_auth(struct adapter *padapter);
-- 
2.35.1


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

* [PATCH 2/5] staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
  2022-03-31 13:05 ` [PATCH 1/5] staging: r8188eu: rename clear_bacon_valid_bit() Michael Straube
@ 2022-03-31 13:05 ` Michael Straube
  2022-03-31 13:05 ` [PATCH 3/5] staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY " Michael Straube
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The HW_VAR_BCN_VALID from GetHwReg8188EU() just calls rtw_read8().
Remove HW_VAR_BCN_VALID from GetHwReg8188EU() and call rtw_read8()
directly. Move the call to a new function to indicate what it actually
does. This is part of the ongoing effort to get rid of the unwanted
hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c    | 10 ++++++++--
 drivers/staging/r8188eu/hal/rtl8188e_cmd.c     |  2 +-
 drivers/staging/r8188eu/hal/usb_halinit.c      |  4 ----
 drivers/staging/r8188eu/include/hal_intf.h     |  1 -
 drivers/staging/r8188eu/include/rtw_mlme_ext.h |  1 +
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 15a91c5fc852..3032a7e7977b 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -5755,7 +5755,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
 
 unsigned int send_beacon(struct adapter *padapter)
 {
-	u8 bxmitok = false;
+	bool bxmitok = false;
 	int	issue = 0;
 	int poll = 0;
 
@@ -5768,7 +5768,7 @@ unsigned int send_beacon(struct adapter *padapter)
 		issue++;
 		do {
 			yield();
-			GetHwReg8188EU(padapter, HW_VAR_BCN_VALID, (u8 *)(&bxmitok));
+			bxmitok = get_beacon_valid_bit(padapter);
 			poll++;
 		} while ((poll % 10) != 0 && !bxmitok && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
 	} while (!bxmitok && issue < 100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
@@ -5784,6 +5784,12 @@ unsigned int send_beacon(struct adapter *padapter)
 	}
 }
 
+bool get_beacon_valid_bit(struct adapter *adapter)
+{
+	/* BIT(16) of REG_TDECTRL = BIT(0) of REG_TDECTRL+2 */
+	return BIT(0) & rtw_read8(adapter, REG_TDECTRL + 2);
+}
+
 void clear_beacon_valid_bit(struct adapter *adapter)
 {
 	/* BIT(16) of REG_TDECTRL = BIT(0) of REG_TDECTRL+2, write 1 to clear, Clear by sw */
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
index 2e252562e48c..45b788212628 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_cmd.c
@@ -568,7 +568,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
 				yield();
 				/* mdelay(10); */
 				/*  check rsvd page download OK. */
-				GetHwReg8188EU(adapt, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid));
+				bcn_valid = get_beacon_valid_bit(adapt);
 				poll++;
 			} while (!bcn_valid && (poll % 10) != 0 && !adapt->bSurpriseRemoved && !adapt->bDriverStopped);
 		} while (!bcn_valid && DLBcnCount <= 100 && !adapt->bSurpriseRemoved && !adapt->bDriverStopped);
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 8cb1163ced5d..8c4bc78681e1 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1289,10 +1289,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 	struct odm_dm_struct *podmpriv = &haldata->odmpriv;
 
 	switch (variable) {
-	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;
-		break;
 	case HW_VAR_DM_FLAG:
 		val[0] = podmpriv->SupportAbility;
 		break;
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index 1e2177b8e11c..065fc7bd78d5 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -17,7 +17,6 @@ enum hw_variables {
 	HW_VAR_MLME_JOIN,
 	HW_VAR_SLOT_TIME,
 	HW_VAR_ACK_PREAMBLE,
-	HW_VAR_BCN_VALID,
 	HW_VAR_DM_FLAG,
 	HW_VAR_DM_FUNC_OP,
 	HW_VAR_DM_FUNC_RESET,
diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index a00da19c4b88..0875472dbb72 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -538,6 +538,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr,
 		     unsigned char action, unsigned short status);
 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
 unsigned int send_beacon(struct adapter *padapter);
+bool get_beacon_valid_bit(struct adapter *adapter);
 void clear_beacon_valid_bit(struct adapter *adapter);
 
 void start_clnt_assoc(struct adapter *padapter);
-- 
2.35.1


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

* [PATCH 3/5] staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
  2022-03-31 13:05 ` [PATCH 1/5] staging: r8188eu: rename clear_bacon_valid_bit() Michael Straube
  2022-03-31 13:05 ` [PATCH 2/5] staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU() Michael Straube
@ 2022-03-31 13:05 ` Michael Straube
  2022-03-31 13:05 ` [PATCH 4/5] staging: r8188eu: remove HW_VAR_FWLPS_RF_ON " Michael Straube
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() just calls
rtw_read32(). Remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
and call rtw_read32() directly. Move the call to a new function to
indicate what it actually does. This is part of the ongoing effort to
get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_cmd.c     | 14 +++++++-------
 drivers/staging/r8188eu/hal/usb_halinit.c  |  3 ---
 drivers/staging/r8188eu/include/hal_intf.h |  1 -
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 859ec8d8ad9e..496fb67f2253 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -1199,6 +1199,11 @@ u8 rtw_ps_cmd(struct adapter *padapter)
 	return res;
 }
 
+static bool rtw_is_hi_queue_empty(struct adapter *adapter)
+{
+	return (rtw_read32(adapter, REG_HGQ_INFORMATION) & 0x0000ff00) == 0;
+}
+
 static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
 {
 	int cnt = 0;
@@ -1210,12 +1215,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
 		return;
 
 	if (psta_bmc->sleepq_len == 0) {
-		u8 val = 0;
-
-		/* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!= 0) */
-		/* while ((rtw_read32(padapter, 0x414)&0x0000ff00)!= 0) */
-
-		GetHwReg8188EU(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
+		bool val = rtw_is_hi_queue_empty(padapter);
 
 		while (!val) {
 			msleep(100);
@@ -1225,7 +1225,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
 			if (cnt > 10)
 				break;
 
-			GetHwReg8188EU(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
+			val = rtw_is_hi_queue_empty(padapter);
 		}
 
 		if (cnt <= 10) {
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 8c4bc78681e1..611785caa17f 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1310,9 +1310,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			}
 		}
 		break;
-	case HW_VAR_CHK_HI_QUEUE_EMPTY:
-		*val = ((rtw_read32(Adapter, REG_HGQ_INFORMATION) & 0x0000ff00) == 0) ? true : false;
-		break;
 	default:
 		break;
 	}
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index 065fc7bd78d5..f0a6d697e68b 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -33,7 +33,6 @@ enum hw_variables {
 	HW_VAR_FIFO_CLEARN_UP,
 	HW_VAR_RPT_TIMER_SETTING,
 	HW_VAR_H2C_MEDIA_STATUS_RPT,
-	HW_VAR_CHK_HI_QUEUE_EMPTY,
 };
 
 enum hal_def_variable {
-- 
2.35.1


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

* [PATCH 4/5] staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
                   ` (2 preceding siblings ...)
  2022-03-31 13:05 ` [PATCH 3/5] staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY " Michael Straube
@ 2022-03-31 13:05 ` Michael Straube
  2022-03-31 13:05 ` [PATCH 5/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
  2022-04-01  5:59 ` [PATCH 0/5] " Greg KH
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

Move the functionality of the HW_VAR_FWLPS_RF_ON case in
GetHwReg8188EU() to a static function in rtw_pwrctrl.c and remove the
HW_VAR_FWLPS_RF_ON case from GetHwReg8188EU(). This is part of the
ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_pwrctrl.c | 19 ++++++++++++++++---
 drivers/staging/r8188eu/hal/usb_halinit.c  | 18 ------------------
 drivers/staging/r8188eu/include/hal_intf.h |  1 -
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 7beabf82eb92..0141de7ab08c 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -217,6 +217,21 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
 
 }
 
+static bool lps_rf_on(struct adapter *adapter)
+{
+	/* When we halt NIC, we should check if FW LPS is leave. */
+	if (adapter->pwrctrlpriv.rf_pwrstate == rf_off) {
+		/*  If it is in HW/SW Radio OFF or IPS state, we do not check Fw LPS Leave, */
+		/*  because Fw is unload. */
+		return true;
+	}
+
+	if (rtw_read32(adapter, REG_RCR) & 0x00070000)
+		return false;
+
+	return true;
+}
+
 /*
  * Return:
  *	0:	Leave OK
@@ -226,13 +241,11 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
 s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
 {
 	u32 start_time;
-	u8 bAwake = false;
 	s32 err = 0;
 
 	start_time = jiffies;
 	while (1) {
-		GetHwReg8188EU(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
-		if (bAwake)
+		if (lps_rf_on(padapter))
 			break;
 
 		if (padapter->bSurpriseRemoved) {
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 611785caa17f..37c56690b13a 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1292,24 +1292,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 	case HW_VAR_DM_FLAG:
 		val[0] = podmpriv->SupportAbility;
 		break;
-	case HW_VAR_FWLPS_RF_ON:
-		{
-			/* When we halt NIC, we should check if FW LPS is leave. */
-			if (Adapter->pwrctrlpriv.rf_pwrstate == rf_off) {
-				/*  If it is in HW/SW Radio OFF or IPS state, we do not check Fw LPS Leave, */
-				/*  because Fw is unload. */
-				val[0] = true;
-			} else {
-				u32 valRCR;
-				valRCR = rtw_read32(Adapter, REG_RCR);
-				valRCR &= 0x00070000;
-				if (valRCR)
-					val[0] = false;
-				else
-					val[0] = true;
-			}
-		}
-		break;
 	default:
 		break;
 	}
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index f0a6d697e68b..0033a0aca27b 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -26,7 +26,6 @@ enum hw_variables {
 	HW_VAR_AMPDU_FACTOR,
 	HW_VAR_H2C_FW_PWRMODE,
 	HW_VAR_H2C_FW_JOINBSSRPT,
-	HW_VAR_FWLPS_RF_ON,
 	HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
 	HW_VAR_INITIAL_GAIN,
 	HW_VAR_ANTENNA_DIVERSITY_SELECT,
-- 
2.35.1


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

* [PATCH 5/5] staging: r8188eu: remove GetHwReg8188EU()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
                   ` (3 preceding siblings ...)
  2022-03-31 13:05 ` [PATCH 4/5] staging: r8188eu: remove HW_VAR_FWLPS_RF_ON " Michael Straube
@ 2022-03-31 13:05 ` Michael Straube
  2022-04-01  5:59 ` [PATCH 0/5] " Greg KH
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Straube @ 2022-03-31 13:05 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The only call to GetHwReg8188EU() that is left over from previous
cleanups sets a variable that is immediately overwritten. This call
is useless and we can finally remove the GetHwReg8188EU() function.
This is part of the ongoing effort to get rid of the unwanted hal
layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/hal/usb_halinit.c    | 15 ---------------
 drivers/staging/r8188eu/include/hal_intf.h   |  1 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c |  4 +---
 3 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 37c56690b13a..6b4b0b0c4f53 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1283,21 +1283,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 
 }
 
-void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
-{
-	struct hal_data_8188e *haldata = &Adapter->haldata;
-	struct odm_dm_struct *podmpriv = &haldata->odmpriv;
-
-	switch (variable) {
-	case HW_VAR_DM_FLAG:
-		val[0] = podmpriv->SupportAbility;
-		break;
-	default:
-		break;
-	}
-
-}
-
 /* Query setting of specified variable. */
 void GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue)
 {
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index 0033a0aca27b..9b465001975c 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -66,7 +66,6 @@ void GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariab
 unsigned int rtl8188eu_inirp_init(struct adapter *Adapter);
 
 void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val);
-void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val);
 
 uint rtw_hal_init(struct adapter *padapter);
 uint rtw_hal_deinit(struct adapter *padapter);
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 7df213856d66..6383b399ae40 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -3620,9 +3620,7 @@ static int rtw_dbg_port(struct net_device *dev,
 			break;
 		case 0x06:
 			{
-				u32	ODMFlag;
-				GetHwReg8188EU(padapter, HW_VAR_DM_FLAG, (u8 *)(&ODMFlag));
-				ODMFlag = (u32)(0x0f & arg);
+				u32 ODMFlag = (u32)(0x0f & arg);
 				SetHwReg8188EU(padapter, HW_VAR_DM_FLAG, (u8 *)(&ODMFlag));
 			}
 			break;
-- 
2.35.1


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

* Re: [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU()
  2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
                   ` (4 preceding siblings ...)
  2022-03-31 13:05 ` [PATCH 5/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
@ 2022-04-01  5:59 ` Greg KH
  5 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2022-04-01  5:59 UTC (permalink / raw)
  To: Michael Straube; +Cc: Larry.Finger, phil, linux-staging, linux-kernel

On Thu, Mar 31, 2022 at 03:05:17PM +0200, Michael Straube wrote:
> This series remove the function GetHwReg8188EU(). This is part of the
> ongoing effort to get rid of the unwanted hal layer.
> 
> Tested on x86_64 with Inter-Tech DMG-02.
> 
> Michael Straube (5):
>   staging: r8188eu: rename clear_bacon_valid_bit()
>   staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU()
>   staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from
>     GetHwReg8188EU()
>   staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()
>   staging: r8188eu: remove GetHwReg8188EU()
> 
>  drivers/staging/r8188eu/core/rtw_cmd.c        | 14 +++----
>  drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 14 +++++--
>  drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 19 +++++++--
>  drivers/staging/r8188eu/hal/rtl8188e_cmd.c    |  6 +--
>  drivers/staging/r8188eu/hal/usb_halinit.c     | 40 -------------------
>  drivers/staging/r8188eu/include/hal_intf.h    |  4 --
>  .../staging/r8188eu/include/rtw_mlme_ext.h    |  3 +-
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  4 +-
>  8 files changed, 39 insertions(+), 65 deletions(-)

Nice work in getting rid of that mess!

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

end of thread, other threads:[~2022-04-01  6:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 13:05 [PATCH 0/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
2022-03-31 13:05 ` [PATCH 1/5] staging: r8188eu: rename clear_bacon_valid_bit() Michael Straube
2022-03-31 13:05 ` [PATCH 2/5] staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU() Michael Straube
2022-03-31 13:05 ` [PATCH 3/5] staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY " Michael Straube
2022-03-31 13:05 ` [PATCH 4/5] staging: r8188eu: remove HW_VAR_FWLPS_RF_ON " Michael Straube
2022-03-31 13:05 ` [PATCH 5/5] staging: r8188eu: remove GetHwReg8188EU() Michael Straube
2022-04-01  5:59 ` [PATCH 0/5] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).