platform/kernel/linux-rpi.git
2 years agostaging: rtl8712: Drop get_recvframe_data()
Kees Cook [Tue, 18 Jan 2022 19:33:27 +0000 (11:33 -0800)]
staging: rtl8712: Drop get_recvframe_data()

As done for rtl8723bs and r8188eu, drop get_recvframe_data(), as it
introduces an impossible value (NULL) for the compiler to check code
paths against which could result in nonsensical warnings.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: linux-staging@lists.linux.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220118193327.2822099-4-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: Drop get_recvframe_data()
Kees Cook [Tue, 18 Jan 2022 19:33:26 +0000 (11:33 -0800)]
staging: rtl8723bs: Drop get_recvframe_data()

When building with -Warray-bounds, the following warning is emitted:

In file included from ./include/linux/string.h:253,
                 from ./arch/x86/include/asm/page_32.h:22,
                 from ./arch/x86/include/asm/page.h:14,
                 from ./arch/x86/include/asm/thread_info.h:12,
                 from ./include/linux/thread_info.h:60,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/rcupdate.h:27,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/sched/signal.h:5,
                 from ./drivers/staging/rtl8723bs/include/drv_types.h:17,
                 from drivers/staging/rtl8723bs/core/rtw_recv.c:7:
In function 'memcpy',
    inlined from 'wlanhdr_to_ethhdr' at drivers/staging/rtl8723bs/core/rtw_recv.c:1554:2:
./include/linux/fortify-string.h:41:33: warning: '__builtin_memcpy' offset [0, 5] is out of the bounds [0, 0] [-Warray-bounds]
   41 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^

This is because the compiler sees it is possible for "ptr" to be a NULL
value, and concludes that it has zero size and attempts to copy to it
would overflow. Instead, remove the get_recvframe_data() entirely, as
it's not possible for this to ever be NULL.

Additionally add missing NULL checks after recvframe_pull() (which are
present in the rtl8712 driver).

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Phillip Potter <phil@philpotter.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michael Straube <straube.linux@gmail.com>
Cc: Fabio Aiuto <fabioaiuto83@gmail.com>
Cc: linux-staging@lists.linux.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220118193327.2822099-3-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Drop get_recvframe_data()
Kees Cook [Tue, 18 Jan 2022 19:33:25 +0000 (11:33 -0800)]
staging: r8188eu: Drop get_recvframe_data()

When building with -Warray-bounds, the following warning is emitted:

In file included from ./include/linux/string.h:253,
                 from ./arch/x86/include/asm/page_32.h:22,
                 from ./arch/x86/include/asm/page.h:14,
                 from ./arch/x86/include/asm/thread_info.h:12,
                 from ./include/linux/thread_info.h:60,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/rcupdate.h:27,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/sched/signal.h:5,
                 from ./drivers/staging/rtl8723bs/include/drv_types.h:17,
                 from drivers/staging/rtl8723bs/core/rtw_recv.c:7:
In function 'memcpy',
    inlined from 'wlanhdr_to_ethhdr' at drivers/staging/rtl8723bs/core/rtw_recv.c:1554:2:
./include/linux/fortify-string.h:41:33: warning: '__builtin_memcpy' offset [0, 5] is out of the bounds [0, 0] [-Warray-bounds]
   41 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^

This is because the compiler sees it is possible for "ptr" to be a NULL
value, and concludes that it has zero size and attempts to copy to it
would overflow. Instead, remove the get_recvframe_data() entirely, as
it's not possible for this to ever be NULL.

Additionally add missing NULL checks after recvframe_pull() (which are
present in the rtl8712 driver).

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Phillip Potter <phil@philpotter.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michael Straube <straube.linux@gmail.com>
Cc: Fabio Aiuto <fabioaiuto83@gmail.com>
Cc: linux-staging@lists.linux.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220118193327.2822099-2-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: do not probe the device if not in the DT
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:24 +0000 (09:55 +0100)]
staging: wfx: do not probe the device if not in the DT

Since the WF200 VID/PID are not reliable, it's recommended to declare it
in the DT. Until now, if the device was not declared, the driver just
printed a warning and continue. But, the risk of a collision is too
high, the driver now returns an error.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-32-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: rename "config-file" DT attribute
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:23 +0000 (09:55 +0100)]
staging: wfx: rename "config-file" DT attribute

"config-file" is too broad. Replace it by "silabs,antenna-config-file"
which is more explicit.

The attribute "config-file" is probably not widely used. This patch
obviously breaks setups that use this attribute.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-31-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: drop legacy compatible values
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:22 +0000 (09:55 +0100)]
staging: wfx: drop legacy compatible values

