summaryrefslogtreecommitdiff
path: root/drivers/staging/r8188eu/hal
AgeCommit message (Collapse)Author
2021-10-30staging: r8188eu: hal: remove goto statement and local variableSaurav Girepunje
Remove the goto statement from FillH2CCmd_88E(). In this function goto can be replace by return statement. As on goto label exit, function only return it is not performing any cleanup. Avoiding goto will improve the function readability. After replacing the goto statement local variable ret is also not needed. So remove the ret local variable. Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/YXjXsChOpaTThkxT@Sauravs-Air.domain.name Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: r8188eu: remove last_tx_complete_timeMartin Kaiser
last_tx_complete_time from struct sreset_priv is set / calculated when a packet is sent out. Like other sreset_priv components, it is not read and can be removed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211024180448.20624-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: r8188eu: wifi_error_status is write-onlyMartin Kaiser
wifi_error_status in struct sreset_priv is set in a couple of places, its value is never used. Remove wifi_error_status itself, the defines for the possible values and the sreset_set_wifi_error_status function. Rewrite the if statement in usb_write_port_complete. For purb->status == -EPIPE or -EPROTO, nothing should be done. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211024180448.20624-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25staging: r8188eu: remove unused local variableSaurav Girepunje
Remove unused local variable padapter from rtl8188eu_init_recvbuf(). Function is not using this variable. Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com> Link: https://lore.kernel.org/r/YXWnd5X9+p0X+1EB@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21staging: r8188eu: use helper to set broadcast addressMartin Kaiser
The eth_broadcast_addr helper assigns the broadcast address to an address array. Call this function instead of copying the address bytes manually. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211020195401.12931-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21staging: r8188eu: use helper to check for broadcast addressMartin Kaiser
Use the is_broadcast_ether_addr function to check for a broadcast address. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211020195401.12931-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21staging: r8188eu: odm_rate_adapt Type is constantMartin Kaiser
Type in struct odm_rate_adapt is always DM_Type_ByDriver. Therefore, bUseRAMask is always true. Remove the constant components, unused defines and dead code. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211020195401.12931-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21staging: r8188eu: remove unused dm_priv componentsMartin Kaiser
Remove unused components from struct dm_priv. DMFlag is only written to, but never read. InitDMFlag is assigned to DMFlag and not used elsewhere. DM_Type is also write-only. UndecoratedSmoothedPWDB and UndecoratedSmoothedCCK are not used at all. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211020195401.12931-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: r8188eu: RFType type is always ODM_1T1RMichael Straube
This driver is for 1T1R chips. The field RfType of odm_dm_struct is set to ODM_1T1R and never changed. Remove code that initializes RFType, remove it from odm_dm_struct and remove resulting dead code. Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211019135137.9893-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: r8188eu: remove unused cases from ODM_CmnInfo{Hook,Update}Michael Straube
Remove unused cases from ODM_CmnInfo{Hook,Update}. Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211019135137.9893-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: r8188eu: rename ODM_PhyStatusQuery_92CSeries()Michael Straube
ODM_PhyStatusQuery() is just a wrapper around ODM_PhyStatusQuery_92CSeries(). Rename ODM_PhyStatusQuery_92CSeries to ODM_PhyStatusQuery() and remove the wrapper. Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211019135137.9893-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: r8188eu: BTRxRSSIPercentage is set but never usedMichael Straube
BTRxRSSIPercentage is set but never used, remove it from structure phy_info. Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211019135137.9893-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20staging: r8188eu: remove duplicate structureMichael Straube
The structures odm_phy_status_info and phy_info are redundant. Keep phy_info and remove odm_phy_status_info. Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211019135137.9893-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: PHY_SetRFPathSwitch_8188E is not usedMartin Kaiser
Remove the PHY_SetRFPathSwitch_8188E function which is not used. It was the only caller of phy_setrfpathswitch_8188e, that function can be removed as well. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211016113008.27549-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove two checks that are always falseMartin Kaiser
Commit aefb1fc5c185 ("staging: r8188eu: odm BoardType is never set") clarified that the odm board type is always 0. The CheckCondition functions extract the board type from the hex parameter and stores it in _board. For _board == 0, (_board == cond) && cond != 0x00 is always false. Remove the checks. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211016113008.27549-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: interface type is always usbMartin Kaiser
SupportInterface in struct odm_dm_struct is always ODM_ITRF_USB. Remove the variable and the code to configure the interface. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211016113008.27549-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove empty trigger gpio codeMartin Kaiser
The hal variable HW_VAR_TRIGGER_GPIO_0 and the rtl8192cu_trigger_gpio_0 function are not used. Remove them. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211016113008.27549-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove unused constants and variablesMichael Straube
Remove some unused constants and variables that are left over from previous cleanup patches. Suggested-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211017111705.18989-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()Michael Straube
In ODM_CmnInfoPtrArrayHook() there is only the case ODM_CMNINFO_STA_STATUS and the function is called only with this value. Remove ODM_CmnInfoPtrArrayHook() and fix the three places where it is called. Acked-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: pMacPhyMode is not usedMichael Straube
pMacPhyMode is not used. Remove it from odm_dm_struct and remove related dead code. Acked-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: pBandType is never setMichael Straube
pBandType is never set, it stays at the default value 0. Remove it from odm_dm_struct and remove related unneeded code. Acked-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove ODM_AntselStatistics_88C()Michael Straube
Function ODM_AntselStatistics_88C() is not used, remove it. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove GetPSDData()Michael Straube
Function GetPSDData() is not used, remove it. It is the only user of ConvertTo_dB() and ODM_StallExecution(), remove these two functions and the now unused dB_Invert_Table as well. Acked-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove ODM_SingleDualAntennaDefaultSetting()Michael Straube
Function ODM_SingleDualAntennaDefaultSetting() is not used, remove it. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18staging: r8188eu: remove empty functions from odm.cMichael Straube
Remove empty functions from odm.c. Acked-by: Martin Kaiser <martin@kaiser.cx> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211015163507.9091-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18Merge 5.15-rc6 into staging-nextGreg Kroah-Hartman
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-15staging: r8188eu: remove MSG_88E calls from hal/usb_halinit.cPhillip Potter
Remove both MSG_88E calls from hal/usb_halinit.c, as these calls serve no purpose other than to print the name of the function they are in (_ReadAdapterInfo8188EU) on entry and on exit, with a timing of the function, which is better accomplished by other means. Also remove the jiffies assignment at the start of the function, as it is no longer used. Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20211015000233.842-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: odm SupportPlatform is always ODM_CEMartin Kaiser
Remove the SupportPlatform entry of struct odm_dm_struct and any code that depends on SupportPlatform != ODM_CE. Merge functions in places where there was a "top-level function" that would select a "sub-function" based on SupportPlatform. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: odm BoardType is never setMartin Kaiser
odm BoardType is never set, so it's always 0 (ODM_BOARD_NORMAL). Remove dead code and the BoardType itself. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm_SwAntDivInitMartin Kaiser
This function is empty, it can be removed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: SupportICType is always ODM_RTL8188EMartin Kaiser
SupportICType in struct odm_dm_struct is always ODM_RTL8188E. Remove the component and code that is executed only for other types. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove rtl8188e_deinit_dm_privMartin Kaiser
This function is empty and can be removed. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: simplify rtl8188e_HalDmWatchDogMartin Kaiser
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> Link: https://lore.kernel.org/r/20211011201159.10252-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove dm_CheckStatisticsMartin Kaiser
The dm_CheckStatistics function is empty. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211011201159.10252-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm ext lna infoMartin Kaiser
The ext lna info is never set. Remove it and fix up the one place where it's read. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm ext pa infoMartin Kaiser
The ext pa info is not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm ext trsw infoMartin Kaiser
The ext trsw info is not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm hct test infoMartin Kaiser
The "in hct test" variable is never set, it's always 0. Remove the variable and fix up the one place where it was used. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm wifi test infoMartin Kaiser
The wifi test info is set but not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm dualmac smart concurrent infoMartin Kaiser
The dualmac smart concurrent info is set but not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm cut version infoMartin Kaiser
The cut version info is set but not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: remove odm fab version infoMartin Kaiser
The fab version info is set but not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-13staging: r8188eu: RfOnOffDetect is unusedMartin Kaiser
Remove the RfOnOffDetect function, which is not used. Suggested-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211010175204.24029-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove some dead codeMichael Straube
In this driver SupportICType is ODM_RTL8188E and SupportInterface is ODM_ITRF_USB. Remove an if statement that is never true and remove function odm_DIGbyRSSI_LPS() which is used only in this dead if block. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211008172621.8721-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: rename rtl8188eu_set_hal_ops()Michael Straube
After the removal of struct hal_ops function rtl8188eu_set_hal_ops() only allocates memory for adapt->HalData. Rename the function to rtl8188eu_alloc_haldata() to reflect what it actually does. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove hal_opsMichael Straube
Remove the last pointer hal_deinit from struct hal_ops and call rtl8188eu_hal_deinit() directly. Remove the now empty struct hal_ops. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove hal_init from hal_opsMichael Straube
Remove hal_init from struct hal_ops and call rtl8188eu_hal_init() directly. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove GetHwRegHandler from hal_opsMichael Straube
Remove GetHwRegHandler from struct hal_ops and remove the wrapper rtw_hal_get_hwreg(). Call GetHwReg8188EU() directly instead. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: remove SetHwRegHandler from hal_opsMichael Straube
Remove SetHwRegHandler from struct hal_ops and remove the wrapper rtw_hal_set_hwreg(). Call SetHwReg8188EU() directly instead. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20211007103943.8433-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-10staging: r8188eu: merge two signal scale mapping functionsMartin Kaiser
Keep the odm_SignalScaleMapping function and remove odm_SignalScaleMapping_92CSeries. Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20211006090949.1694-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>