[PATCH 02/10] staging: wfx: do not declare variables inside loops

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller The local variables should be declared at beginning of the functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c i

[PATCH 01/10] staging: wfx: drop unused variable

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller Since the commit 3f84adfe1d7ae ("staging: wfx: remove hack about tx_rate policies"), the variable "count" is no more used in wfx_tx_policy_build(). Notice that there were two instances of the variable "count" in wfx_tx_policy_build(). This patch also solves this cosmetic is

[PATCH 05/10] staging: wfx: retrieve the PS status from the vif

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller The Power Save status is stored for each virtual interface and for the whole device. The WF200 is able to handle power saving per interface, so use the value stored in vif. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH 07/10] staging: wfx: add support for set/get ps_timeout

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller In some advanced usage or debug scenarios, it could interesting to change the value of ps_timeout or eventually to force use of PS-Poll frames. The wext API (used by iwconfig) provide a way to change ps_timeout. However, this API is obsolete and it seems a little weird to u

[PATCH 10/10] staging: wfx: allow to run nl80211 vendor commands with 'iw'

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller In current code, the nl80211 vendor extensions provided by the driver use the new API[1]. It requires to pack the netlink attributes into a NLA_NESTED. Unfortunately, it is not the way the command 'iw vendor' works. This patch, add extra vendor commands that can be called

[PATCH 08/10] staging: wfx: allow to burn prevent rollback bit

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller In case a security flaw is found in a version of firmware, the device offers a way to disallow the loading an older firmware. This patch provides a vendor extension to nl80211 to enable this feature. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.

[PATCH 09/10] staging: wfx: allow to set PTA settings

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller The device allows to do Packet Traffic Arbitration (PTA or also Coex) with other RF chips. Currently, there is no API to manage the PTA parameters. This patch provides a vendor extension to nl80211 to change the PTA parameters. Signed-off-by: Jérôme Pouiller --- drivers/

[PATCH 06/10] staging: wfx: split wfx_get_ps_timeout() from wfx_update_pm()

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller In the next commit, we will have to compute the PS timeout without changing the power save status of the device. This patch introduces wfx_get_ps_timeout() for that job and make wfx_update_pm() relies on it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4

[PATCH 03/10] staging: wfx: drop unused function wfx_pending_requeue()

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller The function wfx_pending_requeue() is not used anymore since the commit 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Fixes: 7a44644c9379e ("staging: wfx: introduce wfx_set_default_unicast_key()") Signed-off-by: Jérôme Pouiller --- drivers/stagin

[PATCH 04/10] staging: wfx: add support for tx_power_loop

2020-05-26 Thread Jerome Pouiller
From: Jérôme Pouiller During the calibration of the RF amplifier, the device is able to provide some data about the status of the amplifier. Record these data and expose them in debugfs. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 26 ++

[PATCH 02/17] staging: wfx: take advantage of le32_to_cpup()

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller le32_to_cpu(*x) can be advantageously converted in le32_to_cpup(x). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index ac4ec4

[PATCH 01/17] staging: wfx: fix use of cpu_to_le32 instead of le32_to_cpu

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse detected that le32_to_cpu should be used instead of cpu_to_le32. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hwio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c index d878cb3e

[PATCH 07/17] staging: wfx: fix endianness of hif_req_read_mib fields

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The structs hif_{req,cnf}_read_mib contain only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong accesses to fields mib_id and length. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 1

[PATCH 04/17] staging: wfx: fix wrong bytes order

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is a u8. So, assigning it a __le16 produces a nasty bug on big-endian architectures. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH 03/17] staging: wfx: fix cast operator

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse detects that le16_to_cpup() expects a __le16 * as argument. Change the cast operator to be compliant with sparse. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/traces.h | 2 +- 2 files changed, 2 insertions(+), 2 delet

[PATCH 00/17] staging: wfx: fix support for big-endian hosts

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller Hello, As already discussed here[1], this series improves support for big endian hosts. All warnings raised by sparse are now fixed. Note, this series aims to be applied on top of PR named "staging: wfx: fix Out-Of-Band IRQ" [1] https://lore.kernel.org/lkml/201920285

[PATCH 10/17] staging: wfx: fix access to le32 attribute 'indication_type'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute indication_type is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/