Values "silabs,wfx-sdio" and "silabs,wfx-spi" are deprecated for a while
now. We take advantage of getting out of the staging tree to drop them
and start from a blank sheet.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-30-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix firmware location
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:21 +0000 (09:55 +0100)]
staging: wfx: fix firmware location

There is currently, a mismatch between the location of the firmware in
linux-firmware and the path written in the driver.

We take this opportunity to relocate the WF200 firmware in wfx/ instead
of silabs/.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-29-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: map 'compatible' attribute with board name
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:20 +0000 (09:55 +0100)]
staging: wfx: map 'compatible' attribute with board name

"WF200" only designates the chip. To make a WiFi board, the chip must be
associated with an antenna. The antenna configuration is located in
separate files (aka PDS files in Silabs wording). Currently, user has to
write in his DT something like:

    compatible = "silabs,wf200";
    config = "brd4001a.pds";

It is far better to embed a list of known boards (chip + antenna) in the
driver. So the user just have to declare:

    compatible = "silabs,brd4001a";

This patch add the configurations for the evaluation boards sold by
Silabs. To provide a full plug-and-play experience, the associated PDS
files[1] will be available in linux-firmware.

This patch does not break compatibility with existing setups.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-28-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: remove force_ps_timeout
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:19 +0000 (09:55 +0100)]
staging: wfx: remove force_ps_timeout

ps_timeout should be in nl80211, not in debugfs. Let's remove it until
the driver is accepted.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-27-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: do not display functions names in logs
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:18 +0000 (09:55 +0100)]
staging: wfx: do not display functions names in logs

It is not necessary to prefix error logs with the function name when an
error message is unique in the code.

Note this patch still prefixes the message 'received event for
non-existent vif' with the function name since it is used several
times.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-26-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: replace compiletime_assert() by BUILD_BUG_ON_MSG()
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:17 +0000 (09:55 +0100)]
staging: wfx: replace compiletime_assert() by BUILD_BUG_ON_MSG()

It seems that BUILD_BUG_ON_MSG() is a bit more popular.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-25-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: use explicit labels for errors
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:16 +0000 (09:55 +0100)]
staging: wfx: use explicit labels for errors

Prefer fully named labels to handle errors instead of err0, err1, ...

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-24-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix structs alignments
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:15 +0000 (09:55 +0100)]
staging: wfx: fix structs alignments

Some structs members were not properly aligned.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-23-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: reformat comments on 100 columns
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:14 +0000 (09:55 +0100)]
staging: wfx: reformat comments on 100 columns

Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns in every comments.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-22-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: reformat code on 100 columns
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:13 +0000 (09:55 +0100)]
staging: wfx: reformat code on 100 columns

Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-21-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix structs tx_policy and hwbus_ops with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:12 +0000 (09:55 +0100)]
staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_

All the types related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix structs hif_* with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:11 +0000 (09:55 +0100)]
staging: wfx: prefix structs hif_* with wfx_

All the types related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix tx_policy_is_equal() with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:10 +0000 (09:55 +0100)]
staging: wfx: prefix tx_policy_is_equal() with wfx_

tx_policy_is_equal() was the only function from data_tx.c without the
prefix wfx_.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix functions from debug.h with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:09 +0000 (09:55 +0100)]
staging: wfx: prefix functions from debug.h with wfx_

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix functions from hwio.h with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:08 +0000 (09:55 +0100)]
staging: wfx: prefix functions from hwio.h with wfx_

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: prefix functions from hif_*.h with wfx_
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:07 +0000 (09:55 +0100)]
staging: wfx: prefix functions from hif_*.h with wfx_

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix ambiguous function name
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:06 +0000 (09:55 +0100)]
staging: wfx: fix ambiguous function name

The prefix 'ieee80211' is reserved for mac80211. It should not been
used.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix ambiguous function name
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:05 +0000 (09:55 +0100)]
staging: wfx: fix ambiguous function name

The prefix 'ieee80211' is reserved for mac80211. It should not been
used.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: preserve endianness of struct hif_ind_startup
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:04 +0000 (09:55 +0100)]
staging: wfx: preserve endianness of struct hif_ind_startup

The hardware fills struct hif_ind_startup with little endian values. So,
declare it with little endian fields.

It is now a bit more verbose to access to fields of struct
hif_ind_startup, but it is less confusing.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostagigg: wfx: replace magic number by HIF_ID_IS_INDICATION
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:03 +0000 (09:55 +0100)]
stagigg: wfx: replace magic number by HIF_ID_IS_INDICATION

Magic values are not recommended.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:02 +0000 (09:55 +0100)]
staging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE

Magic values are not recommended.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: use IS_ALIGNED()
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:01 +0000 (09:55 +0100)]
staging: wfx: use IS_ALIGNED()

