platform/kernel/linux-rpi.git
2 years agostaging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
Arınç ÜNAL [Tue, 25 Jan 2022 15:39:02 +0000 (18:39 +0300)]
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6

Change phy-mode of gmac0 to trgmii to match the other side, port@6.

Flow control needs to be enabled on both sides to work.
It is already enabled on gmac0, enable it on port@6 too.

Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Link: https://lore.kernel.org/r/20220125153903.1469-4-arinc.unal@arinc9.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: mt7621-dts: fix switch0@0 warnings
Arınç ÜNAL [Tue, 25 Jan 2022 15:39:01 +0000 (18:39 +0300)]
staging: mt7621-dts: fix switch0@0 warnings

Remove reg property from ports node to fix this warning:

Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch0@0/ports: node has a reg or ranges property, but no unit name

Another warning surfaces afterwards. Remove #address-cells and #size-cells
from switch0@0 node to fix this warning:

Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch0@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Link: https://lore.kernel.org/r/20220125153903.1469-3-arinc.unal@arinc9.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: mt7621-dts: fix formatting
Arınç ÜNAL [Tue, 25 Jan 2022 15:39:00 +0000 (18:39 +0300)]
staging: mt7621-dts: fix formatting

Fix formatting on mt7621.dtsi.

Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Link: https://lore.kernel.org/r/20220125153903.1469-2-arinc.unal@arinc9.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: add missing register contants
Paulo Miguel Almeida [Mon, 24 Jan 2022 04:26:36 +0000 (17:26 +1300)]
staging: pi433: add missing register contants

add missing register constants present in RFM69 and/or RFM69HW so that
we don't need to hardcode values when referencing them.

this patch adds REG_TESTLNA, REG_TESTAFC constants

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220124042636.GA7962@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: enforce tx_cfg to be set before any message can be sent
Paulo Miguel Almeida [Fri, 14 Jan 2022 22:16:43 +0000 (11:16 +1300)]
staging: pi433: enforce tx_cfg to be set before any message can be sent

this driver relies on exposing a char device to userspace to tx
messages. Every message can be sent using different trasmitter settings
such so the tx_cfg must be written before sending any messages.
Failing to do so will cause the message to fail silently depending on
printk/dynamic_debug settings which makes it hard to troubleshoot.

This patch add a control variable that will get initialized once tx_cfg
is set for the fd used when interacting with the char device.

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220114221643.GA7843@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: fbtft: Deduplicate driver registration macros
Uwe Kleine-König [Tue, 18 Jan 2022 18:13:38 +0000 (19:13 +0100)]
staging: fbtft: Deduplicate driver registration macros

The two macros FBTFT_REGISTER_DRIVER and FBTFT_REGISTER_SPI_DRIVER
contain quite some duplication: Both define an spi driver and an of device
table and the differences are quite subtle.

So create two new macros and use both twice.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220118181338.207943-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: validate max bit_rate based on modulation used
Paulo Miguel Almeida [Tue, 18 Jan 2022 23:05:55 +0000 (12:05 +1300)]
staging: pi433: validate max bit_rate based on modulation used

Max bit rate is dependent on which modulation is used. Previous
validation routine only took into consideration min bit rate which can
lead a misconfiguration of the rf69 chip causing the packets not to be
sent/read.

This patch enhances that input check in set_bit_rate to account for
modulation values and their respective max bit rate

Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220118230555.GA4961@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: change order in which driver config the rf69 chip
Paulo Miguel Almeida [Tue, 18 Jan 2022 23:05:02 +0000 (12:05 +1300)]
staging: pi433: change order in which driver config the rf69 chip

There is an explicit dependency between modulation and bit rate
configurations. To ensure proper validation of input value for the
set_bit_rate routine, we must ensure that modulation has been set
before.

This patch ensures that set_modulation is always called before
set_bit_rate for both RX and TX routines

Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220118230502.GA4897@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: fix validation for min bit rate supported by the device
Paulo Miguel Almeida [Tue, 18 Jan 2022 23:04:13 +0000 (12:04 +1300)]
staging: pi433: fix validation for min bit rate supported by the device

