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

2019-12-16 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 25/55] staging: wfx: fix name of struct hif_req_start_scan_alt

2019-12-16 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 14/55] staging: wfx: improve error message on unexpected confirmation

2019-12-16 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 19/55] staging: wfx: simplify variable assignment

2019-12-16 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 02/55] staging: wfx: fix case of lack of tx_retry_policies

2019-12-16 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 03/55] staging: wfx: fix counter overflow

2019-12-16 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 00/55] Improve wfx driver

2019-12-16 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 07/55] staging: wfx: ensure that retry policy always fallbacks to MCS0 / 1Mbps

2019-12-16 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 05/55] staging: wfx: firmware does not support more than 32 total retries

2019-12-16 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 08/55] staging: wfx: detect race condition in WEP authentication

2019-12-16 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 01/55] staging: wfx: fix the cache of rate policies on interface reset

2019-12-16 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 31/55] staging: wfx: declare wfx_set_pm() static

2019-12-16 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 50/55] staging: wfx: rewrite wfx_hw_scan()

2019-12-16 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 36/55] staging: wfx: fix pm_mode timeout

2019-12-16 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 55/55] staging: wfx: update TODO

2019-12-16 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 | 78 1 file changed, 64 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/TODO b

Re: [PATCH] docs: dt: fix several broken doc references

2020-02-24 Thread Jérôme Pouiller
operties are recognized either by SPI and SDIO > versions: > Must contains 64 hexadecimal digits. Not supported in current version. > > WFx driver also supports `mac-address` and `local-mac-address` as described > in > -Documentation/devicetree/binding/net/ethernet.txt > +Do

Re: [PATCH] staging: wfx: match parentheses alignment

2020-02-24 Thread Jérôme Pouiller
On Sunday 23 February 2020 20:32:01 CET Kaaira Gupta wrote: > > match next line with open parentheses by giving appropriate tabs. Maybe the body of the commit message should start with a capital letter, else: Reviewed-by: Jérôme Pouiller > > Signed-off-by: Kaaira Gupta >

Re: [[PATCH staging] 6/7] staging: wfx: use sleeping gpio accessors

2020-02-11 Thread Jérôme Pouiller
"enable 'quiescent' power mode with gpio %d and PDS > file %s\n", > desc_to_gpio(wdev->pdata.gpio_wakeup), > wdev->pdata.file_pds); > - gpiod_set_value(wdev->pdata.gpio_wakeup, 1); > + gpiod_set

Re: [[PATCH staging] 7/7] staging: wfx: use more power-efficient sleep for reset

