[PATCH v2 12/20] staging: wfx: add HIF commands helpers

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Provide an abstraction for HIF commands. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 375 +++ drivers/staging/wfx/hif_tx.h | 33 +++ drivers/staging/wfx/hif_tx_mib.h | 281 +++ 3 files changed,

[PATCH v2 16/20] staging: wfx: allow to send 802.11 frames

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Three things make this task more complex than it should: - Chip necessitate to associate a link-id to each station. It is same thing than association ID but, using 8 bits only. - Rate policy is sent separately from Tx frames - Driver try to handle itself power savi

[PATCH v2 17/20] staging: wfx: allow to receive 802.11 frames

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Again, this task is more complex than it should since driver try to handle itself power saving of stations. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/data_rx.c | 182 ++ drivers/staging/wf

[PATCH v2 19/20] staging: wfx: implement 802.11 key handling

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/key.c| 258 +++ drivers/staging/wfx/key.h| 22 +++ drivers/staging/wfx/main.c | 2 + drivers/staging/wfx/sta.c| 4 + drivers/stag

[PATCH v2 15/20] staging: wfx: add debug files and trace debug events

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Add traces when debug events happen and allow to ask internal information to chip. These features work independently from mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 105 +++ drivers/staging/wfx/hif_rx.c |

[PATCH v2 20/20] staging: wfx: implement the rest of mac80211 API

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 26 + drivers/staging/wfx/data_tx.c | 16 + drivers/staging/wfx/debug.c |2 + drivers/staging/wfx/hif_rx.c | 53 ++ drivers/staging/wfx/hif_tx.c |1 + drivers/staging/wfx/main.c| 133

[PATCH v2 11/20] staging: wfx: allow to send commands to chip

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Chip has multiple input buffers and can handle multiple 802.11 frames in parallel. However, other HIF command must be sent sequentially. wsm_send_cmd() handles these requests. This commit also add send_hif_cmd in debugfs. This file allows to send arbitrary commands to chip.

[PATCH v2 14/20] staging: wfx: setup initial chip configuration

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller A few tasks remain to be done in order to finish chip initial configuration: - configure chip to use multi-tx confirmation (speed up data transfer) - configure chip to use wake-up feature (save power consumption during runtime) - set hardware configuration

[PATCH v2 09/20] staging: wfx: add support for start-up indication

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Once firmware is loaded, it send a first indication to host. This indication signalize that host can start to communicate with firmware. In add, it contains information about chip and firmware (MAC addresses, firmware version, etc...). Signed-off-by: Jérôme Pouiller --- d

[PATCH v2 04/20] staging: wfx: add tracepoints for I/O access

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Some tracepoints are useful for debugging. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 6 +- drivers/staging/wfx/debug.c | 10 +++ drivers/staging/wfx/hwio.c | 11 +++ drivers/staging/wfx/traces.h | 149 +++ 4 f

[PATCH v2 10/20] staging: wfx: instantiate mac80211 data

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Allocate a struct ieee80211_hw but do not yet register it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/debug.c | 12 ++ drivers/staging/wfx/debug.h | 15 drivers/staging/wfx/main.c | 41 +

[PATCH v2 08/20] staging: wfx: add tracepoints for HIF

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller These tracepoints decode HIF headers and provide more human readable results. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 5 + drivers/staging/wfx/traces.h | 211 +++ 2 files changed, 216 insertions(+) diff --git a/

[PATCH v2 07/20] staging: wfx: add IRQ handling

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller bh_work() is in charge to schedule all HIF message from/to chip. On normal operation, when an IRQ is received, driver can get size of next message in control register. In order to save control register access, when chip send a message, it also appends a copy of control regi

[PATCH v2 06/20] staging: wfx: import HIF API headers

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller These files are shared with firmware sources. Only a subset of these definitions are used by driver but, for now, it is easier to import all. API defines 3 kinds of messages: - Requests (req) are sent from host to chip - Confirmations (cnf) are sent by chip and are al

[PATCH v2 13/20] staging: wfx: introduce "secure link"

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Chip support encryption of the link between host and chip. This feature is called "secure link". Driver code on github[1] support it. However, it relies on mbedtls for cryptographic functions. So, I decided to not import this feature in current patch. However, in order to ke

