platform/kernel/linux-rpi.git
2 years agostaging: r8188eu: os_dep: simplifiy the rtw_resume function
Saurav Girepunje [Fri, 10 Sep 2021 09:12:56 +0000 (14:42 +0530)]
staging: r8188eu: os_dep: simplifiy the rtw_resume function

Remove unused variable ret and pwrpriv.
Remove the condition with no effect (if == else) in usb_intf.c
file.
Remove rtw_resume_process() and move whole thing to rtw_resume().
Remove the padapter NULL check which couldn't NULL in rtw_resume function.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTshmPcZr/aVclHK@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove the remaining usb endpoint functions
Martin Kaiser [Fri, 10 Sep 2021 20:21:51 +0000 (22:21 +0200)]
staging: r8188eu: remove the remaining usb endpoint functions

Remove the last bunch of unused RT_usb_endpoint_... functions.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210910202151.4007-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function RT_usb_endpoint_num
Martin Kaiser [Fri, 10 Sep 2021 20:21:50 +0000 (22:21 +0200)]
staging: r8188eu: remove unused function RT_usb_endpoint_num

RT_usb_endpoint_num is unused. Remove this function.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210910202151.4007-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in
Martin Kaiser [Fri, 10 Sep 2021 20:21:49 +0000 (22:21 +0200)]
staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in

Remove the RT_usb_endpoint_is_bulk_in function which is not used.

RT_usb_endpoint_dir_in is no longer used either and can also be removed.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210910202151.4007-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function usb_endpoint_is_int
Martin Kaiser [Fri, 10 Sep 2021 20:21:48 +0000 (22:21 +0200)]
staging: r8188eu: remove unused function usb_endpoint_is_int

The usb_endpoint_is_int is not used and can be removed.

RT_usb_endpoint_xfer_int was used only by usb_endpoint_is_int. Remove this
function as well.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210910202151.4007-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: core: remove unused variable Adapter
Saurav Girepunje [Fri, 10 Sep 2021 18:20:26 +0000 (23:50 +0530)]
staging: r8188eu: core: remove unused variable Adapter

Remove unused variable Adapter from rtw_IOL_cmd_buf_dump function.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTuh6iDyPMUC3wha@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: core: remove unused variable padapter
Saurav Girepunje [Fri, 10 Sep 2021 18:31:25 +0000 (00:01 +0530)]
staging: r8188eu: core: remove unused variable padapter

Remove unused variable padapter from mp_init_xmit_attrib().

Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTukfSY0CxowGXlQ@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove write-only variable bLCKInProgress
Martin Kaiser [Sat, 11 Sep 2021 13:23:38 +0000 (15:23 +0200)]
staging: r8188eu: remove write-only variable bLCKInProgress

bLCKInProgress in struct odm_rf_cal is never read. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210911132338.1415-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_IOL_append_LLT_cmd()
Michael Straube [Fri, 10 Sep 2021 11:11:10 +0000 (13:11 +0200)]
staging: r8188eu: remove rtw_IOL_append_LLT_cmd()

Function rtw_IOL_append_LLT_cmd() just returns _SUCCESS and the only
caller does not use the return value. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210910111110.4628-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove wrapper rtw_IOL_exec_cmds_sync()
Michael Straube [Fri, 10 Sep 2021 11:11:09 +0000 (13:11 +0200)]
staging: r8188eu: remove wrapper rtw_IOL_exec_cmds_sync()

Function rtw_IOL_exec_cmds_sync() is just a wrapper around
rtl8188e_IOL_exec_cmds_sync(). Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210910111110.4628-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove IOL_exec_cmds_sync() from struct hal_ops
Michael Straube [Fri, 10 Sep 2021 11:11:08 +0000 (13:11 +0200)]
staging: r8188eu: remove IOL_exec_cmds_sync() from struct hal_ops

Remove IOL_exec_cmds_sync() from struct hal_ops and its wrapper
rtw_hal_iol_cmd(). Call rtl8188e_IOL_exec_cmds_sync() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210910111110.4628-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused macros from ioctl_linux.c
Michael Straube [Thu, 9 Sep 2021 21:19:22 +0000 (23:19 +0200)]
staging: rtl8723bs: remove unused macros from ioctl_linux.c

These macros are not used in the driver, remove them.
Found with GCC -Wunused-macros.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210909211922.24872-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macro ROUND
Michael Straube [Thu, 9 Sep 2021 20:21:30 +0000 (22:21 +0200)]
staging: r8188eu: remove unused macro ROUND