It "IS_ALIGNED(ptr, 4)" is more explicit than "ptr & 3".

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: remove useless #ifdef
Jérôme Pouiller [Thu, 13 Jan 2022 08:55:00 +0000 (09:55 +0100)]
staging: wfx: remove useless #ifdef

In the old days, this file was shared with other projects. Obviously,
this "#ifdef __KERNEL__" have no reasons to be in the kernel.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: remove unnecessary braces
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:59 +0000 (09:54 +0100)]
staging: wfx: remove unnecessary braces

Braces are not necessary for single statement blocks

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: explain uncommon Makefile statement
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:58 +0000 (09:54 +0100)]
staging: wfx: explain uncommon Makefile statement

I have got questions about this line from several reviewers. A comment
is definitively welcome.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix comment correctness
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:57 +0000 (09:54 +0100)]
staging: wfx: fix comment correctness

Using DMA with stack allocated buffers is not supported, whatever the
value of CONFIG_VMAP_STACK.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix missing headers
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:56 +0000 (09:54 +0100)]
staging: wfx: fix missing headers

Each headers files should include every types it needs to compile (ie.
"gcc $CFLAGS -xc file.h" should compile)

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix HIF API license
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:55 +0000 (09:54 +0100)]
staging: wfx: fix HIF API license

Apache-2.0 is not allowed in the kernel.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: fix Makefile and Kconfig licenses
Jérôme Pouiller [Thu, 13 Jan 2022 08:54:54 +0000 (09:54 +0100)]
staging: wfx: fix Makefile and Kconfig licenses

License was missing in Kconfig.

Makefile license was GPL-2.0 while rest of the driver use GPL-2.0-only.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: merge ODM_ConfigBBWithHeaderFile with its callers
Martin Kaiser [Mon, 10 Jan 2022 12:46:38 +0000 (13:46 +0100)]
staging: r8188eu: merge ODM_ConfigBBWithHeaderFile with its callers

ODM_ConfigBBWithHeaderFile is a "multiplexer" for ODM_ReadAndConfig_...
functions. It's called only from phy_BB8188E_Config_ParaFile.

We can remove ODM_ConfigBBWithHeaderFile and call the
ODM_ReadAndConfig_... functions directly.

ODM_ReadAndConfig_PHY_REG_PG_8188E does not return an error status,
there's no need for a check.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused cck, ofdm and mcs rate defines
Martin Kaiser [Mon, 10 Jan 2022 12:46:37 +0000 (13:46 +0100)]
staging: r8188eu: remove unused cck, ofdm and mcs rate defines

Remove some unused defines for cck, ofdm and mcs rates.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: merge ODM_ConfigMACWithHeaderFile into PHY_MACConfig8188E
Martin Kaiser [Mon, 10 Jan 2022 12:46:36 +0000 (13:46 +0100)]
staging: r8188eu: merge ODM_ConfigMACWithHeaderFile into PHY_MACConfig8188E

The ODM_ConfigMACWithHeaderFile function is only one line. Merge it into
PHY_MACConfig8188E, which is its only caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: relay errors from ODM_ReadAndConfig_...
Martin Kaiser [Mon, 10 Jan 2022 12:46:35 +0000 (13:46 +0100)]
staging: r8188eu: relay errors from ODM_ReadAndConfig_...

Most of the ODM_ReadAndConfig_... functions return an error status.
Update their callers to process these return values.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: replace the READ_AND_CONFIG
Martin Kaiser [Mon, 10 Jan 2022 12:46:34 +0000 (13:46 +0100)]
staging: r8188eu: replace the READ_AND_CONFIG

The READ_AND_CONFIG macro builds a function name from chip type and
table name.

Remove the macro and use the resulting function names directly. This
makes the code easier to read.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove constant function parameter
Martin Kaiser [Mon, 10 Jan 2022 12:46:33 +0000 (13:46 +0100)]
staging: r8188eu: remove constant function parameter

The only caller of ODM_ConfigRFWithHeaderFile sets rfpath to RF_PATH_A.
Remove the parameter and the check for RF_PATH_A inside the function.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function parameter
Martin Kaiser [Mon, 10 Jan 2022 12:46:32 +0000 (13:46 +0100)]
staging: r8188eu: remove unused function parameter

ODM_ConfigRFWithHeaderFile does not use its content parameter.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove a constant variable
Martin Kaiser [Mon, 10 Jan 2022 12:46:31 +0000 (13:46 +0100)]
staging: r8188eu: remove a constant variable

The eRFPath variable in phy_RF6052_Config_ParaFile is always 0.

Remove the variable and use 0 directly. (enum rf_radio_path)eRFPath can
be replaced with RF_PATH_A, which is defined as 0.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: fix phy_RF6052_Config_ParaFile error handling
Martin Kaiser [Mon, 10 Jan 2022 12:46:30 +0000 (13:46 +0100)]
staging: r8188eu: fix phy_RF6052_Config_ParaFile error handling