[PATCH v2 03/20] staging: wfx: add I/O API

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller hwio.c provides an abstraction to access different types of register of the chip. Note that only data register (aka FRAME_OUT) and control register are used normal communication. Other registers are only used during chip start up. Signed-off-by: Jérôme Pouiller --- drive

[PATCH v3 00/20] Add support for Silicon Labs WiFi chip WF200 and further

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Hello all, This series add support for Silicon Labs WiFi chip WF200 and further: https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf This driver is an export from: https://github.com/SiliconLabs/wfx-linux-driver/ I squashed all commits from

[PATCH v3 13/20] staging: wfx: introduce "secure link"

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Chip support encryption of the link between host and chip. This feature is called "secure link". Driver code on github[1] support it. However, it relies on mbedtls for cryptographic functions. So, I decided to not import this feature in current patch. However, in order to ke

[PATCH v3 03/20] staging: wfx: add I/O API

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller hwio.c provides an abstraction to access different types of register of the chip. Note that only data register (aka FRAME_OUT) and control register are used normal communication. Other registers are only used during chip start up. Signed-off-by: Jérôme Pouiller --- drive

[PATCH v3 19/20] staging: wfx: implement 802.11 key handling

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_set_key() mostly copy bytes on correct offsets. A big piece of code for a simple work. Unfortunately, I did not found any way to factorize it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/key.c| 258 +

[PATCH v3 17/20] staging: wfx: allow to receive 802.11 frames

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Again, this task is more complex than it should since driver try to handle itself power saving of stations. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/data_rx.c | 182 ++ drivers/staging/wf

[PATCH v3 06/20] staging: wfx: import HIF API headers

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller These files are shared with firmware sources. Only a subset of these definitions are used by driver but, for now, it is easier to import all. API defines 3 kinds of messages: - Requests (req) are sent from host to chip - Confirmations (cnf) are sent by chip and are al

[PATCH v3 04/20] staging: wfx: add tracepoints for I/O access

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Some tracepoints are useful for debugging. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 6 +- drivers/staging/wfx/debug.c | 10 +++ drivers/staging/wfx/hwio.c | 11 +++ drivers/staging/wfx/traces.h | 149 +++ 4 f

[PATCH v3 20/20] staging: wfx: implement the rest of mac80211 API

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Finish to fill struct ieee80211_ops with necessary callbacks. Driver is now ready to be registered to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 26 + drivers/staging/wfx/data_tx.c | 16 + drivers/staging/wfx/debug.c |2 + drive

[PATCH v3 10/20] staging: wfx: instantiate mac80211 data

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Allocate a struct ieee80211_hw but do not yet register it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/debug.c | 12 ++ drivers/staging/wfx/debug.h | 15 drivers/staging/wfx/main.c | 41 +

[PATCH v3 05/20] staging: wfx: load firmware

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller A firmware is necessary to run the chip. wfx_init_device() is in charge of loading firmware on chip and doing low level initialization. Firmwares for WF200 are available here: https://github.com/SiliconLabs/wfx-firmware/ Note that firmware are encrypted. Driver checks t

[PATCH v3 14/20] staging: wfx: setup initial chip configuration

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller A few tasks remain to be done in order to finish chip initial configuration: - configure chip to use multi-tx confirmation (speed up data transfer) - configure chip to use wake-up feature (save power consumption during runtime) - set hardware configuration

[PATCH v3 18/20] staging: wfx: allow to scan networks

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Chip can make foreground scan or background, but both can't be mixed in same request. So, we need to split each mac80211 requests into multiple HIF requests. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makefile | 1 + drivers/staging/wfx/bh.c | 2 +- dr

[PATCH v3 09/20] staging: wfx: add support for start-up indication

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Once firmware is loaded, it send a first indication to host. This indication signalize that host can start to communicate with firmware. In add, it contains information about chip and firmware (MAC addresses, firmware version, etc...). Signed-off-by: Jérôme Pouiller --- d

