mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 2/8] staging: r8188eu: simplify rtl8188e_HalDmWatchDog
Date: Mon, 11 Oct 2021 22:11:53 +0200	[thread overview]
Message-ID: <20211011201159.10252-3-martin@kaiser.cx> (raw)
In-Reply-To: <20211011201159.10252-1-martin@kaiser.cx>

Now that we don't call dm_CheckStatistics any more, we don't need
fw_cur_in_ps and fw_ps_awake.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_dm.c | 43 +++++++----------------
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_dm.c b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
index af8b2752b664..90b30606fe13 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_dm.c
@@ -113,42 +113,25 @@ void rtl8188e_InitHalDm(struct adapter *Adapter)
 
 void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
 {
-	bool fw_cur_in_ps = false;
-	bool fw_ps_awake = true;
-	u8 hw_init_completed = false;
+	u8 hw_init_completed = Adapter->hw_init_completed;
 	struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
-
-
-	hw_init_completed = Adapter->hw_init_completed;
+	struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
+	u8 bLinked = false;
 
 	if (!hw_init_completed)
 		return;
 
-	fw_cur_in_ps = Adapter->pwrctrlpriv.bFwCurrentInPSMode;
-	GetHwReg8188EU(Adapter, HW_VAR_FWLPS_RF_ON, (u8 *)(&fw_ps_awake));
-
-	/*  Fw is under p2p powersaving mode, driver should stop dynamic mechanism. */
-	/*  modifed by thomas. 2011.06.11. */
-	if (Adapter->wdinfo.p2p_ps_mode)
-		fw_ps_awake = false;
-
-	/* ODM */
-	if (hw_init_completed) {
-		struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
-		u8 bLinked = false;
-
-		if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) ||
-		    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE))) {
-			if (Adapter->stapriv.asoc_sta_count > 2)
-				bLinked = true;
-		} else {/* Station mode */
-			if (check_fwstate(pmlmepriv, _FW_LINKED))
-				bLinked = true;
-		}
-
-		ODM_CmnInfoUpdate(&hal_data->odmpriv, ODM_CMNINFO_LINK, bLinked);
-		ODM_DMWatchdog(&hal_data->odmpriv);
+	if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) ||
+	    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE))) {
+		if (Adapter->stapriv.asoc_sta_count > 2)
+			bLinked = true;
+	} else {/* Station mode */
+		if (check_fwstate(pmlmepriv, _FW_LINKED))
+			bLinked = true;
 	}
+
+	ODM_CmnInfoUpdate(&hal_data->odmpriv, ODM_CMNINFO_LINK, bLinked);
+	ODM_DMWatchdog(&hal_data->odmpriv);
 }
 
 void rtl8188e_init_dm_priv(struct adapter *Adapter)
-- 
2.20.1


  parent reply	other threads:[~2021-10-11 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 20:11 [PATCH 0/8] staging: r8188eu: more odm cleanup Martin Kaiser
2021-10-11 20:11 ` [PATCH 1/8] staging: r8188eu: remove dm_CheckStatistics Martin Kaiser
2021-10-11 20:11 ` Martin Kaiser [this message]
2021-10-11 20:11 ` [PATCH 3/8] staging: r8188eu: remove rtl8188e_deinit_dm_priv Martin Kaiser
2021-10-11 20:11 ` [PATCH 4/8] staging: r8188eu: remove LastMinUndecoratedPWDBForDM Martin Kaiser
2021-10-11 20:11 ` [PATCH 5/8] staging: r8188eu: SupportICType is always ODM_RTL8188E Martin Kaiser
2021-10-11 20:11 ` [PATCH 6/8] staging: r8188eu: remove odm_SwAntDivInit Martin Kaiser
2021-10-11 20:11 ` [PATCH 7/8] staging: r8188eu: odm BoardType is never set Martin Kaiser
2021-10-11 20:11 ` [PATCH 8/8] staging: r8188eu: odm SupportPlatform is always ODM_CE Martin Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011201159.10252-3-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®