Fix the error handling in phy_RF6052_Config_ParaFile.
We can simply return rtStatus.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220110124638.6909-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: we always enqueue in rtw_set_chplan_cmd
Martin Kaiser [Sat, 8 Jan 2022 12:49:59 +0000 (13:49 +0100)]
staging: r8188eu: we always enqueue in rtw_set_chplan_cmd

The only caller of rtw_set_chplan_cmd requests that the message be
enqueued and not sent directly.

Remove the enqueue parameter and the code for direct sending.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HAL_*_ENABLE defines
Martin Kaiser [Sat, 8 Jan 2022 12:49:58 +0000 (13:49 +0100)]
staging: r8188eu: remove HAL_*_ENABLE defines

HAL_(MAC|BB|RF)_ENABLE are always set. Remove the defines and the
checks where they are used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set
Martin Kaiser [Sat, 8 Jan 2022 12:49:57 +0000 (13:49 +0100)]
staging: r8188eu: HW_VAR_MEDIA_STATUS1 is never set

The HW_VAR_MEDIA_STATUS1 hal variable is never set. Remove its define
and the code to set it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: CurrentCckTxPwrIdx is set but not used
Martin Kaiser [Sat, 8 Jan 2022 12:49:56 +0000 (13:49 +0100)]
staging: r8188eu: CurrentCckTxPwrIdx is set but not used

CurrentCckTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

The phy_PowerIndexCheck88E function is now empty. Remove it as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: CurrentOfdm24GTxPwrIdx is set but not used
Martin Kaiser [Sat, 8 Jan 2022 12:49:55 +0000 (13:49 +0100)]
staging: r8188eu: CurrentOfdm24GTxPwrIdx is set but not used

CurrentOfdm24GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: CurrentBW2024GTxPwrIdx is set but not used
Martin Kaiser [Sat, 8 Jan 2022 12:49:54 +0000 (13:49 +0100)]
staging: r8188eu: CurrentBW2024GTxPwrIdx is set but not used

CurrentBW2024GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used
Martin Kaiser [Sat, 8 Jan 2022 12:49:53 +0000 (13:49 +0100)]
staging: r8188eu: CurrentBW4024GTxPwrIdx is set but not used

CurrentBW4024GTxPwrIdx in struct hal_data_8188e is set but not used.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove obsolete defines and comments
Martin Kaiser [Sat, 8 Jan 2022 12:49:52 +0000 (13:49 +0100)]
staging: r8188eu: remove obsolete defines and comments

Remove some unused phycfg defines and obsolete comments.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused chip type settings
Martin Kaiser [Sat, 8 Jan 2022 12:49:51 +0000 (13:49 +0100)]
staging: r8188eu: remove unused chip type settings

Remove some unused defines and macros related to chip type.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ODM_BB_CCK_PD is always set
Martin Kaiser [Sat, 8 Jan 2022 12:49:50 +0000 (13:49 +0100)]
staging: r8188eu: ODM_BB_CCK_PD is always set

The ODM_BB_CCK_PD flag is always set.

Remove the flag and the check if ODM_BB_CCK_PD is not set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ODM_BB_FA_CNT is always set
Martin Kaiser [Sat, 8 Jan 2022 12:49:49 +0000 (13:49 +0100)]
staging: r8188eu: ODM_BB_FA_CNT is always set

The ODM_BB_FA_CNT flag is always set.

Remove the flag and the code to check if ODM_BB_FA_CNT is not set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ODM_MAC_EDCA_TURBO is always set
Martin Kaiser [Sat, 8 Jan 2022 12:49:48 +0000 (13:49 +0100)]
staging: r8188eu: ODM_MAC_EDCA_TURBO is always set

The ODM_MAC_EDCA_TURBO flag is always set for chips that are supported by
this driver. Remove the flag and the one place where it's checked.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220108124959.313215-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove redundant result variable
Minghao Chi [Mon, 10 Jan 2022 01:32:40 +0000 (01:32 +0000)]
staging: rtl8723bs: remove redundant result variable

Return value from ips_netdrv_open() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Link: https://lore.kernel.org/r/20220110013240.644190-1-chi.minghao@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_os_recv_resource_alloc()
Michael Straube [Sat, 8 Jan 2022 08:27:36 +0000 (09:27 +0100)]
staging: r8188eu: remove rtw_os_recv_resource_alloc()

Merge rtw_os_recv_resource_alloc() into _rtw_init_recv_priv() and
remove rtw_os_recv_resource_alloc().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220108082736.16788-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rtw_os_recv_resource_init() does nothing
Michael Straube [Sat, 8 Jan 2022 08:27:35 +0000 (09:27 +0100)]
staging: r8188eu: rtw_os_recv_resource_init() does nothing