rf69 datasheets establishes that the minimum supported bit rate is
1.2 kbps regardless of modulation.

this patch replaces the errouneous validation with the correct value

Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220118230413.GA4859@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_dev: Avoid unnecessary alloc in vchiq_ioc_create_service
Stefan Wahren [Sun, 23 Jan 2022 20:02:23 +0000 (21:02 +0100)]
staging: vchiq_dev: Avoid unnecessary alloc in vchiq_ioc_create_service

There is no need to allocate the user service in case there is a VCHIQ
connection required, but not available. So simply check the error conditions
before doing an expensive memory allocation.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-19-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: handle NULL result of find_service_by_handle
Stefan Wahren [Sun, 23 Jan 2022 20:02:22 +0000 (21:02 +0100)]
staging: vchiq_core: handle NULL result of find_service_by_handle

In case of an invalid handle the function find_servive_by_handle
returns NULL. So take care of this and avoid a NULL pointer dereference.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-18-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_arm: Avoid NULL ptr deref in vchiq_dump_platform_instances
Stefan Wahren [Sun, 23 Jan 2022 20:02:21 +0000 (21:02 +0100)]
staging: vchiq_arm: Avoid NULL ptr deref in vchiq_dump_platform_instances

vchiq_get_state() can return a NULL pointer. So handle this cases and
avoid a NULL pointer derefence in vchiq_dump_platform_instances.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-17-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_arm: make vchiq_get_state return early
Stefan Wahren [Sun, 23 Jan 2022 20:02:20 +0000 (21:02 +0100)]
staging: vchiq_arm: make vchiq_get_state return early

Make vchiq_get_state return early with NULL and improve the readability.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-16-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: use min_t macro
Stefan Wahren [Sun, 23 Jan 2022 20:02:19 +0000 (21:02 +0100)]
staging: vchiq_core: use min_t macro

Don't try to open code min_t().

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-15-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: avoid ternary operator for set_service_state
Stefan Wahren [Sun, 23 Jan 2022 20:02:18 +0000 (21:02 +0100)]
staging: vchiq_core: avoid ternary operator for set_service_state

There is already a check for service->sync, so use this instead of a
separate ternary operator to update the service state.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-14-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: fix alignment
Stefan Wahren [Sun, 23 Jan 2022 20:02:17 +0000 (21:02 +0100)]
staging: vchiq_core: fix alignment

This fixes some alignment found by checkpatch.pl.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-13-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: reduce multi-line statements
Stefan Wahren [Sun, 23 Jan 2022 20:02:16 +0000 (21:02 +0100)]
staging: vchiq_core: reduce multi-line statements

In order to improvement readability try to reduce the multi-line statements.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-12-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: drop prefix of vchiq_set_service_state
Stefan Wahren [Sun, 23 Jan 2022 20:02:15 +0000 (21:02 +0100)]
staging: vchiq_core: drop prefix of vchiq_set_service_state

The name of this static function is unnecessary longish. So drop the prefix.
This gives us the chance to avoid some multi-line statements or fix some
indentations later.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-11-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: align return statements in msg_type_str
Stefan Wahren [Sun, 23 Jan 2022 20:02:14 +0000 (21:02 +0100)]
staging: vchiq_core: align return statements in msg_type_str

The return statements aren't properly aligned. So fix this by using tabs.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-10-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: simplify vchiq_add_service_internal
Stefan Wahren [Sun, 23 Jan 2022 20:02:13 +0000 (21:02 +0100)]
staging: vchiq_core: simplify vchiq_add_service_internal

Better use kzalloc to properly init vchiq_service with zero. As a result
this saves us all the zero assignments.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-9-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: fix type of parameter localport
Stefan Wahren [Sun, 23 Jan 2022 20:02:12 +0000 (21:02 +0100)]
staging: vchiq_core: fix type of parameter localport

The whole vchiq driver uses unsigned int for "localport" except of
find_service_by_port(). So fix this and get the rid of this suspicous
cast.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-8-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: add message handling to TODO list
Stefan Wahren [Sun, 23 Jan 2022 20:02:11 +0000 (21:02 +0100)]
staging: vchiq: add message handling to TODO list