[PATCH 11/17] staging: wfx: declare the field 'packet_id' with native byte order

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The field packet_id is not interpreted by the device. It is only used as identifier for the device answer. So it is not necessary to declare it little endian. It fixes some warnings raised by Sparse without complexifying the code. Signed-off-by: Jérôme Pouiller --- driver

[PATCH 15/17] staging: wfx: fix endianness of the field 'num_tx_confs'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'num_tx_confs' from the struct hif_cnf_multi_transmit is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/hif_rx.c:82:9: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:87:29: warning:

[PATCH 08/17] staging: wfx: fix access to le32 attribute 'ps_mode_error'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute ps_mode_error is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/dri

[PATCH 14/17] staging: wfx: fix endianness of the field 'status'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'status' appears in most of structs returned by the hardware. This field is encoded as little endian. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer drivers

[PATCH 13/17] staging: wfx: fix endianness of the field 'len'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_msg is received from the hardware. So, it declared as little endian. However, it is also accessed from many places in the driver. Sparse complains about that: drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/stag

[PATCH 17/17] staging: wfx: update TODO

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller Update the TODO list associated to the wfx driver with the last progresses. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO index fca333

[PATCH 16/17] staging: wfx: fix endianness of the field 'channel_number'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'channel_number' from the structs hif_ind_rx and hif_req_start is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types) drivers/staging/wfx

[PATCH 12/17] staging: wfx: fix endianness of the struct hif_ind_startup

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_ind_startup is received from the hardware. So it is declared as little endian. However, it is also stored in the main driver structure and used on different places in the driver. Sparse complains about that: drivers/staging/wfx/data_tx.c:388:43: warning:

[PATCH 09/17] staging: wfx: fix access to le32 attribute 'event_id'

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute event_id is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/st

[PATCH 05/17] staging: wfx: fix output of rx_stats on big endian hosts

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/driver

[PATCH 06/17] staging: wfx: fix endianness of fields media_delay and tx_queue_delay

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_cnf_tx contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong access to fields media_delay and tx_queue_delay. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3

[PATCH] mmc: fix compilation of user API

2020-05-11 Thread Jerome Pouiller
From: Jérôme Pouiller The definitions of MMC_IOC_CMD and of MMC_IOC_MULTI_CMD rely on MMC_BLOCK_MAJOR: #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) #define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd) However, MMC_BLOCK_MAJOR is defi

[PATCH 00/15] staging: wfx: fix Out-Of-Band IRQ

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller The WF200 can be used on SPI and SDIO. When using SDIO bus, the driver normally use the in band IRQ provided by the SDIO bus. However, WF200 also provides support for a dedicated IRQ line. This feature is used when in-band IRQ does not work or to allows some kind of Wake-On-

[PATCH 02/15] staging: wfx: reduce timeout for chip initial start up

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller The device take a few hundreds of milliseconds to start. However, the current code wait up to 10 second for the chip. We can safely reduce this value to 1 second. Thanks to that change, it is no more necessary to use an interruptible timeout. Signed-off-by: Jérôme Pouiller

[PATCH 03/15] staging: wfx: fix double free

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller In case of error in wfx_probe(), wdev->hw is freed. Since an error occurred, wfx_free_common() is called, then wdev->hw is freed again. Cc: Michał Mirosław Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dr

[PATCH 01/15] staging: wfx: add support for hardware revision 2 and further

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, the driver explicitly exclude support for chip with version number it does not know. However, it unlikely that any futur hardware change would break the driver. Therefore, we prefer to invert the test and only exclude the versions we know the driver does not suppo

[PATCH 10/15] staging: wfx: fix missing 'static' keyword

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse tool noticed that wfx_enable_beacon() is never used outside of sta.c. Therefore, it can be declared static. 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/

[PATCH 13/15] staging: wfx: fix alignements of function prototypes

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller Some function prototypes were not correctly aligned and/or exceed 80 columns. In some other cases, the prototypes were written on more lines than necessary. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +-- drivers/staging/wfx/hif_tx.c | 24

[PATCH 08/15] staging: wfx: poll IRQ during init

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller When the chip starts in SDIO mode, the external IRQ (aka Out-Of-Band IRQ) cannot be used before to configure it. Therefore, the first exchanges with the chip have to be done without the OOB IRQ. This patch allow to poll the data until the OOB IRQ is correctly setup. In orde

[PATCH 09/15] staging: wfx: fix missing 'static' statement

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller The function get_firmware() is only used from fwio.c. It can be declared static. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/fwio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c i

