[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. Sign

[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 of lea

[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 --git a/dri

[PATCH v2 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(-) dif

[PATCH v2 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/sc

[PATCH v2 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 changed, 6 ins

[PATCH v2 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 wo

[PATCH v2 42/65] staging: wfx: do not update uapsd if not necessary

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_conf_tx() is called for each queue. On every call, the function updates UAPSD mask and PM mode for all queues. It is a pity since the UAPSD configuration very rarely changes and it makes exchanges between the host and the chip more difficult to track. This patch avoid t

[PATCH v2 55/65] staging: wfx: firmware never return PS status for stations

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller At the beginning, firmware could send suspend_resume indication to notify that a station wake up or sleep down. However, mac80211 already handles power save status of stations and this behavior has been removed from the firmware. So now, when suspend_resume indication is rec

[PATCH v2 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 75c1e2aecc23..33955278d9d3 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers

[PATCH v2 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 | 18 ++

[PATCH v2 52/65] staging: wfx: replace wfx_tx_get_tid() with ieee80211_get_tid()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_tx_get_tid() was used as a wrapper around ieee80211_get_tid(). It did sometime return WFX_MAX_TID to ask to upper layers to not include the frame in "buffered" counter. The objective of this behavior is not clear, but tests has shown that wfx_tx_get_tid() can be replaced

[PATCH v2 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 v2 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 b/drivers/

[PATCH v2 46/65] staging: wfx: relocate "buffered" information to sta_priv

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller It simplify the code if field buffered is hosted in the struct sta_priv instead of in the struct wfx_link_entry. More globally, struct wfx_link_entry has no real reasons to exist and should be dropped soon. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c

[PATCH v2 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_tx.c | 3

[PATCH v2 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 of lea

[PATCH v2 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 v2 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 ++-- 3

[PATCH v2 47/65] staging: wfx: fix bss_loss

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_tx_confirm_cb() retrieves the station associated with a frame using the MAC address from the 802.11 header. In the other side wfx_tx() retrieves the station using sta field from the ieee80211_tx_control argument. In wfx_cqm_bssloss_sm(), wfx_tx() was called directly wi

[PATCH v2 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 v2 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 the link-id t

[PATCH v2 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 on stati

[PATCH v2 40/65] staging: wfx: update power-save per interface

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

[PATCH v2 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 --- a/driver

[PATCH v2 48/65] staging: wfx: fix RCU usage

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller Indeed, sta was used after call to rcu_unlock() Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c10ebd11944..cc72877a090f 1006

[PATCH v2 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 v2 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/wfx/hif_rx.c inde

[PATCH v2 59/65] staging: wfx: ensure that packet_id is unique

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller In current code, packet_id is derivated from mac802.11 packet sequence number, but this number is only unique for a station. It is not sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 ++-- drivers/staging/wfx/wfx.h | 1 + 2 files c

[PATCH v2 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/s

[PATCH v2 58/65] staging: wfx: simplify wfx_ps_notify_sta()

2020-01-15 Thread Jérôme Pouiller
From: Jérôme Pouiller wfx_ps_notify_sta() is too complex compared to the task it do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c

[PATCH v2 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 indication (see

[PATCH v2 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 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/wfx/queue.c ind

[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 --g

[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, 12 i

Re: [PATCH RFC v3 5/9] staging: most: usb: check for NULL device

2020-01-15 Thread Christian.Gromm
On Wed, 2020-01-15 at 13:18 +0100, Greg KH wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > On Tue, Jan 14, 2020 at 04:57:54PM +0100, Christian Gromm wrote: > > Check if the dci structer has been allocated before trying to > > release it. >

Re: [PATCH RFC v3 5/9] staging: most: usb: check for NULL device

2020-01-15 Thread Greg KH
On Wed, Jan 15, 2020 at 03:32:48PM +, christian.gr...@microchip.com wrote: > On Wed, 2020-01-15 at 13:18 +0100, Greg KH wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you > > know the content is safe > > > > On Tue, Jan 14, 2020 at 04:57:54PM +0100, Christian Gromm wr

Re: [PATCH RFC v3 4/9] staging: most: move interface dev to private section

2020-01-15 Thread Christian.Gromm
On Wed, 2020-01-15 at 13:17 +0100, Greg KH wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > On Tue, Jan 14, 2020 at 04:57:53PM +0100, Christian Gromm wrote: > > This patch moves the struct device of the interface structure to > > its > > pri

[PATCH v2] staging: most: remove header include path to drivers/staging

2020-01-15 Thread Masahiro Yamada
There is no need to add "ccflags-y += -I $(srctree)/drivers/staging" just for including . Use the #include "..." directive with the correct relative path. Signed-off-by: Masahiro Yamada --- Changes in v2: - rebase on linux-next drivers/staging/most/Makefile | 1 - drivers/staging/most/

Re: [PATCH] Remove warning: "dubious: x | !y" detected by sparse

2020-01-15 Thread Felipe Cardoso Resende
Hi Dan, Thank you for you comments, I'll fix the issues in v2. Also, sorry for the duplicate email, I sent the first email only to you (now I think I'll get it right). On Wed, Jan 15, 2020 at 09:21:56AM +0300, Dan Carpenter wrote: > Add a subsystem prefix to the subject. "Staging: kpc2000:" >

Re: [PATCH] Remove warning: "dubious: x | !y" detected by sparse

2020-01-15 Thread Dan Carpenter
Sounds reasonable. Just resend with the fixed commit message. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

<    1   2