The macro ROUND is not used in the driver, remove it.
Found with GCC -Wunused-macros.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210909202130.28508-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macro READ_AND_CONFIG_TC
Michael Straube [Thu, 9 Sep 2021 11:05:17 +0000 (13:05 +0200)]
staging: r8188eu: remove unused macro READ_AND_CONFIG_TC

The macro READ_AND_CONFIG_TC is not used, remove it.
Found with GCC -Wunused-macros.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210909110517.15243-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused ODM_MacStatusQuery()
Michael Straube [Wed, 8 Sep 2021 23:09:53 +0000 (01:09 +0200)]
staging: r8188eu: remove unused ODM_MacStatusQuery()

Function ODM_MacStatusQuery() is unused and empty, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908230953.16931-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused odm_Init_RSSIForDM()
Michael Straube [Wed, 8 Sep 2021 23:09:52 +0000 (01:09 +0200)]
staging: r8188eu: remove unused odm_Init_RSSIForDM()

Function odm_Init_RSSIForDM() is unused and empty, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908230953.16931-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused rtl8192c_PHY_GetHWRegOriginalValue()
Michael Straube [Wed, 8 Sep 2021 22:39:03 +0000 (00:39 +0200)]
staging: r8188eu: remove unused rtl8192c_PHY_GetHWRegOriginalValue()

Function rtl8192c_PHY_GetHWRegOriginalValue() is unused, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908223903.10516-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused PHY_UpdateTxPowerDbm8188E()
Michael Straube [Wed, 8 Sep 2021 22:39:02 +0000 (00:39 +0200)]
staging: r8188eu: remove unused PHY_UpdateTxPowerDbm8188E()

Function PHY_UpdateTxPowerDbm8188E() is unused and it is the only user
of function phy_DbmToTxPwrIdx(), remove both.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908223903.10516-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused PHY_ScanOperationBackup8188E()
Michael Straube [Wed, 8 Sep 2021 22:39:01 +0000 (00:39 +0200)]
staging: r8188eu: remove unused PHY_ScanOperationBackup8188E()

Function PHY_ScanOperationBackup8188E() is unused and empty, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908223903.10516-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused PHY_GetTxPowerLevel8188E()
Michael Straube [Wed, 8 Sep 2021 22:39:00 +0000 (00:39 +0200)]
staging: r8188eu: remove unused PHY_GetTxPowerLevel8188E()

Function PHY_GetTxPowerLevel8188E() is unused and it is the only user
of function phy_TxPwrIdxToDbm(), remove both.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210908223903.10516-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging/mt7621-dma: Format lines in "hsdma-mt7621.c" ending with an open parenthesis
Krish Jain [Wed, 8 Sep 2021 20:59:03 +0000 (22:59 +0200)]
staging/mt7621-dma: Format lines in "hsdma-mt7621.c" ending with an open parenthesis

This patch fixes the format of the code. It properly formats lines that
should not end with a '(' as suggested by checkpath.pl.

Signed-off-by: Krish Jain <krishjain02939@gmail.com>
Link: https://lore.kernel.org/r/20210908205903.GA108157@panther
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove conditionals CONFIG_88EU_{AP_MODE,P2P}
Larry Finger [Thu, 9 Sep 2021 16:58:09 +0000 (11:58 -0500)]
staging: r8188eu: Remove conditionals CONFIG_88EU_{AP_MODE,P2P}

These rwo conditional compile symbols are explicitely defined.
As a result, their included code is always compiled. They could be
converted to Kconfig symbols; however, my experience with this driver
in a GitHub repo is that many users of the device have it built into
a SOC or SBC that they wish to use as an access point. As a result,
CONFIG_88EU_APMODE would need to be selected. Thuse it should be built in.

There have also been many users the wish to establish peer-to-peer
networks with this device. For this reason, I am also proposing that
CONFIG_88EU_P2P be automatically included.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210909165809.12634-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: this endless loop is executed only once
Martin Kaiser [Wed, 8 Sep 2021 08:57:47 +0000 (10:57 +0200)]
staging: r8188eu: this endless loop is executed only once

There's a funny "loop" in rtl8188eu_xmitframe_complete. It looks like

do {
  ... some commands...
  break;
} while (1);

Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210908085747.32254-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused define
Martin Kaiser [Wed, 8 Sep 2021 08:57:46 +0000 (10:57 +0200)]
staging: r8188eu: remove unused define

The RTW_SUSPEND_LOCK_NAME define is not used. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210908085747.32254-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function prototype
Martin Kaiser [Wed, 8 Sep 2021 08:57:45 +0000 (10:57 +0200)]
staging: r8188eu: remove unused function prototype