[PATCH v3 16/20] staging: wfx: allow to send 802.11 frames

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Three things make this task more complex than it should: - Chip necessitate to associate a link-id to each station. It is same thing than association ID but, using 8 bits only. - Rate policy is sent separately from Tx frames - Driver try to handle itself power savi

[PATCH v3 15/20] staging: wfx: add debug files and trace debug events

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Add traces when debug events happen and allow to ask internal information to chip. These features work independently from mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 105 +++ drivers/staging/wfx/hif_rx.c |

[PATCH v3 08/20] staging: wfx: add tracepoints for HIF

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller These tracepoints decode HIF headers and provide more human readable results. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 5 + drivers/staging/wfx/traces.h | 211 +++ 2 files changed, 216 insertions(+) diff --git a/

[PATCH v3 07/20] staging: wfx: add IRQ handling

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller bh_work() is in charge to schedule all HIF message from/to chip. On normal operation, when an IRQ is received, driver can get size of next message in control register. In order to save control register access, when chip send a message, it also appends a copy of control regi

[PATCH v3 12/20] staging: wfx: add HIF commands helpers

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Provide an abstraction for HIF commands. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 375 +++ drivers/staging/wfx/hif_tx.h | 33 +++ drivers/staging/wfx/hif_tx_mib.h | 281 +++ 3 files changed,

[PATCH v3 11/20] staging: wfx: allow to send commands to chip

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Chip has multiple input buffers and can handle multiple 802.11 frames in parallel. However, other HIF command must be sent sequentially. wsm_send_cmd() handles these requests. This commit also add send_hif_cmd in debugfs. This file allows to send arbitrary commands to chip.

[PATCH v3 01/20] staging: wfx: add infrastructure for new driver

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Instantiate build infrastructure WFx driver. This driver provides support for Wifi chipset Silicon Labs WF200 and further: https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf This chip support SPI and SDIO bus. SDIO interface has two particularities

[PATCH v3 02/20] staging: wfx: add support for I/O access

2019-09-19 Thread Jerome Pouiller
From: Jérôme Pouiller Introduce bus level communication layer. At this level, 7 registers can be addressed. Notice that SPI driver is able to manage chip reset. SDIO mode relies on an external driver (`mmc-pwrseq`) to reset chip. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus.h

Re: [PATCH] staging: wfx: avoid compiler warning on empty array

2020-04-30 Thread Jerome Pouiller
On Wednesday 29 April 2020 22:34:56 CEST Arnd Bergmann wrote: > > On Wed, Apr 29, 2020 at 6:04 PM Jerome Pouiller > wrote: > > On Wednesday 29 April 2020 16:21:09 CEST Arnd Bergmann wrote: > > > > > > -static const struct of_device_id wfx_sdio_of_match[]; > &

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread Jerome Pouiller
On Friday 11 October 2019 06:26:16 CEST Greg KH wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. > > > On Fri, Oct 11, 2019 at 11:02:19AM +0800, zhong jiang wrote: > > I

[PATCH] staging: wfx: fix potential vulnerability to spectre

2019-10-11 Thread Jerome Pouiller
From: Jérôme Pouiller array_index_nospec() should be applied after a bound check. Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/wf

[PATCH] staging: wfx: fix error handling in wfx_tx_get_raw_link_id()

2019-10-11 Thread Jerome Pouiller
From: Jérôme Pouiller Since wfx_tx_get_raw_link_id() return an unsigned, it makes no sense to return a negative value. "15" is a better value since it is used by firmware for stations that have not yet associated link-ids. Note that this should never happens since driver set max_ap_assoc_sta to

[PATCH v2] staging: wfx: fix potential vulnerability to spectre

2019-10-11 Thread Jerome Pouiller
From: Jérôme Pouiller array_index_nospec() should be applied after a bound check. Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller --- v2: cut down commit-id to 12 characters drivers/st

Re: [PATCH] staging: wfx: fix potential vulnerability to spectre

2019-10-11 Thread Jerome Pouiller
On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote: > On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote: > > From: Jérôme Pouiller > > > > array_index_nospec() should be applied after a bound check. > > > > Fixes: 9bca45f3d6924f19f29c0d

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread Jerome Pouiller
On Friday 11 October 2019 17:51:29 CEST zhong jiang wrote: [...] > How about the following patch ? > > diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile > index 0d9c1ed..77d68b7 100644 > --- a/drivers/staging/wfx/Makefile > +++ b/drivers/staging/wfx/Makefile > @@ -19,6 +19,6

