[PATCH] staging: wfx: fix possible panic with re-queued frames

2021-02-08 Thread Jerome Pouiller
From: Jérôme Pouiller When the firmware rejects a frame (because station become asleep or disconnected), the frame is re-queued in mac80211. However, the re-queued frame was 8 bytes longer than the original one (the size of the ICV for the encryption). So, when mac80211 try to send this frame aga

[PATCH v5 01/24] mmc: sdio: add SDIO IDs for Silabs WF200 chip

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Add Silabs SDIO ID to sdio_ids.h. Note that the values used by Silabs are uncommon. A driver cannot fully rely on the SDIO PnP. It should also check if the device is declared in the DT. Signed-off-by: Jérôme Pouiller --- include/linux/mmc/sdio_ids.h | 7 +++ 1 file c

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

2021-03-15 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. The firmware is now a part of the linux-firmware repository since relase 20210315[1]. It had taken a bit of time because I have worked with the legal department to simplify the

[PATCH v5 02/24] dt-bindings: introduce silabs,wfx.yaml

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Prepare the inclusion of the wfx driver in the kernel. Signed-off-by: Jérôme Pouiller --- .../bindings/net/wireless/silabs,wfx.yaml | 133 ++ 1 file changed, 133 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/silabs,w

[PATCH v5 03/24] wfx: add Makefile/Kconfig

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/Kconfig | 12 +++ drivers/net/wireless/silabs/wfx/Makefile | 26 2 files changed, 38 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/Kconfig create mode

[PATCH v5 04/24] wfx: add wfx.h

2021-03-15 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 v5 05/24] wfx: add main.c/main.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/main.c | 503 + drivers/net/wireless/silabs/wfx/main.h | 43 +++ 2 files changed, 546 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/main.c create mode 100644 dr

[PATCH v5 06/24] wfx: add bus.h

2021-03-15 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 v5 07/24] wfx: add bus_spi.c

2021-03-15 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 v5 08/24] wfx: add bus_sdio.c

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bus_sdio.c | 259 + 1 file changed, 259 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 v5 10/24] wfx: add fwio.c/fwio.h

2021-03-15 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 v5 09/24] wfx: add hwio.c/hwio.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hwio.c | 340 + drivers/net/wireless/silabs/wfx/hwio.h | 79 ++ 2 files changed, 419 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/hwio.c create mode 100644

[PATCH v5 12/24] wfx: add hif_api_*.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_api_cmd.h | 555 ++ .../net/wireless/silabs/wfx/hif_api_general.h | 262 + drivers/net/wireless/silabs/wfx/hif_api_mib.h | 343 +++ 3 files changed, 1160 insertions(+) c

[PATCH v5 11/24] wfx: add bh.c/bh.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/bh.c | 332 +++ drivers/net/wireless/silabs/wfx/bh.h | 33 +++ 2 files changed, 365 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/bh.c create mode 100644 driver

[PATCH v5 13/24] wfx: add hif_tx*.c/hif_tx*.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_tx.c | 527 +++ 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 v5 14/24] wfx: add key.c/key.h

2021-03-15 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 v5 15/24] wfx: add hif_rx.c/hif_rx.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/hif_rx.c | 416 +++ drivers/net/wireless/silabs/wfx/hif_rx.h | 18 + 2 files changed, 434 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/hif_rx.c create mode 100644

[PATCH v5 16/24] wfx: add data_rx.c/data_rx.h

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

[PATCH v5 17/24] wfx: add queue.c/queue.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/queue.c | 307 drivers/net/wireless/silabs/wfx/queue.h | 45 2 files changed, 352 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/queue.c create mode 100644

[PATCH v5 18/24] wfx: add data_tx.c/data_tx.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/data_tx.c | 598 ++ drivers/net/wireless/silabs/wfx/data_tx.h | 68 +++ 2 files changed, 666 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/data_tx.c create mode 100