The function rtw_os_recv_resource_init() just returns _SUCCESS and
the return value is not checked by the caller. Remove the function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220108082736.16788-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rtw_os_recv_resource_free() is empty
Michael Straube [Sat, 8 Jan 2022 08:27:34 +0000 (09:27 +0100)]
staging: r8188eu: rtw_os_recv_resource_free() is empty

The function rtw_os_recv_resource_free() is empty. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220108082736.16788-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert switch to if statement in mgt_dispatcher()
Michael Straube [Sat, 8 Jan 2022 08:27:33 +0000 (09:27 +0100)]
staging: r8188eu: convert switch to if statement in mgt_dispatcher()

The 'switch (GetFrameSubType(pframe))' in mgt_dispatcher() has only
one case that does something different than the default case. Convert
the switch to an if statement to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220108082736.16788-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rtw_hostapd_mlme_rx() is empty
Michael Straube [Sat, 8 Jan 2022 08:27:32 +0000 (09:27 +0100)]
staging: r8188eu: rtw_hostapd_mlme_rx() is empty

The function rtw_hostapd_mlme_rx() is empty. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220108082736.16788-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert/remove DBG_88E calls in os_dep/usb_ops_linux.c
Phillip Potter [Sat, 8 Jan 2022 00:55:50 +0000 (00:55 +0000)]
staging: r8188eu: convert/remove DBG_88E calls in os_dep/usb_ops_linux.c

Convert DBG_88E macro calls in os_dep/usb_ops_linux.c to use netdev_dbg
when they may display useful information, and remove erroneous DBG_88E
calls entirely.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220108005550.26264-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E call in core/rtw_cmd.c
Phillip Potter [Sat, 8 Jan 2022 00:55:49 +0000 (00:55 +0000)]
staging: r8188eu: convert DBG_88E call in core/rtw_cmd.c

Convert the DBG_88E macro call in core/rtw_cmd.c to use netdev_dbg
as its information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220108005550.26264-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove DBG_88E call from os_dep/osdep_service.c
Phillip Potter [Sat, 8 Jan 2022 00:55:48 +0000 (00:55 +0000)]
staging: r8188eu: remove DBG_88E call from os_dep/osdep_service.c

Remove the single DBG_88E macro call from os_dep/osdep_service.c, as it
is unreachable anyway. This gets the driver closer to the eventual
removal of DBG_88E itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220108005550.26264-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in os_dep/xmit_linux.c
Phillip Potter [Sat, 8 Jan 2022 00:55:47 +0000 (00:55 +0000)]
staging: r8188eu: convert DBG_88E calls in os_dep/xmit_linux.c

Convert three DBG_88E macro calls in core/rtw_ap.c to use netdev_dbg
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220108005550.26264-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert/remove DBG_88E calls in core/rtw_ap.c
Phillip Potter [Sat, 8 Jan 2022 00:55:46 +0000 (00:55 +0000)]
staging: r8188eu: convert/remove DBG_88E calls in core/rtw_ap.c

Convert DBG_88E macro calls in core/rtw_ap.c to use netdev_dbg when they
may display useful information, and remove erroneous DBG_88E calls
entirely.

This leaves six empty static functions which only had DBG_88E calls,
so just remove them:

update_bcn_fixed_ie
update_bcn_htcap_ie
update_bcn_htinfo_ie
update_bcn_rsn_ie
update_bcn_wpa_ie
update_bcn_wmm_ie

also modifying the if blocks/switch cases that invoke them to no longer do
so. This goes further towards the goal of removing this non-standard
debugging code.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220108005550.26264-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_APFM_ON_MAC
Michael Straube [Fri, 7 Jan 2022 21:50:33 +0000 (22:50 +0100)]
staging: r8188eu: remove HW_VAR_APFM_ON_MAC

SetHwReg8188EU() and GetHwReg8188EU() are never called with
HW_VAR_APFM_ON_MAC. Remove that case from both functions.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: EfuseUsedBytes is set but never used
Michael Straube [Fri, 7 Jan 2022 21:50:32 +0000 (22:50 +0100)]
staging: r8188eu: EfuseUsedBytes is set but never used

The field EfuseUsedBytes of struct hal_data_8188e is set but never
used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_EFUSE_BYTES from GetHwReg8188EU()
Michael Straube [Fri, 7 Jan 2022 21:50:31 +0000 (22:50 +0100)]
staging: r8188eu: remove HW_VAR_EFUSE_BYTES from GetHwReg8188EU()

GetHwReg8188EU() is never called with HW_VAR_EFUSE_BYTES. Remove that
case from the function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_CURRENT_ANTENNA from GetHwReg8188EU()
Michael Straube [Fri, 7 Jan 2022 21:50:30 +0000 (22:50 +0100)]
staging: r8188eu: remove HW_VAR_CURRENT_ANTENNA from GetHwReg8188EU()

