linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 10/12] staging: r8188eu: remove HW_VAR_BCN_FUNC
Date: Sun, 30 Jan 2022 20:03:19 +0100	[thread overview]
Message-ID: <20220130190321.7172-11-straube.linux@gmail.com> (raw)
In-Reply-To: <20220130190321.7172-1-straube.linux@gmail.com>

The HW_VAR_BCN_FUNC case in SetHwReg8188EU() just calls
hw_var_set_bcn_func(). Remove HW_VAR_BCN_FUNC from SetHwReg8188EU(),
remove hw_var_set_bcn_func() and call rtw_write8() directly.

Since hw_var_set_bcn_func() was always called with value 0, we only
need to keep the else arm of the if statement that checks the value.

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

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index e7782d2499a8..73069dddf6b7 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -7644,8 +7644,8 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
 
 	if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) {
 		/* Stop BCN */
-		val8 = 0;
-		SetHwReg8188EU(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8));
+		val8 = rtw_read8(padapter, REG_BCN_CTRL);
+		rtw_write8(padapter, REG_BCN_CTRL, val8 & (~(EN_BCN_FUNCTION | EN_TXBCN_RPT)));
 	}
 
 	/* set MSR to no link state -> infra. mode */
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index d3daefc0e80f..796c898bfb8c 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1049,18 +1049,6 @@ static void hw_var_set_bssid(struct adapter *Adapter, u8 *val)
 		rtw_write8(Adapter, (reg_bssid + idx), val[idx]);
 }
 
-static void hw_var_set_bcn_func(struct adapter *Adapter, u8 *val)
-{
-	u32 bcn_ctrl_reg;
-
-	bcn_ctrl_reg = REG_BCN_CTRL;
-
-	if (*((u8 *)val))
-		rtw_write8(Adapter, bcn_ctrl_reg, (EN_BCN_FUNCTION | EN_TXBCN_RPT));
-	else
-		rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg) & (~(EN_BCN_FUNCTION | EN_TXBCN_RPT)));
-}
-
 void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 {
 	struct hal_data_8188e *haldata = &Adapter->haldata;
@@ -1109,9 +1097,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 			rtw_write8(Adapter, REG_INIRTS_RATE_SEL, RateIndex);
 		}
 		break;
-	case HW_VAR_BCN_FUNC:
-		hw_var_set_bcn_func(Adapter, val);
-		break;
 	case HW_VAR_CORRECT_TSF:
 		{
 			u64	tsf;
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index edb4696218fb..7be5eb2c4a9b 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -13,7 +13,6 @@ enum hw_variables {
 	HW_VAR_BSSID,
 	HW_VAR_INIT_RTS_RATE,
 	HW_VAR_BASIC_RATE,
-	HW_VAR_BCN_FUNC,
 	HW_VAR_CORRECT_TSF,
 	HW_VAR_CHECK_BSSID,
 	HW_VAR_MLME_DISCONNECT,
-- 
2.34.1


  parent reply	other threads:[~2022-01-30 19:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 19:03 [PATCH 00/12] staging: r8188eu: remove some HW variables Michael Straube
2022-01-30 19:03 ` [PATCH 01/12] staging: r8188eu: remove HW_VAR_BEACON_INTERVAL Michael Straube
2022-01-30 19:03 ` [PATCH 02/12] staging: r8188eu: remove HW_VAR_SEC_CFG Michael Straube
2022-01-30 19:03 ` [PATCH 03/12] staging: r8188eu: remove HW_VAR_CAM_INVALID_ALL Michael Straube
2022-01-30 19:03 ` [PATCH 04/12] staging: r8188eu: remove HW_VAR_AC_PARAM_VO Michael Straube
2022-01-30 19:03 ` [PATCH 05/12] staging: r8188eu: remove HW_VAR_AC_PARAM_VI Michael Straube
2022-01-30 19:03 ` [PATCH 06/12] staging: r8188eu: remove HW_VAR_AC_PARAM_BK Michael Straube
2022-01-30 19:03 ` [PATCH 07/12] staging: r8188eu: remove HW_VAR_MEDIA_STATUS Michael Straube
2022-01-30 19:03 ` [PATCH 08/12] staging: r8188eu: merge Set_NETYPE0_MSR() and Set_MSR() Michael Straube
2022-01-30 19:03 ` [PATCH 09/12] staging: r8188eu: remove HW_VAR_CAM_WRITE Michael Straube
2022-01-30 19:03 ` Michael Straube [this message]
2022-01-30 19:03 ` [PATCH 11/12] staging: r8188eu: remove HW_VAR_CHECK_BSSID Michael Straube
2022-01-30 19:03 ` [PATCH 12/12] staging: r8188eu: remove HW_VAR_CAM_EMPTY_ENTRY Michael Straube

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=20220130190321.7172-11-straube.linux@gmail.com \
    --to=straube.linux@gmail.com \
    --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 \
    /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;
as well as URLs for NNTP newsgroup(s).