[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220130111219.6390-4-straube.linux@gmail.com>
Date: Sun, 30 Jan 2022 12:12:19 +0100
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH 3/3] staging: r8188eu: remove hal_init_macaddr()
hal_init_macaddr() is just a wrapper around SetHwReg8188EU() which
calls hw_var_set_macaddr(). Remove hal_init_macaddr(), remove the
HW_VAR_MAC_ADDR case from SetHwReg8188EU() and call
hw_var_set_macaddr() directly.
Signed-off-by: Michael Straube <straube.linux@...il.com>
---
drivers/staging/r8188eu/hal/hal_com.c | 5 ----
drivers/staging/r8188eu/hal/usb_halinit.c | 27 ++++++++++------------
drivers/staging/r8188eu/include/hal_com.h | 2 --
drivers/staging/r8188eu/include/hal_intf.h | 1 -
4 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/hal_com.c b/drivers/staging/r8188eu/hal/hal_com.c
index f83375a389f8..06f2a9083056 100644
--- a/drivers/staging/r8188eu/hal/hal_com.c
+++ b/drivers/staging/r8188eu/hal/hal_com.c
@@ -287,11 +287,6 @@ bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
return result;
}
-void hal_init_macaddr(struct adapter *adapter)
-{
- SetHwReg8188EU(adapter, HW_VAR_MAC_ADDR, adapter->eeprompriv.mac_addr);
-}
-
/*
* C2H event format:
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index c5282603a42c..90f545f17710 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -567,6 +567,17 @@ static void _InitAntenna_Selection(struct adapter *Adapter)
DBG_88E("%s,Cur_ant:(%x)%s\n", __func__, haldata->CurAntenna, (haldata->CurAntenna == Antenna_A) ? "Antenna_A" : "Antenna_B");
}
+static void hw_var_set_macaddr(struct adapter *Adapter, u8 *val)
+{
+ u8 idx = 0;
+ u32 reg_macid;
+
+ reg_macid = REG_MACID;
+
+ for (idx = 0; idx < 6; idx++)
+ rtw_write8(Adapter, (reg_macid + idx), val[idx]);
+}
+
u32 rtl8188eu_hal_init(struct adapter *Adapter)
{
u8 value8 = 0;
@@ -673,7 +684,7 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
_InitDriverInfoSize(Adapter, DRVINFO_SZ);
_InitInterrupt(Adapter);
- hal_init_macaddr(Adapter);/* set mac_address */
+ hw_var_set_macaddr(Adapter, Adapter->eeprompriv.mac_addr);
_InitNetworkType(Adapter);/* set msr */
_InitWMACSetting(Adapter);
_InitAdaptiveCtrl(Adapter);
@@ -1027,17 +1038,6 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 *val)
}
}
-static void hw_var_set_macaddr(struct adapter *Adapter, u8 *val)
-{
- u8 idx = 0;
- u32 reg_macid;
-
- reg_macid = REG_MACID;
-
- for (idx = 0; idx < 6; idx++)
- rtw_write8(Adapter, (reg_macid + idx), val[idx]);
-}
-
static void hw_var_set_bssid(struct adapter *Adapter, u8 *val)
{
u8 idx = 0;
@@ -1080,9 +1080,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
case HW_VAR_SET_OPMODE:
hw_var_set_opmode(Adapter, val);
break;
- case HW_VAR_MAC_ADDR:
- hw_var_set_macaddr(Adapter, val);
- break;
case HW_VAR_BSSID:
hw_var_set_bssid(Adapter, val);
break;
diff --git a/drivers/staging/r8188eu/include/hal_com.h b/drivers/staging/r8188eu/include/hal_com.h
index 4417054c0f93..56ba356b5371 100644
--- a/drivers/staging/r8188eu/include/hal_com.h
+++ b/drivers/staging/r8188eu/include/hal_com.h
@@ -148,8 +148,6 @@ void HalSetBrateCfg(struct adapter *Adapter, u8 *mBratesOS, u16 *pBrateCfg);
bool Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe);
-void hal_init_macaddr(struct adapter *adapter);
-
s32 c2h_evt_read(struct adapter *adapter, u8 *buf);
#endif /* __HAL_COMMON_H__ */
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index 9b4d1650b4b5..9e66ef68e1e8 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -11,7 +11,6 @@
enum hw_variables {
HW_VAR_MEDIA_STATUS,
HW_VAR_SET_OPMODE,
- HW_VAR_MAC_ADDR,
HW_VAR_BSSID,
HW_VAR_INIT_RTS_RATE,
HW_VAR_BASIC_RATE,
--
2.34.1
Powered by blists - more mailing lists