Re: [PATCH] staging: wfx: fix reset GPIO polarity

2019-12-05 Thread Jérôme Pouiller
What do you think about it? (in add, this solution would explicitly change the name of the DT attribute instead of changing the semantic of the existing attribute) -- Jérôme Pouiller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: wfx: fix reset GPIO polarity

2019-12-05 Thread Jérôme Pouiller
On Thursday 5 December 2019 15:49:55 CET Michał Mirosław wrote: > On Thu, Dec 05, 2019 at 02:08:23PM +0000, Jérôme Pouiller wrote: > > On Wednesday 4 December 2019 17:59:46 CET Michał Mirosław wrote: > > > Driver inverts meaning of GPIO_ACTIVE_LOW/HIGH. Fix it to preve

Re: [PATCH 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps

2019-12-17 Thread Jérôme Pouiller
On Monday 16 December 2019 19:08:39 CET Felix Fietkau wrote: > On 2019-12-16 18:03, Jérôme Pouiller wrote: > > From: Jérôme Pouiller > > > > When not using HT mode, minstrel always includes 1Mbps as fallback rate. > > But, when using HT mode, this fallback is

[PATCH v2 40/55] staging: wfx: simplify hif_set_pm() usage

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The struct hif_req_set_pm_mode comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate the handling of this struct to hif_set_pm() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH v2 54/55] staging: wfx: implement cancel_hw_scan()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The device provides an API to abort a scan request. Expose this feature to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 13 + drivers/staging/wfx/scan.h | 1 + drivers/staging/wfx/wfx.h | 1