Recently Arnd Bergmann noticed that the message handling looks broken
to him. So add this point on the TODO list.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-7-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: drop completed tasks from TODO
Stefan Wahren [Sun, 23 Jan 2022 20:02:10 +0000 (21:02 +0100)]
staging: vchiq: drop completed tasks from TODO

This removes all already completed tasks from the TODO file.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-6-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: convert TODOs into unordered list
Stefan Wahren [Sun, 23 Jan 2022 20:02:09 +0000 (21:02 +0100)]
staging: vchiq: convert TODOs into unordered list

Keeping the order of the TODO items is hard and also unnecessary.
So convert it to an unordered list.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-5-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_arm: introduce is_adjacent_block
Stefan Wahren [Sun, 23 Jan 2022 20:02:08 +0000 (21:02 +0100)]
staging: vchiq_arm: introduce is_adjacent_block

The check for an adjacent block is hard to read. So move it into a separate
inline function.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-4-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_debugfs: get the rid of n_log_entries
Stefan Wahren [Sun, 23 Jan 2022 20:02:07 +0000 (21:02 +0100)]
staging: vchiq_debugfs: get the rid of n_log_entries

There is no need for this static variable, so use the macro directly.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-3-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq_core: fix indentation in vchiq_log_dump_mem
Stefan Wahren [Sun, 23 Jan 2022 20:02:06 +0000 (21:02 +0100)]
staging: vchiq_core: fix indentation in vchiq_log_dump_mem

This align the indentation in the var declaration of vchiq_log_dump_mem to
the other code.

Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1642968143-19281-2-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: handle rtw_init_netdev_name() failure appropriately
Vihas Mak [Sun, 23 Jan 2022 18:17:35 +0000 (23:47 +0530)]
staging: r8188eu: handle rtw_init_netdev_name() failure appropriately

rtw_init_netdev_name() calls dev_alloc_name() which allocates the name
for the device as per the given name format.
The name format is specified by the module parameter "ifname".
It returns a negative err code if the format is invalid. Handle this
error appropriately.
Cancel the timers ininitliazed by rtw_init_drv_sw() before calling
rtw_free_drv_sw() and then proceed to free the adapter.

Also, if register_netdev() fails then goto free_drv_sw instead of
goto handle_dualmac.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Mak <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220123181734.10402-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: pi433: move get version func to where all other functions are
Paulo Miguel Almeida [Sat, 8 Jan 2022 21:27:28 +0000 (10:27 +1300)]
staging: pi433: move get version func to where all other functions are

As a convention for the pi433 driver, all routines that deals with the
rf69 chip are defined in the rf69.c file. There was an exception to the
rule in which the uC version verification was being done directly
elsewhere. While at it, the Version Register hardcoded value was
replaced with a pre-existing constant in the driver.

This patch adds rf69_get_version function to rf69.c

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20220108212728.GA7784@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: merge Init_ODM_ComInfo_88E and rtl8188e_init_dm_priv
Martin Kaiser [Sat, 22 Jan 2022 17:05:47 +0000 (18:05 +0100)]
staging: r8188eu: merge Init_ODM_ComInfo_88E and rtl8188e_init_dm_priv

rtl8188e_init_dm_priv is the only caller of Init_ODM_ComInfo_88E.
Merge the two functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220122170547.68378-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ODM_RF_CALIBRATION is always set
Martin Kaiser [Sat, 22 Jan 2022 17:05:46 +0000 (18:05 +0100)]
staging: r8188eu: ODM_RF_CALIBRATION is always set

The ODM_RF_CALIBRATION flag is set in Init_ODM_ComInfo_88E directly
after the driver is probed and it's never cleared.

Remove the flag and the code where it's set or checked.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220122170547.68378-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ODM_RF_TX_PWR_TRACK is always set
Martin Kaiser [Sat, 22 Jan 2022 17:05:45 +0000 (18:05 +0100)]
staging: r8188eu: ODM_RF_TX_PWR_TRACK is always set