GetHwReg8188EU() is never called with HW_VAR_CURRENT_ANTENNA. Remove
that case from the function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_TXPAUSE
Michael Straube [Fri, 7 Jan 2022 21:50:29 +0000 (22:50 +0100)]
staging: r8188eu: remove HW_VAR_TXPAUSE

SetHwReg8188EU() and GetHwReg8188EU() are never called with
HW_VAR_TXPAUSE. Remove that case from both functions.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_BASIC_RATE from GetHwReg8188EU()
Michael Straube [Fri, 7 Jan 2022 21:50:28 +0000 (22:50 +0100)]
staging: r8188eu: remove HW_VAR_BASIC_RATE from GetHwReg8188EU()

GetHwReg8188EU() is never called with HW_VAR_BASIC_RATE. Remove that
case from the function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107215033.12257-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: move firmware related macros to rtw_fw.h
Michael Straube [Fri, 7 Jan 2022 14:36:17 +0000 (15:36 +0100)]
staging: r8188eu: move firmware related macros to rtw_fw.h

Move firmware related macros from rtl8188e_hal.h to rtw_fw.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107143617.2214-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add spaces around & operator in IS_FW_HEADER_EXIST
Michael Straube [Fri, 7 Jan 2022 14:36:16 +0000 (15:36 +0100)]
staging: r8188eu: add spaces around & operator in IS_FW_HEADER_EXIST

Add spaces around & operator in the macro IS_FW_HEADER_EXIST to
improve readability and follow kernel coding style.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107143617.2214-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename _pFwHdr in IS_FW_HEADER_EXIST
Michael Straube [Fri, 7 Jan 2022 14:36:15 +0000 (15:36 +0100)]
staging: r8188eu: rename _pFwHdr in IS_FW_HEADER_EXIST

Rename _pFwHdr in the macro IS_FW_HEADER_EXIST to avoid camel case.

_pFwHdr -> _fwhdr

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107143617.2214-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: move firmware loading code out of the hal layer
Michael Straube [Fri, 7 Jan 2022 10:36:20 +0000 (11:36 +0100)]
staging: r8188eu: move firmware loading code out of the hal layer

Move the firmware loading functions from rtl8188e_hal_init.c into the
new file core/rtw_fw.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-20-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename pFirmwareBuf and FirmwareLen
Michael Straube [Fri, 7 Jan 2022 10:36:19 +0000 (11:36 +0100)]
staging: r8188eu: rename pFirmwareBuf and FirmwareLen

Rename the variables pFirmwareBuf and FirmwareLen in
rtl8188e_firmware_download() to avoid camel case.

pFirmwareBuf -> fw_data
FirmwareLen -> fw_size

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-19-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename pFwHdr in rtl8188e_firmware_download()
Michael Straube [Fri, 7 Jan 2022 10:36:18 +0000 (11:36 +0100)]
staging: r8188eu: rename pFwHdr in rtl8188e_firmware_download()

Rename the variable pFwHdr in rtl8188e_firmware_download() to avoid
camel case.

pFwHdr -> fwhdr

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename writeFW_retry
Michael Straube [Fri, 7 Jan 2022 10:36:17 +0000 (11:36 +0100)]
staging: r8188eu: rename writeFW_retry

Rename the variable writeFW_retry in rtl8188e_firmware_download()
to avoid camel case.

writeFW_retry -> write_fw_retry

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename FWDL_ChkSum_rpt
Michael Straube [Fri, 7 Jan 2022 10:36:16 +0000 (11:36 +0100)]
staging: r8188eu: rename FWDL_ChkSum_rpt

Rename FWDL_ChkSum_rpt to avoid camel case.

FWDL_ChkSum_rpt -> FWDL_CHKSUM_RPT

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename rtSatus in rtl8188e_firmware_download()
Michael Straube [Fri, 7 Jan 2022 10:36:15 +0000 (11:36 +0100)]
staging: r8188eu: rename rtSatus in rtl8188e_firmware_download()

Rename the variable rtStatus in rtl8188e_firmware_download() to avoid
camel case.

rtStatus -> ret

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename Exit label in rtl8188e_firmware_download()
Michael Straube [Fri, 7 Jan 2022 10:36:14 +0000 (11:36 +0100)]
staging: r8188eu: rename Exit label in rtl8188e_firmware_download()

Rename the Exit label in rtl8188e_firmware_download() to avoid camel
case.

Exit -> exit

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert two functions from s32 to int
Michael Straube [Fri, 7 Jan 2022 10:36:13 +0000 (11:36 +0100)]
staging: r8188eu: convert two functions from s32 to int