Re: [PATCH 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps

2019-12-17 Thread Jérôme Pouiller
on in January. One last thing, do you know why minstrel appends the lowest rate and minstrel_ht don't? They should be identical, not? -- Jérôme Pouiller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/ma

Re: [PATCH 01/55] staging: wfx: fix the cache of rate policies on interface reset

2019-12-17 Thread Jérôme Pouiller
On Tuesday 17 December 2019 12:52:11 CET Greg Kroah-Hartman wrote: > On Mon, Dec 16, 2019 at 05:03:33PM +0000, Jérôme Pouiller wrote: > > From: Jérôme Pouiller > > > > Device and driver maintain a cache of rate policies (aka. > > tx_retry_policy in hardware API). >

[PATCH v2 32/55] staging: wfx: drop useless argument from wfx_set_pm()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Argument to wfx_set_pm() is always wvif->powersave_mode. So, we can simplify it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/stag

[PATCH v2 33/55] staging: wfx: remove redundant test while calling wfx_update_pm()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Condition about wvif->state and wvif->bss_params.aid is already checked at beginning of wfx_update_pm(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/d

[PATCH v2 52/55] staging: wfx: delayed_unjoin cannot happen

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Original code allows to detect an unjoin request during a scan and delaying the unjoin request. However, it is far easier to just block the unjoin request until the end of the scan request. In fact, it is already the case since scan and unjoin are protected by conf_mutex

[PATCH v2 31/55] staging: wfx: declare wfx_set_pm() static

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_set_pm() is now only used by sta.c. It can be declared static. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 57 --- drivers/staging/wfx/sta.h | 1 - 2 files changed, 30 insertions(+), 28 deletions(-) diff --git

[PATCH v2 39/55] staging: wfx: simplify hif_set_uapsd_info() usage

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller It is useless to keep uapsd_info in struct wfx_vif. This structure can be rebuilt just before to be sent. In add, the struct hif_mib_set_uapsd_information comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocates

[PATCH v2 28/55] staging: wfx: better naming for hif_mib_set_association_mode->greenfield

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Current name "mixed_or_greenfield_type" does not allow to know if "true" means "mixed" of "greenfield". It is possible to use a better name and drop "enum hif_tx_mode". Signed-off-by: Jérôme Pouiller --- drivers/staging/w

[PATCH v2 48/55] staging: wfx: introduce update_probe_tmpl()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Simplify wfx_hw_scan() by splitting out the update of the probe request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 59 -- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/scan.c

[PATCH v2 55/55] staging: wfx: update TODO

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Update the TODO list of wfx driver with a more precise list of items. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 81 +--- 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/TODO b

[PATCH v2 49/55] staging: wfx: simplify hif_set_template_frame() usage

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_template_frame come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, the current code for hif_set_template_frame() is dumb. All the difficult task is left to the caller. So, there is code to factorize here

[PATCH v2 43/55] staging: wfx: simplify hif_set_edca_queue_params() usage

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The struct hif_req_edca_queue_params comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch: 1. relocate the handling of this struct in hif_set_edca_queue_params() (the low level function) 2. replace

[PATCH v2 47/55] staging: wfx: simplify hif_scan() usage

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The structures hif_req_start_scan and hif_ssid_def come from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate handling of theses structures to hif_scan() (the low level function). This change also allows to drop

[PATCH v2 50/55] staging: wfx: rewrite wfx_hw_scan()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Scan requests from mac80211 must be splitted in a few hardware requests (it is necessary to split channels with active scan and channels with passive scan). Current code schedules a work_struct for each hardware request and one delayed_work to handle scan timeout

[PATCH v2 35/55] staging: wfx: do not try to save call to hif_set_pm()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code try to not exchange data with device if it is not necessary. However, it seems that the additional code does not provide any gain. So, we prefer to keep a simpler code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 7 +-- 1 file changed

[PATCH v2 36/55] staging: wfx: fix pm_mode timeout

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Maximum request time (how long a request wait for the medium) is set in firmware to 512TU 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

[PATCH v2 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller In the old days, wfx_do_join() could be called from different contexts. Now that wfx_do_join() is called only from one place, it is cleaner to keep lock and unlock of data inside the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 9 - 1

[PATCH v2 38/55] staging: wfx: prefer a bitmask instead of an array of boolean

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller It is easier to manipulate a int than an array of booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 17 +++-- drivers/staging/wfx/sta.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b

[PATCH v2 46/55] staging: wfx: drop useless wfx_scan_complete()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Since wfx_scan_complete() is now only called from wfx_scan_complete_cb(), it make sense to merge the both functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging

[PATCH v2 37/55] staging: wfx: simplify wfx_conf_tx()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Error management of wfx_conf_tx() can be simplified. In add, the hardware command "hif_set_edca_queue_params" never returns any error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 44 ++- 1 file c

[PATCH v2 26/55] staging: wfx: improve API of hif_req_join->infrastructure_bss_mode

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller In fact "mode" is a boolean that indicates if IBSS mode is used. This patch fixes the name and uses a more adapted memory representation. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 ++-- drivers/staging/wfx/sta.c | 2 +

[PATCH v2 44/55] staging: wfx: hif_scan() never fails

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller If scan fails, status is returned in hif_ind_scan_cmpl. hif_scan always return a success. So, we can simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 20 ++-- drivers/staging/wfx/scan.h | 1 - 2 files changed, 2

[PATCH v2 45/55] staging: wfx: device already handle sleep mode during scan

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The device is not allowed to enter in sleep mode during scan. However, this is already handled by the device. So driver does not have to care about it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 3 +-- drivers/staging/wfx/scan.c | 3 --- drivers

[PATCH v2 42/55] staging: wfx: remove unnecessary EDCA initialisation

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 already call wfx_conf_tx() on every VIF instanciation. So, the driver does not need to do it. Note that current code did dirty things with wvif->edca_params. This struct was initialized, but only 'queue_id' was really used. The other members are only used to st

[PATCH v2 51/55] staging: wfx: workaround bug with "iw scan"

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 specification does not forbid hw_scan() to call ieee80211_scan_completed(). However, from userspace point of view, not all applications support this behavior. In particular, the code of iw contains a big fat warning: /* * This code has a bug, which requires

[PATCH v2 30/55] staging: wfx: firmware already handle powersave mode during scan

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller When user try to launch scan while connected, it is necessary to notify the AP that we cannot receive data (using power save mode). Firmware already handles this automatically so the code in the driver is redundant and can be dropped. By edge effect, hack of scan status

[PATCH v2 34/55] staging: wfx: drop unnecessary wvif->powersave_mode

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Power save status is already available in bss_conf. So there is no reason to keep information duplicated in wvif->powersave_mode. In add, type of wvif->powersave_mode is low level struct made to communicate with device. We would like to limit usage of this kind of

[PATCH v2 14/55] staging: wfx: improve error message on unexpected confirmation

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller When driver receives an unexpected answer from the device, it shows "unsupported HIF ID". That message does not represent the real error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletio

[PATCH v2 12/55] staging: wfx: don't print useless error messages

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller During chip probing, if error does not come from secure boot (for exemple when firmware has been found), others errors probably appears. It is not necessary to say to user that the error does not come from secure boot. So, drop the message saying "no error rep

[PATCH v2 23/55] staging: wfx: fix typo in "num_of_ssi_ds"

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The script that has imported API headers has made a mistake in "num_of_ssi_ds". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 4 ++-- drivers/staging/wfx/hif_tx.c | 10 +- drivers/staging/wfx/scan.c| 2 +- 3 fil

[PATCH v2 10/55] staging: wfx: fix wrong error message

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The driver checks that the number of retries made by the device is coherent with the rate policy. However, this check make sense only if the device has returned RETRY_EXCEEDED. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 4 +++- 1 file changed, 3

[PATCH v2 19/55] staging: wfx: simplify variable assignment

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Attribute "aborted" and argument "aborted" are both booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.

[PATCH v2 03/55] staging: wfx: fix counter overflow

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Some weird behaviors were observed when connection is really good and packets are small. It appears that sometime, number of packets in queues can exceed 255 and generate an overflow in field usage_count. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.h

[PATCH v2 09/55] staging: wfx: fix hif_set_mfp() with big endian hosts

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller struct hif_mib_protected_mgmt_policy is an array of u8. There is no reason to swap its bytes. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx

[PATCH v2 01/55] staging: wfx: fix the cache of rate policies on interface reset

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Device and driver maintain a cache of rate policies (aka. tx_retry_policy in hardware API). When hif_reset() is sent to hardware, device resets its cache of rate policies. In order to keep driver in sync, it is necessary to do the same on driver. Note, when driver tries

[PATCH v2 08/55] staging: wfx: detect race condition in WEP authentication

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code has a special case to handle association with WEP. Before to rework the tx data handling, let's try to detect any possible misuse of this code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 02/55] staging: wfx: fix case of lack of tx_retry_policies

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller In some rare cases, driver may not have any available tx_retry_policies. In this case, the driver asks to mac80211 to stop sending data. However, it seems that a race is possible and a few frames can be sent to the driver. In this case, driver can't wait for free

[PATCH v2 20/55] staging: wfx: make conditions easier to read

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller We prefer series of simple boolean conditions than computing bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers

[PATCH v2 11/55] staging: wfx: increase SPI bus frequency limit

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The chip has now proven that it can run at 50MHz on any boards without any problem. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx

[PATCH v2 18/55] staging: wfx: remove useless include

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller hif_tx.c does not use any struct skb. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index cb7cddcb9815..e8c2bd1efbac 100644 --- a/drivers

[PATCH v2 05/55] staging: wfx: firmware does not support more than 32 total retries

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The sum of all retries for a Tx frame cannot be superior to 32. There are 4 rates at most. So this patch limits number of retries per rate to 8. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 24/55] staging: wfx: fix typo in "num_i_es"

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The script that has imported API header has made a mistake "num_i_es". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 2 +- drivers/staging/wfx/hif_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH v2 04/55] staging: wfx: use boolean appropriately

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The field 'uploaded' is used as a boolean, so call it a boolean. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 4 ++-- drivers/staging/wfx/data_tx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c

[PATCH v2 13/55] staging: wfx: avoid double warning when no more tx policy are available

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Currently, number of available tx retry policies is checked two times. Only one is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers

[PATCH v2 27/55] staging: wfx: better naming for hif_req_join->short_preamble

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller HIF_PREAMBLE_SHORT_LONG12 is never used. So it is possible to change "preamble_type" into a boolean and drop "enum hif_preamble". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 16 ++-- drivers/staging/wf

[PATCH v2 22/55] staging: wfx: ensure that received hif messages are never modified

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller There are no real reason to modify the data received from device. So, let's mark the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 8 ++- drivers/staging/wfx/data_rx.h | 4 +- drivers/staging/wfx/data_tx.c | 2

[PATCH v2 15/55] staging: wfx: take advantage of IS_ERR_OR_NULL()

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Obviously, current code can be replaced by IS_ERR_OR_NULL(). 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/main.c b/drivers/staging/wfx/main.c index 3b47b6c21ea1

[PATCH v2 25/55] staging: wfx: fix name of struct hif_req_start_scan_alt

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller The original name did not make any sense. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 3e77fbe3d5ff

[PATCH v2 00/55] Improve wfx driver

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Hello all, This pull request continue to clean up the wfx driver. It can be more or less divided in four parts: - 0001 to 0009 fix some issues (should be included in 5.5?) - 0010 to 0028 mostly contains cosmetics changes - 0029 to 0043 re-work power save (in station

[PATCH v2 06/55] staging: wfx: fix rate control handling

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller A tx_retry_policy (the equivalent of a list of ieee80211_tx_rate in hardware API) is not able to include a rate multiple time. So currently, the driver merges the identical rates from the policy provided by minstrel (and it try to do the best choice it can in the associated

[PATCH v2 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller When not using HT mode, minstrel always includes 1Mbps as fallback rate. But, when using HT mode, this fallback is not included. Yet, it seems that it could save some frames. So, this patch add it unconditionally. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx

[PATCH v2 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_*

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller This new naming allows to save a comment. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 ++ drivers/staging/wfx/fwio.c| 2 +- drivers/staging/wfx/hwio.h| 15 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git

[PATCH v2 53/55] staging: wfx: delayed_link_loss cannot happen

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Original code allows to detect an BSS loss during a scan and delaying the handling of BSS loss. However, there it is no real problem to just make these two events mutually exclusive (there is just a performance penalty). Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH v2 21/55] staging: wfx: ensure that traces never modify arguments

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller There is no reason for a trace to change any bit of the argument. So, let's make sure that is the case by declaring the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/traces.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH v2 41/55] staging: wfx: drop struct wfx_edca_params

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller Intermediate structure wfx_edca_params does not help. This patch relocates its members directly in struct wfx_vif. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 ++-- drivers/staging/wfx/sta.c | 18 +- drivers/staging/wfx/sta.h

[PATCH v2 16/55] staging: wfx: uniformize naming rule

2019-12-17 Thread Jérôme Pouiller
From: Jérôme Pouiller In wfx driver, when a function is used as a struct member, its name is the name of the member prefixed with "wfx_". This patch apply this rule to wfx_spi_remove(). Also remove the useless comment above the function. Signed-off-by: Jérôme Pouiller --- drive

[PATCH 45/55] staging: wfx: device already handle sleep mode during scan

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The device is not allowed to enter in sleep mode during scan. However, this is already handled by the device. So driver does not have to care about it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 3 +-- drivers/staging/wfx/scan.c | 3 --- drivers

[PATCH 49/55] staging: wfx: simplify hif_set_template_frame() usage

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_template_frame come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, the current code for hif_set_template_frame() is dumb. All the difficult task is left to the caller. So, there is code to factorize here

[PATCH 47/55] staging: wfx: simplify hif_scan() usage

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The structures hif_req_start_scan and hif_ssid_def come from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate handling of theses structures to hif_scan() (the low level function). This change also allows to drop

[PATCH 46/55] staging: wfx: drop useless wfx_scan_complete()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Since wfx_scan_complete() is now only called from wfx_scan_complete_cb(), it make sense to merge the both functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging

[PATCH 43/55] staging: wfx: simplify hif_set_edca_queue_params() usage

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The struct hif_req_edca_queue_params comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch: 1. relocate the handling of this struct in hif_set_edca_queue_params() (the low level function) 2. replace

[PATCH 44/55] staging: wfx: hif_scan() never fails

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller If scan fails, status is returned in hif_ind_scan_cmpl. hif_scan always return a success. So, we can simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 20 ++-- drivers/staging/wfx/scan.h | 1 - 2 files changed, 2

[PATCH 42/55] staging: wfx: remove unnecessary EDCA initialisation

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 already call wfx_conf_tx() on every VIF instanciation. So, the driver does not need to do it. Note that current code did dirty things with wvif->edca_params. This struct was initialized, but only 'queue_id' was really used. The other members are only used to st

[PATCH 48/55] staging: wfx: introduce update_probe_tmpl()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Simplify wfx_hw_scan() by splitting out the update of the probe request. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 57 -- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/drivers/staging/wfx/scan.c

[PATCH 38/55] staging: wfx: prefer a bitmask instead of an array of boolean

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller It is easier to manipulate a int than an array of booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 17 +++-- drivers/staging/wfx/sta.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b

[PATCH 37/55] staging: wfx: simplify wfx_conf_tx()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Error management of wfx_conf_tx() can be simplified. In add, the hardware command "hif_set_edca_queue_params" never returns any error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 42 ++- 1 file c

[PATCH 39/55] staging: wfx: simplify hif_set_uapsd_info() usage

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller It is useless to keep uapsd_info in struct wfx_vif. This structure can be rebuilt just before to be sent. In add, the struct hif_mib_set_uapsd_information comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocates

[PATCH 40/55] staging: wfx: simplify hif_set_pm() usage

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The struct hif_req_set_pm_mode comes from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate the handling of this struct to hif_set_pm() (the low level function). Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH 41/55] staging: wfx: drop struct wfx_edca_params

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Intermediate structure wfx_edca_params does not help. This patch relocates its members directly in struct wfx_vif. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 ++-- drivers/staging/wfx/sta.c | 18 +- drivers/staging/wfx/sta.h

[PATCH 06/55] staging: wfx: fix rate control handling

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller A tx_retry_policy (the equivalent of a list of ieee80211_tx_rate in hardware API) is not able to include a rate multiple time. So currently, the driver merges the identical rates from the policy provided by minstrel (and it try to do the best choice it can in the associated

[PATCH 27/55] staging: wfx: better naming for hif_req_join->short_preamble

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller HIF_PREAMBLE_SHORT_LONG12 is never used. So it is possible to change "preamble_type" into a boolean and drop "enum hif_preamble". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 16 ++-- drivers/staging/wf

[PATCH 53/55] staging: wfx: delayed_link_loss cannot happen

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Original code allows to detect an BSS loss during a scan and delaying the handling of BSS loss. However, there it is no real problem to just make these two events mutually exclusive (there is just a performance penalty). Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH 30/55] staging: wfx: firmware already handle powersave mode during scan

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller When user try to launch scan while connected, it is necessary to notify the AP that we cannot receive data (using power save mode). Firmware already handles this automatically so the code in the driver is redundant and can be dropped. By edge effect, hack of scan status

[PATCH 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller In the old days, wfx_do_join() could be called from different contexts. Now that wfx_do_join() is called only from one place, it is cleaner to keep lock and unlock of data inside the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 9 - 1

[PATCH 28/55] staging: wfx: better naming for hif_mib_set_association_mode->greenfield

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Current name "mixed_or_greenfield_type" does not allow to know if "true" means "mixed" of "greenfield". It is possible to use a better name and drop "enum hif_tx_mode". Signed-off-by: Jérôme Pouiller --- drivers/staging/w

[PATCH 32/55] staging: wfx: drop useless argument from wfx_set_pm()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Argument to wfx_set_pm() is always wvif->powersave_mode. So, we can simplify it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/stag

[PATCH 11/55] staging: wfx: increase SPI bus frequency limit

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The chip has now proven that it can run at 50MHz on any boards without any problem. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx

[PATCH 34/55] staging: wfx: drop unnecessary wvif->powersave_mode

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Power save status is already available in bss_conf. So there is no reason to keep information duplicated in wvif->powersave_mode. In add, type of wvif->powersave_mode is low level struct made to communicate with device. We would like to limit usage of this kind of

[PATCH 52/55] staging: wfx: delayed_unjoin cannot happen

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Original code allows to detect an unjoin request during a scan and delaying the unjoin request. However, it is far easier to just block the unjoin request until the end of the scan request. In fact, it is already the case since scan and unjoin are protected by conf_mutex

[PATCH 35/55] staging: wfx: do not try to save call to hif_set_pm()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code try to not exchange data with device if it is not necessary. However, it seems that the additional code does not provide any gain. So, we prefer to keep a simpler code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 7 +-- 1 file changed

[PATCH 54/55] staging: wfx: implement cancel_hw_scan()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The device provides an API to abort a scan request. Expose this feature to mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 1 + drivers/staging/wfx/scan.c | 13 + drivers/staging/wfx/scan.h | 1 + drivers/staging/wfx/wfx.h | 1

[PATCH 51/55] staging: wfx: workaround bug with "iw scan"

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 specification does not forbid hw_scan() to call ieee80211_scan_completed(). However, from userspace point of view, not all applications support this behavior. In particular, the code of iw contains a big fat warning: /* * This code has a bug, which requires

[PATCH 09/55] staging: wfx: fix hif_set_mfp() with big endian hosts

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller struct hif_mib_protected_mgmt_policy is an array of u8. There is no reason to swap its bytes. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx

[PATCH 04/55] staging: wfx: use boolean appropriately

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The field 'uploaded' is used as a boolean, so call it a boolean. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 4 ++-- drivers/staging/wfx/data_tx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c

[PATCH 22/55] staging: wfx: ensure that received hif messages are never modified

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller There are no real reason to modify the data received from device. So, let's mark the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 8 ++- drivers/staging/wfx/data_rx.h | 4 +- drivers/staging/wfx/data_tx.c | 2

[PATCH 26/55] staging: wfx: improve API of hif_req_join->infrastructure_bss_mode

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller In fact "mode" is a boolean that indicates if IBSS mode is used. This patch fixes the name and uses a more adapted memory representation. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 ++-- drivers/staging/wfx/sta.c | 2 +

[PATCH 24/55] staging: wfx: fix typo in "num_i_es"

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The script that has imported API header has made a mistake "num_i_es". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 2 +- drivers/staging/wfx/hif_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 12/55] staging: wfx: don't print useless error messages

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller During chip probing, if error does not come from secure boot (for exemple when firmware has been found), others errors probably appears. It is not necessary to say to user that the error does not come from secure boot. So, drop the message saying "no error rep

[PATCH 20/55] staging: wfx: make conditions easier to read

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller We prefer series of simple boolean conditions than computing bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers

[PATCH 18/55] staging: wfx: remove useless include

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller hif_tx.c does not use any struct skb. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index cb7cddcb9815..e8c2bd1efbac 100644 --- a/drivers

[PATCH 23/55] staging: wfx: fix typo in "num_of_ssi_ds"

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller The script that has imported API headers has made a mistake in "num_of_ssi_ds". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 4 ++-- drivers/staging/wfx/hif_tx.c | 10 +- drivers/staging/wfx/scan.c| 2 +- 3 fil

[PATCH 21/55] staging: wfx: ensure that traces never modify arguments

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller There is no reason for a trace to change any bit of the argument. So, let's make sure that is the case by declaring the arguments constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/traces.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH 13/55] staging: wfx: avoid double warning when no more tx policy are available

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Currently, number of available tx retry policies is checked two times. Only one is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers

[PATCH 15/55] staging: wfx: take advantage of IS_ERR_OR_NULL()

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller Obviously, current code can be replaced by IS_ERR_OR_NULL(). 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/main.c b/drivers/staging/wfx/main.c index 3b47b6c21ea1

[PATCH 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_*

2019-12-16 Thread Jérôme Pouiller
From: Jérôme Pouiller This new naming allows to save a comment. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 ++ drivers/staging/wfx/fwio.c| 2 +- drivers/staging/wfx/hwio.h| 15 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git

  1   2   3   4   >