The ODM_RF_TX_PWR_TRACK flag is set in Init_ODM_ComInfo_88E directly
after the driver is probed and it's never cleared.

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/20220122170547.68378-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: EntryMaxUndecoratedSmoothedPWDB is set but not used
Martin Kaiser [Sat, 22 Jan 2022 17:05:44 +0000 (18:05 +0100)]
staging: r8188eu: EntryMaxUndecoratedSmoothedPWDB is set but not used

The variable EntryMaxUndecoratedSmoothedPWDB in struct dm_priv
is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220122170547.68378-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary braces in rtw_xmit.c
Marcelo Aloisio da Silva [Wed, 19 Jan 2022 03:49:33 +0000 (00:49 -0300)]
staging: r8188eu: remove unnecessary braces in rtw_xmit.c

Remove unnecessary braces reported by checkpatch.pl in rtw_xmit.c.

Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
Link: https://lore.kernel.org/r/20220119034933.GA29744@snoopy
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_netif_stop_queue wrapper
Martin Kaiser [Sat, 15 Jan 2022 16:55:35 +0000 (17:55 +0100)]
staging: r8188eu: remove rtw_netif_stop_queue wrapper

Remove the rtw_netif_stop_queue wrapper function. Call
netif_tx_stop_all_queues directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_netif_start_queue wrapper
Martin Kaiser [Sat, 15 Jan 2022 16:55:34 +0000 (17:55 +0100)]
staging: r8188eu: remove rtw_netif_start_queue wrapper

Remove the rtw_netif_start_queue wrapper function. Call
netif_tx_start_all_queues directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_netif_wake_queue wrapper
Martin Kaiser [Sat, 15 Jan 2022 16:55:33 +0000 (17:55 +0100)]
staging: r8188eu: remove rtw_netif_wake_queue wrapper

Remove the rtw_netif_wake_queue wrapper function. Call
netif_tx_wake_all_queues directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: call msecs_to_jiffies in _set_timer
Martin Kaiser [Sat, 15 Jan 2022 16:55:32 +0000 (17:55 +0100)]
staging: r8188eu: call msecs_to_jiffies in _set_timer

The _set_timer wrapper function takes a timeout in milliseconds.
Call msecs_to_jiffies to convert the timeout to jiffies. Don't do
the calculation ourselves.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove _cancel_timer wrapper
Martin Kaiser [Sat, 15 Jan 2022 16:55:31 +0000 (17:55 +0100)]
staging: r8188eu: remove _cancel_timer wrapper

Remove the _cancel_timer wrapper function and call del_timer_sync
directly.

None of the callers needs the bcancelled variable that's populated by
_cancel_timer, these variables can be removed in the calling functions.

rtw_surveydone_event_callback calls _cancel_timer only if it believes
that the timer is currently running. We can drop this. It's safe to
call del_timer_sync when the timer is not running. The timer in question,
scan_to_timer, is used only for the site survey command (the rtw_survey
functions) so we won't be stopping it while it's in use by someone else.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_list_delete wrapper
Martin Kaiser [Sat, 15 Jan 2022 16:55:30 +0000 (17:55 +0100)]
staging: r8188eu: remove rtw_list_delete wrapper

Remove the rtw_list_delete wrapper function. Call list_del_init directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused PATH_LENGTH_MAX define
Martin Kaiser [Sat, 15 Jan 2022 16:55:29 +0000 (17:55 +0100)]
staging: r8188eu: remove unused PATH_LENGTH_MAX define

PATH_LENGTH_MAX in osdep_service.h is not used and can
be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused bitshift function
Martin Kaiser [Sat, 15 Jan 2022 16:55:28 +0000 (17:55 +0100)]
staging: r8188eu: remove unused bitshift function

The bitshift function from osdep_service.h is not used.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macros
Martin Kaiser [Sat, 15 Jan 2022 16:55:27 +0000 (17:55 +0100)]
staging: r8188eu: remove unused macros

Remove some unused macros from osdep_service.h.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused externl variables
Martin Kaiser [Sat, 15 Jan 2022 16:55:26 +0000 (17:55 +0100)]
staging: r8188eu: remove unused externl variables

