747 Commits

Author SHA1 Message Date
Martin Kaiser
608230e733 staging: r8188eu: remove the sreset_priv structure
last_tx_time from struct sreset_priv is no longer used now that
last_tx_complete_time is gone.

This patch removes last_tx_time. This was the last remaining component of
struct sreset_priv, we can now remove the structure itself.

After removing include/rtw_sreset.h, it turned out that some definitions
in .c files were pulled in via rtw_sreset.h. Add the required include
files directly to make compilation succeed without rtw_sreset.h.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211024180448.20624-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25 09:09:44 +02:00
Martin Kaiser
562f1bf39a staging: r8188eu: remove last_tx_complete_time
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-25 09:09:44 +02:00
Martin Kaiser
4d911d4ea4 staging: r8188eu: silentreset_mutex is unused
silentreset_mutex from struct sreset_priv is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211024180448.20624-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25 09:09:44 +02:00
Martin Kaiser
8590f5db39 staging: r8188eu: wifi_error_status is write-only
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-25 09:09:44 +02:00
Martin Kaiser
dae4c880a8 staging: r8188eu: silent_reset_inprogress is never read
silent_reset_inprogress in struct sreset_priv is only written
but never read. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211024180448.20624-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-25 09:09:44 +02:00
Saurav Girepunje
29ac48f927 staging: r8188eu: remove unused local variable
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-25 09:08:40 +02:00
Fabio M. De Francesco
7e4c7947b4 staging: r8188eu: Use a Mutex instead of a binary Semaphore
Use a Mutex instead of a binary Semaphore for the purpose of enforcing
mutual exclusive access to the "pwrctrl_priv" structure.

Mutexes are sleeping locks similar to Semaphores with a 'count' of one
(like binary Semaphores), however they have a simpler interface, more
efficient performance, and additional constraints.

There is no change in the logic of the new code; however it is more
simple because it gets rid of four unnecessary wrappers:
_init_pwrlock(), _enter_pwrlock(),_exit_pwrlock(), _rtw_down_sema().

Actually, there is a change in the state in which the code waits for
acquiring locks, because it makes it in an uninterruptible state
(instead the old code used down_interruptibe()). Interruptible
waits are neither required nor wanted in this driver.

Tested with ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano].

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211022171917.24363-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-24 14:31:20 +02:00
Fabio M. De Francesco
a624c06194 staging: r8188eu: Remove unused semaphore "io_retevt"
Remove semaphore "io_retevt" because it is never used.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211022101028.30367-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-24 14:28:09 +02:00
Fabio M. De Francesco
e1be7542a3 staging: r8188eu: Remove initialized but unused semaphore
Remove semaphore "xmit_sema" from "struct adapter" because it is
initialized but never used.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211022101028.30367-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-24 14:28:09 +02:00
Wan Jiabing
5c0480deda staging: r8188eu: Use memdup_user instead of kmalloc/copy_from_user
Fix following coccicheck warning:
./drivers/staging/r8188eu/os_dep/ioctl_linux.c:1986:8-15: WARNING
opportunity for memdup_user.

Use memdup_user rather than duplicating its implementation, which
makes code simple and easy to understand.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20211021122015.6974-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-22 11:06:36 +02:00
Martin Kaiser
c31237afcd staging: r8188eu: remove unused defines and enums
Remove a couple of unused defines and an unused enum
from rtl8188e_cmd.h.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211020195401.12931-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21 10:27:05 +02:00
Martin Kaiser
e537d53c80 staging: r8188eu: use helper to set broadcast address
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-21 10:27:05 +02:00
Martin Kaiser
083d9d40ff staging: r8188eu: use helper to check for broadcast address
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-21 10:27:05 +02:00
Martin Kaiser
35f8fa8f01 staging: r8188eu: odm_rate_adapt Type is constant
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-21 10:27:05 +02:00
Martin Kaiser
4df5190976 staging: r8188eu: remove unused dm_priv components
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-21 10:27:05 +02:00
Martin Kaiser
26f4483718 staging: r8188eu: fix memleak in rtw_wx_set_enc_ext
Free the param struct if the caller sets an unsupported algorithm
and we return an error.

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211019202356.12572-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 19:35:52 +02:00
Jakub Kicinski
6ed178cb23 staging: use eth_hw_addr_set()
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert staging drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - memcpy(dev->dev_addr, np, ETH_ALEN)
  + eth_hw_addr_set(dev, np)
  @@
  - memcpy(dev->dev_addr, np, 6)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-2-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 19:33:58 +02:00