[PATCH 06/15] staging: wfx: use threaded IRQ with SPI

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, the SPI implementation use a workqueue to acknowledge IRQ while the SDIO-OOB implementation use a threaded IRQ. The threaded also offers the advantage to allow level triggered IRQs. Uniformize the code and use threaded IRQ in both case. Therefore, prefer level t

[PATCH 14/15] staging: wfx: remove spaces after cast operator

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller The kernel coding style expects no space after cast operator. This patch make the wfx driver compliant with this rule. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 2 +- drivers/staging/wfx/hif_tx.c | 4 ++-- drivers/staging/wfx/hwio.c | 4 ++--

[PATCH 15/15] staging: wfx: use kernel types instead of c99 ones

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller The kernel coding style promotes the use of kernel types (u8, u16, u32, etc...) instead of the C99 ones. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 ++--- drivers/staging/wfx/hif_tx_mib.c | 2 +- drivers/staging/wfx/hif_tx_mib.h | 2 +- driver

[PATCH 12/15] staging: wfx: remove useless header inclusions

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller In order to keep the compilation times reasonable, we try to only include the necessary headers (especially header included from other headers). This patch clean up unnecessary headers inclusions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.h| 3 +-

[PATCH 04/15] staging: wfx: drop useless check

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, the ISR check if bus->core is not NULL. But, it is a useless check. bus->core is initialiased before to request IRQ and it is not assigned to NULL when it is released. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_sdio.c | 9 + drivers/stag

[PATCH 07/15] staging: wfx: introduce a way to poll IRQ

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller It is possible to check if an IRQ is ending by polling the control register. This function must used with care: if an IRQ fires while the host reads control register, the IRQ can be lost. However, it could be useful in some cases. Signed-off-by: Jérôme Pouiller --- driver

[PATCH 11/15] staging: wfx: prefer ARRAY_SIZE instead of a magic number

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller When possible, we prefer to use the macro ARRAY_SIZE rather than hard coding the number of elements. 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

[PATCH 05/15] staging: wfx: repair external IRQ for SDIO

2020-05-05 Thread Jerome Pouiller
From: Jérôme Pouiller When used over SDIO bus, device is able to use an external line to signal IRQs (also called Out-Of-Band IRQ). The current code have several problems: 1. The ISR cannot directly acknowledge IRQ since access to the bus is not atomic. This patch use a threaded IRQ to sol