Remove a group of external variables which are not used in
osdep_service.h or in the files where osdep_service.h is included.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220115165536.231210-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c
Phillip Potter [Mon, 10 Jan 2022 09:00:20 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_sta_mgt.c

Convert the DBG_88E macro calls in core/rtw_sta_mgt.c to use pr_debug,
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.

These calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_mlme_ext.c
Phillip Potter [Mon, 10 Jan 2022 09:00:19 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_mlme_ext.c

Convert the DBG_88E macro calls in core/rtw_mlme_ext.c to use pr_debug
or netdev_dbg appropriately, 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. Also remove some commented out
or unnecessary DBG_88E calls altogether.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_ioctl_set.c
Phillip Potter [Mon, 10 Jan 2022 09:00:18 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_ioctl_set.c

Convert the DBG_88E macro calls in core/rtw_ioctl_set.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.
Also remove one unnecessary DBG_88E call which was already commented
out.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_mlme.c
Phillip Potter [Mon, 10 Jan 2022 09:00:17 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_mlme.c

Convert the DBG_88E macro calls in core/rtw_mlme.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.
Also remove some unnecessary DBG_88E calls altogether as all they do
is print the function name.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_iol.c
Phillip Potter [Mon, 10 Jan 2022 09:00:16 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_iol.c

Convert the DBG_88E macro calls in core/rtw_iol.c to use pr_debug
or netdev_dbg appropriately, 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.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_xmit.c
Phillip Potter [Mon, 10 Jan 2022 09:00:15 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_xmit.c

Convert the DBG_88E macro calls in core/rtw_xmit.c to use pr_debug
or netdev_dbg appropriately, 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. Also remove some commented out
DBG_88E calls altogether.

Some calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_ieee80211.c
Phillip Potter [Mon, 10 Jan 2022 09:00:14 +0000 (09:00 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_ieee80211.c

Convert the DBG_88E macro calls in core/rtw_ieee80211.c to use pr_debug
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.

These calls are at points in the call chain where use of dev_dbg or
netdev_dbg isn't possible due to lack of device pointer, so plain
pr_debug is appropriate here.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220110090020.6800-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoStaging: rtl8723bs: Inserting blank line after declaration
Jagath Jog J [Mon, 24 Jan 2022 03:44:56 +0000 (09:14 +0530)]
Staging: rtl8723bs: Inserting blank line after declaration

Fix following checkpatch.pl warning by inserting blank line
WARNING: Missing a blank line after declarations

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220124034456.8665-4-jagathjog1996@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoStaging: rtl8723bs: Removed extra spaces between datatype and variable
Jagath Jog J [Mon, 24 Jan 2022 03:44:55 +0000 (09:14 +0530)]
Staging: rtl8723bs: Removed extra spaces between datatype and variable

Fix following checkpatch.pl warning by placing single space between
datatype and variable
WARNING: please, no space before tabs

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220124034456.8665-3-jagathjog1996@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoStaging: rtl8723bs: Placing opening { braces in previous line
Jagath Jog J [Mon, 24 Jan 2022 03:44:54 +0000 (09:14 +0530)]
Staging: rtl8723bs: Placing opening { braces in previous line

Fix following checkpatch.pl error by placing opening {
braces in previous line
ERROR: that open brace { should be on the previous line

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220124034456.8665-2-jagathjog1996@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vc04_services: use KBUILD_MODNAME instead of own module name definition
Gaston Gonzalez [Fri, 7 Jan 2022 23:46:22 +0000 (20:46 -0300)]
staging: vc04_services: use KBUILD_MODNAME instead of own module name definition

Remove own module name definition and use KBUILD_MODNAME instead, which
is the standard way of getting the module name.

While at it, one realignment was made to improve readability.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Link: https://lore.kernel.org/r/20220107234620.49900-3-gascoar@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vc04_services: remove unneeded MODULE_VERSION() usage
Gaston Gonzalez [Fri, 7 Jan 2022 23:46:20 +0000 (20:46 -0300)]
staging: vc04_services: remove unneeded MODULE_VERSION() usage

MODULE_VERSION() is useless for in-tree drivers given that only the kernel
version matters. Hence, remove it.

While at it, one realignment was made to improve readability.

Suggested by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Link: https://lore.kernel.org/r/20220107234620.49900-2-gascoar@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>