There's no rtw_write_scsi function in this driver. Remove its prototype.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210908085747.32254-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function Hal_ProSetCrystalCap()
Michael Straube [Tue, 7 Sep 2021 21:09:24 +0000 (23:09 +0200)]
staging: r8188eu: remove unused function Hal_ProSetCrystalCap()

Remove unused function Hal_ProSetCrystalCap().

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210907210924.22287-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove redundant variable hoffset
Colin Ian King [Tue, 7 Sep 2021 08:53:02 +0000 (09:53 +0100)]
staging: r8188eu: remove redundant variable hoffset

Variable hoffset is being assigned values but it is never being
used. The variable is redundant and can be removed.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210907085302.10672-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: axis-fifo: convert to use miscdevice
Greg Kroah-Hartman [Tue, 7 Sep 2021 11:40:44 +0000 (13:40 +0200)]
staging: axis-fifo: convert to use miscdevice

Using a struct class, a cdev, and another device just for a single minor
device is total overkill.  Just use a dynamic misc device instead,
saving lots of logic and memory.

Cc: Jacob Feder <jacobsfeder@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/YTdPvBgKW6cKYrvb@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: convert to use a miscdevice
Greg Kroah-Hartman [Tue, 7 Sep 2021 11:50:45 +0000 (13:50 +0200)]
staging: vchiq: convert to use a miscdevice

Using a struct class, a cdev, and another device just for a single minor
device is total overkill.  Just use a dynamic misc device instead,
saving lots of logic and memory.

Cc: Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ojaswin Mujoo <ojaswin98@gmail.com>
Cc: Phil Elwell <phil@raspberrypi.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20210907115045.2206083-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove UpdateHalRAMask8188EUsb from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:23 +0000 (21:02 +0200)]
staging: r8188eu: remove UpdateHalRAMask8188EUsb from hal_ops

Remove UpdateHalRAMask8188EUsb from hal_ops and call
UpdateHalRAMask8188EUsb() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-41-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove SetBeaconRelatedRegistersHandler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:22 +0000 (21:02 +0200)]
staging: r8188eu: remove SetBeaconRelatedRegistersHandler from hal_ops

Remove SetBeaconRelatedRegistersHandler from hal_ops and remove its
wrapper rtw_hal_bcn_related_reg_setting().
Call SetBeaconRelatedRegisters8188EUsb() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-40-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function rtl8188e_clone_haldata()
Michael Straube [Mon, 6 Sep 2021 19:02:21 +0000 (21:02 +0200)]
staging: r8188eu: remove unused function rtl8188e_clone_haldata()

Remove unused function rtl8188e_clone_haldata().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-39-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove free_hal_data from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:20 +0000 (21:02 +0200)]
staging: r8188eu: remove free_hal_data from hal_ops

Remove free_hal_data from hal_ops and remove its wrapper
rtw_hal_free_data(). Call rtl8188e_free_hal_data() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-38-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove hal_notch_filter from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:19 +0000 (21:02 +0200)]
staging: r8188eu: remove hal_notch_filter from hal_ops

Remove hal_notch_filter from hal_ops and remove its wrapper
rtw_hal_notch_filter(). Call hal_notch_filter_8188e() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-37-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty function rtl8188e_stop_thread()
Michael Straube [Mon, 6 Sep 2021 19:02:18 +0000 (21:02 +0200)]
staging: r8188eu: remove empty function rtl8188e_stop_thread()

Remove empty function rtl8188e_stop_thread() and related code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-36-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty function rtl8188e_start_thread()
Michael Straube [Mon, 6 Sep 2021 19:02:17 +0000 (21:02 +0200)]
staging: r8188eu: remove empty function rtl8188e_start_thread()

Remove empty function rtl8188e_start_thread() and related code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-35-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove AntDivCompareHandler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:16 +0000 (21:02 +0200)]
staging: r8188eu: remove AntDivCompareHandler from hal_ops

Remove AntDivCompareHandler from hal_ops and remove its wrapper
rtw_hal_antdiv_rssi_compared(). Call AntDivCompare8188E() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-34-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove AntDivBeforeLinkHandler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:15 +0000 (21:02 +0200)]
staging: r8188eu: remove AntDivBeforeLinkHandler from hal_ops

Remove AntDivBeforeLinkHandler from hal_ops and remove its wrapper
rtw_hal_antdiv_before_linked(). Call AntDivBeforeLink8188E() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-33-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove useless assignment
Michael Straube [Mon, 6 Sep 2021 19:02:14 +0000 (21:02 +0200)]
staging: r8188eu: remove useless assignment

