platform/kernel/linux-starfive.git
22 months agostaging: rtl8192e: Remove blank lines in rtl_core.c
Philipp Hortmann [Wed, 24 Aug 2022 20:14:34 +0000 (22:14 +0200)]
staging: rtl8192e: Remove blank lines in rtl_core.c

Remove blank lines as requested by checkpatch. Reasons are "multiple
blank lines", "Blank lines aren't necessary after an open brace" and
"Blank lines aren't necessary before a close brace".

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/32e831619a91f00cc37e04a2da1a9aeda2ad90a0.1661370978.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove unnecessary null check
Minghao Chi [Wed, 24 Aug 2022 08:03:50 +0000 (08:03 +0000)]
staging: r8188eu: remove unnecessary null check

container_of is never null, so this null check is
unnecessary.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220824080350.221614-1-chi.minghao@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: sm750fb: split multiple assignments to lines
Christopher Carbone [Tue, 23 Aug 2022 21:05:32 +0000 (17:05 -0400)]
staging: sm750fb: split multiple assignments to lines

Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: multiple assignments should be avoided

Signed-off-by: Christopher Carbone <chris.m.carbone@gmail.com>
Link: https://lore.kernel.org/r/YwVBHM3z0QExtuXr@valhalla
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: always update the status variables
Martin Kaiser [Mon, 22 Aug 2022 20:13:29 +0000 (22:13 +0200)]
staging: r8188eu: always update the status variables

Always update the status variables in rtw_led_control when we start
blinking because of no link. The code is easier to understand without
the if conditions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220822201329.95559-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: always cancel blink_work
Martin Kaiser [Mon, 22 Aug 2022 20:13:28 +0000 (22:13 +0200)]
staging: r8188eu: always cancel blink_work

In rtw_led_control, we can always cancel a running blink worker when we
start blinking because of no link.

The worker will be scheduled again and there's no point in having more
than one pending blink worker.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220822201329.95559-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: don't restart "no link" blinking unnecessarily
Martin Kaiser [Mon, 22 Aug 2022 20:13:27 +0000 (22:13 +0200)]
staging: r8188eu: don't restart "no link" blinking unnecessarily

Simplify one of the cases in rtw_led_control. If we're already blinking
because we have no link, we don't have to restart this blinking when the
caller requests it again. We can simply return and keep on blinking.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220822201329.95559-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove unused module parameter rtw_chip_version
Michael Straube [Sun, 21 Aug 2022 12:31:38 +0000 (14:31 +0200)]
staging: r8188eu: remove unused module parameter rtw_chip_version

The module parameter rtw_chip_version sets the chip_version field of
struct registry_priv but that field is never used in the driver code.
Remove the unused module parameter.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220821123138.8070-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove xmit_osdep.h
Michael Straube [Sat, 20 Aug 2022 18:16:23 +0000 (20:16 +0200)]
staging: r8188eu: remove xmit_osdep.h

After previous cleanups the header xmit_osdep.h only contains some
structure forward declarations and extern declarations for some module
parameters. The forward declarations are not needed. We can make the
module parameters static in os_dep/os_intf.c and remove xmit_osdep.h.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-20-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove os_dep/xmit_linux.c
Michael Straube [Sat, 20 Aug 2022 18:16:22 +0000 (20:16 +0200)]
staging: r8188eu: remove os_dep/xmit_linux.c

Move the last remaining function rtw_xmit_entry(), and the static
functions it calls, from os_dep/xmit_linux.c to core/rtw_xmit.c and
remove the now empty file os_dep/xmit_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-19-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename rtw_os_pkt_complete()
Michael Straube [Sat, 20 Aug 2022 18:16:21 +0000 (20:16 +0200)]
staging: r8188eu: rename rtw_os_pkt_complete()

The function rtw_os_pkt_complete() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. Obviously we do not need an extra 'os'
in the function name that indicates that the function is operating
system specific. Rename it to rtw_pkt_complete().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_os_pkt_complete() static
Michael Straube [Sat, 20 Aug 2022 18:16:20 +0000 (20:16 +0200)]
staging: r8188eu: make rtw_os_pkt_complete() static

The function rtw_os_pkt_complete() is only used in rtw_xmit.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename rtw_os_xmit_complete()
Michael Straube [Sat, 20 Aug 2022 18:16:19 +0000 (20:16 +0200)]
staging: r8188eu: rename rtw_os_xmit_complete()

The function rtw_os_xmit_complete() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. Obviously we do not need an extra 'os'
in the function name that indicates that the function is operating
system specific. Rename it to rtw_xmit_complete().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: move rtw_os_xmit_complete() to rtw_xmit.c
Michael Straube [Sat, 20 Aug 2022 18:16:18 +0000 (20:16 +0200)]
staging: r8188eu: move rtw_os_xmit_complete() to rtw_xmit.c

Move the function rtw_os_xmit_complete() from the os_dep/xmit_linux.c
to core/rtw_xmit.c. The goal is to get rid of os_dep/xmit_linux.c in
follow up patches.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: move struct pkt_file to rtw_xmit.h
Michael Straube [Sat, 20 Aug 2022 18:16:17 +0000 (20:16 +0200)]
staging: r8188eu: move struct pkt_file to rtw_xmit.h