[PATCH 00/19] staging: wfx: various fixes

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Hello, This series contains various changes. The most important patches are the 13 and 14 since they fix two functional defects. The other patches fix runtime warnings (1, 17, 18, 19), improve robustness (3, 4, 5, 7, 10, 16) and do some cosmetics improvements (2, 6, 8, 9, 1

[PATCH 03/19] staging: wfx: check pointers returned by allocations

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, the driver did not always check if the allocations success. The issue was discussed here: https://lore.kernel.org/netdev/2026476.QLiXXEGFCf@pc-42/ Reported-by: Dan Carpenter Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 43 +

[PATCH 01/19] staging: wfx: fix warning when unregister a frozen device

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller The device does not answer to the command hif_shutdown. Therefore, hif_shutdown() is a bit special. It bypasses some of work normally made by wfx_cmd_send(). In particularly, it unlock hif_cmd.lock and hif_cmd.key_renew_lock. However, if the driver notice that the device is

[PATCH 02/19] staging: wfx: apply 80-columns rule to strings

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Strings are allowed to exceed 80 columns but, in this case, the format arguments should be placed on a new line. Apply this rule to the whole code of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_sdio.c | 3 ++- drivers/staging/wfx/data_tx.c |

[PATCH 06/19] staging: wfx: fix indentation

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Fix indention of wfx_skb_dtor(). 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_tx.c index cac8c9ecbc34..a12590214a5d 10064

[PATCH 04/19] staging: wfx: fix value of scan timeout

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Before to start the scan request, the firmware signals (with a null frame) to the AP it won't be able to receive data. This frame can be long to send: up to 512TU. The current calculus of the scan timeout does not take into account this delay. Signed-off-by: Jérôme Pouiller

[PATCH 17/19] staging: wfx: remove false-positive WARN()

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller The function wfx_tx_flush() wait for there is no more queued frames in hardware queue. Then, for the sanity, it checks that there is no more pending frame on any AC queue. However, there is a race here. It may happens that hardware queues are empty, but the counters of the

[PATCH 18/19] staging: wfx: trace acknowledges not linked to any stations

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Some resources are associated to the outgoing of the stations. To avoid any resource leaks. It is important to understand why an acknowledge is not associated to any station. Add a trace for that purpose. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c |

[PATCH 14/19] staging: wfx: fix PS parameters when multiple vif are in use

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller When multiple vif are in use (= one access point and one station), and when the channels are different, it is necessary to enable power save on station. The firmware check that steps are done in the correct order: - AP can't start if PS is not enable on the station - PS

[PATCH 09/19] staging: wfx: call wfx_tx_update_sta() before to destroy tx_priv

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller The function wfx_notify_buffered_tx() need to know if the frame was associated to a station. This information is available in the Control Buffer (CB) of the skb. However, when wfx_notify_buffered_tx() is called, the CB is no more available. Thus, the caller has to take care

[PATCH 16/19] staging: wfx: fix error reporting in wfx_start_ap()

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller If AP did not start, the error was not reported to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 57304ed42e79..f

[PATCH 19/19] staging: wfx: remove false positive warning

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller When a station is removed, the driver check that all the Tx frames were correctly sent. However, the station can be removed before all the Tx frames were acknowledged and a false positive warning can be emitted. The previous commit has added a trace when driver received an

[PATCH 10/19] staging: wfx: fix potential use-after-free

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_policy_put() use data from the skb. However, the call to skb_pull() has just discarded them (even if the memory is in fact not really discarded). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 15/19] staging: wfx: drop unnecessary filter configuration when disabling filter

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, when mac80211 want to disable beacon filtering, the driver reset the filter table and disable the beacon filtering. Only the latter action is required. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH 11/19] staging: wfx: rename wfx_do_unjoin() into wfx_reset()

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller In fact, wfx_do_unjoin() resets the interface. This mechanism can be used in more cases than just disassociating from a BSS. So, rename it to reflect that fact. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 32 +++- drivers/sta

[PATCH 05/19] staging: wfx: fix coherency of hif_scan() prototype

2020-05-15 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 08/19] staging: wfx: split out wfx_tx_fill_rates() from wfx_tx_confirm_cb()

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_confirm_cb() is a big function. A big part of its body aims to fill the rates list. So, create a new function wfx_tx_fill_rates() and make wfx_tx_confirm_cb() smaller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 63 ++-

[PATCH 12/19] staging: wfx: merge wfx_stop_ap() with wfx_reset()

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_stop_ap() and wfx_reset() do the same thing. Merge them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e077f42b62dc..7d9

[PATCH 13/19] staging: wfx: fix potential dead lock between join and scan

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller The device disallows to start a scan request between hif_join() and hif_set_bss_params(). The driver is not protected against that. The worst case happens when association is aborted and hif_set_bss_params() never happens. mac80211 would never ask for scan during the associ

[PATCH 07/19] staging: wfx: fix status of dropped frames

2020-05-15 Thread Jerome Pouiller
From: Jérôme Pouiller When wfx_flush() is called, the status of pending frames are reported to mac80211 with random status. mac80211 probably won't interpret this status in this case, but it is cleaner to return a correctly initialized status. Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH v2 03/12] staging: wfx: fix BA when MFP is disabled but BSS is MFP capable

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The protection of the management frames is mainly done by mac80211. However, frames for the management of the BlockAck sessions are directly sent by the device. These frames have to be protected if MFP is in use. So the driver has to pass the MFP configuration to the device.

[PATCH v2 01/12] staging: wfx: fix BA when device is AP and MFP is enabled

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The protection of the management frames is mainly done by mac80211. However, frames for the management of the BlockAck sessions are directly sent by the device. These frames have to be protected if MFP is in use. So the driver has to pass the MFP configuration to the device.

[PATCH v2 05/12] staging: wfx: fix support for cipher AES_CMAC (multicast PMF)

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller When MFP is enabled, the multicast management frames are not protected, in fact. Instead, but they should include an IE containing the MMIC of the frames (i.e. a cryptographic signature). Until now, the driver didn't correctly detect this kind of frames (they are not marked

[PATCH v2 08/12] staging: wfx: fix potential use before init

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The trace below can appear: [83613.832200] INFO: trying to register non-static key. [83613.837248] the code is fine but needs lockdep annotation. [83613.842808] turning off the locking correctness validator. [83613.848375] CPU: 3 PID: 141 Comm: kworker/3:2H