The local variable badworden is set to a new value immediately after
an assignment. Remove the useless assignment and initialization.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-32-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Efuse_WordEnableDataWrite from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:13 +0000 (21:02 +0200)]
staging: r8188eu: remove Efuse_WordEnableDataWrite from hal_ops

Remove Efuse_WordEnableDataWrite from hal_ops and remove its wrapper
Efuse_WordEnableDataWrite(). Call rtl8188e_Efuse_WordEnableDataWrite()
directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-31-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Efuse_PgPacketWrite from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:12 +0000 (21:02 +0200)]
staging: r8188eu: remove Efuse_PgPacketWrite from hal_ops

Remove Efuse_PgPacketWrite from hal_ops and remove its wrapper
Efuse_PgPacketWrite(). Call rtl8188e_Efuse_PgPacketWrite() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-30-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Efuse_PgPacketRead from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:11 +0000 (21:02 +0200)]
staging: r8188eu: remove Efuse_PgPacketRead from hal_ops

Remove Efuse_PgPacketRead from hal_ops and remove its wrapper
Efuse_PgPacketRead(). Call rtl8188e_Efuse_PgPacketRead() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-29-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty comments
Michael Straube [Mon, 6 Sep 2021 19:02:10 +0000 (21:02 +0200)]
staging: r8188eu: remove empty comments

Remove empty comments.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-28-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove EfuseGetCurrentSize from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:09 +0000 (21:02 +0200)]
staging: r8188eu: remove EfuseGetCurrentSize from hal_ops

Remove EfuseGetCurrentSize from hal_ops and remove its wrapper
Efuse_GetCurrentSize(). Call rtl8188e_EfuseGetCurrentSize() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-27-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove EFUSEGetEfuseDefinition from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:08 +0000 (21:02 +0200)]
staging: r8188eu: remove EFUSEGetEfuseDefinition from hal_ops

Remove EFUSEGetEfuseDefinition from hal_ops and remove its wrapper
EFUSE_GetEfuseDefinition(). Call rtl8188e_EFUSE_GetEfuseDefinition()
directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-26-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove ReadEFuse from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:07 +0000 (21:02 +0200)]
staging: r8188eu: remove ReadEFuse from hal_ops

Remove ReadEFuse from hal_ops and remove its wrapper
efuse_ReadEFuse(). Call rtl8188e_ReadEFuse() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-25-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove wrapper Efuse_PowerSwitch()
Michael Straube [Mon, 6 Sep 2021 19:02:06 +0000 (21:02 +0200)]
staging: r8188eu: remove wrapper Efuse_PowerSwitch()

Remove wrapper Efuse_PowerSwitch() and call rtl8188e_EfusePowerSwitch()
directly.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-24-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename hal_EfusePowerSwitch_RTL8188E()
Michael Straube [Mon, 6 Sep 2021 19:02:05 +0000 (21:02 +0200)]
staging: r8188eu: rename hal_EfusePowerSwitch_RTL8188E()

Rename hal_EfusePowerSwitch_RTL8188E() to get rid of a wrapper.

hal_EfusePowerSwitch_RTL8188E() -> rtl8188e_EfusePowerSwitch().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-23-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove EfusePowerSwitch from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:04 +0000 (21:02 +0200)]
staging: r8188eu: remove EfusePowerSwitch from hal_ops

Remove EfusePowerSwitch from hal_ops and call
rtl8188e_EfusePowerSwitch() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-22-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove sreset_get_wifi_status from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:03 +0000 (21:02 +0200)]
staging: r8188eu: remove sreset_get_wifi_status from hal_ops

Remove sreset_get_wifi_status from hal_ops and remove its wrapper
rtw_hal_sreset_get_wifi_status(). Call sreset_get_wifi_status()
directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-21-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove sreset_linked_status_check from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:02 +0000 (21:02 +0200)]
staging: r8188eu: remove sreset_linked_status_check from hal_ops

Remove sreset_linked_status_check from hal_ops and remove its wrapper
rtw_hal_sreset_linked_status_check().
Call rtl8188e_sreset_linked_status_check() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-20-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove sreset_xmit_status_check from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:01 +0000 (21:02 +0200)]
staging: r8188eu: remove sreset_xmit_status_check from hal_ops

Remove sreset_xmit_status_check from hal_ops and remove its wrapper
rtw_hal_sreset_xmit_status_check().
Call rtl8188e_sreset_xmit_status_check() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-19-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove silentreset from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:02:00 +0000 (21:02 +0200)]
staging: r8188eu: remove silentreset from hal_ops