Convert the return type of fw_free_to_go() and
rtl8188e_firmware_download() from s32 to the more common int.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up rtw_reset_8051()
Michael Straube [Fri, 7 Jan 2022 10:36:12 +0000 (11:36 +0100)]
staging: r8188eu: clean up rtw_reset_8051()

Rename the local variable u1bTmp in rtw_reset_8051() to avoid camel
case and remove a call to DBG_88E that contains no important
information.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename fw related functions to avoid camel case
Michael Straube [Fri, 7 Jan 2022 10:36:11 +0000 (11:36 +0100)]
staging: r8188eu: rename fw related functions to avoid camel case

Rename firmware related functions to avoid camel case.

rtl8188e_FirmwareDownload -> rtl8188e_firmware_download
_FWDownloadEnable -> fw_download_enable
_8051Reset88E -> rtw_reset_8051
_FWFreeToGo -> fw_free_to_go
_BlockWrite -> block_write
_PageWrite -> page_write
_WriteFW -> write_fw

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use kmemdup instead of kzalloc and memcpy
Michael Straube [Fri, 7 Jan 2022 10:36:10 +0000 (11:36 +0100)]
staging: r8188eu: use kmemdup instead of kzalloc and memcpy

Use kmemdup instead of kzalloc and memcpy in load_firmware().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename fields of struct rt_firmware
Michael Straube [Fri, 7 Jan 2022 10:36:09 +0000 (11:36 +0100)]
staging: r8188eu: rename fields of struct rt_firmware

Rename fields of struct rt_firmware to avoid camel case.

szFwBuffer -> data
ulFwLength -> size

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename parameter pFirmware of load_firmware()
Michael Straube [Fri, 7 Jan 2022 10:36:08 +0000 (11:36 +0100)]
staging: r8188eu: rename parameter pFirmware of load_firmware()

Rename the parameter pFirmware of load_firmware() to avoid camel case.

pFirmware -> rtfw

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert type of return variable in load_firmware()
Michael Straube [Fri, 7 Jan 2022 10:36:07 +0000 (11:36 +0100)]
staging: r8188eu: convert type of return variable in load_firmware()

The return type of load_firmware() is int. Change the type of the
return variable from s32 to int to match the function return type.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename rtStatus in load_firmware()
Michael Straube [Fri, 7 Jan 2022 10:36:06 +0000 (11:36 +0100)]
staging: r8188eu: rename rtStatus in load_firmware()

Rename the local variable rtStatus in load_firmware() to avoid camel
case.

rtStatus -> ret

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename Exit label in load_firmware()
Michael Straube [Fri, 7 Jan 2022 10:36:05 +0000 (11:36 +0100)]
staging: r8188eu: rename Exit label in load_firmware()

Rename Exit label in load_firmware() to avoid camel case.

Exit -> exit

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: release_firmware is not called if allocation fails
Michael Straube [Fri, 7 Jan 2022 10:36:04 +0000 (11:36 +0100)]
staging: r8188eu: release_firmware is not called if allocation fails

In function load_firmware() release_firmware() is not called if the
allocation of pFirmware->szFwBuffer fails or if fw->size is greater
than FW_8188E_SIZE.

Move the call to release_firmware() to the exit label at the end of
the function to fix this.

Fixes: 8cd574e6af54 ("staging: r8188eu: introduce new hal dir for RTL8188eu driver")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtl8188e_InitializeFirmwareVars()
Michael Straube [Fri, 7 Jan 2022 10:36:03 +0000 (11:36 +0100)]
staging: r8188eu: remove rtl8188e_InitializeFirmwareVars()

Merge rtl8188e_InitializeFirmwareVars() into rtl8188eu_hal_init()
and remove rtl8188e_InitializeFirmwareVars().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove Firmware* from struct hal_data_8188e
Michael Straube [Fri, 7 Jan 2022 10:36:02 +0000 (11:36 +0100)]
staging: r8188eu: remove Firmware* from struct hal_data_8188e

The fields FirmwareVersion, FirmwareSubVersion and FirmwareSignature
of struct hal_data_8188e are only used in the function
rtl8188e_FirmwareDownload(). Use local variables in that function and
remove the fields from struct hal_data_8188e. FirmwareVersionRev is
not used at all, remove it as well.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoLinux 5.17-rc1
Linus Torvalds [Sun, 23 Jan 2022 08:12:53 +0000 (10:12 +0200)]
Linux 5.17-rc1

2 years agoMerge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 23 Jan 2022 06:14:21 +0000 (08:14 +0200)]
Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git./linux/kernel/git/acme/linux