2020-02-11 Thread Jérôme Pouiller
ging/wfx/hwio.c > +++ b/drivers/staging/wfx/hwio.c > @@ -142,7 +142,7 @@ static int indirect_read(struct wfx_dev *wdev, int reg, > u32 addr, void *buf, > goto err; > if (!(cfg & prefetch)) > break; > - udelay(200); > +

Re: [PATCH v2 1/6] staging: wfx: fix init/remove vs IRQ race

2020-02-11 Thread Jérôme Pouiller
g/wfx/main.h > index 875f8c227803..9c9410072def 100644 > --- a/drivers/staging/wfx/main.h > +++ b/drivers/staging/wfx/main.h > @@ -34,7 +34,6 @@ struct wfx_dev *wfx_init_common(struct device *dev, > const struct wfx_platform_data *pdata, > const struct hwbus_ops *hwbus_ops, > void *hwbus_priv); > -void wfx_free_common(struct wfx_dev *wdev); > > int wfx_probe(struct wfx_dev *wdev); > void wfx_release(struct wfx_dev *wdev); > -- > 2.20.1 > Are you sure you can completely drop wfx_free_common()? If you want to use devres, I think that wfx_flush_irq_work() should call wfx_free_common(), no? -- Jérôme Pouiller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [[PATCH staging] 4/7] staging: wfx: annotate nested gc_list vs tx queue locking

2020-02-11 Thread Jérôme Pouiller
spin_unlock_bh(>queue.lock); > if (wakeup_stats) > @@ -259,10 +259,10 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct > sk_buff *skb) > spin_lock_bh(>queue.lock); > ++queue->link_map_cache[tx_priv->link_id]; > > - spin_lock_bh(>

Re: [PATCH -next] staging: wfx: remove set but not used variable 'tx_priv'

2020-02-11 Thread Jérôme Pouiller
On Tuesday 11 February 2020 16:21:41 CET Jérôme Pouiller wrote: > On Tuesday 11 February 2020 15:03:34 CET YueHaibing wrote: > > drivers/staging/wfx/queue.c: In function wfx_tx_queues_get: > > drivers/staging/wfx/queue.c:484:28: warning: variable tx_priv set but not > > u

Re: [PATCH v2 1/6] staging: wfx: fix init/remove vs IRQ race

2020-02-11 Thread Jérôme Pouiller
ee_hw(wdev->hw); > > > -} > > > - > > > int wfx_probe(struct wfx_dev *wdev) > > > { > > > int i; > > > diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h > > > index 875f8c227803..9c9410072def 100644 > > > --- a/drivers/staging/wfx/main.h > > > +++ b/drivers/staging/wfx/main.h > > > @@ -34,7 +34,6 @@ struct wfx_dev *wfx_init_common(struct device *dev, > > > const struct wfx_platform_data *pdata, > > > const struct hwbus_ops *hwbus_ops, > > > void *hwbus_priv); > > > -void wfx_free_common(struct wfx_dev *wdev); > > > > > > int wfx_probe(struct wfx_dev *wdev); > > > void wfx_release(struct wfx_dev *wdev); > > > -- > > > 2.20.1 > > > > > > > Are you sure you can completely drop wfx_free_common()? If you want to > > use devres, I think that wfx_flush_irq_work() should call > > wfx_free_common(), no? > > wfx_free_common() will be called by devres in the right order. That's ensured > by devm_add_action_or_reset() at the end of wfx_init_common(). Indeed. Reviewed-by: Jérôme Pouiller -- Jérôme Pouiller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH -next] staging: wfx: remove set but not used variable 'tx_priv'

2020-02-11 Thread Jérôme Pouiller
ev, queue, tx_allowed_mask); > if (!skb) > continue; > - tx_priv = wfx_skb_tx_priv(skb); > hif = (struct hif_msg *) skb->data; > wvif = wdev_to_wvif(wdev, hif-&g

[PATCH 01/65] staging: wfx: revert unexpected change in debugfs output

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It appears that commit 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") do slightly more than what is explained in commit log. Especially, it changes the output of the file rx_stats from debugfs. From some point of view, thi

[PATCH 23/65] staging: wfx: drop wvif->enable_beacon

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It seems that current code try to save calls to hif_beacon_transmit() by keeping a copy of the previous value of bss_conf->enable_beacon. However, hif_beacon_transmit() does not cost so much and mac80211 already take care to not send useless events. Signed-off-by: Jér

[PATCH 00/65] Simplify and improve the wfx driver

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Hello all, This pull request is finally bigger than I expected, sorry. It contains 2 main topics: - Simplify handling of stations in power save mode. Most of the work was redundant with mac80211. I have saved plenty of lines of code by using the mac80211 API

[PATCH 56/65] staging: wfx: simplify wfx_suspend_resume_mc()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to wfx_suspend_resume_mc(). In add, the structure hif_ind_suspend_resume_tx come from hardware API. It is not intended to be manipulated in upper layers of the driver. Signed-off-by: Jérôme Pouiller

[PATCH 35/65] staging: wfx: simplify hif_set_mac_addr_condition()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_mac_addr_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_mac_addr_condition() is too dumb. It should pack data with hardware representation instead

[PATCH 30/65] staging: wfx: simplify hif_set_association_mode()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_set_association_mode come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_association_mode() is too dumb. It should pack data with hardware representation instead of leaving all

[PATCH 32/65] staging: wfx: simplify hif_mib_uc_mc_bc_data_frame_condition

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The current API defines bitfields. It is not very convenient. Prefer to use bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 14 -- drivers/staging/wfx/hif_tx_mib.h | 9 +++-- drivers/staging/wfx/sta.c | 4

[PATCH 34/65] staging: wfx: simplify hif_set_data_filtering()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_set_data_filtering come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_data_filtering() is too dumb. It should pack data with hardware representation instead of leaving all work

[PATCH 36/65] staging: wfx: simplify hif_set_config_data_filter()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_config_data_filter come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_config_data_filter() is too dumb. It should pack data with hardware representation instead of leaving all

[PATCH 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_uc_mc_bc_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_uc_mc_bc_condition() is too dumb. It should pack data with hardware representation instead

[PATCH 14/65] staging: wfx: drop wdev->output_power

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 and the device are both able to control tx power per vif. But, the current code retrieve tx power from wfx_config(). So, it does not allow to setup the tx power independently for each vif. Driver just has to rely on bss_conf->txpower to get the correct informat

[PATCH 05/65] staging: wfx: simplify hif_set_tx_rate_retry_policy() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_set_tx_rate_retry_policy come from hardware API. It is not intended to be manipulated in upper layers of the driver. So, this patch relocate handling of this structure to hif_set_tx_rate_retry_policy() (the low level function). Signed-off-by: Jérôme

[PATCH 06/65] staging: wfx: simplify hif_set_output_power() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Hardware API use 10th of dBm for output power unit. Upper layers should use same units than mac80211 and the conversion should be done by low level layer of the driver (hif_set_output_power()) In add, current code of hif_set_output_power() use a __le32 while the device API

[PATCH 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_rcpi_rssi_threshold come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_rcpi_rssi_threshold() is dumb. It should pack data using the hardware representation instead of leaving

[PATCH 17/65] staging: wfx: simplify wfx_upload_ap_templates()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller This function built probe response from data retrieved in beacon. Yet, this job can be done with ieee80211_proberesp_get(). So, we can simplify that code (and fix bugs like inclusion of TIM in probe responses). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c

[PATCH 29/65] staging: wfx: simplify hif_join()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_req_join come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_join() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off

[PATCH 15/65] staging: wfx: simplify wfx_config()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Now that wfx_config() only handles IEEE80211_CONF_CHANGE_PS, it can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging

[PATCH 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller When mac80211 ask for a frame to be sent after a DTIM, driver should: 1. Update TIM with multicast bit set (using update_ie). This function can be called whenever. 2. Keep buffered all frames marked "after dtim" 3. When it receive a suspend_resume indic

[PATCH 38/65] staging: wfx: simplify wfx_update_filtering()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_update_filtering() has no reason to instantiate a struct hif_mib_bcn_filter_enable. Drop it and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions

[PATCH 37/65] staging: wfx: simplify wfx_set_mcast_filter()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller HIF functions return only serious errors (OOM or device freeze). The current handling of errors in wfx_set_mcast_filter() does not bring anything. Finally it may disturb the developer more than it helps. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 30

[PATCH 43/65] staging: wfx: fix case where RTS threshold is 0

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller If RTS threshold is 0, it currently disables RTS. It should mean "enabled for every frames". Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h

[PATCH 44/65] staging: wfx: fix possible overflow on jiffies comparaison

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is recommended to use function time_*() to compare jiffies. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 14 +- 1 file changed, 5 insertions

[PATCH 64/65] staging: wfx: simplify hif_multi_tx_confirm()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Usage of the "buf_loc" variable does not simplify the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wf

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

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Some work has been done :) Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO index 6b1cdd24afc9..efcb7c6a5aa7 100644

[PATCH 45/65] staging: wfx: remove handling of "early_data"

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It seems that purpose of "early_data" was to prevent sending data to mac80211 before station was completely associated. It is a useless precaution. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 17 + drivers/staging/wfx/data

[PATCH 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_tx_queue_get_num_queued() can take advantage of BIT() instead of maintaining one variable for a counter and another for a mask. In add, wfx_tx_queue_get_num_queued() has no real reason to return a size_t instead of an int. Signed-off-by: Jérôme Pouiller --- drivers

[PATCH 53/65] staging: wfx: pspoll_mask make no sense

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller pspoll_mask is here to send data buffered in driver. But since station is marked buffered, TIM for this station is 1 and mac80211 will call sta_notify when a ps-poll is received. So pspoll_mask is useless and sta_alseep_mask is sufficient. Signed-off-by: Jérôme Pouiller

[PATCH v2 62/65] staging: wfx: simplify hif_handle_tx_data()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Since enum action has now only two cases, it can be dropped. Then hif_handle_tx_data() can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++--- 1 file changed, 15 insertions(+), 25 deletions(-) diff

[PATCH v2 61/65] staging: wfx: remove check for interface state

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Obviously, the value of wvif->state as no reason to be wrong. At least, if it the case, dropping the frame is probably not the bast thing to do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 50 + 1 file changed,

[PATCH 18/65] staging: wfx: simplify wfx_update_beaconing()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Remove most of indentation of wfx_update_beaconing() by reworking the error handling. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c

[PATCH 21/65] staging: wfx: simplify update of DTIM period

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code parse the TIM and retrieve the DTIM period. It is far easier to rely on bss_info_changed() for this job. It is no more necessary to run task asynchronously. So set_beacon_wakeup_period_work is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH 04/65] staging: wfx: send rate policies one by one

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Rate policies (aka. tx_rate_retry_policy in hardware API) are sent to device asynchronously from tx requests. So, the device maintains a list of active rate policies and the tx requests only reference an existent rate policy. The device API allows to send multiple rate

[PATCH 08/65] staging: wfx: simplify hif_set_arp_ipv4_filter() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_arp_ip_addr_table come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_arp_ipv4_filter() is too dumb. It should pack data using the hardware representation instead of leaving all

[PATCH 28/65] staging: wfx: simplify hif_update_ie()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller hif_update_ie() is only called to change the beacon template. So, specialize this function and simplify the way to call it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 ++--- drivers/staging/wfx/hif_tx.h | 3 +-- drivers/staging/wfx/sta.c

[PATCH 54/65] staging: wfx: sta and dtim

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_ps_notify() is called for any changes in the TIM. However, association ID 0 is a very special case that should be handled independently. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 33 +++-- 1 file changed, 15 insertions

[PATCH 39/65] staging: wfx: simplify wfx_scan_complete()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_scan_complete() do nothing with argument hif_ind_scan_cmpl. In add, hif_ind_scan_cmpl come from hardware API and is not expected to be used with upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 3 +-- drivers/staging/wfx

[PATCH v2 13/65] staging: wfx: drop struct wfx_ht_info

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller This struct is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++--- drivers/staging/wfx/sta.h | 6 -- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wfx

[PATCH v2 03/65] staging: wfx: add missing PROBE_RESP_OFFLOAD feature

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Some userspace tools (hostapd) rely on probe_resp_offload fields for certain features. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index

[PATCH v2 04/65] staging: wfx: send rate policies one by one

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Rate policies (aka. tx_rate_retry_policy in hardware API) are sent to device asynchronously from tx requests. So, the device maintains a list of active rate policies and the tx requests only reference an existent rate policy. The device API allows to send multiple rate

[PATCH v2 01/65] staging: wfx: revert unexpected change in debugfs output

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It appears that commit 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") do slightly more than what is explained in commit log. Especially, it changes the output of the file rx_stats from debugfs. From some point of view, thi

[PATCH v2 00/65] Simplify and improve the wfx driver

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Hello all, This pull request is finally bigger than I expected, sorry. It contains 2 main topics: - Simplify handling of stations in power save mode. Most of the work was redundant with mac80211. I have saved plenty of lines of code by using the mac80211 API

[PATCH v2 16/65] staging: wfx: rename wfx_upload_beacon()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller In fact, wfx_upload_beacon() uploads beacon and probe response. So, rename it in wfx_upload_ap_templates(). The call to wfx_fwd_probe_req() has nothing to do with template uploading, so relocate it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6

[PATCH v2 12/65] staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wvif->ht_info contains useless copies of sta->ht_cap and bss_conf->ht_operation_mode. Prefer to retrieve information from the original structs instead of rely on wvif->ht_info. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 ++

[PATCH v2 26/65] staging: wfx: drop wfx_set_cts_work()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_bss_info_changed() is not called from atomic contexts. So, it is not necessary to raise an asynchronous work to change ERP. Thus wfx_set_cts_work() become useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 40

[PATCH v2 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wvif->ht_info.ht_cap is a useless copy of sta->ht_cap. It makes no sense to rely on it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/s

[PATCH v2 23/65] staging: wfx: drop wvif->enable_beacon

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It seems that current code try to save calls to hif_beacon_transmit() by keeping a copy of the previous value of bss_conf->enable_beacon. However, hif_beacon_transmit() does not cost so much and mac80211 already take care to not send useless events. Signed-off-by: Jér

[PATCH v2 29/65] staging: wfx: simplify hif_join()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_req_join come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_join() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off

[PATCH v2 34/65] staging: wfx: simplify hif_set_data_filtering()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_set_data_filtering come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_data_filtering() is too dumb. It should pack data with hardware representation instead of leaving all work

[PATCH v2 30/65] staging: wfx: simplify hif_set_association_mode()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_set_association_mode come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_association_mode() is too dumb. It should pack data with hardware representation instead of leaving all

[PATCH v2 10/65] staging: wfx: use specialized structs for HIF arguments

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Most of the commands that are sent to device should take struct in argument. In the current code, when this struct is binary compatible with a __le32, the driver use a __le32. This behavior is error prone. This patch fixes that and uses the specialized structs instead

[PATCH v2 06/65] staging: wfx: simplify hif_set_output_power() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Hardware API use 10th of dBm for output power unit. Upper layers should use same units than mac80211 and the conversion should be done by low level layer of the driver (hif_set_output_power()) In add, current code of hif_set_output_power() use a __le32 while the device API

[PATCH v2 17/65] staging: wfx: simplify wfx_upload_ap_templates()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller This function built probe response from data retrieved in beacon. Yet, this job can be done with ieee80211_proberesp_get(). So, we can simplify that code (and fix bugs like inclusion of TIM in probe responses). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c

[PATCH v2 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_uc_mc_bc_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_uc_mc_bc_condition() is too dumb. It should pack data with hardware representation instead

[PATCH v2 20/65] staging: wfx: simplify wfx_flush()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code of wfx_flush() force to drop packets in some contexts. However, there is no obvious reasons to do that. It looks like a workaround for a bug with the old implementation of __wfx_flush(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12

[PATCH v2 24/65] staging: wfx: drop wvif->cqm_rssi_thold

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code keeps a copy of bss_conf->cqm_rssi_thold in wfx_vif. There is no sane reason for that. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 ++ drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --

[PATCH v2 02/65] staging: wfx: make hif_scan() usage clearer

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller hif_scan() return max number of jiffies to wait before the completion indication. However, if this value is negative, an error has occurred. Reword the code to reflect that behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 7 +++ 1 file

[PATCH v2 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_rcpi_rssi_threshold come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_rcpi_rssi_threshold() is dumb. It should pack data using the hardware representation instead of leaving

[PATCH v2 08/65] staging: wfx: simplify hif_set_arp_ipv4_filter() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_mib_arp_ip_addr_table come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_arp_ipv4_filter() is too dumb. It should pack data using the hardware representation instead of leaving all

[PATCH v2 19/65] staging: wfx: fix __wfx_flush() when drop == false

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_tx_queues_clear() only clear not yet sent requests. So, it always necessary to wait for tx_queue_stats.wait_link_id_empty whatever the value of "drop" argument. In add, it is not necessary to return with tx queue locked since all calls to __wfx_flush() unl

[PATCH v2 27/65] staging: wfx: SSID should be provided to hif_start() even if hidden

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller SSID is hidden in beacon but firmware has to know to which probe requests it has to answer. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers

[PATCH v2 25/65] staging: wfx: drop wvif->setbssparams_done

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller setbssparams_done was here to ensure that the firmware does not enable powersave before to get the first beacon. However, mac80211 already ensures it gets a beacon before to associate to the BSS. And even, if it won't, the firmware wake up at least on every DTIM, which

[PATCH v2 15/65] staging: wfx: simplify wfx_config()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Now that wfx_config() only handles IEEE80211_CONF_CHANGE_PS, it can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging

[PATCH v2 09/65] staging: wfx: simplify hif_start() usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The structure hif_req_start come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_start() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off

[PATCH v2 18/65] staging: wfx: simplify wfx_update_beaconing()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Remove most of indentation of wfx_update_beaconing() by reworking the error handling. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c

[PATCH v2 28/65] staging: wfx: simplify hif_update_ie()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller hif_update_ie() is only called to change the beacon template. So, specialize this function and simplify the way to call it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 ++--- drivers/staging/wfx/hif_tx.h | 3 +-- drivers/staging/wfx/sta.c

[PATCH v2 21/65] staging: wfx: simplify update of DTIM period

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Current code parse the TIM and retrieve the DTIM period. It is far easier to rely on bss_info_changed() for this job. It is no more necessary to run task asynchronously. So set_beacon_wakeup_period_work is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging

[PATCH v2 14/65] staging: wfx: drop wdev->output_power

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller mac80211 and the device are both able to control tx power per vif. But, the current code retrieve tx power from wfx_config(). So, it does not allow to setup the tx power independently for each vif. Driver just has to rely on bss_conf->txpower to get the correct informat

[PATCH v2 22/65] staging: wfx: drop wvif->dtim_period

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It is not necessary to keep a copy of dtim_period in wfx_vif. Prefer to just rely on bss_conf->dtim_period. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 20 drivers/staging/wfx/wfx.h | 1 - 2 files changed, 4 insertions(+),

[PATCH 60/65] staging: wfx: remove unused do_probe

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The identifier do_probe is unused since "staging: wfx: remove workaround to send probe requests" Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/w

[PATCH 33/65] staging: wfx: simplify hif_mib_set_data_filtering

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The field "default_filter" was not obvious. In add, explicitly declare that fields default_filter and enable are booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 8 +--- drivers/staging/wfx/sta.c | 3 +-- 2 files

[PATCH 51/65] staging: wfx: check that no tx is pending before release sta

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Just for sanity. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 84853aa90f4b..eebbd3292b1b 100644 --- a/drivers/staging/wfx/sta.c +++ b

[PATCH 41/65] staging: wfx: with multiple vifs, force PS only if channels differs

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller When multiple vif are in use (the only supported configuration is one station and one AP), the driver force power save flag on station. This behavior allows the station to leave the station channel and make its business on AP channel. However, this has a big impact

[PATCH 49/65] staging: wfx: simplify wfx_set_tim_impl()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and there is no reason to provide another argument. Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c |

[PATCH 62/65] staging: wfx: simplify hif_handle_tx_data()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Since enum action has now only two cases, it can be dropped. Then hif_handle_tx_data() can be simplified. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++--- 1 file changed, 15 insertions(+), 25 deletions(-) diff

[PATCH 50/65] staging: wfx: simplify the link-id allocation

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller The "link-id" is a slot number provided to the chip. A link-id is allocated to every station associated with the chip (mainly when the chip is in AP mode). It is more or less the same thing than the association ID, but it is limited to 14 values. Firmware uses t

[PATCH 26/65] staging: wfx: drop wfx_set_cts_work()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_bss_info_changed() is not called from atomic contexts. So, it is not necessary to raise an asynchronous work to change ERP. Thus wfx_set_cts_work() become useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 40

<    1   2   3   4   >