[PATCH v3] staging: wfx: fix potential vulnerability to spectre

2019-10-11 Thread Jerome Pouiller
From: Jérôme Pouiller array_index_nospec() should be applied after a bound check. Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller --- v2: cut down commit-id to 12 characters v3: fix miss

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread Jerome Pouiller
On Friday 11 October 2019 18:38:17 CEST zhong jiang wrote: > I hit the following error when compile the kernel. > > drivers/staging/wfx/main.o: In function `wfx_core_init': > /home/z00352263/linux-next/linux-next/drivers/staging/wfx/main.c:488: > undefined reference to `sdio_register_driver' > dr

Re: [PATCH] staging: wfx: avoid compiler warning on empty array

2020-04-29 Thread Jerome Pouiller
On Wednesday 29 April 2020 16:21:09 CEST Arnd Bergmann wrote: > > When CONFIG_OF is disabled, gcc-9 produces a warning about the > wfx_sdio_of_match[] array having a declaration without a dimension: > > drivers/staging/wfx/bus_sdio.c:159:34: error: array 'wfx_sdio_of_match' > assumed to have one

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-14 Thread Jerome Pouiller
On Saturday 12 October 2019 04:48:55 CEST zhong jiang wrote: > On 2019/10/12 0:57, Jerome Pouiller wrote: > > On Friday 11 October 2019 18:38:17 CEST zhong jiang wrote: > >> I hit the following error when compile the kernel. > >> > >> drivers/staging/wf

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-14 Thread Jerome Pouiller
On Monday 14 October 2019 11:53:19 CEST Jérôme Pouiller wrote: [...] > Hello Zhong, > > Now, I see the problem. It happens when CONFIG_MMC=m and CONFIG_WFX=y > (if CONFIG_WFX=m, it works). > > I think the easiest way to solve problem is to disallow CONFIG_WFX=y if > CONFIG_MMC=m. > > This solut

[PATCH 6/6] staging: wfx: fix number of available tx_policies

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller Original API declares 16 tx_policies. But in fact, the 16th is used internally by the firmware. So, only 15 tx_policies are available for driver. Reported-by: Alban Jeantheau Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 2 +- 1 file changed, 1 i

[PATCH 3/6] staging: wfx: fix CONFIG_MMC=m with CONFIG_WFX=y

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller If CONFIG_MMC=m and CONFIG_WFX=y, compilation complains with undefined references: drivers/staging/wfx/main.o: In function `wfx_core_init': /linux/drivers/staging/wfx/main.c:488: undefined reference to `sdio_register_driver' drivers/staging/wfx/main.o: In function

[PATCH 5/6] staging: wfx: fix setting MAC address from DT

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller MAC address read from chip is unconditionally used even if a MAC address is configured in device tree. Reported-by: Marc Dorval Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/sta

[PATCH 2/6] staging: wfx: relocate wfx_fill_sl_key() in secure_link.h

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller "Secure link" feature is not available in in-tree driver (because it depends on mbedtls). Thus, secure_link.h only empty functions. Module parameter "slk_key" and associated function wfx_fill_sl_key() had an unjustifiable place in main.c. This patch relocate them to secure_

[PATCH 1/6] staging: wfx: drop module version

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_version.h says that this code is same same than driver 2.3.1 hosted on github: https://github.com/siliconlabs/wfx-linux-driver/tree/2.3.1-public However, it is inaccurate, driver in-tree contains multiple small patches ahead 2.3.1. I prefer to drop this confusing

[PATCH 4/6] staging: wfx: fix Oops when CONFIG_OF_NET is not set

2019-10-17 Thread Jerome Pouiller
From: Jérôme Pouiller In most case, of_get_mac_address() return NULL in case of error. However, if CONFIG_OF_NET is not set, it return -ENODEV. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/

[PATCH] dt: writing-schema: Fix indentation of items