Remove silentreset from hal_ops and remove its wrapper
rtw_hal_sreset_reset().
Call rtl8188e_silentreset_for_specific_platform() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove sreset_reset_value from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:59 +0000 (21:01 +0200)]
staging: r8188eu: remove sreset_reset_value from hal_ops

Remove sreset_reset_value from hal_ops and remove its wrapper
rtw_hal_sreset_reset_value(). Call sreset_reset_value() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove sreset_init_value from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:58 +0000 (21:01 +0200)]
staging: r8188eu: remove sreset_init_value from hal_ops

Remove sreset_init_value from hal_ops and remove its wrapper
rtw_hal_sreset_init(). Call sreset_init_value() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove hal_power_on from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:57 +0000 (21:01 +0200)]
staging: r8188eu: remove hal_power_on from hal_ops

Remove hal_power_on from hal_ops and remove its wrapper
rtw_hal_power_on(). Call rtl8188eu_InitPowerOn() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Add_RateATid from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:56 +0000 (21:01 +0200)]
staging: r8188eu: remove Add_RateATid from hal_ops

Remove Add_RateATid from hal_ops and remove its wrapper
rtw_hal_add_ra_tid(). Call rtl8188e_Add_RateATid() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused enum hal_intf_ps_func
Michael Straube [Mon, 6 Sep 2021 19:01:55 +0000 (21:01 +0200)]
staging: r8188eu: remove unused enum hal_intf_ps_func

HAL_USB_SELECT_SUSPEND and HAL_MAX_ID are both unused,
so enum hal_intf_ps_func can be removed.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove set_channel_handler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:54 +0000 (21:01 +0200)]
staging: r8188eu: remove set_channel_handler from hal_ops

Remove set_channel_handler from hal_ops and remove its wrapper
rtw_hal_set_chan(). Call PHY_SwChnl8188E() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove set_bwmode_handler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:53 +0000 (21:01 +0200)]
staging: r8188eu: remove set_bwmode_handler from hal_ops

Remove set_bwmode_handler from hal_ops and remove its wrapper
rtw_hal_set_bwmode(). Call PHY_SetBWMode8188E() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove hal_dm_watchdog from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:52 +0000 (21:01 +0200)]
staging: r8188eu: remove hal_dm_watchdog from hal_ops

Remove hal_dm_watchdog from hal_ops and remove its wrapper
rtw_hal_dm_watchdog(). Call rtl8188e_HalDmWatchDog directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove interface_ps_func from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:51 +0000 (21:01 +0200)]
staging: r8188eu: remove interface_ps_func from hal_ops

Remove interface_ps_func from hal_ops from hal_ops and remove its
wrapper rtw_hal_intf_ps_func() and the unused rtl8188eu_ps_func().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function rtw_interface_ps_func()
Michael Straube [Mon, 6 Sep 2021 19:01:50 +0000 (21:01 +0200)]
staging: r8188eu: remove unused function rtw_interface_ps_func()

Remove unused function rtw_interface_ps_func().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty functions
Michael Straube [Mon, 6 Sep 2021 19:01:49 +0000 (21:01 +0200)]
staging: r8188eu: remove empty functions

Remove the following empty functions.

Hal_InitChannelPlan()
Hal_CustomizeByCustomerID_8188EU()
_InitBeaconMaxError()

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove SetHalODMVarHandler from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:48 +0000 (21:01 +0200)]
staging: r8188eu: remove SetHalODMVarHandler from hal_ops

Remove SetHalODMVarHandler from hal_ops and remove its wrapper
rtw_hal_set_odm_var(). Call rtl8188e_SetHalODMVar() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove dm_deinit from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:47 +0000 (21:01 +0200)]
staging: r8188eu: remove dm_deinit from hal_ops

Remove dm_deinit from hal_ops and remove its wrapper
rtw_hal_dm_deinit(). Call rtl8188e_deinit_dm_priv() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove dm_init from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:46 +0000 (21:01 +0200)]
staging: r8188eu: remove dm_init from hal_ops

Remove dm_init from hal_ops and remove its wrapper rtw_hal_dm_init().
Call rtl8188e_init_dm_priv() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove DeInitSwLeds from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:45 +0000 (21:01 +0200)]
staging: r8188eu: remove DeInitSwLeds from hal_ops