Michael Straube
07e00148a2 staging: r8188eu: RFType type is always ODM_1T1R
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-20 19:32:48 +02:00
Michael Straube
b7a96e0d40 staging: r8188eu: remove unused enums and defines from odm.h
Remove unused enums and defines from odm.h.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211019135137.9893-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 19:32:48 +02:00
Michael Straube
7b2f8ee2fe staging: r8188eu: remove unused fields from enum odm_common_info_def
Remove unused fields from enum odm_common_info_def.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211019135137.9893-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 19:32:48 +02:00
Michael Straube
4f276b3a35 staging: r8188eu: remove unused cases from ODM_CmnInfo{Hook,Update}
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-20 19:32:48 +02:00
Michael Straube
ea49ef360b staging: r8188eu: rename ODM_PhyStatusQuery_92CSeries()
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-20 19:32:48 +02:00
Michael Straube
b670be54c4 staging: r8188eu: BTRxRSSIPercentage is set but never used
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-20 19:32:48 +02:00
Michael Straube
a35ff2f488 staging: r8188eu: remove duplicate structure
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-20 19:32:48 +02:00
Fabio M. De Francesco
d9f32a101e staging: r8188eu: Remove redundant 'if' statement
Remove the redundant first 'if' statement of two identical ones.

In rtw_cmd_thread() there are two identical 'if' statement, one
immediately after the other. They check whether or not the device is
removed or the driver is stopped and, if true, they break a 'while'
loop.

The only noteworthy context difference is that the second statement is
within a block labelled "_next". The code has a 'goto' to the "_next"
label so that the checking is performed each time the above directive
is encountered. Instead, the first 'if' is before the "_next" label.

One of the two must be removed and that it must be the one before the
label because "bSurpriseRemoved" as well as "bDriverStopped" may be
changed asynchronously by other code of the driver and so they should be
checked at each jump to "_next".

Tested with "ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano]".

Acked-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211018162006.5527-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-19 09:33:54 +02:00
Fabio M. De Francesco
e8eb2f890f staging: r8188eu: Use completions for signaling enqueueing
rtw_enqueue_cmd() uses a semaphore to notify rtw_cmd_thread() that it
has enqueued commands. rtw_cmd_thread() "down(s)" in interruptible mode
to wait to be notified.

Use completion variables because they are better suited for the purpose.

In rtw_cmd_thread(), wait in uninterruptible mode, even if the original
code uses down_interruptible(), because the interruption of
rtw_cmd_thread() is not allowed and unwanted.

Tested with "ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano]".

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211018162006.5527-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-19 09:33:54 +02:00
Fabio M. De Francesco
d250bf4c39 staging: r8188eu: Use completions for signaling start / end kthread
rtw_cmd_thread() "up(s)" a semaphore twice, first to notify callers when
its execution is started and then to notify when it is about to end.

It makes the same semaphore go "up" twice in the same thread. This
construct makes Smatch to warn of duplicate "up(s)".

This thread uses interruptible semaphores where instead completions are
more suitable. For this purpose it calls an helper (_rtw_down_sema())
that returns values that are never checked. It may lead to bugs.

To address the above-mentioned issues, use two completions variables
instead of semaphores. Use the uninterruptible versions of
wake_for_completion*() because the interruptible / killable versions are
not necessary.

Tested with "ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano]".

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211018162006.5527-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-19 09:33:54 +02:00
Michael Straube
2d68d8ee8f staging: r8188eu: fix a gcc warning
Replace strncpy with strlcpy to fix the following gcc warning.

drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 'rtw_wx_set_enc_ext':
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
 1929 |         strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The destination buffer size is IEEE_CRYPT_ALG_NAME_LEN and the length