[PATCH v5 19/24] wfx: add sta.c/sta.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/sta.c | 809 ++ drivers/net/wireless/silabs/wfx/sta.h | 73 +++ 2 files changed, 882 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/sta.c create mode 100644 driv

[PATCH v5 20/24] wfx: add scan.c/scan.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/scan.c | 131 + drivers/net/wireless/silabs/wfx/scan.h | 22 + 2 files changed, 153 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/scan.c create mode 100644

[PATCH v5 21/24] wfx: add debug.c/debug.h

2021-03-15 Thread Jerome Pouiller
From: Jérôme Pouiller Signed-off-by: Jérôme Pouiller --- drivers/net/wireless/silabs/wfx/debug.c | 361 drivers/net/wireless/silabs/wfx/debug.h | 19 ++ 2 files changed, 380 insertions(+) create mode 100644 drivers/net/wireless/silabs/wfx/debug.c create mode 100644 d

[PATCH v5 22/24] wfx: add traces.h

2021-03-15 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 v5 24/24] wfx: get out from the staging area

2021-03-15 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 01/31] staging: wfx: use abbreviated message for "incorrect sequence"

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver checks carefully the coherency of of the DTIM notifications. We have noticed several times some small inconsistencies from the firmware on these notification. They have never been critical. However on the driver side they lead to big fat warnings. Worse, if t

[PATCH 00/31] [PATCH 00/31] staging/wfx: usual maintenance

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Hi, The following PR contains now usual maintenance for the wfx driver. I have more-or-less sorted the patches by importance: - the first ones are fixes for a few corner-cases reported by users - the patches 9 and 10 add support for CSA and TDLS - then the end o

[PATCH 02/31] staging: wfx: do not send CAB while scanning

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller During the scan requests, the Tx traffic is suspended. This lock is shared by all the network interfaces. So, a scan request on one interface will block the traffic on a second interface. This causes trouble when the queued traffic contains CAB (Content After DTIM Beacon) si

[PATCH 03/31] staging: wfx: ignore PS when STA/AP share same channel

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller When multiple interface are in use. One is always AP while the other is always station. When the two interface use the same channel, it makes no sense to enabled Power Saving (PS) on the station. Indeed, because of the AP, the device will be kept awake on this channel anyway

[PATCH 04/31] staging: wfx: wait for SCAN_CMPL after a SCAN_STOP

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller When the device has finished a scan request, it send a scan complete ("SCAN_COMPL") indication. It is also possible to abort a scan request with a "SCAN_STOP" message. A SCAN_COMPL is also send in this case. The driver limits the delay to make a scan request. A timeout happ

[PATCH 05/31] staging: wfx: avoid possible lock-up during scan

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller If the environment is noisy, the device may take time to send scan requests. Thus, scan requests durations > 5s have already been observed. During the scan, traffic is neither received, neither sent. From the user point-of-view, the traffic is frozen for a long time. This p

[PATCH 06/31] staging: wfx: drop unused argument from hif_scan()

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller It is no more necessary to compute the expected duration of the scan request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 9 + drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/scan.c | 2 +- 3 files changed, 3 insertions(+), 10 dele

[PATCH 07/31] staging: wfx: fix atomic accesses in wfx_tx_queue_empty()

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Checking if a skb_queue is empty is not an atomic operation. We should take some precautions to do it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/driver