Remove DeInitSwLeds from hal_ops and remove its wrapper
rtw_hal_sw_led_deinit(). Call rtl8188eu_DeInitSwLeds() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove InitSwLeds from hal_ops
Michael Straube [Mon, 6 Sep 2021 19:01:44 +0000 (21:01 +0200)]
staging: r8188eu: remove InitSwLeds from hal_ops

Remove InitSwLeds from hal_ops and remove its wrapper
rtw_hal_sw_led_init(). Call rtl8188eu_InitSwLeds() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210906190223.11396-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove _enter/_exit_critical_mutex()
Fabio M. De Francesco [Sat, 28 Aug 2021 11:36:56 +0000 (13:36 +0200)]
staging: r8188eu: Remove _enter/_exit_critical_mutex()

Remove _enter_critical_mutex() and _exit_critical_mutex(). They are
unnecessary wrappers, respectively to mutex_lock_interruptible() and
to mutex_unlock(). They also have an odd interface that takes an unused
argument named pirqL of type unsigned long.
The original code enters the critical section if the mutex API is
interrupted while waiting to acquire the lock; therefore it could lead
to a race condition. Use mutex_lock() because it is uninterruptible and
so avoid that above-mentioned potential race condition.

Tested-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210828113656.6963-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove _rtw_mutex_{init,free}
Pavel Skripkin [Sat, 4 Sep 2021 12:47:47 +0000 (15:47 +0300)]
staging: r8188eu: remove _rtw_mutex_{init,free}

While testing Fabio's patch I hit lockdep warning about possible
deadlock:

[  252.063305] WARNING: possible recursive locking detected
[  252.063642] 5.14.0+ #9 Tainted: G         C
[  252.063946] --------------------------------------------
[  252.064282] ip/335 is trying to acquire lock:
[  252.064560] ffff888009ebad28 (pmutex){+.+.}-{4:4}, at: usbctrl_vendorreq+0xc5/0x4a0 [r8188eu]
[  252.065168]
[  252.065168] but task is already holding lock:
[  252.065536] ffffffffc021b3b8 (pmutex){+.+.}-{4:4}, at:  netdev_open+0x3a/0x5f [r8188eu]
[  252.066085]
[  252.066085] other info that might help us debug this:
[  252.066494]  Possible unsafe locking scenario:
[  252.066494]
[  252.066866]        CPU0
[  252.067025]        ----
[  252.067184]   lock(pmutex);
[  252.067367]   lock(pmutex);

There is one problem with this warning: there is no pmutex in this
driver, *BUT* all mutexes are initialized via private _rtw_mutex_init
API, which had struct mutex *pmutex argument.

So, all mutexes in this driver had same name in lockdep map. Of course,
lockdep will complain about any nested locking.

Fix it by open-coding _rtw_mutex_{init,free} wrappers, because we do not
need them at all.

Cc: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210904124747.30050-1-paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove useless check
Pavel Skripkin [Sun, 5 Sep 2021 20:42:18 +0000 (23:42 +0300)]
staging: r8188eu: remove useless check

smatch says:
usb_intf.c:326 rtw_hw_suspend() warn: variable dereferenced before check 'padapter' (see line 323)
usb_intf.c:387 rtw_hw_resume() warn: variable dereferenced before check 'padapter' (see line 385)

There is only one caller of rtw_hw_suspend() and it does not check
padapter pointer, so let's just omit this check to make smatch happy.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210905204218.19317-1-paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: include: remove duplicate declaration.
Saurav Girepunje [Sun, 5 Sep 2021 07:14:37 +0000 (12:44 +0530)]
staging: r8188eu: include: remove duplicate declaration.

Remove below duplicate declaration from rtl8188e_led.h file

void SwLedOn(struct adapter *padapter, struct LED_871x *pLed);
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed);

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTRuXTu/kePBDwAF@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove c2h_id_filter_ccx from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:01:06 +0000 (02:01 +0100)]
staging: r8188eu: remove c2h_id_filter_ccx from struct hal_ops

Remove c2h_id_filter_ccx function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-15-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_c2h_id_filter_ccx function
Phillip Potter [Mon, 6 Sep 2021 01:01:05 +0000 (02:01 +0100)]
staging: r8188eu: remove rtw_hal_c2h_id_filter_ccx function

Remove rtw_hal_c2h_id_filter_ccx from hal/hal_intf.c and its one caller
from core/rtw_cmd.c. This function is a wrapper function which returns
the c2h_id_filter_ccx function pointer of struct hal_ops unconditionally.
As this function pointer is never set, and the function call's return
value is subsequently called inside an if condition, this could lead to
an attempt to deference a NULL pointer, which would crash the driver.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-14-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Efuse_PgPacketWrite_BT from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:01:04 +0000 (02:01 +0100)]
staging: r8188eu: remove Efuse_PgPacketWrite_BT from struct hal_ops