The code that uses struct pkt_file has been moved to rtw_xmit.c.
Move the structure definition to rtw_xmit.h.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove unnecessary initialization to zero
Michael Straube [Sat, 20 Aug 2022 18:16:16 +0000 (20:16 +0200)]
staging: r8188eu: remove unnecessary initialization to zero

The initialization to zero of the variable 'len' in rtw_pktfile_read()
is not needed. It is immediately set to another value. Remove the
initialization to zero. While at it, remove an extra space.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename _rtw_pktfile_read()
Michael Straube [Sat, 20 Aug 2022 18:16:15 +0000 (20:16 +0200)]
staging: r8188eu: rename _rtw_pktfile_read()

There is no need to prefix the function name of _rtw_pktfile_read()
with an underscore. Rename it to rtw_pktfile_read().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make _rtw_pktfile_read() static
Michael Straube [Sat, 20 Aug 2022 18:16:14 +0000 (20:16 +0200)]
staging: r8188eu: make _rtw_pktfile_read() static

The function _rtw_pktfile_read() is only used in rtw_xmit.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename _rtw_open_pktfile()
Michael Straube [Sat, 20 Aug 2022 18:16:13 +0000 (20:16 +0200)]
staging: r8188eu: rename _rtw_open_pktfile()

There is no need to prefix the function name of _rtw_open_pktfile()
with an underscore. Rename it to rtw_open_pktfile().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make _rtw_open_pktfile() static
Michael Straube [Sat, 20 Aug 2022 18:16:12 +0000 (20:16 +0200)]
staging: r8188eu: make _rtw_open_pktfile() static

The function _rtw_open_pktfile() is only used in rtw_xmit.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename rtw_os_xmit_resource_free()
Michael Straube [Sat, 20 Aug 2022 18:16:11 +0000 (20:16 +0200)]
staging: r8188eu: rename rtw_os_xmit_resource_free()

The function rtw_os_xmit_resource_free() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. Obviously we do not need an extra 'os'
in the function name that indicates that the function is operating
system specific. Rename it to rtw_xmit_resource_free().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_os_xmit_resource_free() static
Michael Straube [Sat, 20 Aug 2022 18:16:10 +0000 (20:16 +0200)]
staging: r8188eu: make rtw_os_xmit_resource_free() static

The function rtw_os_xmit_resource_free() is only used in rtw_xmit.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename rtw_os_xmit_resource_alloc()
Michael Straube [Sat, 20 Aug 2022 18:16:09 +0000 (20:16 +0200)]
staging: r8188eu: rename rtw_os_xmit_resource_alloc()

The function rtw_os_xmit_resource_alloc() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. Obviously we do not need an extra 'os'
in the function name that indicates that the function is operating
system specific. Rename it to rtw_xmit_resource_alloc().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_os_xmit_resource_alloc() static
Michael Straube [Sat, 20 Aug 2022 18:16:08 +0000 (20:16 +0200)]
staging: r8188eu: make rtw_os_xmit_resource_alloc() static

The function rtw_os_xmit_resource_alloc() is only used in rtw_xmit.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: rename rtw_os_xmit_schedule()
Michael Straube [Sat, 20 Aug 2022 18:16:07 +0000 (20:16 +0200)]
staging: r8188eu: rename rtw_os_xmit_schedule()

The function rtw_os_xmit_schedule() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. Obviously we do not need an extra 'os'
in the function name that indicates that the function is operating
system specific. Rename it to rtw_xmit_schedule().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_os_xmit_schedule() static
Michael Straube [Sat, 20 Aug 2022 18:16:06 +0000 (20:16 +0200)]
staging: r8188eu: make rtw_os_xmit_schedule() static

The function rtw_os_xmit_schedule() is only used in rtw_mlme.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_remainder_len() static
Michael Straube [Sat, 20 Aug 2022 18:16:05 +0000 (20:16 +0200)]
staging: r8188eu: make rtw_remainder_len() static

The function rtw_remainder_len() is only used in xmit_linux.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220820181623.12497-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove odm_NoiseMonitor.h and odm_NoiseMonitor.c
Nam Cao [Sat, 20 Aug 2022 18:34:51 +0000 (20:34 +0200)]
staging: rtl8723bs: remove odm_NoiseMonitor.h and odm_NoiseMonitor.c

because the content of these files is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/6f51a3531ffe60650972bd9f288570db55e3e0ec.1661020250.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove member noise_level from struct dm_odm_t
Nam Cao [Sat, 20 Aug 2022 18:34:50 +0000 (20:34 +0200)]
staging: rtl8723bs: remove member noise_level from struct dm_odm_t

because it is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/5a8256d3823baaa72775da80d821749dfbda7ad4.1661020250.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove unused function ODM_InbandNoise_Monitor
Nam Cao [Sat, 20 Aug 2022 18:34:49 +0000 (20:34 +0200)]
staging: rtl8723bs: remove unused function ODM_InbandNoise_Monitor

because this function is not used. Also remove function
odm_InbandNoise_Monitor_NSeries because it is a static function
which is only called from ODM_InbandNoise_Monitor.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/46d73e331bae2192a328f6691763f39ea6c18b08.1661020250.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove static const variable odm_comp_str
Nam Cao [Fri, 19 Aug 2022 13:49:42 +0000 (15:49 +0200)]
staging: rtl8723bs: remove static const variable odm_comp_str