[PATCH 08/31] staging: wfx: take advantage of wfx_tx_queue_empty()

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_queues_check_empty() can be slightly simplified by calling wfx_tx_queue_empty(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/queue.c b

[PATCH 09/31] staging: wfx: declare support for TDLS

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Since API 3.8, the device is able to support TDLS. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 4b9fdf99981b..0a9d02d1af2f 100644 --- a/dr

[PATCH 10/31] staging: wfx: fix support for CSA

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The WF200 is able to filter beacons. However, it uses a positive filter: any change to an IE not listed won't be reported. In current code, the changes in Channel Switch Announcement (CSA) are not reported to the host. Thus, it fixes the support for CSA in station mode. Si

[PATCH 11/31] staging: wfx: relax the PDS existence constraint

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The PDS file contains antenna parameters. The file is specific to each hardware design. Normally, the board designer should add a line in the of_device_id table with his own antenna parameters. Until, now the absence of PDS file is a hard fatal error. However, during the de

[PATCH 12/31] staging: wfx: simplify API coherency check

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The 'channel' argument of hif_join() should never be NULL. hif_join() does not have the responsibility to recover bug of caller. A call to WARN() at the beginning of the function reminds this constraint to the developer. In current code, if the argument channel is NULL, mem

[PATCH 13/31] staging: wfx: update with API 3.8

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller API 3.8 introduces new statistic counters. These changes are backward compatible. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 3 +++ drivers/staging/wfx/hif_api_mib.h | 5 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 14/31] staging: wfx: uniformize counter names

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The device provide some internal statistic counters. However, the names of counter were not very meaningful. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 45 - drivers/staging/wfx/hif_api_mib.h | 82 +++

[PATCH 15/31] staging: wfx: fix misleading 'rate_id' usage

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The driver sometime use the term 'rate_id' to identify a retry policy (which is in fact a series of rate IDs). This is misleading. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff

[PATCH 16/31] staging: wfx: declare variables at beginning of functions

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller For better code, we prefer to declare all the local variables at beginning of the functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/driver

[PATCH 17/31] staging: wfx: simplify hif_join()

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The new code is smaller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 6ffbae32028b..aea0ed55edc6 100644 --- a/drive

[PATCH 18/31] staging: wfx: reorder function for slightly better eye candy

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller For a code more eye candy, group all the unconditional assignments together. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data

[PATCH 19/31] staging: wfx: fix error names

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller ENOTSUP is an alias of EOPNOTSUPP. However, EOPNOTSUPP is preferred. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 464a67a9b41c..