Remove Efuse_PgPacketWrite_BT function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-13-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Efuse_PgPacketWrite_BT function
Phillip Potter [Mon, 6 Sep 2021 01:01:03 +0000 (02:01 +0100)]
staging: r8188eu: remove Efuse_PgPacketWrite_BT function

Remove static Efuse_PgPacketWrite_BT and its one caller from
core/rtw_efuse.c. This function is a wrapper function which calls
the Efuse_PgPacketWrite_BT function pointer of struct hal_ops
unconditionally. As this function pointer is never set, and this
function call is possible to reach, this could lead to an attempt to
deference a NULL pointer, which would crash the driver.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-12-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove hal_xmitframe_enqueue from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:01:02 +0000 (02:01 +0100)]
staging: r8188eu: remove hal_xmitframe_enqueue from struct hal_ops

Remove hal_xmitframe_enqueue function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-11-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_xmitframe_enqueue function
Phillip Potter [Mon, 6 Sep 2021 01:01:01 +0000 (02:01 +0100)]
staging: r8188eu: remove rtw_hal_xmitframe_enqueue function

Remove rtw_hal_xmitframe_enqueue from hal/hal_intf.c and its one
caller from core/rtw_recv.c, and remove its declaration from
include/hal_intf.h as well. This is just a wrapper function that calls
the function pointer hal_xmitframe_enqueue in struct hal_ops if it
is set, which it never is.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-10-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove interrupt_handler from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:01:00 +0000 (02:01 +0100)]
staging: r8188eu: remove interrupt_handler from struct hal_ops

Remove interrupt_handler function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_interrupt_handler function
Phillip Potter [Mon, 6 Sep 2021 01:00:59 +0000 (02:00 +0100)]
staging: r8188eu: remove rtw_hal_interrupt_handler function

Remove rtw_hal_interrupt_handler from hal/hal_intf.c, and remove its
declaration from include/hal_intf.h as well. This is just a wrapper
function that calls the function pointer interrupt_handler in struct
hal_ops if it is set, which it never is. In addition, this wrapper
function is unused anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove disable_interrupt from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:00:58 +0000 (02:00 +0100)]
staging: r8188eu: remove disable_interrupt from struct hal_ops

Remove disable_interrupt function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_disable_interrupt function
Phillip Potter [Mon, 6 Sep 2021 01:00:57 +0000 (02:00 +0100)]
staging: r8188eu: remove rtw_hal_disable_interrupt function

Remove rtw_hal_disable_interrupt from hal/hal_intf.c, and remove its
declaration from include/hal_intf.h as well. This is just a wrapper
function that calls the function pointer disable_interrupt in struct
hal_ops if it is set, which it never is. In addition, this wrapper
function is unused anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove enable_interrupt from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:00:56 +0000 (02:00 +0100)]
staging: r8188eu: remove enable_interrupt from struct hal_ops

Remove enable_interrupt function pointer from struct hal_ops, as it
is unused.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_enable_interrupt function
Phillip Potter [Mon, 6 Sep 2021 01:00:55 +0000 (02:00 +0100)]
staging: r8188eu: remove rtw_hal_enable_interrupt function

Remove rtw_hal_enable_interrupt from hal/hal_intf.c, and remove its
declaration from include/hal_intf.h as well. This is just a wrapper
function that calls the function pointer enable_interrupt in struct
hal_ops if it is set, which it never is. In addition, this wrapper
function is unused anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove hal_reset_security_engine from struct hal_ops
Phillip Potter [Mon, 6 Sep 2021 01:00:54 +0000 (02:00 +0100)]
staging: r8188eu: remove hal_reset_security_engine from struct hal_ops

Remove hal_reset_security_engine function pointer from struct hal_ops,
as it is unused.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_hal_reset_security_engine function
Phillip Potter [Mon, 6 Sep 2021 01:00:53 +0000 (02:00 +0100)]
staging: r8188eu: remove rtw_hal_reset_security_engine function

Remove rtw_hal_reset_security_engine and its one caller from
hal/hal_intf.c, and remove its declaration from include/hal_intf.h as
well. This is just a wrapper function that calls the function pointer
hal_reset_security_engine in struct hal_ops if it is set, which it never
is.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210906010106.898-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: core: remove condition never execute
Saurav Girepunje [Sat, 4 Sep 2021 12:50:20 +0000 (18:20 +0530)]
staging: r8188eu: core: remove condition never execute