2020-10-06 Thread Jerome Pouiller
From: Jérôme Pouiller The items 'allOf' and 'properties' are indented with one space. This change as been introduced in commit cdea0121ae80 ("docs: writing-schema.md: convert from markdown to ReST") and it produces weird results in Html and Pdf outputs. Obviously, this extra indentation was unat

[PATCH 1/7] staging: wfx: fix handling of MMIC error

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller As expected, when the device detect a MMIC error, it returns a specific status. However, it also strip IV from the frame (don't ask me why). So, with the current code, mac80211 detects a corrupted frame and it drops it before it handle the MMIC error. The expected behavior

[PATCH 0/7] wfx: move out from the staging area

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller I think the wfx driver is now mature enough to be accepted in the drivers/net/wireless directory. There is still one item on the TODO list. It is an idea to improve the rate control in some particular cases[1]. However, the current performances of the driver seem to satisfy

[PATCH 5/7] staging: wfx: update copyrights dates

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller Most of the files have been modified in 2020, so update the copyright notices. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/bus.h | 2 +- drivers/staging/wfx/

[PATCH 2/7] staging: wfx: remove remaining code of 'secure link' feature

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller Commit e8d607ce0c81 ("staging: wfx: drop 'secure link' feature") had removed the 'secure link' feature. However, a few lines of codes were yet here. Fixes: e8d607ce0c81 ("staging: wfx: drop 'secure link' feature") Signed-off-by: Jérôme Pouiller --- .../bindings/net/wirele

[PATCH 3/7] staging: wfx: fix BA sessions for older firmwares

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller Firmwares with API < 3.6 do not forward DELBA requests. Thus, when a Block Ack session is restarted, the reordering buffer is not flushed and the received sequence number is not contiguous. Therefore, mac80211 starts to wait some missing frames that it will never receive. T

[PATCH 4/7] staging: wfx: fix QoS priority for slow buses

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller The device is in charge of respecting the QoS constraints. The driver have to ensure that all the queues contain data and the device choose the right queue to send. The things starts to be more difficult when the bandwidth of the bus is lower than the bandwidth of the WiFi.

[PATCH 6/7] dt-bindings: staging: wfx: silabs,wfx yaml conversion

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller The device can be connected on SPI or on SDIO. The original file described the two options separately. So, most of the file had to be rewritten in order to match with the Yaml requirements. Some device requirements are still written in the comments since they cannot been ex

[PATCH 7/7] wfx: move out from the staging area

2020-10-07 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver is now mature enough to leave the staging area. Signed-off-by: Jérôme Pouiller --- .../bindings/net/wireless/silabs,wfx.yaml | 0 MAINTAINERS | 2 +- drivers/net/wireless/Kconfig| 1 + drivers

[PATCH 0/8] staging: wfx: fix issues reported by Smatch

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Fix the issues reported by Dan using Smatch[1]. [1] https://lore.kernel.org/lkml/20201008131320.GA1042@kadam/ Jérôme Pouiller (8): staging: wfx: improve error handling of hif_join() staging: wfx: check memory allocation staging: wfx: standardize the error when vif do

[PATCH 1/8] staging: wfx: improve error handling of hif_join()

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: hif_tx.c:319 hif_join() error: we previously assumed 'channel' could be null (see line 315) 311 if (!hif) 312 return -ENOMEM; 313 body->infrastructure_bss_mode = !conf->ibss_joined; 314 body->shor

[PATCH 2/8] staging: wfx: check memory allocation

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: main.c:228 wfx_send_pdata_pds() warn: potential NULL parameter dereference 'tmp_buf' 227 tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL); 228 ret = wfx_send_pds(wdev, tmp_buf, pds->size);

[PATCH 4/8] staging: wfx: wfx_init_common() returns NULL on error

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: bus_spi.c:228 wfx_spi_probe() warn: 'bus->core' could be an error pointer bus_sdio.c:221 wfx_sdio_probe() warn: 'bus->core' could be an error pointer bus->core contains the result of wfx_init_common(). With this patch, wfx_init_common() returns a