[PATCH 20/31] staging: wfx: apply naming rules in hif_tx_mib.c

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller All the functions of hif_tx_mib.c format data to be sent to the hardware. In this file, the struct to be sent is always named 'arg'. Also applies this rule to hif_set_macaddr(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 6 +++--- 1 file change

[PATCH 21/31] staging: wfx: remove unused definition

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The enum hif_fw_type is never used in the driver. Drop it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h inde

[PATCH 22/31] staging: wfx: remove useless debug statement

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller In the early age, it was unexpected to access a VIF that did not exist. With current code, this happens frequently. Having a trace associated on this event brings absolutely no informations. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/wfx.h | 5 + 1 file ch

[PATCH 23/31] staging: wfx: fix space after cast operator

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller checkpatch.pl reports that cast operators should not been followed by a space. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/wfx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index a8ef

[PATCH 24/31] staging: wfx: remove references to WFxxx in comments

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The WF200 is the only representative of the WFxxx series and the development of any successor is not expected. So, for clarity, replace occurrences of "WFxxx" with "WF200". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 4 ++-- drivers/staging

[PATCH 25/31] staging: wfx: update files descriptions

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Each file of the driver contains a short description of its purpose. These description were a bit outdated. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/data_rx.c | 2 +- drivers/staging/wfx/data_rx.h | 2 +- drivers/staging

[PATCH 26/31] staging: wfx: reformat comment

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The new comment takes only one line instead of three. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index d64476b48881..0f48dab105e9

[PATCH 28/31] staging: wfx: fix comments styles

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Unify all comments of the wfx driver to use the same comment style. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 11 +++ drivers/staging/wfx/bus_spi.c | 6 ++ drivers/staging/wfx/fwio.c| 3 +-- drivers/staging/wfx/main.h| 3 +--

[PATCH 27/31] staging: wfx: avoid c99 comments

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver is a network driver. C99 comments are prohibited in this part of the kernel. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 18 +++--- drivers/staging/wfx/bus_sdio.c| 8 +-- drivers/staging/wfx/bus_spi.c | 12 ++-

[PATCH 29/31] staging: wfx: remove useless comments after #endif

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Comments after the last #endif of header files don't bring any information and are redundant with the name of the file. Drop them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/data_rx.h | 2 +- drivers/staging/wfx/data_tx.h

[PATCH 30/31] staging: wfx: explain the purpose of wfx_send_pds()

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller On first look, the goal of wfx_send_pds() is not obvious. A small explanation is welcomed. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/main.c b/driver

[PATCH 31/31] staging: wfx: indent functions arguments

2021-09-10 Thread Jerome Pouiller
From: Jérôme Pouiller Function arguments must be aligned with left parenthesis. Apply that rule. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 2 +- drivers/staging/wfx/key.c| 26 +- 2 files changed, 14 insertions(+), 14 deletions(-) di

[PATCH v2 00/33] staging/wfx: usual maintenance

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Hi, The following PR contains now usual maintenance for the wfx driver. I have more-or-less sorted the patches by importance: - the first ones and the two last ones are fixes for a few corner-cases reported by users - the patches 9 and 10 add support for CSA a

[PATCH v2 01/33] staging: wfx: use abbreviated message for "incorrect sequence"

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver checks carefully the coherency of of the DTIM notifications. We have noticed several times some small inconsistencies from the firmware on these notification. They have never been critical. However on the driver side they lead to big fat warnings. Worse, if t

[PATCH v2 02/33] staging: wfx: do not send CAB while scanning

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller During the scan requests, the Tx traffic is suspended. This lock is shared by all the network interfaces. So, a scan request on one interface will block the traffic on a second interface. This causes trouble when the queued traffic contains CAB (Content After DTIM Beacon) si

[PATCH v2 03/33] staging: wfx: ignore PS when STA/AP share same channel

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller When multiple interface are in use. One is always AP while the other is always station. When the two interface use the same channel, it makes no sense to enabled Power Saving (PS) on the station. Indeed, because of the AP, the device will be kept awake on this channel anyway

[PATCH v2 04/33] staging: wfx: wait for SCAN_CMPL after a SCAN_STOP

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller When the device has finished a scan request, it send a scan complete ("SCAN_COMPL") indication. It is also possible to abort a scan request with a "SCAN_STOP" message. A SCAN_COMPL is also send in this case. The driver limits the delay to make a scan request. A timeout happ

[PATCH v2 06/33] staging: wfx: drop unused argument from hif_scan()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller It is no more necessary to compute the expected duration of the scan request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 9 + drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/scan.c | 2 +- 3 files changed, 3 insertions(+), 10 dele

[PATCH v2 07/33] staging: wfx: fix atomic accesses in wfx_tx_queue_empty()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Checking if a skb_queue is empty is not an atomic operation. We should take some precautions to do it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/driver

[PATCH v2 08/33] staging: wfx: take advantage of wfx_tx_queue_empty()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_queues_check_empty() can be slightly simplified by calling wfx_tx_queue_empty(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/queue.c b

[PATCH v2 10/33] staging: wfx: fix support for CSA

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The WF200 is able to filter beacons. However, it uses a positive filter: any change to an IE not listed won't be reported. In current code, the changes in Channel Switch Announcement (CSA) are not reported to the host. Thus, it fixes the support for CSA in station mode. Si

[PATCH v2 05/33] staging: wfx: avoid possible lock-up during scan

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller If the environment is noisy, the device may take time to send scan requests. Thus, scan requests durations > 5s have already been observed. During the scan, traffic is neither received, neither sent. From the user point-of-view, the traffic is frozen for a long time. This p

[PATCH v2 09/33] staging: wfx: declare support for TDLS

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Since the firmware API 3.8, the device is able to support TDLS. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 4b9fdf99981b..0a9d02d1af2f 10

[PATCH v2 11/33] staging: wfx: relax the PDS existence constraint

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The PDS file contains antenna parameters. The file is specific to each hardware design. Normally, the board designer should add a line in the of_device_id table with his own antenna parameters. Until, now the absence of PDS file is a hard fatal error. However, during the de

[PATCH v2 12/33] staging: wfx: simplify API coherency check

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The 'channel' argument of hif_join() should never be NULL. hif_join() does not have the responsibility to recover bug of caller. A call to WARN() at the beginning of the function reminds this constraint to the developer. In current code, if the argument channel is NULL, mem

[PATCH v2 13/33] staging: wfx: update with the firmware API 3.8

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The firmware API 3.8 introduces new statistic counters. These changes are backward compatible. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 3 +++ drivers/staging/wfx/hif_api_mib.h | 5 - 2 files changed, 7 insertions(+), 1 deletion(-) diff

[PATCH v2 16/33] staging: wfx: declare variables at beginning of functions

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller For better code, we prefer to declare all the local variables at beginning of the functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/driver

[PATCH v2 14/33] staging: wfx: uniformize counter names

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The device provide some internal statistic counters. However, the names of counter were not very meaningful. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 45 - drivers/staging/wfx/hif_api_mib.h | 82 +++

[PATCH v2 15/33] staging: wfx: fix misleading 'rate_id' usage

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The driver sometime use the term 'rate_id' to identify a retry policy (which is in fact a series of rate IDs). This is misleading. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff

[PATCH v2 17/33] staging: wfx: simplify hif_join()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The new code is smaller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 6ffbae32028b..aea0ed55edc6 100644 --- a/drive

[PATCH v2 19/33] staging: wfx: fix error names

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller ENOTSUP is an alias of EOPNOTSUPP. However, EOPNOTSUPP is preferred. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 5f2f8900ce99..

[PATCH v2 18/33] staging: wfx: reorder function for slightly better eye candy

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller For a code more eye candy, group all the unconditional assignments together. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data

[PATCH v2 22/33] staging: wfx: remove useless debug statement

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller In the early age, it was unexpected to access a VIF that did not exist. With current code, this happens frequently. Having a trace associated on this event brings absolutely no informations. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/wfx.h | 5 + 1 file ch

[PATCH v2 21/33] staging: wfx: remove unused definition

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The enum hif_fw_type is never used in the driver. Drop it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h inde

[PATCH v2 20/33] staging: wfx: apply naming rules in hif_tx_mib.c

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller All the functions of hif_tx_mib.c format data to be sent to the hardware. In this file, the struct to be sent is always named 'arg'. Also applies this rule to hif_set_macaddr(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 6 +++--- 1 file change

[PATCH v2 23/33] staging: wfx: fix space after cast operator

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller checkpatch.pl reports that cast operators should not been followed by a space. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/wfx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index a8ef

[PATCH v2 24/33] staging: wfx: remove references to WFxxx in comments

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The WF200 is the only representative of the WFxxx series and the development of any successor is not expected. So, for clarity, replace occurrences of "WFxxx" with "WF200". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 4 ++-- drivers/staging

[PATCH v2 26/33] staging: wfx: reformat comment

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The new comment takes only one line instead of three. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1e21beeed438..70e1c4d8ae2e

[PATCH v2 25/33] staging: wfx: update files descriptions

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Each file of the driver contains a short description of its purpose. These description were a bit outdated. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/data_rx.c | 2 +- drivers/staging/wfx/data_rx.h | 2 +- drivers/staging

[PATCH v2 29/33] staging: wfx: remove useless comments after #endif

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Comments after the last #endif of header files don't bring any information and are redundant with the name of the file. Drop them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.h | 2 +- drivers/staging/wfx/data_rx.h | 2 +- drivers/staging/wfx/data_tx.h

[PATCH v2 28/33] staging: wfx: fix comments styles

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Unify all comments of the wfx driver to use the same comment style. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 11 +++ drivers/staging/wfx/bus_spi.c | 6 ++ drivers/staging/wfx/fwio.c| 3 +-- drivers/staging/wfx/main.h| 3 +--

[PATCH v2 27/33] staging: wfx: avoid c99 comments

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver is a network driver. C99 comments are prohibited in this part of the kernel. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 18 --- drivers/staging/wfx/bus_sdio.c| 8 +-- drivers/staging/wfx/bus_spi.c | 12 ++

[PATCH v2 30/33] staging: wfx: explain the purpose of wfx_send_pds()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller On first look, the goal of wfx_send_pds() is not obvious. A small explanation is welcomed. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/main.c b/driver

[PATCH v2 31/33] staging: wfx: indent functions arguments

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Function arguments must be aligned with first argument. Apply that rule. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 2 +- drivers/staging/wfx/key.c| 26 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff

[PATCH v2 32/33] staging: wfx: ensure IRQ is ready before enabling it

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Since commit 5561770f80b1 ("staging: wfx: repair external IRQ for SDIO"), wfx_sdio_irq_subscribe() enforce the device to use IRQs. However, there is currently a race in this code. An IRQ may happen before the IRQ has been registered. The problem has observed during debug se

[PATCH v2 33/33] staging: wfx: early exit of PDS is not correct

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller If PDS data is not correct, the device is unlikely to work. Worse, the pinmux maybe it misconfigured and it can generate IRQ-storms. Therefore, do not try to start-up the device if PDS is invalid. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 4 +++- 1 f

[PATCH v3 01/32] staging: wfx: use abbreviated message for "incorrect sequence"

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller The wfx driver checks carefully the coherency of of the DTIM notifications. We have noticed several times some small inconsistencies from the firmware on these notification. They have never been critical. However on the driver side they lead to big fat warnings. Worse, if t

[PATCH v3 00/32] staging/wfx: usual maintenance

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Hi, The following PR contains now usual maintenance for the wfx driver. I have more-or-less sorted the patches by importance: - the first ones and the two last ones are fixes for a few corner-cases reported by users - the patches 9 and 10 add support for CSA a

[PATCH v3 02/32] staging: wfx: do not send CAB while scanning

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller During the scan requests, the Tx traffic is suspended. This lock is shared by all the network interfaces. So, a scan request on one interface will block the traffic on a second interface. This causes trouble when the queued traffic contains CAB (Content After DTIM Beacon) si

[PATCH v3 03/32] staging: wfx: ignore PS when STA/AP share same channel

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller When multiple interface are in use. One is always AP while the other is always station. When the two interface use the same channel, it makes no sense to enabled Power Saving (PS) on the station. Indeed, because of the AP, the device will be kept awake on this channel anyway

[PATCH v3 04/32] staging: wfx: wait for SCAN_CMPL after a SCAN_STOP

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller When the device has finished a scan request, it send a scan complete ("SCAN_COMPL") indication. It is also possible to abort a scan request with a "SCAN_STOP" message. A SCAN_COMPL is also send in this case. The driver limits the delay to make a scan request. A timeout happ

[PATCH v3 05/32] staging: wfx: avoid possible lock-up during scan

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller If the environment is noisy, the device may take time to send scan requests. Thus, scan requests durations > 5s have already been observed. During the scan, traffic is neither received, neither sent. From the user point-of-view, the traffic is frozen for a long time. This p

[PATCH v3 06/32] staging: wfx: drop unused argument from hif_scan()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller It is no more necessary to compute the expected duration of the scan request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 9 + drivers/staging/wfx/hif_tx.h | 2 +- drivers/staging/wfx/scan.c | 2 +- 3 files changed, 3 insertions(+), 10 dele

[PATCH v3 07/32] staging: wfx: fix atomic accesses in wfx_tx_queue_empty()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller Checking if a skb_queue is empty is not an atomic operation. We should take some precautions to do it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/driver

[PATCH v3 08/32] staging: wfx: take advantage of wfx_tx_queue_empty()

2021-09-13 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_queues_check_empty() can be slightly simplified by calling wfx_tx_queue_empty(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/queue.c b

  1   2   3   4   5   6   7   8   >