[PATCH v2 07/12] staging: wfx: fix frame reordering

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller When mac80211 debug is enabled, the trace below appears: [60744.340037] wlan0: Rx A-MPDU request on aa:bb:cc:97:60:24 tid 0 result -524 This imply that ___ieee80211_start_rx_ba_session will prematurely exit and frame reordering won't be enabled. Fixes: e5da5fbd77411

[PATCH v2 04/12] staging: wfx: fix spaces around binary operators

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller A binary operator should be followed by exactly one space. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c index 5ee2ffc5f935..6165

[PATCH v2 02/12] staging: wfx: improve usage of hif_map_link()

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, hif_map_link() get as argument the raw value for map_link_flags when map_link_flags is defined as a bitfield. It was error prone. Now hif_map_link() takes explicit value for every flags of the struct map_link_flags. Signed-off-by: Jérôme Pouiller --- drivers/s

[PATCH v2 11/12] staging: wfx: remove useless extra jiffy

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The initial developer has feared msecs_to_jiffies() could round down the result. However, the documentation of msecs_to_jiffies() says that the result is rounded upward. So the increment of the result of msecs_to_jiffies() is not necessary. Signed-off-by: Jérôme Pouiller -

[PATCH v2 10/12] staging: wfx: enable powersave on probe

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller In the old days, ieee80211 powersave has some impact on the Rx speed. These problems are solved for a long time now. There is no more reason to not enabling it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v2 09/12] staging: wfx: scan while AP is supported

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The device is able to scan while running an Access Point. Just declare it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 4 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/main.c b/

[PATCH v2 06/12] staging: wfx: drop useless field from struct wfx_tx_priv

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The device need to receive a skb with necessary space for the ICV. So, the driver adds this space before to send the frame. Currently, once the frame is sent, the driver restore the original content of the skb. However, this step is useless. Mac80211 don't do it when softwa

[PATCH v2 12/12] staging: wfx: add workaround for 'timeout while wake up chip'