Remove condition which never get execute.
as pattrib->mdata is always zero before if condition check.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTNrjG1y05ByN54+@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove init_default_value from hal_ops
Michael Straube [Sat, 4 Sep 2021 12:40:33 +0000 (14:40 +0200)]
staging: r8188eu: remove init_default_value from hal_ops

Remove init_default_value from hal_ops and remove its wrapper
rtw_hal_def_value_init(). Call rtl8188eu_init_default_value()
directly instead

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove GetHalODMVarHandler from hal_ops
Michael Straube [Sat, 4 Sep 2021 12:40:32 +0000 (14:40 +0200)]
staging: r8188eu: remove GetHalODMVarHandler from hal_ops

Remove GetHalODMVarHandler from hal_ops ant remove its wrapper
rtw_hal_get_odm_var(), both are unused.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove wrapper around ReadChipVersion8188E()
Michael Straube [Sat, 4 Sep 2021 12:40:31 +0000 (14:40 +0200)]
staging: r8188eu: remove wrapper around ReadChipVersion8188E()

Function ReadChipVersion8188E() is only called by the wrapper
rtl8188e_read_chip_version(). Rename ReadChipVersion8188E()
to rtl8188e_read_chip_version() and change the return type to
void since the return value is never used.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove read_chip_version from hal_ops
Michael Straube [Sat, 4 Sep 2021 12:40:30 +0000 (14:40 +0200)]
staging: r8188eu: remove read_chip_version from hal_ops

Remove read_chip_version from hal_ops and remove its wrapper
rtw_hal_read_chip_version(). Call rtl8188e_read_chip_version()
directly instead

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove read_adapter_info from hal_ops
Michael Straube [Sat, 4 Sep 2021 12:40:29 +0000 (14:40 +0200)]
staging: r8188eu: remove read_adapter_info from hal_ops

Remove read_adapter_info from hal_ops and remove its wrapper
rtw_hal_read_chip_info(). Call ReadAdapterInfo8188EU() directly
instead.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove intf_chip_configure from hal_ops
Michael Straube [Sat, 4 Sep 2021 12:40:28 +0000 (14:40 +0200)]
staging: r8188eu: remove intf_chip_configure from hal_ops

Remove intf_chip_configure from hal_ops and remove its wrapper
rtw_hal_chip_configure(). Call rtl8188eu_interface_configure()
directly instead.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210904124033.14244-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: fbtft: fbtft-core: fix 'trailing statements should be on next line' coding...
Srivathsa Dara [Sat, 4 Sep 2021 08:09:16 +0000 (13:39 +0530)]
staging: fbtft: fbtft-core: fix 'trailing statements should be on next line' coding style error

Fix coding style error 'trailing statements should be on next line'

Signed-off-by: Srivathsa Dara <srivathsa729.8@gmail.com>
Link: https://lore.kernel.org/r/20210904080916.15476-1-srivathsa729.8@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove useless memset
Pavel Skripkin [Fri, 3 Sep 2021 18:18:07 +0000 (21:18 +0300)]
staging: r8188eu: remove useless memset

psetkeyparm is kzalloced buffer, there is no need in zeroing it one more
time, since kzalloc had already set memory to 0.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/97a283ed5b97632033b0fc7c6aa0fbfc82f06da3.1630692375.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: fix memory leak in rtw_set_key
Pavel Skripkin [Fri, 3 Sep 2021 18:17:52 +0000 (21:17 +0300)]
staging: r8188eu: fix memory leak in rtw_set_key

Before returning with an error we should free allocated buffers, since
they are not assigned to anywhere.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/ee783fbb71abb549505b84542223be7a7c905eea.1630692375.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: hal: remove condition with no effect
Saurav Girepunje [Sat, 4 Sep 2021 05:44:37 +0000 (11:14 +0530)]
staging: r8188eu: hal: remove condition with no effect

Fixes coccicheck warning: Remove the condition with no effect
(if == else) in odm.c

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YTMHxQJXKZHE5mg0@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_use_tkipkey_handler()
Michael Straube [Fri, 3 Sep 2021 19:04:44 +0000 (21:04 +0200)]
staging: r8188eu: remove rtw_use_tkipkey_handler()

Function rtw_use_tkipkey_handler() is unused, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210903190444.15585-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use in-kernel arc4 encryption
Michael Straube [Fri, 3 Sep 2021 19:04:43 +0000 (21:04 +0200)]
staging: r8188eu: use in-kernel arc4 encryption

Replace custom arc4 implementation with in-kernel one.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210903190444.15585-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>