of the string to copy is always < IEEE_CRYPT_ALG_NAME_LEN. So strlcpy
will never truncate the string.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211018221231.7837-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-19 09:33:31 +02:00
Martin Kaiser
6ba3047d49 staging: r8188eu: Makefile: use one file list
It's enough to have a single list of source files. There are no config
settings for this driver that change the list of source files that
we compile.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016173544.25376-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:51:07 +02:00
Martin Kaiser
811245c461 staging: r8188eu: Makefile: don't overwrite global settings
Remove settings from the Makefile that are set by higher-level Makefiles.

Some of those settings might have been useful when the driver was
maintained out of tree.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016173544.25376-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:47:20 +02:00
Martin Kaiser
02be9e8225 staging: r8188eu: Makefile: remove unused driver config
Remove config settings from the Makefile that are related to
unused or deleted features.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211016173544.25376-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:46:28 +02:00
Michael Straube
679e0f8e41 staging: r8188eu: remove unnecessary assignment
The assignment "pLed->BlinkTimes = 0" is in a code path that is
executed only if pLed->BlinkTimes is 0. Remove this unnecessary
assignment.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211017170629.13785-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:45:01 +02:00
Martin Kaiser
bef56d47b9 staging: r8188eu: don't accept SIGTERM for cmd thread
At the moment, our command thread can be killed by user space.

[root@host ]# kill `pidof RTW_CMD_THREAD`

The driver will then stop working until the module is unloaded
and reloaded.

Don't process SIGTERM in the command thread. Other drivers that have a
command thread don't process SIGTERM either.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016181343.3686-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:44:41 +02:00
Martin Kaiser
d508cee5d0 staging: r8188eu: daemonize is not defined
Remove dead code that depends on daemonize.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016181343.3686-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:44:41 +02:00
Martin Kaiser
3331785f3c staging: r8188eu: res_to_status is unused
The function res_to_status is not used. Remove it.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016181343.3686-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:44:41 +02:00
Martin Kaiser
7ddd551351 staging: r8188eu: remove BT_COEXIST settings from Makefile
CONFIG_BT_COEXIST is disabled and not used outside of the Makefile.
Remove the settings in the Makefile as well.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016172345.23114-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:48 +02:00
Martin Kaiser
8f35a0b569 staging: r8188eu: remove unused components in pwrctrl_priv
CONFIG_BT_COEXIST is never set. Remove two variables of
struct pwrctrl_priv that depend on CONFIG_BT_COEXIST,
they're not used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211016172345.23114-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:48 +02:00
Martin Kaiser
9b6abb874a staging: r8188eu: CurrentWirelessMode is not used
CurrentWirelessMode in struct hal_data_8188e is not used. Remove the
component and the enum with its possible values.

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-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:15 +02:00
Martin Kaiser
2fd96ac559 staging: r8188eu: remove procfs functions
It seems that previous versions of this driver provided a procfs
interface for debugging.

Remove the procfs helper functions which are no longer used.

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-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:15 +02:00
Martin Kaiser
d443ddf4e3 staging: r8188eu: clean up Hal8188EPhyCfg.h
Remove a bunch of unused structs, enums and defines
from Hal8188EPhyCfg.h.

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-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:15 +02:00
Martin Kaiser
93998fb0a9 staging: r8188eu: PHY_SetRFPathSwitch_8188E is not used
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-18 16:40:15 +02:00
Martin Kaiser
fed4c84b6f staging: r8188eu: remove unused function prototypes
Remove prototypes of functions that aren't present in this driver.

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-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-18 16:40:15 +02:00
Martin Kaiser
8393640768 staging: r8188eu: remove two checks that are always false
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-18 16:40:15 +02:00
Martin Kaiser
7a11bd052a staging: r8188eu: interface type is always usb
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-18 16:40:15 +02:00
Martin Kaiser
ec23d22546 staging: r8188eu: remove empty trigger gpio code
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-18 16:40:15 +02:00
Michael Straube
78a689b6a0 staging: r8188eu: remove unused constants and variables
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-18 16:39:30 +02:00
Michael Straube
abadb46d4b staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()
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-18 16:38:18 +02:00
Michael Straube
24198f2ffd staging: r8188eu: pMacPhyMode is not used
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-18 16:38:18 +02:00
Michael Straube
79b1186dd9 staging: r8188eu: pBandType is never set
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-18 16:38:17 +02:00
Michael Straube
4b095e9c88 staging: r8188eu: remove ODM_AntselStatistics_88C()
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-18 16:38:17 +02:00