Re: [PATCH] staging: wfx: add gcc extension __force cast

2019-11-12 Thread Jerome Pouiller
Hello Al, Thank you for your extensive review. On Monday 11 November 2019 21:28:52 CET Al Viro wrote: > On Mon, Nov 11, 2019 at 01:51:33PM +, Jules Irenge wrote: > > > > > NAK. force-cast (and it's not a gcc extension, BTW - it's sparse) is > > > basically > > > "I know better; the code is

Re: [PATCH] staging: wfx: add gcc extension __force cast

2019-11-12 Thread Jerome Pouiller
On Tuesday 12 November 2019 00:16:59 CET Al Viro wrote: [...] > More fun: > int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, > size_t val_len) > { > int ret; > struct hif_msg *hif; > int buf_len = sizeof(struct hif_cnf_read_mib) + val_len; >

[PATCH 0/5] staging: wfx: late fixes

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller This series fixes some issues for 5.6. The two last patches fix misuse of RCU. They are probably the most important of the series. Jérôme Pouiller (5): staging: wfx: fix warning about freeing in-use mutex during device unregister staging: wfx: fix lines ending with

[PATCH 1/5] staging: wfx: fix warning about freeing in-use mutex during device unregister

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller After hif_shutdown(), communication with the chip is no more possible. It the only request that never reply. Therefore, hif_cmd.lock is never unlocked. hif_shutdown() unlock itself hif_cmd.lock to avoid a potential warning during disposal of device. hif_cmd.key_renew_lock sh

[PATCH 4/5] staging: wfx: fix RCU usage in wfx_join_finalize()

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller Access to sta->ht_cap is protected by RCU. However, hif_set_association_mode() may sleep, so it can't be called in RCU. This patch fix this behavior by handling sta and its RCU directly from function hif_set_association_mode(). Signed-off-by: Jérôme Pouiller Fixes: d00149

[PATCH 3/5] staging: wfx: make warning about pending frame less scary

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller Removing station while some traffic is in progress may happen. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 03d0f224ffdb..010

[PATCH 5/5] staging: wfx: fix RCU usage between hif_join() and ieee80211_bss_get_ie()

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller Access to result of ieee80211_bss_get_ie() is protected by RCU. In other hand, function hif_join() can sleep and cannot be called with RCU locked. Provide a copy of "ssidie" to hif_join() to solve this behavior. Fixes: 9ced9b593741 ("staging: wfx: simplify hif_join()") Sig

[PATCH 2/5] staging: wfx: fix lines ending with a comma instead of a semicolon

2020-03-10 Thread Jerome Pouiller
From: Jérôme Pouiller Obviously introduced by mistake. Fixes: 09779276f1ba ("staging: wfx: simplify hif_start() usage") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drive

[PATCH 02/32] staging: wfx: do not stop mac80211 queueing during tx_policy upload

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller When a new tx_policy has to be uploaded, it is necessary to avoid any race between the frame and the policy. So, the driver stops the tx queue during tx_policy upload. However, it is not necessary to stop mac80211 queuing. Signed-off-by: Jérôme Pouiller --- drivers/stagin

[PATCH 12/32] staging: wfx: drop useless sta_asleep_mask

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, the driver tracks power save state of the stations with the variable sta_asleep_mask. Then, it takes care to not sent data to asleep stations. However, this work is already done by mac80211. Normally, there are no frames for asleep stations in our queues. So, dri

[PATCH 20/32] staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim()

[PATCH 26/32] staging: wfx: improve interface between data_tx.c and queue.c

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward

[PATCH 17/32] staging: wfx: drop unused link_id field

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller It is not used anymore. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 5 - drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/queue.h | 2 -- 3 files changed, 8 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx

[PATCH 32/32] staging: wfx: remove hack about tx_rate policies

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Current code contains a weird hack to avoid switch from 54Mbps CTS to 1Mbps. However, we have not been able to reproduce the problem and hardware team don't know any defect of this kind. So, it seems this hack is no more necessary. Signed-off-by: Jérôme Pouiller --- drive

[PATCH 18/32] staging: wfx: drop unused raw_link_id field

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller raw_link_id can be retrieved by wfx_tx_get_raw_link_id(). So, it is not necessary to keep it in struct wfx_tx_priv. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +-- drivers/staging/wfx/data_tx.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(

[PATCH 24/32] staging: wfx: drop struct wfx_queue_stats

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller There is no reason to keep the intermediate struct wfx_queue_stats. Relocate its members to struct wfx_dev. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 36 +++- drivers/staging/wfx/queue.h | 5 - drivers/staging/wf

[PATCH 08/32] staging: wfx: simplify hif_handle_tx_data()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller The last argument of hif_handle_tx_data() was now unused. In add, hif_handle_tx_data() has nothing to do with HIF layer and should be renamed. Finally, it not convenient to pass a wfx_vif as parameter. It is easier to let hif_handle_tx_data() find the interface itself. Sign

[PATCH 13/32] staging: wfx: drop argument tx_allowed_mask since it is constant now

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Following the remove of asleep_mask, the tx_allowed_mask argument passed to various functions is now always the same. Drop this argument and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 48 + drive

[PATCH 22/32] staging: wfx: change the way to choose frame to send

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller The current code computes itself the QoS policy to choose which frame should be sent. However, firmware already do that job. Firmware would prefer to have packets in every queues and be able to choose itself which queue to use. So, this patch sort the queues from the emptie

[PATCH 19/32] staging: wfx: rename wfx_tx_get_raw_link_id()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/

[PATCH 21/32] staging: wfx: introduce a counter of pending frames

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller This counter will be useful to know which queue is least full in a further patch. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 15 +++ drivers/staging/wfx/queue.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/staging/wfx/

[PATCH 29/32] staging: wfx: wfx_flush() did not ensure that frames are processed

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_flush() exited once all frames are retrieved from the device. However, it did not ensure they were processed by driver before to return. Therefore, some frame may be processed after the interface has disappear. Change the place we signal that the queue is empty to fix t

[PATCH 07/32] staging: wfx: avoid useless wake_up

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller __wfx_flush() wait for all queues to be empty. In current code, wait_link_id_empty is wake up each time there is no more data for a station. We can simplify the processing and avoid some wake-up by raising this event only when the queue is empty. Signed-off-by: Jérôme Pouil

[PATCH 28/32] staging: wfx: repair wfx_flush()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and

[PATCH 25/32] staging: wfx: simplify usage of wfx_tx_queues_put()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller The queue used for wfx_tx_queue_put() can be deducted from the content of the skb. So drop this parameter from call to wfx_tx_queues_put(). In add, this change uniformizes usage of functions wfx_tx_queues_*. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.

[PATCH 23/32] staging: wfx: drop now useless field edca_params

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 deletions(-) diff --gi

[PATCH 27/32] staging: wfx: relocate wfx_skb_dtor() prior its callers

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller In a next commit, we would like to mark wfx_skb_dtor as static and stop to declare it in data_tx.h. Relocate wfx_skb_dtor() prior its callers to avoid compile error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 72 ++-

[PATCH 31/32] staging: wfx: fix case where AP stop with CAB traffic pending

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller When driver has Content After DTIM Beacon (CAB) in queue, it wait for an indication from the firmware. However, when we stop to send beacons, this indication may never happen. Solve this issue by simply simulate this indication. Firmware will send data that probably nobody

[PATCH 09/32] staging: wfx: simplify wfx_tx_queues_empty()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 16 +--- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c

[PATCH 06/32] staging: wfx: drop useless queue_id field

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller The field queue_id is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 +--- drivers/staging/wfx/queue.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 71

[PATCH 00/32] staging: wfx: rework the Tx queue

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller This current implementation of the Tx queue is far more complex than necessary and its behavior is dubious on some corner cases. This series rework the Tx queue: - Simplify support for QoS (since device already do the job) - Simplify support for Power Saving stations (si

[PATCH 05/32] staging: wfx: uniformize queue_id retrieval

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]". For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it is not the same semantic. In wfx_tx_inner(), we want to get the mac80211 queue index, not the hardware queue index. Signed-off-by: J

[PATCH 04/32] staging: wfx: remove "burst" mechanism

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller In the old days, the driver tried to reorder frames in order to send frames from the same queue grouped to the firmware. However, the firmware is able to do the job internally for a long time. There is no reasons to keep this mechanism. Signed-off-by: Jérôme Pouiller ---

[PATCH 03/32] staging: wfx: take advantage of ieee80211_{stop/start}_queues

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Instead of maintaining stop status for each queue, we can just maintain a global status for all queues. In add, wfx_tx_queues_{lock/unlock} are only used when no more tx_policies are available. Therefore, the counter of recursive locks ("tx_locked_cnt") is useless. So, wfx

[PATCH 30/32] staging: wfx: fix potential deadlock in wfx_tx_flush()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current cod

[PATCH 01/32] staging: wfx: add sanity checks to hif_join()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Add a few check on start of hif_join(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 77bca43aca42..445906035e9d 100644 --- a/drivers/

[PATCH 14/32] staging: wfx: do not use link_map_cache to track CAB

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Since we do not track power save status of the stations anymore, link_map_cache is now only used to track "Content After (DTIM) Beacon". We prefer to rely on flags from tx_info. So we will be able to drop link_map_cache. Signed-off-by: Jérôme Pouiller --- drivers/staging/

[PATCH 10/32] staging: wfx: drop unused argument in wfx_get_prio_queue()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller The argument "total" is not used anymore since commit a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM"). Fixes: a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM") Signed-off-by: Jérôme Pouiller --- driv

[PATCH 11/32] staging: wfx: simplify wfx_tx_queue_mask_get()

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller It is far simpler to return a pointer instead of an error. Thus, it is no more necessary to pass a pointer reference as argument. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --g

[PATCH 16/32] staging: wfx: do not rely anymore on link_id to choose packet in queue

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller link_id was expected to contain identifier of a station. It was also used to mark frames that has to sent after dtim. We do not use the further purpose. For the last purpose, we can directly check the flag value in tx_info. Signed-off-by: Jérôme Pouiller --- drivers/stagi

[PATCH 15/32] staging: wfx: drop useless link_map_cache

2020-04-01 Thread Jerome Pouiller
From: Jérôme Pouiller Driver does not use link_map_cache anymore. So we can drop it. In add, we do not have to keep this counter in sync with skb_queue item, so we can drop explicit spin_locks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 60

[PATCH 04/11] staging: wfx: remove unused definitions from the hif API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, hif API was directly imported from firmware sources. However, it does not make sense to keep ton of unused structures in the driver. Moreover, the hif API is now stable enough to be keep in sync by importing delta from firmware. So, drop unused definitions from t

[PATCH 11/11] staging: wfx: send just necessary bytes

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Size of hif_mib_template_frame must be sufficient to contains bytes declared by frame_length and cannot exceed 700bytes. Change the API to reflect that. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 4 +++- drivers/staging/wfx/hif_tx_mib.c | 3 +

[PATCH 10/11] staging: wfx: make hif_ie_table_entry const

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller In wfx_update_filtering(), filter_ies is never modified. So, make it constant. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 4 ++-- drivers/staging/wfx/hif_tx_mib.h | 4 ++-- drivers/staging/wfx/sta.c| 2 +- 3 files changed, 5 insertions(+

[PATCH 05/11] staging: wfx: remove useless defines

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Several values defined in hif API are only here to define length of some arrays. In most cases, they do not provide any extra information about the size of the array (ie. "API_FIRMWARE_LABEL_SIZE" is only used to define the size of member "firmware_label"). Remove these use

[PATCH 03/11] staging: wfx: relocate TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID to hif API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller The definitions TX_RETRY_POLICY_MAX and TX_RETRY_POLICY_INVALID are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 16 +++- drivers/staging/wfx/da

[PATCH 01/11] staging: wfx: drop unused WFX_LINK_ID_GC_TIMEOUT

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller The definition WFX_LINK_ID_GC_TIMEOUT is not used anymore since commit d6aeba575f27 ("staging: wfx: simplify the link-id allocation") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/da

[PATCH 07/11] staging: wfx: align members declarations in hif API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Hardware API headers were not uniformly aligned. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 484 +- drivers/staging/wfx/hif_api_general.h | 272 +++ drivers/staging/wfx/hif_api_mib.h | 388 ++-

[PATCH 00/11] staging: wfx: clean up HIF API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Hello all, This series try to clean up the Hardware InterFace (HIF) API of the wfx driver. Notice it intended to be applied on top of Pull-Request named "staging: wfx: rework the Tx queue". Jérôme Pouiller (11): staging: wfx: drop unused WFX_LINK_ID_GC_TIMEOUT staging

[PATCH 02/11] staging: wfx: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE are imposed by the hardware. Therefore, they should be located in the hardware interface API. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/hif_api_cmd.h | 3 +++ dr

[PATCH 09/11] staging: wfx: allow to connect an IBSS with an existing SSID

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller With current code, chip is not able to join an existing IBSS network. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 4459

[PATCH 06/11] staging: wfx: fix endianness of hif API

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller The chip expects little endian in all structs it sends/receives. This patch fixes the hif API to reflect this fact. Sparse should now report meaningful errors. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 120 - driver

[PATCH 08/11] staging: wfx: place hif_tx_mib functions into a .c file

2020-04-06 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, all functions from hif_tx_mib.h are declared "static inline". However, they are not time critical. So, it does not make so much sense. We prefer to place them in a .c file as for other hif functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/Makef

[PATCH 01/19] staging: wfx: fix race between configure_filter and remove_interface

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_remove_interface() and wfx_configure_filter() can be run concurrently. Therefore, this patch protect access to the list of interfaces from wfx_configure_filter(). Notice that wfx_configure_filter() now lock "conf_lock" and "scan_lock". Beside that, wfx_hw_scan_work() al

[PATCH 03/19] staging: wfx: call wfx_do_unjoin() synchronously

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, wfx_do_unjoin() are called by the mean of work queues. However, the contexts from where they are called are not atomic. So there is no reason to not call it synchronously. This change will simplify the code. Notice two main changes: - There no more reason to l

[PATCH 11/19] staging: wfx: request to send beacons in IBSS mode

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, firmware take in charge of start/stop sending beacons while in IBSS mode. However, this behavior may change in the further releases. Currently, asking to firmware to send beacon while in IBSS mode return an error but is harmless. Therefore, send this request unc

[PATCH 16/19] staging: wfx: re-enable BA after reset

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Firmware does not support Block Acks when multiple vif are running. Thus, wfx_add_interface() and wfx_remove_interface() enable and disable Block Acks as necessary. Block Ack policy is also reset after hif_reset(). Driver have to re-enable it after each call to hif_reset().

[PATCH 05/19] staging: wfx: set all parameters before starting AP

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Current code start AP and then configure the different parameters. Since all the configuration is sent quickly after AP started, it works. However, it is not very nice. In add, last firmware releases start to disallow incorrect settings. Signed-off-by: Jérôme Pouiller ---

[PATCH 07/19] staging: wfx: remove useless call to wfx_tx_flush()

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_do_join() calls wfx_tx_lock_flush() ate beginning of the function. Therefore, the subsequent call to wfx_tx_flush() is useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c

[PATCH 04/19] staging: wfx: implement start_ap/stop_ap

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, wfx_bss_info_changed() check interface status changes and guess when the pattern match with an AP start and AP stop (through wfx_update_beaconing()). It is far easier to rely on start_ap and stop_ap callbacks provided by mac80211. wfx_bss_info_changed() keeps onl

[PATCH 17/19] staging: wfx: check value of beacon_int

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Firmware dislike when beacon_int value is 0. This patch add some warnings in case it would happen. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_

[PATCH 08/19] staging: wfx: fix support for BSS_CHANGED_KEEP_ALIVE

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Chip firmware is able to send periodic null frames to keep the association with the AP. The driver arbitrary set this period to 30sec. We prefer to rely on BSS_CHANGED_KEEP_ALIVE that provide a true value. Note that if BSS_CHANGED_KEEP_ALIVE is not received, we just disabl

[PATCH 00/19] staging: wfx: simplify start/shutdown of RF

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Hello, This series mainly simplify the processes to join/leave/create networks. Notice it intended to be applied on top of the Pull-Request named "staging: wfx: clean up HIF API". Jérôme Pouiller (19): staging: wfx: fix race between configure_filter and remove_interfac

[PATCH 06/19] staging: wfx: change the way the station associate to an AP

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Chipset need two steps to associate with an AP: 1. it start receiving beacon from the AP (done with wfx_do_join()) 2. it sent the association request (done with wfx_join_finalize()) The join request (see hif_join()) contains basic rates, beacon interval and bssid to c

[PATCH 18/19] staging: wfx: drop unused attribute 'beacon_int'

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller The field beacon_int is never read. Drop it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 5 - drivers/staging/wfx/wfx.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 91b4ce945598..53

[PATCH 02/19] staging: wfx: reduce hold duration of cfg80211_bss

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Pointer to cfg80211_bss is held during all duration of wfx_do_join. But, it is not necessary, We can release it far earlier. 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/

[PATCH 15/19] staging: wfx: introduce wfx_join_ibss() and wfx_leave_ibss()

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, IBSS networks are started by the mean of wfx_bss_info_changed(). It easier to use use callbacks provided by mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 ++ drivers/staging/wfx/sta.c | 19 +-- drivers/staging/wfx

[PATCH 09/19] staging: wfx: disabling keep alive during unjoin is useless

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller After a call to hif_reset(), the parameters associated with BSS are reset. So, it useless to explicitly reset the keep alive period. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b

[PATCH 12/19] staging: wfx: remove unnecessary conditions in wfx_bss_info_changed()

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_bss_info_changed() update ERP and CQM related stuff. Thus, it check the flags BSS_CHANGED_ERP_* and BSS_CHANGED_CQM. It also update ERP and CQM on join and leave by checking the flag BSS_CHANGED_ASSOC. This check is useless. Mac80211 already do that job and set necessar

[PATCH 13/19] staging: wfx: avoid duplicate updating of beacon template

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller When ERP changes, mac80211 call wfx_bss_info_changed() with BSS_CHANGED_ERP_* and with BSS_CHANGED_BEACON. The driver already update beacon template because of BSS_CHANGED_BEACON. It is not necessary to also update beacon template because of BSS_CHANGED_ERP_*. Signed-off-b

[PATCH 19/19] staging: wfx: drop useless update of macaddr

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Mac address is set in wfx_add_interface() and removed in wfx_remove_interface(). Currently, there is also an additional update of mac address in wfx_do_unjoin(). It has no rationale. Mac address is already present and nothing has changed it. Therefore, we can drop it. Sign

[PATCH 10/19] staging: wfx: drop unnecessary condition checks in wfx_upload_ap_templates()

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller In former code, wfx_upload_ap_templates() was called in more cases than necessary. Therefore, it tried to not update the frame templates if it was not necessary. Now, wfx_upload_ap_templates() is called only if mac80211 asked to update the templates. In add, it does not hur

[PATCH 14/19] staging: wfx: allow to join IBSS networks

2020-04-10 Thread Jerome Pouiller
From: Jérôme Pouiller Current code does not permit to join an already existing IBSS network. 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 75f1c515751b

[PATCH 01/20] staging: wfx: update filtering even if not connected

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, filtering are not update if the device is not connected. There is no obvious rationale for that. Updating filtering while it is not necessary is harmless. On the other hand, it is difficult to ensure that the filtering rule has been correctly sent to the firmware.

[PATCH 06/20] staging: wfx: do not wait for a dtim before associate

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller The only reason we ask to mac80211 to wait for a dtim before to associate is to get an accurate DTIM value. However, we can temporary set the dtim period to 1. Then we can waiting for BSS_CHANGED_BEACON_INFO for the real value. Thus, the association process is faster. Signe

[PATCH 18/20] staging: wfx: drop useless filter update when starting AP

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller mac80211 explicitly call wfx_configure_filters() before/after starting AP. Thus, it is not necessary to call wfx_update_filtering() from wfx_start_ap(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers

[PATCH 10/20] staging: wfx: ensure that probe requests are filtered when AP

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Device is able to automatically reply to probe request (therefore, the probe requests are not forwarded to host). This feature is enabled by wfx_start_ap(). However, further calls to wfx_configure_filter() can disable it. So, relocate the handling of probe request filtering

[PATCH 14/20] staging: wfx: drop struct wfx_grp_addr_table

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller The struct wfx_grp_addr_table is only instantiated on one place. There is no justifiation for this struct. Moreover, it is not consistent with other fields related to filtering (filter_bssid, etc...). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 28 +

[PATCH 17/20] staging: wfx: split out wfx_filter_beacon()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, wfx_update_filtering() is sometime called only to apply the value of wvif->filter_beacon to the hardware. It is nicer to have a specific function for beacon filtering. In add, an attentive reader would note that wfx_update_filtering() is always called after chang

[PATCH 05/20] staging: wfx: wfx_update_filtering_work() is no more used

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Since we had simplified the join process, update_filtering_work is no more used. Drop it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 10 -- drivers/staging/wfx/sta.h | 1 - drivers/staging/wfx/wfx.h | 1 - 3 files changed, 12 deletions(-) di

[PATCH 15/20] staging: wfx: drop useless call to hif_set_rx_filter()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller hif_set_rx_filter() apply changes on filter_prbreq and filter_bssid to the hardware. Each time filter_prbreq and filter_bssid are changed, hif_set_rx_filter() is called. Currently, on extra call to hif_set_rx_filter() is made from wfx_update_filtering(). This call is useles

[PATCH 00/20] staging: wfx: simplify filtering

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller The frame filtering is more complex than necessary. This series simplify the whole process and hopefully fixes some corner cases. Jérôme Pouiller (20): staging: wfx: update filtering even if not connected staging: wfx: simplify wfx_update_filtering() staging: wfx: re

[PATCH 02/20] staging: wfx: simplify wfx_update_filtering()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Inline wfx_set_mcast_filter() into wfx_update_filtering() and remove useless intermediate variables. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 69 ++- 1 file changed, 25 insertions(+), 44 deletions(-) diff --git a/

[PATCH 04/20] staging: wfx: simplify handling of beacon filter during join process

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller When the device joins an AP, beacon are forwarded to the host. Once has retrieved all necessary parameters, we can start to filter the beacon (and only beacon with changed/new data will be forwarded). Currently, the driver detect beacons in data Rx process. It is far more e

[PATCH 12/20] staging: wfx: align semantic of beacon filter with other filters

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Filters provided by HIF API are sometime inclusive, sometime exclusive. This patch align the behavior and name of the beacon filter with the other filters. Also avoid double negation: "disable filter" Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 10

[PATCH 03/20] staging: wfx: rework wfx_configure_filter()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_configure_filter() lacks of coherency. In add, some corner cases seems to not been handled properly. Rework the whole function(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 41 +-- 1 file changed, 35 insertions(+

[PATCH 09/20] staging: wfx: stop changing filtering rule in wfx_hw_scan()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller It is not very clear why driver ask to firmware to stop filtering probe request during scan. It is particularly weird because scan is not supported in AP mode. In add, it does not restore previous filtering state after scanning. It seems to be a mistake and should be droppe

[PATCH 08/20] staging: wfx: do not use built-in AUTO_ERP feature

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Firmware is able to detect detect changes about ERP protection in beacons and automatically enable/disable ERP protection. However, it not bring performance improvements and we are more confident in the ERP handling of mac80211. So, the patch disable this feature. Signed-of

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

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Update the TODO list associated to the wfx driver with the last progresses and last remarks made by reviewers. The items about support for P2P and mesh have also been removed. Indeed, it seems that the device does not fully support them. Signed-off-by: Jérôme Pouiller ---

[PATCH 13/20] staging: wfx: align semantic of probe request filter with other filters

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Filters provided by HIF API are sometime inclusive, sometime exclusive. This patch align the behavior and name of the probe request filter with the other filters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 4 ++-- drivers/staging/wfx/sta.c

[PATCH 19/20] staging: wfx: drop useless attribute 'filter_mcast'

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller Currently, wfx_update_filtering() apply the value of wvif->filter_mcast to the hardware. But an attentive reader will note that wfx_update_filtering() is always called after set wvif->filter_mcast. Thus, it not necessary to store filter_mcast in the struct wfx_vif. We can ju

[PATCH 07/20] staging: wfx: disabling beacon filtering after hif_reset() is useless

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller After hif_reset(), device stop to receive any RF data. So, it is useless to disable beacon filtering. In add, if necessary, mac80211 will call wfx_configure_filter(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 2 -- 1 file changed, 2 deletions(-) diff

[PATCH 11/20] staging: wfx: drop useless wfx_fwd_probe_req()

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller wfx_fwd_probe_req() is a function of two lines called from only one place. In order to uniformize all filtering functions, drop wfx_fwd_probe_req(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 14 +- drivers/staging/wfx/sta.h | 1 - 2 files

[PATCH 16/20] staging: wfx: drop useless attributes 'filter_prbreq' and 'filter_bssid'

2020-04-15 Thread Jerome Pouiller
From: Jérôme Pouiller It is now useless to store filter_prbreq and filter_bssid in struct wfx_vif. We can just pass them as parameters to hif_set_rx_filter(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 ++-- drivers/staging/wfx/wfx.h | 2 -- 2 files changed, 6 i

[PATCH 13/16] staging: wfx: drop useless checks in wfx_do_unjoin()

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller The callers of wfx_do_unjoin() already take care of vif state. Therefore, it is not necessary to take care of the status of the interface. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging

[PATCH 00/16] staging: wfx: rework the handling of the connection loss

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller Until now, the driver handled itself the connection loss. This series allows to use ieee80211_beacon_loss() instead (patch 2/16). This change allow a bunch of simplifications in many parts of the driver (most of the patches 3 to 16). In particular it allows to drop the infam

[PATCH 06/16] staging: wfx: dual CTS is never necessary

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller Dual CTS is only necessary when sending/receiving STBC data. However, the chip does not support STBC, so it is never necessary to enable double CTS. We can simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 6 -- drivers/stagin

[PATCH 14/16] staging: wfx: simplify wfx_remove_interface()

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller In wfx_remove_interface(), the current code differentiate AP and Station cases. However, it is not necessary. In all cases, the only important thing is the call to hif_reset(). We can use the same code to support all cases. Signed-off-by: Jérôme Pouiller --- drivers/stagi

[PATCH 03/16] staging: wfx: drop useless attribute 'bss_params'

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller Since wfx_bss_params_work() does not exist anymore, there is no more reason to keep a copy of bss_params in struct wfx_dev. A local instance in wfx_join_finalize() is sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 14 ++ drivers/sta

[PATCH 12/16] staging: wfx: drop protection for asynchronous join during scan

2020-04-20 Thread Jerome Pouiller
From: Jérôme Pouiller In former code (before the inclusion of the driver in mainline kernel), hif_join() could run asynchronously. When a join request was in progress, it was forbidden to launch hif_scan(). Now, hif_join() is always run synchronously. There is no more reasons to keep a protectio

<    1   2   3   4   5   6   7   8   >