Pull more perf tools updates from Arnaldo Carvalho de Melo:

 - Fix printing 'phys_addr' in 'perf script'.

 - Fix failure to add events with 'perf probe' in ppc64 due to not
   removing leading dot (ppc64 ABIv1).

 - Fix cpu_map__item() python binding building.

 - Support event alias in form foo-bar-baz, add pmu-events and
   parse-event tests for it.

 - No need to setup affinities when starting a workload or attaching to
   a pid.

 - Use path__join() to compose a path instead of ad-hoc snprintf()
   equivalent.

 - Override attr->sample_period for non-libpfm4 events.

 - Use libperf cpumap APIs instead of accessing the internal state
   directly.

 - Sync x86 arch prctl headers and files changed by the new
   set_mempolicy_home_node syscall with the kernel sources.

 - Remove duplicate include in cpumap.h.

 - Remove redundant err variable.

* tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
  perf tools: Remove redundant err variable
  perf test: Add parse-events test for aliases with hyphens
  perf test: Add pmu-events test for aliases with hyphens
  perf parse-events: Support event alias in form foo-bar-baz
  perf evsel: Override attr->sample_period for non-libpfm4 events
  perf cpumap: Remove duplicate include in cpumap.h
  perf cpumap: Migrate to libperf cpumap api
  perf python: Fix cpu_map__item() building
  perf script: Fix printing 'phys_addr' failure issue
  tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall
  tools headers UAPI: Sync x86 arch prctl headers with the kernel sources
  perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)
  perf evlist: No need to setup affinities when disabling events for pid targets
  perf evlist: No need to setup affinities when enabling events for pid targets
  perf stat: No need to setup affinities when starting a workload
  perf affinity: Allow passing a NULL arg to affinity__cleanup()
  perf probe: Fix ppc64 'perf probe add events failed' case

2 years agoMerge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Sun, 23 Jan 2022 06:07:02 +0000 (08:07 +0200)]
Merge tag 'trace-v5.17-3' of git://git./linux/kernel/git/rostedt/linux-trace

Pull ftrace fix from Steven Rostedt:
 "Fix s390 breakage from sorting mcount tables.

  The latest merge of the tracing tree sorts the mcount table at build
  time. But s390 appears to do things differently (like always) and
  replaces the sorted table back to the original unsorted one. As the
  ftrace algorithm depends on it being sorted, bad things happen when it
  is not, and s390 experienced those bad things.

  Add a new config to tell the boot if the mcount table is sorted or
  not, and allow s390 to opt out of it"

* tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ftrace: Fix assuming build time sort works for s390

2 years agoftrace: Fix assuming build time sort works for s390
Steven Rostedt (Google) [Sat, 22 Jan 2022 14:17:10 +0000 (09:17 -0500)]
ftrace: Fix assuming build time sort works for s390

To speed up the boot process, as mcount_loc needs to be sorted for ftrace
to work properly, sorting it at build time is more efficient than boot up
and can save milliseconds of time. Unfortunately, this change broke s390
as it will modify the mcount_loc location after the sorting takes place
and will put back the unsorted locations. Since the sorting is skipped at
boot up if it is believed that it was sorted at run time, ftrace can crash
as its algorithms are dependent on the list being sorted.

Add a new config BUILDTIME_MCOUNT_SORT that is set when
BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
if sorting should take place at boot up.

Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
Fixes: 72b3942a173c ("scripts: ftrace - move the sort-processing in ftrace_init")
Reported-by: Sven Schnelle <svens@linux.ibm.com>
Tested-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2 years agoMerge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masah...
Linus Torvalds [Sun, 23 Jan 2022 04:32:29 +0000 (06:32 +0200)]
Merge tag 'kbuild-fixes-v5.17' of git://git./linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage

 - Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH

 - Fix build errors in certs/Makefile

* tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty
  certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI
  Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH"
  usr/include/Makefile: add linux/nfc.h to the compile-test coverage

2 years agoMerge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux
Linus Torvalds [Sun, 23 Jan 2022 04:20:44 +0000 (06:20 +0200)]
Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux

Pull bitmap updates from Yury Norov:

 - introduce for_each_set_bitrange()

 - use find_first_*_bit() instead of find_next_*_bit() where possible

 - unify for_each_bit() macros

* tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
  vsprintf: rework bitmap_list_string
  lib: bitmap: add performance test for bitmap_print_to_pagebuf
  bitmap: unify find_bit operations
  mm/percpu: micro-optimize pcpu_is_populated()
  Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
  find: micro-optimize for_each_{set,clear}_bit()
  include/linux: move for_each_bit() macros from bitops.h to find.h
  cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
  tools: sync tools/bitmap with mother linux
  all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
  cpumask: use find_first_and_bit()
  lib: add find_first_and_bit()
  arch: remove GENERIC_FIND_FIRST_BIT entirely
  include: move find.h from asm_generic to linux
  bitops: move find_bit_*_le functions from le.h to find.h
  bitops: protect find_first_{,zero}_bit properly