because it is not used.

Link: https://lore.kernel.org/linux-staging/202208192018.BfgiZyOY-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/678b03dad7217e70e61074d11975319cb1c1828c.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function rtw_odm_dbg_comp_set
Nam Cao [Fri, 19 Aug 2022 13:49:41 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function rtw_odm_dbg_comp_set

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/e1927eb6151d39b53a6ce1eed1d7ad20a2d633be.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function rtw_odm_adaptivity_parm_msg
Nam Cao [Fri, 19 Aug 2022 13:49:40 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function rtw_odm_adaptivity_parm_msg

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/24c3baa696adb7633d643258b60bba9bcd18b953.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function IsCommentString
Nam Cao [Fri, 19 Aug 2022 13:49:39 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function IsCommentString

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/c062f678dc8f99c18a251f6137c4c3883f8c8205.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function GetFractionValueFromString
Nam Cao [Fri, 19 Aug 2022 13:49:38 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function GetFractionValueFromString

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/e782bcd3ff8c33df8da7eb6b8e4bb00b1c270edc.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function rtw_odm_ability_set
Nam Cao [Fri, 19 Aug 2022 13:49:37 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function rtw_odm_ability_set

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/35d0f2115fa6febd72a1a7d1c740dece3d55a3df.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function rtw_get_ch_setting_union
Nam Cao [Fri, 19 Aug 2022 13:49:36 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function rtw_get_ch_setting_union

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/c8c5b0c78ee9a4cd8304efeff22b51049c75a3f2.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8723bs: remove function rtw_odm_dbg_comp_msg
Nam Cao [Fri, 19 Aug 2022 13:49:35 +0000 (15:49 +0200)]
staging: rtl8723bs: remove function rtw_odm_dbg_comp_msg

because this function is not used.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/7ff2d658863db4fd5eecc1a53f682510c2765c3f.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove ioctl_cfg80211.h
Nam Cao [Thu, 18 Aug 2022 19:54:55 +0000 (21:54 +0200)]
staging: r8188eu: remove ioctl_cfg80211.h

Remove header file ioctl_cfg80211.h because it is not used.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20220818195454.11822-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove ODM_ConfigRFWithHeaderFile()
Michael Straube [Fri, 19 Aug 2022 18:23:59 +0000 (20:23 +0200)]
staging: r8188eu: remove ODM_ConfigRFWithHeaderFile()

The function ODM_ConfigRFWithHeaderFile() is just a wrapper around
ODM_ReadAndConfig_RadioA_1T_8188E(). Remove the wrapper and call
ODM_ReadAndConfig_RadioA_1T_8188E() directly.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819182359.24141-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove unused function parameter
Michael Straube [Fri, 19 Aug 2022 12:54:28 +0000 (14:54 +0200)]
staging: r8188eu: remove unused function parameter

The parameter 'aborted' of rtw_indicate_scan_done() is not used.
Remove it.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge rtw_{os,}_indicate_scan_done()
Michael Straube [Fri, 19 Aug 2022 12:54:27 +0000 (14:54 +0200)]
staging: r8188eu: merge rtw_{os,}_indicate_scan_done()

Merge rtw_os_indicate_scan_done() into rtw_indicate_scan_done().
It looks like the driver was originaly written to support different
operating systems. We do not need this wrapping into an extra _os_
function obviously.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge rtw_{os,}_indicate_connect()
Michael Straube [Fri, 19 Aug 2022 12:54:26 +0000 (14:54 +0200)]
staging: r8188eu: merge rtw_{os,}_indicate_connect()

Merge rtw_os_indicate_connect() into rtw_indicate_connect().
It looks like the driver was originaly written to support different
operating systems. We do not need this wrapping into an extra _os_
function obviously.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge rtw_{os,}_indicate_disconnect()
Michael Straube [Fri, 19 Aug 2022 12:54:25 +0000 (14:54 +0200)]
staging: r8188eu: merge rtw_{os,}_indicate_disconnect()

Merge rtw_os_indicate_disconnect() into rtw_indicate_disconnect().
The function rtw_os_indicate_disconnect() was moved from the os_dep
directory. It looks like the driver was originaly written to support
different operating systems. We do not need this wrapping into an
extra _os_ function obviously.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_reset_securitypriv() static
Michael Straube [Fri, 19 Aug 2022 12:54:24 +0000 (14:54 +0200)]
staging: r8188eu: make rtw_reset_securitypriv() static

The function rtw_reset_securitypriv() is only used in rtw_mlme.c.
Make rtw_reset_securitypriv() and its user
rtw_os_indicate_disconnect() static to get one step closer to
removing os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove unneeded initializations
Michael Straube [Fri, 19 Aug 2022 12:54:23 +0000 (14:54 +0200)]
staging: r8188eu: remove unneeded initializations

In the function rtw_reset_securitypriv() three variables are
initialized to zero. That is not necessary because they are all
set before use in the code. Remove the initializations.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_report_sec_ie() static
Michael Straube [Fri, 19 Aug 2022 12:54:22 +0000 (14:54 +0200)]
staging: r8188eu: make rtw_report_sec_ie() static

The function rtw_report_sec_ie() is only used in rtw_mlme.c.
Make it static to get one step closer to removing
os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: move rtw_indicate_sta_assoc_event() to rtw_ap.c
Michael Straube [Fri, 19 Aug 2022 12:54:21 +0000 (14:54 +0200)]
staging: r8188eu: move rtw_indicate_sta_assoc_event() to rtw_ap.c

Move the function rtw_indicate_sta_assoc_event() to core/rtw_ap.c to
get one step closer to removing os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_indicate_sta_disassoc_event() static
Michael Straube [Fri, 19 Aug 2022 12:54:20 +0000 (14:54 +0200)]
staging: r8188eu: make rtw_indicate_sta_disassoc_event() static

The function rtw_indicate_sta_disassoc_event() is only used in
rtw_ap.c. Make it static to get one step closer to removing
os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make init_addba_retry_timer() static
Michael Straube [Fri, 19 Aug 2022 12:54:19 +0000 (14:54 +0200)]
staging: r8188eu: make init_addba_retry_timer() static

The function init_addba_retry_timer() is only used in rtw_sta_mgt.c.
Make it static to get one step closer to removing os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make init_mlme_ext_timer() static
Michael Straube [Fri, 19 Aug 2022 12:54:18 +0000 (14:54 +0200)]
staging: r8188eu: make init_mlme_ext_timer() static

The function init_mlme_ext_timer() is only used in rtw_mlme_ext.c.
Make it static to get one step closer to removing os_dep/mlme_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220819125428.8412-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: move from strlcpy with unused retval to strscpy
Wolfram Sang [Thu, 18 Aug 2022 21:01:08 +0000 (23:01 +0200)]
staging: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210108.7397-1-wsa+renesas@sang-engineering.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove rtw_endofpktfile()
Michael Straube [Wed, 17 Aug 2022 06:32:23 +0000 (08:32 +0200)]
staging: r8188eu: remove rtw_endofpktfile()

The function rtw_endofpktfile() just checks for pkt_len == 0.
Remove rtw_endofpktfile() and merge the check into the caller to
improve readability and simplify the driver code.

Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220817063223.8140-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: drop the DRIVERVERSION macro
Grzegorz Szymaszek [Fri, 5 Aug 2022 16:28:12 +0000 (18:28 +0200)]
staging: r8188eu: drop the DRIVERVERSION macro

Since the driver is currently in the kernel, the module version macro is
not necessary.

Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Link: https://lore.kernel.org/r/39e6b702918b7bcc59dec381022c1d1b97c2046e.1659715931.git.gszymaszek@short.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: drop the DRV_NAME macro
Grzegorz Szymaszek [Fri, 5 Aug 2022 16:28:05 +0000 (18:28 +0200)]
staging: r8188eu: drop the DRV_NAME macro

The DRV_NAME macro is not used anywhere; KBUILD_MODNAME should be used
instead. Remove the macro declaration.

Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Link: https://lore.kernel.org/r/f8d7b4ba4533a315ebd6711f17bbfd81e99ccf5a.1659715931.git.gszymaszek@short.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: use KBUILD_MODNAME instead of a string constant
Grzegorz Szymaszek [Fri, 5 Aug 2022 16:27:53 +0000 (18:27 +0200)]
staging: r8188eu: use KBUILD_MODNAME instead of a string constant

The field .usbdrv.name of the struct rtw_usb_drv hardcoded the module
(driver) name as a constant string. Replace the string with the
KBUILD_MODNAME macro.

Link: https://lore.kernel.org/lkml/Yuy7QSh%2FclQ5Ki09@kroah.com/
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Link: https://lore.kernel.org/r/0325540ba8be0a3dc4083d22e484a8a31fb2a892.1659715931.git.gszymaszek@short.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: set firmware path in a macro
Grzegorz Szymaszek [Fri, 5 Aug 2022 16:27:41 +0000 (18:27 +0200)]
staging: r8188eu: set firmware path in a macro

The r8188eu driver requires a firmware file, the path of which was
hardcoded as constant strings in two places:
(1) in core/rtw_fw.c, in function load_firmware(),
(2) in os_dep/os_intfs.c, in the MODULE_FIRMWARE() call.

Declare the path using a macro, FW_RTL8188EU, and replace the above
constant strings with the macro. That's the way it is done in many other
drivers. The new macro is defined in include/drv_types.h, because that
file is already included by both of the above files (or at least their
headers) and because it already contains other driver constants, like
its name and version.

Link: https://lore.kernel.org/lkml/YuoQ37PIKzWO1zIY@kroah.com/
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Link: https://lore.kernel.org/r/60dc57fc73e8e6e8e3aaae68784f4be932547bf5.1659715931.git.gszymaszek@short.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: add firmware dependency
Grzegorz Szymaszek [Tue, 2 Aug 2022 17:18:44 +0000 (19:18 +0200)]
staging: r8188eu: add firmware dependency

The old rtl8188eu module, removed in commit 55dfa29b43d2 ("staging:
rtl8188eu: remove rtl8188eu driver from staging dir") (Linux kernel
v5.15-rc1), required (through a MODULE_FIRMWARE call()) the
rtlwifi/rtl8188eufw.bin firmware file, which the new r8188eu driver no
longer requires.

I have tested a few RTL8188EUS-based Wi-Fi cards and, while supported by
both drivers, they do not work when using the new one and the firmware
wasn't manually loaded. According to Larry Finger, the module
maintainer, all such cards need the firmware and the driver should
depend on it (see the linked mails).

Add a proper MODULE_FIRMWARE() call, like it was done in the old driver.

Thanks to Greg Kroah-Hartman and Larry Finger for quick responses to my
questions.

Link: https://answers.launchpad.net/ubuntu/+source/linux-meta-hwe-5.15/+question/702611
Link: https://lore.kernel.org/lkml/YukkBu3TNODO3or9@nx64de-df6d00/
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Link: https://lore.kernel.org/r/YulcdKfhA8dPQ78s@nx64de-df6d00
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_init_recv_timer() static
Michael Straube [Sun, 7 Aug 2022 18:15:38 +0000 (20:15 +0200)]
staging: r8188eu: make rtw_init_recv_timer() static

The function rtw_init_recv_timer() is only used in rtw_sta_mgt.c.
Make it static and remove the now empty file os_dep/recv_linux.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220807181538.8499-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_recv_indicatepkt() static
Michael Straube [Sun, 7 Aug 2022 18:15:37 +0000 (20:15 +0200)]
staging: r8188eu: make rtw_recv_indicatepkt() static

The function rtw_recv_indicatepkt() is only used in rtw_recv.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220807181538.8499-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_handle_tkip_mic_err() static
Michael Straube [Sun, 7 Aug 2022 18:15:36 +0000 (20:15 +0200)]
staging: r8188eu: make rtw_handle_tkip_mic_err() static

The function rtw_handle_tkip_mic_err() is only used in rtw_recv.c.
Make it static.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220807181538.8499-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge rtw_os_recvbuf_resource_alloc() into rtw_recv.c
Michael Straube [Sun, 7 Aug 2022 18:15:35 +0000 (20:15 +0200)]
staging: r8188eu: merge rtw_os_recvbuf_resource_alloc() into rtw_recv.c

Merge the functionality of the function rtw_os_recvbuf_resource_alloc()
into rtl8188eu_init_recv_priv(). Merging the functionality instead of
just making the function static improves readability and we have one
function less to care about when converting the uses of _FAIL/_SUCCESS
to normal kernel error code logic.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220807181538.8499-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge rtw_os_recvbuf_resource_free() into rtw_recv.c
Michael Straube [Sun, 7 Aug 2022 18:15:34 +0000 (20:15 +0200)]
staging: r8188eu: merge rtw_os_recvbuf_resource_free() into rtw_recv.c

The function rtw_os_recvbuf_resource_free() is just a wrapper around
usb_free_urb(). Call usb_free_urb() directly in
rtl8188eu_free_recv_priv() and remove rtw_os_recvbuf_resource_free()
to simplify the driver code.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220807181538.8499-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: do not spam the kernel log
Michael Straube [Mon, 8 Aug 2022 06:50:23 +0000 (08:50 +0200)]
staging: r8188eu: do not spam the kernel log

Drivers should not spam the kernel log if they work properly. Convert
the functions Hal_EfuseParseIDCode88E() and _netdev_open() to use
netdev_dbg() instead of pr_info() so that developers can still enable
it if they want to see this information.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220808065023.3175-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: the high prio queue is always selected
Martin Kaiser [Mon, 8 Aug 2022 20:14:05 +0000 (22:14 +0200)]
staging: r8188eu: the high prio queue is always selected

The high priority queue is always selected, regardless of the number of
out endpoints.

Therefore, haldata->OutEpQueueSel & TX_SELE_HQ is always true. We can
remove the check and use a define instead of the numHQ variable.

This check was the last user of TX_SELE_HQ. Rename haldata->OutEpQueueSel
to haldata->out_ep_extra_queues and store only the queues that are selected
in addition to the high priority queue.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove two unused defines
Martin Kaiser [Mon, 8 Aug 2022 20:14:04 +0000 (22:14 +0200)]
staging: r8188eu: remove two unused defines

HPQ_PUBLIC_DIS and LPQ_PUBLIC_DIS are not used by the r8188eu driver.
Remove them.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: change all num...Q variables to u8
Martin Kaiser [Mon, 8 Aug 2022 20:14:03 +0000 (22:14 +0200)]
staging: r8188eu: change all num...Q variables to u8

All of numPubQ, numHQ and numLQ variables store only u8 values. Change
their types to u8. We can then simplify the REG_RQPN expression. The
macros and the temporary variable are not needed any more.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make numNQ a u8
Martin Kaiser [Mon, 8 Aug 2022 20:14:02 +0000 (22:14 +0200)]
staging: r8188eu: make numNQ a u8

The numNQ variable in _InitQueueReservedPage is defined as u32. It is
either set to 0 or to 0x1C. Change its type to u8 and remove the code that
casts the u32 value to u8.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove a temporary variable
Martin Kaiser [Mon, 8 Aug 2022 20:14:01 +0000 (22:14 +0200)]
staging: r8188eu: remove a temporary variable

Use pregistrypriv->wifi_spec directly instead of defining a temporary
variable.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: simplify _InitNormalChipTwoOutEpPriority
Martin Kaiser [Sat, 6 Aug 2022 19:55:40 +0000 (21:55 +0200)]
staging: r8188eu: simplify _InitNormalChipTwoOutEpPriority

Simplify the _InitNormalChipTwoOutEpPriority function, now that we have
only one configuration for the queues.

Remove the variables which are constant. Keep only those settings that
depend on wifi_spec.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-14-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: we always use HQ and NQ for two endpoints
Martin Kaiser [Sat, 6 Aug 2022 19:55:39 +0000 (21:55 +0200)]
staging: r8188eu: we always use HQ and NQ for two endpoints

When _InitNormalChipTwoOutEpPriority is called, pdvobjpriv->RtNumOutPipes
and haldata->OutEpQueueSel have already been initialized.

_InitNormalChipTwoOutEpPriority is called only if
pdvobjpriv->RtNumOutPipes == 2. In this case, haldata->OutEpQueueSel is
always TX_SELE_HQ | TX_SELE_NQ.

Remove the switch-case statement and set valueHi and valueLow directly.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove _InitNormalChipOneOutEpPriority
Martin Kaiser [Sat, 6 Aug 2022 19:55:38 +0000 (21:55 +0200)]
staging: r8188eu: remove _InitNormalChipOneOutEpPriority

When _InitNormalChipOneOutEpPriority is called, pdvobjpriv->RtNumOutPipes
and haldata->OutEpQueueSel have already been initialized.

_InitNormalChipOneOutEpPriority is called only if
pdvobjpriv->RtNumOutPipes == 1. In this case, haldata->OutEpQueueSel is
always TX_SELE_HQ.

We can then simplify _InitNormalChipOneOutEpPriority to a single
_InitNormalChipRegPriority call, i.e. we can remove
_InitNormalChipOneOutEpPriority and call _InitNormalChipRegPriority
directly.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: simplify two_out_pipe
Martin Kaiser [Sat, 6 Aug 2022 19:55:37 +0000 (21:55 +0200)]
staging: r8188eu: simplify two_out_pipe

Simplify the two_out_pipe function. Move common settings out of the
if clause.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: simplify three_out_pipe
Martin Kaiser [Sat, 6 Aug 2022 19:55:36 +0000 (21:55 +0200)]
staging: r8188eu: simplify three_out_pipe

Only one of the mappings in three_out_pipe depends on the wifi_cfg flag.
Simplify the code accordingly.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: summarize common Queue2Pipe settings
Martin Kaiser [Sat, 6 Aug 2022 19:55:35 +0000 (21:55 +0200)]
staging: r8188eu: summarize common Queue2Pipe settings

Regardless of the number of endpoints, queues 4 to 7 are mapped to pipe 0.
Move these mappings to rtl8188eu_interface_configure to make the code
simpler.

It's ok to make these settings even if we exit with error later. In this
case, the driver will not be loaded and pdvobjpriv->Queue2Pipe[] will be
freed.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove comments about endpoint mapping
Martin Kaiser [Sat, 6 Aug 2022 19:55:34 +0000 (21:55 +0200)]
staging: r8188eu: remove comments about endpoint mapping

Remove the comments in two_out_pipe and three_out_pipe that show the
mappings. They simply repeat the settings in the code and provide no
additional information. Keep the info which RtOutPipe is high, normal
or low.

Without the removed comments, it'll be easier to summarize and reorganize
the code.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: remove OutEpNumber
Martin Kaiser [Sat, 6 Aug 2022 19:55:33 +0000 (21:55 +0200)]
staging: r8188eu: remove OutEpNumber

Remove the OutEpNumber component of struct hal_data_8188e.
RtNumOutPipes in struct dvobj_priv stores the same info.

Update the only place where OutEpNumber is read.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: summarize endpoint-related settings
Martin Kaiser [Sat, 6 Aug 2022 19:55:32 +0000 (21:55 +0200)]
staging: r8188eu: summarize endpoint-related settings

rtl8188eu_interface_configure calls _ConfigNormalChipOutEP_8188E and
Hal_MappingOutPipe.

Both of these functions make some settings based on the number of
out endpoints on the 8188eu chip. We can merge both of them into
rtl8188eu_interface_configure and summarize the common code.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: move endpoint init functions to usb_halinit.c
Martin Kaiser [Sat, 6 Aug 2022 19:55:31 +0000 (21:55 +0200)]
staging: r8188eu: move endpoint init functions to usb_halinit.c

Move the Hal_MappingOutPipe function and the functions
one_/two_/three_out_pipe from hal_com.c to usb_halinit.c.

After this move, all the functions that rtl8188eu_interface_configure
calls are in one file and we can continue to summarize and merge them.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: merge two small functions
Martin Kaiser [Sat, 6 Aug 2022 19:55:30 +0000 (21:55 +0200)]
staging: r8188eu: merge two small functions

All that rtl8188eu_interface_configure does is call
HalUsbSetQueuePipeMapping8188EUsb. We can merge the two functions.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: process HalUsbSetQueuePipeMapping8188EUsb's return value
Martin Kaiser [Sat, 6 Aug 2022 19:55:29 +0000 (21:55 +0200)]
staging: r8188eu: process HalUsbSetQueuePipeMapping8188EUsb's return value

At the moment, HalUsbSetQueuePipeMapping8188EUsb returns an error status
to rtl8188eu_interface_configure, where this status is discarded.

Pass the error status from rtl8188eu_interface_configure to
rtw_usb_if1_init and handle it there.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: Hal_MappingOutPipe should return an int
Martin Kaiser [Sat, 6 Aug 2022 19:55:28 +0000 (21:55 +0200)]
staging: r8188eu: Hal_MappingOutPipe should return an int

Update the Hal_MappingOutPipe function to return 0 for success or -EXNIO
if the caller requested more than the number of available endpoints.
This error code is also used by usb_find_common_endpoints if a requested
endpoint was not found.

Unlike a boolean return value, a negative error code can be returned to
external functions that call the r8188eu driver, e.g. to the caller of our
probe function.

HalUsbSetQueuePipeMapping8188EUsb passes the return value of
Hal_MappingOutPipe on to its caller. We have to change its return type
from bool to int as well.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806195540.777390-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: simplify the calculation of ie start offset
Martin Kaiser [Sat, 6 Aug 2022 11:13:52 +0000 (13:13 +0200)]
staging: r8188eu: simplify the calculation of ie start offset

Use offsetof to calculate the start offset of the information elements in
an association response message. This should make it easier to understand
how the offset is calculated.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806111352.690650-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: read aid from struct ieee80211_mgmt
Martin Kaiser [Sat, 6 Aug 2022 11:13:51 +0000 (13:13 +0200)]
staging: r8188eu: read aid from struct ieee80211_mgmt

Read the aid of the association response message from struct
ieee80211_mgmt. This should be easier to understand and to review than
calculating the offset manually.

Remove the cast to int, aid is a u16.
Keep the 0x3fff mask that is currently applied to the aid.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806111352.690650-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: read capability info from struct ieee80211_mgmt
Martin Kaiser [Sat, 6 Aug 2022 11:13:50 +0000 (13:13 +0200)]
staging: r8188eu: read capability info from struct ieee80211_mgmt

Read the capability info of the association response message from struct
ieee80211_mgmt. This should be easier to understand and to review than
calculating the offset manually.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806111352.690650-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: read status_code from struct ieee80211_mgmt
Martin Kaiser [Sat, 6 Aug 2022 11:13:49 +0000 (13:13 +0200)]
staging: r8188eu: read status_code from struct ieee80211_mgmt

Read the status code of the association response message from struct
ieee80211_mgmt. This should be easier to understand and to review than
calculating the offset manually.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806111352.690650-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: replace a get_da call
Martin Kaiser [Sat, 6 Aug 2022 11:13:48 +0000 (13:13 +0200)]
staging: r8188eu: replace a get_da call

The r8188eu driver implements an internal get_da function to read the
destination address (da) from an incoming message. Callers of this
function should be updated to use the ieee80211 framework, with the goal
of removing get_da eventually.

This patch replaces a get_da call in the OnAssocRsp function.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220806111352.690650-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: clean up comment for phy_calculate_bit_shift()
Michael Straube [Sat, 6 Aug 2022 06:09:29 +0000 (08:09 +0200)]
staging: r8188eu: clean up comment for phy_calculate_bit_shift()

Clean up the comment for function phy_calculate_bit_shift().

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220806060929.11022-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: avoid camel case in phy_CalculateBitShift()
Michael Straube [Sat, 6 Aug 2022 06:09:28 +0000 (08:09 +0200)]
staging: r8188eu: avoid camel case in phy_CalculateBitShift()

Rename the function phy_CalculateBitShift() and its parameter BitMask
to avoid camel case.

phy_CalculateBitShift -> phy_calculate_bit_shift
BitMask -> bitmask

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220806060929.11022-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: use ffs() in phy_CalculateBitShift()
Michael Straube [Sat, 6 Aug 2022 06:09:27 +0000 (08:09 +0200)]
staging: r8188eu: use ffs() in phy_CalculateBitShift()

Use ffs() in phy_CalculateBitShift() to simplify the function and
improve readability.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220806060929.11022-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: convert rtw_p2p_enable to correct error code semantics
Phillip Potter [Tue, 2 Aug 2022 23:44:08 +0000 (00:44 +0100)]
staging: r8188eu: convert rtw_p2p_enable to correct error code semantics

Convert the rtw_p2p_enable function to use correct error code semantics
rather than _SUCCESS/_FAIL, and also make sure we allow these to be
passed through properly in the one caller where we actually check the
code, rtw_wext_p2p_enable.

This change moves these functions to a clearer 'return 0;' style at the
end of the function, and in the case of errors now returns ret instead
of jumping to the end of the function, so that these can still be passed
through but without using a goto to jump to a single return statement at
the end which is less clear.

This change moves the driver slowly closer to using standard error code
semantics everywhere.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220802234408.930-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtl8188eu_{init,free}_recv_priv() static
Michael Straube [Thu, 4 Aug 2022 10:55:32 +0000 (12:55 +0200)]
staging: r8188eu: make rtl8188eu_{init,free}_recv_priv() static

The functions rtl8188eu_init_recv_priv() and rtl8188eu_free_recv_priv()
are only used in rtw_recv.c. Make them static and remove the now empty
file rtl8188eu_recv.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220804105532.7532-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make handle_txrpt_ccx_88e() static
Michael Straube [Thu, 4 Aug 2022 10:55:31 +0000 (12:55 +0200)]
staging: r8188eu: make handle_txrpt_ccx_88e() static

The function handle_txrpt_ccx_88e() is only used in usb_ops_linux.c.
Make it static and remove the now empty file rtl8188e_xmit.c.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220804105532.7532-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging/rtl8723bs/core: remove inactive initialization
Li zeming [Tue, 2 Aug 2022 01:25:13 +0000 (09:25 +0800)]
staging/rtl8723bs/core: remove inactive initialization

The allocation address of the psta pointer variable is first performed
in the function, no initialization assignment is required, and no
invalid pointer will appear.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Li zeming <zeming@nfschina.com>
Link: https://lore.kernel.org/r/20220802012513.2824-1-zeming@nfschina.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: refactor dump_chip_info()
Michael Straube [Sat, 30 Jul 2022 15:06:37 +0000 (17:06 +0200)]
staging: r8188eu: refactor dump_chip_info()

Refactor the function dump_chip_info() to make the code cleaner and
reduce the driver object file size. Instead of using sprintf() to
print all the information to a buffer use a char pointer for the cut
version string and print the other strings directly by netdev_dbg().
For the unknown cut string we can use a smaller buffer and print to
that buffer with snprintf() to be safe.

These changes avoid the possible buffer overflow that the original
code had and reduces the driver object file size by 1029 bytes.

Suggested-by: Joe Perches <joe@perches.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220730150637.3550-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: convert dump_chip_info() to use netdev_dbg()
Michael Straube [Sat, 30 Jul 2022 15:06:36 +0000 (17:06 +0200)]
staging: r8188eu: convert dump_chip_info() to use netdev_dbg()

Drivers should not spam the kernel log if they work properly. Convert
the dump_chip_info() function to use netdev_dbg() instead of pr_info()
so that developers can still enable it if they want to see this
information.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220730150637.3550-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: return an error code in rtw_usb_if1_init
Martin Kaiser [Sat, 30 Jul 2022 14:39:39 +0000 (16:39 +0200)]
staging: r8188eu: return an error code in rtw_usb_if1_init

rtw_usb_if1_init returns a pointer that isn't used by the caller. Return
an error code instead. We can then propagate errors from lower-level
functions like ReadAdapterInfo8188EU and fail the initialisation of the
driver with a proper error code.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220730143939.671951-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: make rtw_handle_dualmac a void function
Martin Kaiser [Sat, 30 Jul 2022 14:39:38 +0000 (16:39 +0200)]
staging: r8188eu: make rtw_handle_dualmac a void function

The rtw_handle_dualmac function always returns _SUCCESS. Remove the return
value and update the one caller that checks it.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220730143939.671951-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: r8188eu: handle errors from ReadAdapterInfo8188EU
Martin Kaiser [Sat, 30 Jul 2022 14:39:37 +0000 (16:39 +0200)]
staging: r8188eu: handle errors from ReadAdapterInfo8188EU

Update ReadAdapterInfo8188EU to return 0 for success or a negative
error code. If rtw_read8 fails, we can just relay the error it returns.

Update rtw_usb_if1_init to check the return value from
ReadAdapterInfo8188EU. For now, rtw_usb_if1_init does not yet pass errors
from ReadAdapterInfo8188EU on to its caller.

Suggested-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220730143939.671951-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8192u: fix rmmod warn when device is renamed
Tong Zhang [Sat, 30 Jul 2022 03:33:24 +0000 (20:33 -0700)]
staging: rtl8192u: fix rmmod warn when device is renamed

This driver creates 4 debug files under [devname] folder. The devname
could be wlan0 initially, however it could be renamed later to e.g.
enx00e04c00000. This will cause problem during debug file teardown since
it uses netdev->name, which is no longer wlan0. To solve this problem,
add a notifier to handle device renaming. Also note that we cannot
simply do debugfs_lookup to find out old dentry since by the time the
notifier is called, netdev->name is already changed to new name.

Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Tested-by: Zheyu Ma <zheyuma97@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Link: https://lore.kernel.org/r/20220730033335.74153-5-ztong0001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 months agostaging: rtl8192u: move debug files to debugfs
Tong Zhang [Sat, 30 Jul 2022 03:33:23 +0000 (20:33 -0700)]
staging: rtl8192u: move debug files to debugfs

There are 4 debug files created under /proc/net/[Devname].
Due to this is purely for debuging as files are created read only,
move this to debugfs like other NIC drivers do instead of using procfs.
The directory structure will be like the following

  /sys/kernel/debug/r8192u_usb/wlan0/stats-rx
  /sys/kernel/debug/r8192u_usb/wlan0/stats-rx
  /sys/kernel/debug/r8192u_usb/wlan0/stats-ap
  /sys/kernel/debug/r8192u_usb/wlan0/registers

This is also to prepare for address rmmod warn issue.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Link: https://lore.kernel.org/r/20220730033335.74153-4-ztong0001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>