[PATCH 5/8] staging: wfx: increase robustness of hif_generic_confirm()

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: drivers/staging/wfx/hif_rx.c:26 hif_generic_confirm() warn: negative user subtract: 0-u16max - 4 20 static int hif_generic_confirm(struct wfx_dev *wdev, 21 const struct hif_msg *hif, const void *buf) 22 {

[PATCH 6/8] staging: wfx: gpiod_get_value() can return an error

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: hif_rx.c:98 hif_wakeup_indication() warn: 'gpiod_get_value(wdev->pdata.gpio_wakeup)' returns positive and negative bh.c:24 device_wakeup() warn: 'gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup)' returns positive and negative Reported-by: Dan

[PATCH 7/8] staging: wfx: drop unicode characters from strings

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xc2' hif_rx.c:235 hif_generic_indication() warn: format string contains non-ascii character '\xb0' 234 if (!wfx_api_older_than(wdev, 1, 4))

[PATCH 3/8] staging: wfx: standardize the error when vif does not exist

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: drivers/staging/wfx/hif_rx.c:177 hif_scan_complete_indication() warn: potential NULL parameter dereference 'wvif' drivers/staging/wfx/data_tx.c:576 wfx_flush() warn: potential NULL parameter dereference 'wvif' Indeed, if the vif id returned by the

[PATCH 8/8] staging: wfx: improve robustness of wfx_get_hw_rate()

2020-10-09 Thread Jerome Pouiller
From: Jérôme Pouiller Smatch complains: data_tx.c:37 wfx_get_hw_rate() warn: constraint '(struct ieee80211_supported_band)->bitrates' overflow 'band->bitrates' 0 <= abs_rl '0-127' user_rl '' required = '(struct ieee80211_supported_band)->n_bitrates' 23 struct ieee80211_support

[PATCH 02/23] wfx: add Makefile/Kconfig

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/Kconfig | 8 drivers/net/wireless/silabs/wfx/Makefile | 25 2 files changed, 33 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/Kconfig create mode 100

[PATCH 01/23] dt-bindings: introduce silabs,wfx.yaml

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- .../bindings/net/wireless/silabs,wfx.yaml | 125 ++ 1 file changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml diff --git a/Documentation/devicetree/bindings/

[PATCH 03/23] wfx: add wfx.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/wfx.h | 166 ++ 1 file changed, 166 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/wfx.h diff --git a/drivers/net/wireless/silabs/wfx/wfx.h b/drivers/net/wireles

[PATCH 04/23] wfx: add main.c/main.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/main.c | 489 + drivers/net/wireless/silabs/wfx/main.h | 44 +++ 2 files changed, 533 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/main.c create mode 100644 dr

[PATCH 00/23] wfx: get out from the staging area

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller I think the wfx driver is now mature enough to be accepted in the drivers/net/wireless directory. As requested by Kalle[1], I send one file per patch. At the end, all the patches will be squashed (therefore, I didn't bother to write real commit messages). Here is a diagram

[PATCH 05/23] wfx: add bus.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bus.h | 38 +++ 1 file changed, 38 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/bus.h diff --git a/drivers/net/wireless/silabs/wfx/bus.h b/drivers/net/wireless

[PATCH 15/23] wfx: add data_rx.c/data_rx.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/data_rx.c | 93 +++ drivers/net/wireless/silabs/wfx/data_rx.h | 18 + 2 files changed, 111 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/data_rx.c create mode 10

[PATCH 06/23] wfx: add bus_spi.c

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bus_spi.c | 271 ++ 1 file changed, 271 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/bus_spi.c diff --git a/drivers/net/wireless/silabs/wfx/bus_spi.c b/drivers/net

[PATCH 07/23] wfx: add bus_sdio.c

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bus_sdio.c | 269 + 1 file changed, 269 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/bus_sdio.c diff --git a/drivers/net/wireless/silabs/wfx/bus_sdio.c b/drivers/n

[PATCH 09/23] wfx: add fwio.c/fwio.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/fwio.c | 405 + drivers/net/wireless/silabs/wfx/fwio.h | 15 + 2 files changed, 420 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/fwio.c create mode 100644 driv

[PATCH 10/23] wfx: add bh.c/bh.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bh.c | 333 +++ drivers/net/wireless/silabs/wfx/bh.h | 33 +++ 2 files changed, 366 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/bh.c create mode 100644 driver

[PATCH 08/23] wfx: add hwio.c/hwio.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hwio.c | 352 + drivers/net/wireless/silabs/wfx/hwio.h | 75 ++ 2 files changed, 427 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/hwio.c create mode 100644

[PATCH 11/23] wfx: add hif_api_*.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_api_cmd.h | 553 ++ .../net/wireless/silabs/wfx/hif_api_general.h | 267 + drivers/net/wireless/silabs/wfx/hif_api_mib.h | 343 +++ 3 files changed, 1163 insertions(+) c

[PATCH 23/23] wfx: get out from the staging area

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver is now mature enough to leave the staging area. Signed-off-by: Jérôme Pouiller --- MAINTAINERS | 3 ++- drivers/net/wireless/Kconfig | 1 + drivers/net/wireless/Makefile| 1 + drivers/net/wireless/silabs/Kconfig

[PATCH 17/23] wfx: add data_tx.c/data_tx.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/data_tx.c | 585 ++ drivers/net/wireless/silabs/wfx/data_tx.h | 67 +++ 2 files changed, 652 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/data_tx.c create mode 100

[PATCH 16/23] wfx: add queue.c/queue.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/queue.c | 304 drivers/net/wireless/silabs/wfx/queue.h | 45 2 files changed, 349 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/queue.c create mode 100644

[PATCH 14/23] wfx: add hif_rx.c/hif_rx.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_rx.c | 415 +++ drivers/net/wireless/silabs/wfx/hif_rx.h | 18 + 2 files changed, 433 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/hif_rx.c create mode 100644

[PATCH 12/23] wfx: add hif_tx*.c/hif_tx*.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 523 +++ drivers/net/wireless/silabs/wfx/hif_tx.h | 60 +++ drivers/net/wireless/silabs/wfx/hif_tx_mib.c | 324 drivers/net/wireless/silabs/wfx/hif_tx_mib.h

[PATCH 21/23] wfx: add traces.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/traces.h | 501 +++ 1 file changed, 501 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/traces.h diff --git a/drivers/net/wireless/silabs/wfx/traces.h b/drivers/net/w

[PATCH 20/23] wfx: add debug.c/debug.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/debug.c | 359 drivers/net/wireless/silabs/wfx/debug.h | 19 ++ 2 files changed, 378 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/debug.c create mode 100644 d

[PATCH 19/23] wfx: add scan.c/scan.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/scan.c | 132 + drivers/net/wireless/silabs/wfx/scan.h | 22 + 2 files changed, 154 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/scan.c create mode 100644

[PATCH 13/23] wfx: add key.c/key.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/key.c | 241 ++ drivers/net/wireless/silabs/wfx/key.h | 20 +++ 2 files changed, 261 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/key.c create mode 100644 driv

[PATCH 18/23] wfx: add sta.c/sta.h

2020-10-12 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/sta.c | 807 ++ drivers/net/wireless/silabs/wfx/sta.h | 73 +++ 2 files changed, 880 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/sta.c create mode 100644 driv

[PATCH v2] staging: wfx: fix coherency of hif_scan() prototype

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller The function hif_scan() return the timeout for the completion of the scan request. It is the only function from hif_tx.c that return another thing than just an error code. This behavior is not coherent with the rest of file. Worse, if value returned is positive, the caller c

[PATCH 2/2] staging: wfx: drop useless loop

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller It is guarantee that the loop will stop at first iteration. So drop the loop. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 19 --- 1 file changed, 8 insertion

[PATCH 1/2] staging: wfx: fix AC priority

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller In order to work properly all the queues of the device must be filled (the device chooses itself the queue to use depending of AC parameters and other things). It is the job of wfx_tx_queues_get_skb() to choose which queue must be filled. However, the sorting algorithm was i

[PATCH 00/10] staging: wfx: introduce nl80211 vendor extensions

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller Hello, This series introduces some nl80211 vendor extensions to the wfx driver. This series may lead to some discussions: 1. Patch 7 allows to change the dynamic PS timeout. I have found an API in wext (cfg80211_wext_siwpower()) that do more or less the same t

<    1   2   3   4   >