2020-08-25 Thread Jerome Pouiller
From: Jérôme Pouiller The host and the device can be connected with a called Wake-Up GPIO. When the host fall down this GPIO, it allows the device to enter in deep sleep and no communication with the device is no more possible (the device wakes up automatically on DTIM and fetch data if necessary

[PATCH 01/31] staging: wfx: improve readability of association processing

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The statements in wfx_bss_info_changed() has no particular order. For better readability, group and sort the statements relative to the association processing. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 53 +++ 1 fi

[PATCH 00/31] staging: wfx: fix last items of the TODO list

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Hello folks, This PR fixes most of the items of the TODO list associated to the wfx driver. Normally, my next PR will ask to move the wfx driver out of the staging area. Jérôme Pouiller (31): staging: wfx: improve readability of association processing staging: wfx: rel

[PATCH 02/31] staging: wfx: relocate wfx_join() beside wfx_join_finalize()

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_join() and wfx_join_finalize() are the two halves of the association process. Group them. In addition, for better uniformity of the code, rename wfx_do_join() in wfx_join(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 100 +++---

[PATCH 19/31] staging: wfx: drop useless structs only used in hif_req_tx

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The structs hif_queue, hif_data_flags, hif_tx_flags and hif_ht_tx_parameters have no real reasons to exist. Drop them and simplify access to fields of struct hif_req_tx. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 39 ++-- dr

[PATCH 14/31] staging: wfx: drop useless struct hif_map_link_flags

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_map_link_flags has no reason to exist. Drop it and simplify access to struct hif_req_map_link. Also rename the field 'map_direction' in 'unmap'. It is more meaningful and allows to drop enum hif_sta_map_direction. Signed-off-by: Jérôme Pouiller --- drivers/sta

[PATCH 25/31] staging: wfx: drop struct hif_ie_tlv

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller This struct hif_ie_tlv is definitively an Information Element (IE). This struct is defined by 802.11 specification and already exists in mac80211. Reuse this definition instead of struct hif_ie_tlv. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 10

[PATCH 13/31] staging: wfx: drop useless struct hif_bss_flags

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_bss_flags has no reason to exist. In add, it is never used. Drop it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/stagi

[PATCH 27/31] staging: wfx: fix naming of hif_tx_rate_retry_policy

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller In the wfx driver, the prefix 'hif_mib_' is normally used for structures that represent a hardware message. hif_mib_tx_rate_retry_policy does not fall in this category. So, rename it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 4 ++-- 1 file ch

[PATCH 29/31] staging: wfx: uniformize naming rules in hif_tx_mib.c

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller hif_tx_mib.c contains functions that format data to be sent to the hardware. In this file, sometime the struct to be sent is named 'arg', sometime 'val'. In some other function 'val' is used for the argument of the function. This patch uniformize the things and choose to ca

[PATCH 26/31] staging: wfx: drop macro API_SSID_SIZE

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The maximum length of a SSID is defined by 802.11 specification. It is already defined in mac80211: IEEE80211_MAX_SSID_LEN. Therefore, use this generic definition. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 +++- drivers/staging/wfx/h

[PATCH 28/31] staging: wfx: fix spaces

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller There is no reason to place two spaces between the field tx_conf_payload and its type. In the same vein, remove duplicate empty lines between declarations. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 4 +--- drivers/staging/wfx/hif_api_gene

[PATCH 30/31] staging: wfx: drop async field from struct hif_cmd

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The parameter "async" in wfx_cmd_send() allows to send command without waiting for the reply. In this case, the mutex hif_cmd.lock is released asynchronously in the context of the receiver workqueue. However, "kbuild test robot" complains about this architecture[1] since it

[PATCH 24/31] staging: wfx: drop useless union hif_indication_data

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The union hif_indication_data is never used in the driver. So, it is not necessary to declare it separately from hif_ind_generic. In add, drop prefix 'indication_' from the names 'indication_type' and 'indication_data' since it is redundant with the name of the struct. Sig

[PATCH 31/31] staging: wfx: update TODO list

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The driver is now close to leave the staging directory. Update the TODO list to reflect the work done. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/st

[PATCH 23/31] staging: wfx: drop useless union hif_event_data

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The union hif_event_data is never used in the driver. So, it is not necessary to declare it separately from hif_ind_event. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a

[PATCH 21/31] staging: wfx: drop useless structs only used in hif_ind_startup

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The structs hif_capabilities, hif_otp_regul_sel_mode_info and hif_otp_phy_info have no real reasons to exist. Drop them and simplify access to fields of struct hif_ind_startup. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 32 +

[PATCH 22/31] staging: wfx: drop useless union hif_privacy_key_data

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The union hif_privacy_key_data is never used in the driver. So, it is not necessary to declare it separately from hif_req_add_key. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 24 +++- 1 file changed, 11 insertions(+), 13 dele

[PATCH 08/31] staging: wfx: drop useless enum hif_beacon

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Enum hif_beacon is not used. Moreover, it is just another definition of a boolean. Absolutely useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers

[PATCH 16/31] staging: wfx: drop useless struct hif_pm_mode

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_pm_mode has no reason to exist. Drop it and simplify access to struct hif_req_set_pm_mode. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 6 +- drivers/staging/wfx/hif_tx.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions

[PATCH 15/31] staging: wfx: drop useless struct hif_suspend_resume_flags

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_suspend_resume_flags has no reason to exist. Drop it and simplify access to struct hif_ind_suspend_resume_tx. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 6 +- drivers/staging/wfx/hif_rx.c | 6 +++--- 2 files changed, 4 inser

[PATCH 20/31] staging: wfx: drop useless stricts only used in hif_req_start_scan_alt

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller The structs hif_scan_type, hif_scan_flags and hif_auto_scan_param have no real reasons to exist (apart maybe defining namespaces). Moreover, the names of the fields within these structs are not all meaningful. Drop the structs and rename the fields. Signed-off-by: Jérôme P

[PATCH 18/31] staging: wfx: drop useless struct hif_tx_result_flags

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_tx_result_flags has no reason to exist. Drop it and simplify access to struct hif_cnf_tx. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +-- drivers/staging/wfx/hif_api_cmd.h | 16 ++-- 2 files changed, 7 insertions(+), 1

[PATCH 11/31] staging: wfx: drop useless struct hif_ie_flags

2020-09-07 Thread Jerome Pouiller
From: Jérôme Pouiller Struct hif_ie_flags has no reason to exist. Drop it and simplify access to struct hif_req_update_ie. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 14 +- drivers/staging/wfx/hif_tx.c | 2 +- 2 files changed, 6 insertions(+), 10 d

<    1   2   3   4   >