staging: r8188eu: remove two wrappers
cover staging: r8188eu: remove two wrappers
This set removes the wrapper functions c2h_evt_clear() and hal_init_macaddr().
Tested on x86_64 with Inter-Tech DMG-02.
Michael Straube (3):
staging: r8188eu: remove c2h_evt_clear()
staging: r8188eu: remove unused parameter from hw_var_set_*
staging: r8188eu: remove hal_init_macaddr()
drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- drivers/staging/r8188eu/hal/hal_com.c | 12 +------ drivers/staging/r8188eu/hal/usb_halinit.c | 39 ++++++++++------------ drivers/staging/r8188eu/include/hal_com.h | 3 -- drivers/staging/r8188eu/include/hal_intf.h | 1 - 5 files changed, 20 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 staging: r8188eu: remove c2h_evt_clear()
Function c2h_evt_clear() is just a wrapper around rtw_write8(). Remove c2h_evt_clear() and call rtw_write8() directly.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- drivers/staging/r8188eu/hal/hal_com.c | 7 +------ drivers/staging/r8188eu/include/hal_com.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/core/rtw_cmd.c +1 -1
@@ -1331,7 +1331,7 @@ static void c2h_wk_callback(struct work_struct *work)while (!rtw_cbuf_empty (evtpriv->c2h_queue)) {if ((c2h_evt = (struct c2h_evt_hdr *)rtw_cbuf_pop (evtpriv->c2h_queue)) !=NULL ) {/* This C2H event is read, clear it */ -c2h_evt_clear (adapter); +rtw_write8 (adapter,REG_C2HEVT_CLEAR ,C2H_EVT_HOST_CLOSE ); }else { c2h_evt =kmalloc (16 ,GFP_KERNEL );if (c2h_evt) {
drivers/staging/r8188eu/hal/hal_com.c +1 -6
@@ -298,11 +298,6 @@ void hal_init_macaddr(struct adapter *adapter)* BITS [127:120] [119:16] [15:8] [7:4] [3:0] */ -void c2h_evt_clear (struct adapter *adapter) -{ -rtw_write8 (adapter,REG_C2HEVT_CLEAR ,C2H_EVT_HOST_CLOSE ); -} -s32 c2h_evt_read (struct adapter *adapter,u8 *buf) {s32 ret = _FAIL;
@@ -340,7 +335,7 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)* If this field isn't clear, the FW won't update the next * command message. */ -c2h_evt_clear (adapter); +rtw_write8 (adapter,REG_C2HEVT_CLEAR ,C2H_EVT_HOST_CLOSE ); exit:return ret; }
drivers/staging/r8188eu/include/hal_com.h +0 -1
@@ -150,7 +150,6 @@ bool Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe);void hal_init_macaddr (struct adapter *adapter); -void c2h_evt_clear (struct adapter *adapter);s32 c2h_evt_read (struct adapter *adapter,u8 *buf);#endif /* __HAL_COMMON_H__ */
Signature · 1 line
2.34.1
PATCH 2/3 staging: r8188eu: remove unused parameter from hw_var_set_*
In reply to Michael StraubeRemove the unused parameter 'variable' from hw_var_set_* functions.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +8 -8
@@ -970,7 +970,7 @@ static void StopTxBeacon(struct adapter *adapt)/* todo: CheckFwRsvdPageContent(Adapter); 2010.06.23. Added by tynli. */ } -static void hw_var_set_opmode (struct adapter *Adapter,u8 variable,u8 *val) +static void hw_var_set_opmode (struct adapter *Adapter,u8 *val) {u8 val8;u8 mode = *((u8 *)val);
@@ -1027,7 +1027,7 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8 *val) } } -static void hw_var_set_macaddr (struct adapter *Adapter,u8 variable,u8 *val) +static void hw_var_set_macaddr (struct adapter *Adapter,u8 *val) {u8 idx =0 ;u32 reg_macid;
@@ -1038,7 +1038,7 @@ static void hw_var_set_macaddr(struct adapter *Adapter, u8 variable, u8 *val)rtw_write8 (Adapter, (reg_macid + idx), val[idx]); } -static void hw_var_set_bssid (struct adapter *Adapter,u8 variable,u8 *val) +static void hw_var_set_bssid (struct adapter *Adapter,u8 *val) {u8 idx =0 ;u32 reg_bssid;
@@ -1049,7 +1049,7 @@ static void hw_var_set_bssid(struct adapter *Adapter, u8 variable, u8 *val)rtw_write8 (Adapter, (reg_bssid + idx), val[idx]); } -static void hw_var_set_bcn_func (struct adapter *Adapter,u8 variable,u8 *val) +static void hw_var_set_bcn_func (struct adapter *Adapter,u8 *val) {u32 bcn_ctrl_reg;
@@ -1078,13 +1078,13 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val) }break ;case HW_VAR_SET_OPMODE : -hw_var_set_opmode (Adapter, variable, val); +hw_var_set_opmode (Adapter, val);break ;case HW_VAR_MAC_ADDR : -hw_var_set_macaddr (Adapter, variable, val); +hw_var_set_macaddr (Adapter, val);break ;case HW_VAR_BSSID : -hw_var_set_bssid (Adapter, variable, val); +hw_var_set_bssid (Adapter, val);break ;case HW_VAR_BASIC_RATE : {
@@ -1122,7 +1122,7 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val) }break ;case HW_VAR_BCN_FUNC : -hw_var_set_bcn_func (Adapter, variable, val); +hw_var_set_bcn_func (Adapter, val);break ;case HW_VAR_CORRECT_TSF : {
Signature · 1 line
2.34.1
PATCH 3/3 staging: r8188eu: remove hal_init_macaddr()
In reply to Michael Straubehal_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.
--- 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(-)
drivers/staging/r8188eu/hal/hal_com.c +0 -5
@@ -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
drivers/staging/r8188eu/hal/usb_halinit.c +12 -15
@@ -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 ;
drivers/staging/r8188eu/include/hal_com.h +0 -2
@@ -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__ */
drivers/staging/r8188eu/include/hal_intf.h +0 -1
@@ -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 ,
Signature · 1 line
2.34.1