diff options
author | Michael Straube <straube.linux@gmail.com> | 2022-04-08 14:46:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-08 15:48:30 +0200 |
commit | 6b58692032c1d9ee9694e446929ebf9f8f2e0f6e (patch) | |
tree | 316fd1ace70a9f3425e3bc4bd3ad0d557eabed77 | |
parent | f90613bb2cb6496874ea4aad5561727550e84ce3 (diff) | |
download | linux-6b58692032c1d9ee9694e446929ebf9f8f2e0f6e.tar.bz2 |
staging: r8188eu: remove SetHalDefVar8188EUsb()
In SetHalDefVar8188EUsb() there is only the case HAL_DEF_DBG_DM_FUNC.
Move its functionality to a new static function in ioctl_linux.c and
remove SetHalDefVar8188EUsb(). This is part of the ongoing effort to
get rid of the unwanted hal layer.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220408124615.3687-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/r8188eu/hal/usb_halinit.c | 29 | ||||
-rw-r--r-- | drivers/staging/r8188eu/include/hal_intf.h | 6 | ||||
-rw-r--r-- | drivers/staging/r8188eu/os_dep/ioctl_linux.c | 43 |
3 files changed, 34 insertions, 44 deletions
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index 285282b5fe35..5cbb982505a8 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -1194,35 +1194,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val) } -/* Change default setting of specified variable. */ -void SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue) -{ - struct hal_data_8188e *haldata = &Adapter->haldata; - - switch (eVariable) { - case HAL_DEF_DBG_DM_FUNC: - { - u8 dm_func = *((u8 *)pValue); - struct odm_dm_struct *podmpriv = &haldata->odmpriv; - - if (dm_func == 0) { /* disable all dynamic func */ - podmpriv->SupportAbility = DYNAMIC_FUNC_DISABLE; - } else if (dm_func == 1) {/* disable DIG */ - podmpriv->SupportAbility &= (~DYNAMIC_BB_DIG); - } else if (dm_func == 6) {/* turn on all dynamic func */ - if (!(podmpriv->SupportAbility & DYNAMIC_BB_DIG)) { - struct rtw_dig *pDigTable = &podmpriv->DM_DigTable; - pDigTable->CurIGValue = rtw_read8(Adapter, 0xc50); - } - podmpriv->SupportAbility = DYNAMIC_ALL_FUNC_ENABLE; - } - } - break; - default: - break; - } -} - void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level) { u8 init_rate = 0; diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h index ab6cab1281ab..532d02bba9f8 100644 --- a/drivers/staging/r8188eu/include/hal_intf.h +++ b/drivers/staging/r8188eu/include/hal_intf.h @@ -27,10 +27,6 @@ enum hw_variables { HW_VAR_H2C_MEDIA_STATUS_RPT, }; -enum hal_def_variable { - HAL_DEF_DBG_DM_FUNC,/* for dbg */ -}; - typedef s32 (*c2h_id_filter)(u8 id); #define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse) @@ -51,8 +47,6 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level); int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt); -void SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue); - unsigned int rtl8188eu_inirp_init(struct adapter *Adapter); void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val); diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index b6851628e4d2..6b655d65eafb 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -3389,6 +3389,34 @@ static void rf_reg_dump(struct adapter *padapter) } } +static void rtw_set_dynamic_functions(struct adapter *adapter, u8 dm_func) +{ + struct hal_data_8188e *haldata = &adapter->haldata; + struct odm_dm_struct *odmpriv = &haldata->odmpriv; + + switch (dm_func) { + case 0: + /* disable all dynamic func */ + odmpriv->SupportAbility = DYNAMIC_FUNC_DISABLE; + break; + case 1: + /* disable DIG */ + odmpriv->SupportAbility &= (~DYNAMIC_BB_DIG); + break; + case 6: + /* turn on all dynamic func */ + if (!(odmpriv->SupportAbility & DYNAMIC_BB_DIG)) { + struct rtw_dig *digtable = &odmpriv->DM_DigTable; + + digtable->CurIGValue = rtw_read8(adapter, 0xc50); + } + odmpriv->SupportAbility = DYNAMIC_ALL_FUNC_ENABLE; + break; + default: + break; + } +} + static int rtw_dbg_port(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -3674,15 +3702,12 @@ static int rtw_dbg_port(struct net_device *dev, rf_reg_dump(padapter); break; case 0xee:/* turn on/off dynamic funcs */ - { - if (extra_arg != 0xf) { - /* extra_arg = 0 - disable all dynamic func - extra_arg = 1 - disable DIG - extra_arg = 2 - disable tx power tracking - extra_arg = 3 - turn on all dynamic func - */ - SetHalDefVar8188EUsb(padapter, HAL_DEF_DBG_DM_FUNC, &extra_arg); - } + if (extra_arg != 0xf) { + /* extra_arg = 0 - disable all dynamic func + * extra_arg = 1 - disable DIG + * extra_arg = 6 - turn on all dynamic func + */ + rtw_set_dynamic_functions(padapter, extra_arg); } break; case 0xfd: |