Re: [PATCH] media: allegro: Fix some NULL vs IS_ERR() checks in probe

2020-07-01 Thread Michael Tretter
On Fri, 19 Jun 2020 17:30:07 +0300, Dan Carpenter wrote:
> The devm_ioremap() function doesn't return error pointers, it returns
> NULL on error.
> 
> Fixes: f20387dfd065 ("media: allegro: add Allegro DVT video IP core driver")
> Signed-off-by: Dan Carpenter 

Reviewed-by: Michael Tretter 

> ---
>  drivers/staging/media/allegro-dvt/allegro-core.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c 
> b/drivers/staging/media/allegro-dvt/allegro-core.c
> index 70f133a842dd..3ed66aae741d 100644
> --- a/drivers/staging/media/allegro-dvt/allegro-core.c
> +++ b/drivers/staging/media/allegro-dvt/allegro-core.c
> @@ -3065,9 +3065,9 @@ static int allegro_probe(struct platform_device *pdev)
>   return -EINVAL;
>   }
>   regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> - if (IS_ERR(regs)) {
> + if (!regs) {
>   dev_err(&pdev->dev, "failed to map registers\n");
> - return PTR_ERR(regs);
> + return -ENOMEM;
>   }
>   dev->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
>   &allegro_regmap_config);
> @@ -3085,9 +3085,9 @@ static int allegro_probe(struct platform_device *pdev)
>   sram_regs = devm_ioremap(&pdev->dev,
>sram_res->start,
>resource_size(sram_res));
> - if (IS_ERR(sram_regs)) {
> + if (!sram_regs) {
>   dev_err(&pdev->dev, "failed to map sram\n");
> - return PTR_ERR(sram_regs);
> + return -ENOMEM;
>   }
>   dev->sram = devm_regmap_init_mmio(&pdev->dev, sram_regs,
> &allegro_sram_config);
> -- 
> 2.27.0
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4] staging: wfx: Get descriptors for GPIOs

2020-07-01 Thread Jérôme Pouiller
Hello Linus,

On Tuesday 30 June 2020 10:21:33 CEST Linus Walleij wrote:
> 
> The code has the functionality to insert the GPIO lines using
> the global GPIO numbers through module parameters.
> 
> As we are clearly deprecating the use of global GPIO numbers
> look up the GPIO descriptors from the device instead. This
> usually falls back to device hardware descriptions using e.g.
> device tree or ACPI. This device clearly supports device
> tree when used over SPI for example.
> 
> For example, this can be supplied in the device tree like so:
> 
>   wfx@0x01 {
>   compatible = "silabs,wf200";
>   reset-gpios = <&gpio0 1>;
>   wakeup-gpios = <&gpio0 2>;
>   };
> 
> Cc: Jérôme Pouiller 
> Signed-off-by: Linus Walleij 
> ---
> ChangeLog v3->v4:
> - Finally figured out how to compile this by selecting SPI
>   host and deselecting MMC host.

Weird, it should be selectable if MMC or SPI is selected.

> - Initialize the reset GPIO as OUT_LOW
> - Initialize the wakeup GPIO as OUT_LOW
> - Drop one more desc_to_gpio()
> - Update the warning if GPIO is not found.
> ChangeLog v2->v3:
> - ERR_CAST not PTR_CAST
> ChangeLog v1->v2:
> - Fixed a cast and a variable name.
> - I still don't know how to compile this but hey the zeroday
>   robot does.
> ---
>  drivers/staging/wfx/bus_spi.c | 14 +--
>  drivers/staging/wfx/main.c| 45 ---
>  drivers/staging/wfx/main.h|  2 --
>  3 files changed, 12 insertions(+), 49 deletions(-)
> 
[...]
> diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
> index 6bd96f476388..3828a2652313 100644
> --- a/drivers/staging/wfx/main.c
> +++ b/drivers/staging/wfx/main.c
[...]
> @@ -340,7 +303,10 @@ struct wfx_dev *wfx_init_common(struct device *dev,
> memcpy(&wdev->pdata, pdata, sizeof(*pdata));
> of_property_read_string(dev->of_node, "config-file",
> &wdev->pdata.file_pds);
> -   wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup");
> +   wdev->pdata.gpio_wakeup = devm_gpiod_get(dev, "wakeup", 
> GPIOD_OUT_LOW);
> +   if (IS_ERR(wdev->pdata.gpio_wakeup))
> +   return ERR_CAST(wdev->pdata.gpio_wakeup);
> +   gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wakeup");

In the original code, the gpio wakeup was not mandatory. But in this code,
wfx_init_common() will return an error if the gpio "wakeup" is not
defined.

> wfx_sl_fill_pdata(dev, &wdev->pdata);
> 
> mutex_init(&wdev->conf_mutex);
[...]

-- 
Jérôme Pouiller


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 00/17] wilc1000: move out of staging

2020-07-01 Thread Pali Rohár
On Tuesday 30 June 2020 03:17:01 ajay.kat...@microchip.com wrote:
> On 29/06/20 6:56 pm, Pali Rohár wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the 
> > content is safe
> > 
> > On Tuesday 23 June 2020 11:00:04 ajay.kat...@microchip.com wrote:
> >> This patch series is to review and move wilc1000 driver out of staging.
> >> Most of the review comments received in [1] & [2] are addressed in the
> >> latest code.
> >> Please review and provide your inputs.
> > 
> > Hello Ajay! Could you please move SDIO vendor/device ID definitions from
> > driver code wilc1000/sdio.c to common file include/linux/mmc/sdio_ids.h?
> > 
> 
> Currently, the wilc1000 driver movement changes are present in topic
> branch and yet to be merged to master branch. Would it be okay to submit
> the new patch once driver is merged to 'wireless-driver-next' master and
> branch is pulled into Greg's staging repo.

I think it should be OK. But maybe Ulf as maintainer of mmc subsystem
could have opinion or react on this.

> Regards,
> Ajay
> 
> > Similar cleanup was recently finished for all existing non-staging drivers:
> > https://lore.kernel.org/linux-mmc/20200522144412.19712-1-p...@kernel.org/
> > 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 00/17] wilc1000: move out of staging

2020-07-01 Thread Pali Rohár
(adding Ulf)

On Wednesday 01 July 2020 09:55:15 Pali Rohár wrote:
> On Tuesday 30 June 2020 03:17:01 ajay.kat...@microchip.com wrote:
> > On 29/06/20 6:56 pm, Pali Rohár wrote:
> > > EXTERNAL EMAIL: Do not click links or open attachments unless you know 
> > > the content is safe
> > > 
> > > On Tuesday 23 June 2020 11:00:04 ajay.kat...@microchip.com wrote:
> > >> This patch series is to review and move wilc1000 driver out of staging.
> > >> Most of the review comments received in [1] & [2] are addressed in the
> > >> latest code.
> > >> Please review and provide your inputs.
> > > 
> > > Hello Ajay! Could you please move SDIO vendor/device ID definitions from
> > > driver code wilc1000/sdio.c to common file include/linux/mmc/sdio_ids.h?
> > > 
> > 
> > Currently, the wilc1000 driver movement changes are present in topic
> > branch and yet to be merged to master branch. Would it be okay to submit
> > the new patch once driver is merged to 'wireless-driver-next' master and
> > branch is pulled into Greg's staging repo.
> 
> I think it should be OK. But maybe Ulf as maintainer of mmc subsystem
> could have opinion or react on this.
> 
> > Regards,
> > Ajay
> > 
> > > Similar cleanup was recently finished for all existing non-staging 
> > > drivers:
> > > https://lore.kernel.org/linux-mmc/20200522144412.19712-1-p...@kernel.org/
> > > 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 0/9] move Rockchip ISP bindings out of staging / add ISP DT nodes for RK3399

2020-07-01 Thread Heiko Stuebner
On Fri, 3 Apr 2020 13:15:29 -0300, Helen Koike wrote:
> Move the bindings out of drivers/staging and place them in
> Documentation/devicetree/bindings instead.
> 
> Also, add DT nodes for RK3399 and verify with make ARCH=arm64 dtbs_check
> and make ARCH=arm64 dt_binding_check.
> 
> Tested by verifying images streamed from RockPi 4 board with imx219
> module.
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: rockchip: add rx0 mipi-phy for rk3399
  commit: e4bfde13e323f9ee5f2f38aa5cac0676dd656f8e

Best regards,
-- 
Heiko Stuebner 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 6/6] staging: greybus: audio: Enable GB codec, audio module compilation.

2020-07-01 Thread Greg Kroah-Hartman
On Fri, Jun 19, 2020 at 04:50:26PM +0530, Vaibhav Agarwal wrote:
> Currently you can't enable the Gey Bus Audio Codec because there is no
> entry for it in the Kconfig file. Originally the config name was going
> to be AUDIO_MSM8994 but that's not correct because other types of
> hardware are supported now. I have chosen the name AUDIO_APB_CODEC
> instead.  Also I had to update the dependencies for GREYBUS_AUDIO to
> make the compile work.
> 
> Signed-off-by: Vaibhav Agarwal 
> Reviewed-by: Dan Carpenter 
> ---
>  drivers/staging/greybus/Kconfig  | 14 +-
>  drivers/staging/greybus/Makefile |  4 ++--
>  2 files changed, 15 insertions(+), 3 deletions(-)

Can you fix the build issues found by the bot and resend?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Drivers: rtl8188eu: core: Fix coding style issue

2020-07-01 Thread Puranjay Mohan
Use %s and  __func__ in place of function names.
This solves following checkpatch.pl warning
WARNING: Prefer using '"%s...", __func__' to using 'rtw_do_join', this 
function's name, in a string

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 7bb26c362b10..9cc77ab4fd6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -25,7 +25,7 @@ u8 rtw_do_join(struct adapter *padapter)
phead = get_list_head(queue);
plist = phead->next;
 
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: 
phead = %p; plist = %p\n\n\n", phead, plist));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n %s: phead = %p; 
plist = %p\n\n\n", __func__, phead, plist));
 
pmlmepriv->cur_network.join_res = -2;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/13] staging: wfx: add a debugfs entry to force ps_timeout

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

In some advanced usage or debug scenarios, it could interesting to
change the value of ps_timeout or eventually to force use of PS-Poll
frames.

The wext API (used by iwconfig) provide a way to change ps_timeout.
However, this API is obsolete and it seems a little weird to use (it
seems it does apply the change, so the user have to disable then
re-enable de power save)

On side of nl80211, there is no way to change the ps_timeout.

This patch provides a file in debugfs to change the value of ps_timeout.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/debug.c | 23 +++
 drivers/staging/wfx/main.c  |  1 +
 drivers/staging/wfx/sta.c   | 10 +++---
 drivers/staging/wfx/sta.h   |  1 +
 drivers/staging/wfx/wfx.h   |  1 +
 5 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index 10d649985696a..3f1712b7c919d 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -334,6 +334,28 @@ static const struct file_operations wfx_send_hif_msg_fops 
= {
.read = wfx_send_hif_msg_read,
 };
 
+static int wfx_ps_timeout_set(void *data, u64 val)
+{
+   struct wfx_dev *wdev = (struct wfx_dev *)data;
+   struct wfx_vif *wvif;
+
+   wdev->force_ps_timeout = val;
+   wvif = NULL;
+   while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
+   wfx_update_pm(wvif);
+   return 0;
+}
+
+static int wfx_ps_timeout_get(void *data, u64 *val)
+{
+   struct wfx_dev *wdev = (struct wfx_dev *)data;
+
+   *val = wdev->force_ps_timeout;
+   return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(wfx_ps_timeout_fops, wfx_ps_timeout_get, 
wfx_ps_timeout_set, "%lld\n");
+
 int wfx_debug_init(struct wfx_dev *wdev)
 {
struct dentry *d;
@@ -348,6 +370,7 @@ int wfx_debug_init(struct wfx_dev *wdev)
&wfx_burn_slk_key_fops);
debugfs_create_file("send_hif_msg", 0600, d, wdev,
&wfx_send_hif_msg_fops);
+   debugfs_create_file("ps_timeout", 0600, d, wdev, &wfx_ps_timeout_fops);
 
return 0;
 }
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 80e4474cc3314..62e3634556ec0 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -352,6 +352,7 @@ struct wfx_dev *wfx_init_common(struct device *dev,
skb_queue_head_init(&wdev->tx_pending);
init_waitqueue_head(&wdev->tx_dequeue);
wfx_init_hif_cmd(&wdev->hif_cmd);
+   wdev->force_ps_timeout = -1;
 
if (devm_add_action_or_reset(dev, wfx_free_common, wdev))
return NULL;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 2c0ab51fc92da..fdf4f48ddc2ce 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -217,20 +217,24 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool 
*enable_ps)
// are differents.
if (enable_ps)
*enable_ps = true;
-   if (wvif->bss_not_support_ps_poll)
+   if (wvif->wdev->force_ps_timeout > -1)
+   return wvif->wdev->force_ps_timeout;
+   else if (wvif->bss_not_support_ps_poll)
return 30;
else
return 0;
}
if (enable_ps)
*enable_ps = wvif->vif->bss_conf.ps;
-   if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps)
+   if (wvif->wdev->force_ps_timeout > -1)
+   return wvif->wdev->force_ps_timeout;
+   else if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps)
return conf->dynamic_ps_timeout;
else
return -1;
 }
 
-static int wfx_update_pm(struct wfx_vif *wvif)
+int wfx_update_pm(struct wfx_vif *wvif)
 {
int ps_timeout;
bool ps;
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 43808cef4785c..6b15a64ac9e28 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -66,6 +66,7 @@ void wfx_cooling_timeout_work(struct work_struct *work);
 void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd);
 void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
 void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi);
+int wfx_update_pm(struct wfx_vif *wvif);
 
 // Other Helpers
 void wfx_reset(struct wfx_vif *wvif);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 0c44b733ef6fe..477c08fc713fa 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -59,6 +59,7 @@ struct wfx_dev {
struct mutexrx_stats_lock;
struct hif_tx_power_loop_info tx_power_loop_info;
struct mutextx_power_loop_info_lock;
+   int force_ps_timeout;
 };
 
 struct wfx_vif {
-- 
2.27.0

___
devel mailing list
de...@linuxdri

[PATCH 09/13] staging: wfx: fix handling of frames without RSSI data

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

It seems that in the old days, the RSSI information could be missing. In
this case, in order to not pollute the RSSI stats, the frame was
dropped (!).

It is far better to mark the frame with the flag RX_FLAG_NO_SIGNAL_VAL.

In add, the problem seems now fixed in the firmware (at least, it has
not been encountered with recent firmwares).

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_rx.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 0e959ebc38b56..316c2f1537fe5 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -73,12 +73,6 @@ void wfx_rx_cb(struct wfx_vif *wvif,
 
memset(hdr, 0, sizeof(*hdr));
 
-   // FIXME: Why do we drop these frames?
-   if (!arg->rcpi_rssi &&
-   (ieee80211_is_probe_resp(frame->frame_control) ||
-ieee80211_is_beacon(frame->frame_control)))
-   goto drop;
-
if (arg->status == HIF_STATUS_RX_FAIL_MIC)
hdr->flag |= RX_FLAG_MMIC_ERROR;
else if (arg->status)
@@ -102,6 +96,10 @@ void wfx_rx_cb(struct wfx_vif *wvif,
hdr->rate_idx = arg->rxed_rate;
}
 
+   if (!arg->rcpi_rssi) {
+   hdr->flag |= RX_FLAG_NO_SIGNAL_VAL;
+   dev_info(wvif->wdev->dev, "received frame without RSSI data\n");
+   }
hdr->signal = arg->rcpi_rssi / 2 - 110;
hdr->antenna = 0;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/13] staging: wfx: check the vif ID of the Tx confirmations

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

When the driver has sent a frame on a virtual interface (vif), it
expects to receive the confirmation on the same vif.

This patch add a check for that.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/queue.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 7ec36598d9a83..6069143369f30 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -142,14 +142,18 @@ struct sk_buff *wfx_pending_get(struct wfx_vif *wvif, u32 
packet_id)
 {
struct wfx_queue *queue;
struct hif_req_tx *req;
+   struct hif_msg *hif;
struct sk_buff *skb;
 
spin_lock_bh(&wvif->wdev->tx_pending.lock);
skb_queue_walk(&wvif->wdev->tx_pending, skb) {
-   req = wfx_skb_txreq(skb);
+   hif = (struct hif_msg *)skb->data;
+   req = (struct hif_req_tx *)hif->body;
if (req->packet_id == packet_id) {
spin_unlock_bh(&wvif->wdev->tx_pending.lock);
queue = &wvif->tx_queue[skb_get_queue_mapping(skb)];
+   WARN(hif->interface != wvif->id, "sent frame %08x on 
vif %d, but get reply on vif %d",
+req->packet_id, hif->interface, wvif->id);
WARN_ON(skb_get_queue_mapping(skb) > 3);
WARN_ON(!atomic_read(&queue->pending_frames));
atomic_dec(&queue->pending_frames);
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/13] staging: wfx: load the firmware faster

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

During the loading of the firmware, the WFX_DCA_GET register provide the
number available bytes in the receiving buffer. It is not necessary to
access to the WFX_DCA_GET after sent of each firmware fragment.

This patch allows to send the firmware:
  - in 64ms instead of 130ms using SDIO bus
  - in 78ms instead of 115ms using SPI bus

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/fwio.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index 72bb3d2a96138..d9a886f3e64be 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -188,15 +188,14 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 
*data, size_t len)
while (offs < len) {
start = ktime_get();
for (;;) {
-   ret = sram_reg_read(wdev, WFX_DCA_GET, &bytes_done);
-   if (ret < 0)
-   return ret;
now = ktime_get();
-   if (offs +
-   DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE)
+   if (offs + DNLD_BLOCK_SIZE - bytes_done < 
DNLD_FIFO_SIZE)
break;
if (ktime_after(now, ktime_add_ms(start, DCA_TIMEOUT)))
return -ETIMEDOUT;
+   ret = sram_reg_read(wdev, WFX_DCA_GET, &bytes_done);
+   if (ret < 0)
+   return ret;
}
if (ktime_compare(now, start))
dev_dbg(wdev->dev, "answer after %lldus\n",
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/13] staging: wfx: drop counter of buffered frames

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

Since the driver does not call ieee80211_sta_set_buffered() anymore, it
is no more necessary to maintain a counter of buffered frames for each
stations.

This change allows to simplify the processing in multiple places in the
driver.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_tx.c | 50 ---
 drivers/staging/wfx/data_tx.h |  1 -
 drivers/staging/wfx/sta.c |  8 --
 drivers/staging/wfx/sta.h |  3 ---
 4 files changed, 62 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 3244a768345c5..5c744d9c8c114 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -213,22 +213,6 @@ static bool ieee80211_is_action_back(struct ieee80211_hdr 
*hdr)
return true;
 }
 
-static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr,
-struct wfx_tx_priv *tx_priv,
-struct ieee80211_sta *sta)
-{
-   struct wfx_sta_priv *sta_priv;
-   int tid = ieee80211_get_tid(hdr);
-
-   if (sta) {
-   tx_priv->has_sta = true;
-   sta_priv = (struct wfx_sta_priv *)&sta->drv_priv;
-   spin_lock_bh(&sta_priv->lock);
-   sta_priv->buffered[tid]++;
-   spin_unlock_bh(&sta_priv->lock);
-   }
-}
-
 static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta,
 struct ieee80211_hdr *hdr)
 {
@@ -406,7 +390,6 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct 
ieee80211_sta *sta,
req->tx_flags.retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info);
 
// Auxiliary operations
-   wfx_tx_manage_pm(wvif, hdr, tx_priv, sta);
wfx_tx_queues_put(wvif, skb);
if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
schedule_work(&wvif->update_tim_work);
@@ -449,35 +432,6 @@ void wfx_tx(struct ieee80211_hw *hw, struct 
ieee80211_tx_control *control,
ieee80211_tx_status_irqsafe(wdev->hw, skb);
 }
 
-static struct ieee80211_hdr *wfx_skb_hdr80211(struct sk_buff *skb)
-{
-   struct hif_msg *hif = (struct hif_msg *)skb->data;
-   struct hif_req_tx *req = (struct hif_req_tx *)hif->body;
-
-   return (struct ieee80211_hdr *)(req->frame + req->data_flags.fc_offset);
-}
-
-static void wfx_tx_update_sta(struct wfx_vif *wvif, struct ieee80211_hdr *hdr)
-{
-   int tid = ieee80211_get_tid(hdr);
-   struct wfx_sta_priv *sta_priv;
-   struct ieee80211_sta *sta;
-
-   rcu_read_lock(); // protect sta
-   sta = ieee80211_find_sta(wvif->vif, hdr->addr1);
-   if (sta) {
-   sta_priv = (struct wfx_sta_priv *)&sta->drv_priv;
-   spin_lock_bh(&sta_priv->lock);
-   WARN(!sta_priv->buffered[tid], "inconsistent notification");
-   sta_priv->buffered[tid]--;
-   spin_unlock_bh(&sta_priv->lock);
-   } else {
-   dev_dbg(wvif->wdev->dev, "%s: sta does not exist anymore\n",
-   __func__);
-   }
-   rcu_read_unlock();
-}
-
 static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
 {
struct hif_msg *hif = (struct hif_msg *)skb->data;
@@ -553,8 +507,6 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct 
hif_cnf_tx *arg)
 
// You can touch to tx_priv, but don't touch to tx_info->status.
wfx_tx_fill_rates(wdev, tx_info, arg);
-   if (tx_priv->has_sta)
-   wfx_tx_update_sta(wvif, wfx_skb_hdr80211(skb));
skb_trim(skb, skb->len - wfx_tx_get_icv_len(tx_priv->hw_key));
 
// From now, you can touch to tx_info->status, but do not touch to
@@ -634,8 +586,6 @@ void wfx_flush(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
while ((skb = skb_dequeue(&dropped)) != NULL) {
hif = (struct hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface);
-   if (wfx_skb_tx_priv(skb)->has_sta)
-   wfx_tx_update_sta(wvif, wfx_skb_hdr80211(skb));
ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb));
wfx_skb_dtor(wvif, skb);
}
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index b1727ddecd5e2..cff7b9ff99a99 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -36,7 +36,6 @@ struct tx_policy_cache {
 struct wfx_tx_priv {
ktime_t xmit_timestamp;
struct ieee80211_key_conf *hw_key;
-   bool has_sta;
 } __packed;
 
 void wfx_tx_policy_init(struct wfx_vif *wvif);
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 85d4bc2949882..2c0ab51fc92da 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -430,7 +430,6 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
struct wfx_sta_priv 

[PATCH 11/13] staging: wfx: fix CCMP/TKIP replay protection

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

To enable the TKIP/CCMP replay protection, the frames has to be
processed in the right order. However, the device is not able to
re-order the frames during BlockAck sessions.

Mac80211 is able to reorder the frames, but it need the information
about the BlockAck sessions start and stop. Unfortunately, since the
BlockAck is fully handled by the hardware, these frames were not
forwarded to the host. So, if the driver ask to mac80211 to apply the
replay protection, it drop all misordered frames.

So, until now, the driver explicitly asked to mac80211 to not apply
the CCMP/TKIP replay protection.

The situation has changed with the API 3.4 of the device firmware. The
firmware forward the BlockAck information. Mac80211 is now able to
correctly reorder the frames. There is no more reasons to drop
cryptographic data.

This patch also impact the older firmwares. There will be a performance
impact on these firmware (since the misordered frames will dropped).
However, we can't keep the replay protection disabled.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_rx.c | 31 ++-
 drivers/staging/wfx/data_tx.c |  3 ++-
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 60e2e5cb4656a..6fb0788807426 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -13,6 +13,24 @@
 #include "bh.h"
 #include "sta.h"
 
+static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt)
+{
+   int params, tid;
+
+   switch (mgmt->u.action.u.addba_req.action_code) {
+   case WLAN_ACTION_ADDBA_REQ:
+   params = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
+   tid = (params & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
+   ieee80211_start_rx_ba_session_offl(wvif->vif, mgmt->sa, tid);
+   break;
+   case WLAN_ACTION_DELBA:
+   params = le16_to_cpu(mgmt->u.action.u.delba.params);
+   tid = (params &  IEEE80211_DELBA_PARAM_TID_MASK) >> 12;
+   ieee80211_stop_rx_ba_session_offl(wvif->vif, mgmt->sa, tid);
+   break;
+   }
+}
+
 void wfx_rx_cb(struct wfx_vif *wvif,
   const struct hif_ind_rx *arg, struct sk_buff *skb)
 {
@@ -53,15 +71,18 @@ void wfx_rx_cb(struct wfx_vif *wvif,
hdr->antenna = 0;
 
if (arg->rx_flags.encryp)
-   hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_PN_VALIDATED;
+   hdr->flag |= RX_FLAG_DECRYPTED;
 
-   /* Filter block ACK negotiation: fully controlled by firmware */
+   // Block ack negociation is offloaded by the firmware. However,
+   // re-ordering must be done by the mac80211.
if (ieee80211_is_action(frame->frame_control) &&
-   arg->rx_flags.match_uc_addr &&
-   mgmt->u.action.category == WLAN_CATEGORY_BACK)
+   mgmt->u.action.category == WLAN_CATEGORY_BACK &&
+   skb->len > IEEE80211_MIN_ACTION_SIZE) {
+   wfx_rx_handle_ba(wvif, mgmt);
goto drop;
+   }
+
ieee80211_rx_irqsafe(wvif->wdev->hw, skb);
-
return;
 
 drop:
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 5c744d9c8c114..3acf4eb0214dc 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -418,7 +418,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct 
ieee80211_tx_control *control,
wvif = wvif_iterate(wdev, NULL);
if (WARN_ON(!wvif))
goto drop;
-   // FIXME: why?
+   // Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any
+   // BlockAck session management frame. The check below exist just in 
case.
if (ieee80211_is_action_back(hdr)) {
dev_info(wdev->dev, "drop BA action\n");
goto drop;
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] staging: wfx: add tracepoint "queues_stats"

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

It is useful to check which queue the driver choose to send to the
hardware.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/queue.c  |  3 +++
 drivers/staging/wfx/traces.h | 51 
 2 files changed, 54 insertions(+)

diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 678f622639093..6e31591651432 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -12,6 +12,7 @@
 #include "wfx.h"
 #include "sta.h"
 #include "data_tx.h"
+#include "traces.h"
 
 void wfx_tx_lock(struct wfx_dev *wdev)
 {
@@ -256,6 +257,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev 
*wdev)
WARN_ON(queues[i] !=
&wvif->tx_queue[skb_get_queue_mapping(skb)]);
atomic_inc(&queues[i]->pending_frames);
+   trace_queues_stats(wdev, queues[i]);
return skb;
}
// No more multicast to sent
@@ -267,6 +269,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev 
*wdev)
skb = skb_dequeue(&queues[i]->normal);
if (skb) {
atomic_inc(&queues[i]->pending_frames);
+   trace_queues_stats(wdev, queues[i]);
return skb;
}
}
diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index 0b6fbd5186381..d376db2f1891b 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -439,6 +439,57 @@ TRACE_EVENT(tx_stats,
 );
 #define _trace_tx_stats(tx_cnf, skb, delay) trace_tx_stats(tx_cnf, skb, delay)
 
+TRACE_EVENT(queues_stats,
+   TP_PROTO(struct wfx_dev *wdev, const struct wfx_queue *elected_queue),
+   TP_ARGS(wdev, elected_queue),
+   TP_STRUCT__entry(
+   __field(int, vif_id)
+   __field(int, queue_id)
+   __array(int, hw, IEEE80211_NUM_ACS * 2)
+   __array(int, drv, IEEE80211_NUM_ACS * 2)
+   __array(int, cab, IEEE80211_NUM_ACS * 2)
+   ),
+   TP_fast_assign(
+   const struct wfx_queue *queue;
+   struct wfx_vif *wvif;
+   int i, j;
+
+   for (j = 0; j < IEEE80211_NUM_ACS * 2; j++) {
+   __entry->hw[j] = -1;
+   __entry->drv[j] = -1;
+   __entry->cab[j] = -1;
+   }
+   __entry->vif_id = -1;
+   __entry->queue_id = -1;
+   wvif = NULL;
+   while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
+   for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+   j = wvif->id * IEEE80211_NUM_ACS + i;
+   WARN_ON(j >= IEEE80211_NUM_ACS * 2);
+   queue = &wvif->tx_queue[i];
+   __entry->hw[j] = 
atomic_read(&queue->pending_frames);
+   __entry->drv[j] = skb_queue_len(&queue->normal);
+   __entry->cab[j] = skb_queue_len(&queue->cab);
+   if (queue == elected_queue) {
+   __entry->vif_id = wvif->id;
+   __entry->queue_id = i;
+   }
+   }
+   }
+   ),
+   TP_printk("got skb from %d/%d, pend. hw/norm/cab: [ %d/%d/%d %d/%d/%d 
%d/%d/%d %d/%d/%d ] [ %d/%d/%d %d/%d/%d %d/%d/%d %d/%d/%d ]",
+   __entry->vif_id, __entry->queue_id,
+   __entry->hw[0], __entry->drv[0], __entry->cab[0],
+   __entry->hw[1], __entry->drv[1], __entry->cab[1],
+   __entry->hw[2], __entry->drv[2], __entry->cab[2],
+   __entry->hw[3], __entry->drv[3], __entry->cab[3],
+   __entry->hw[4], __entry->drv[4], __entry->cab[4],
+   __entry->hw[5], __entry->drv[5], __entry->cab[5],
+   __entry->hw[6], __entry->drv[6], __entry->cab[6],
+   __entry->hw[7], __entry->drv[7], __entry->cab[7]
+   )
+);
+
 #endif
 
 /* This part must be outside protection */
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/13] staging: wfx: associate tx_queues to vifs

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

The device handles 4 queues (one per AC) for each virtual interface (and
maximum 4 virtual interfaces). Until now the driver unified the queue of
all interfaces and handled only 4 queues for whole device.

This architecture did not allow to balance the traffic between the vif. So,
this patch relocate the queues into the vif and change the API accordingly.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_tx.c |  57 +-
 drivers/staging/wfx/main.c|   3 +-
 drivers/staging/wfx/queue.c   | 141 +++---
 drivers/staging/wfx/queue.h   |  15 ++--
 drivers/staging/wfx/sta.c |   4 +-
 drivers/staging/wfx/wfx.h |   2 +-
 6 files changed, 111 insertions(+), 111 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index f042ef36b408e..ce3048c94961c 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -408,7 +408,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct 
ieee80211_sta *sta,
 
// Auxiliary operations
wfx_tx_manage_pm(wvif, hdr, tx_priv, sta);
-   wfx_tx_queues_put(wvif->wdev, skb);
+   wfx_tx_queues_put(wvif, skb);
if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
schedule_work(&wvif->update_tim_work);
wfx_bh_request_tx(wvif->wdev);
@@ -539,7 +539,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct 
hif_cnf_tx *arg)
const struct wfx_tx_priv *tx_priv;
struct sk_buff *skb;
 
-   skb = wfx_pending_get(wvif->wdev, arg->packet_id);
+   skb = wfx_pending_get(wvif, arg->packet_id);
if (!skb) {
dev_warn(wvif->wdev->dev, "received unknown packet_id (%#.8x) 
from chip\n",
 arg->packet_id);
@@ -582,34 +582,50 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct 
hif_cnf_tx *arg)
wfx_skb_dtor(wvif, skb);
 }
 
+static void wfx_flush_vif(struct wfx_vif *wvif, u32 queues,
+ struct sk_buff_head *dropped)
+{
+   struct wfx_queue *queue;
+   int i;
+
+   for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+   if (!(BIT(i) & queues))
+   continue;
+   queue = &wvif->tx_queue[i];
+   if (dropped)
+   wfx_tx_queue_drop(wvif, queue, dropped);
+   }
+   if (wvif->wdev->chip_frozen)
+   return;
+   for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+   if (!(BIT(i) & queues))
+   continue;
+   queue = &wvif->tx_queue[i];
+   if (wait_event_timeout(wvif->wdev->tx_dequeue,
+  wfx_tx_queue_empty(wvif, queue),
+  msecs_to_jiffies(1000)) <= 0)
+   dev_warn(wvif->wdev->dev,
+"frames queued while flushing tx queues?");
+   }
+}
+
 void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
   u32 queues, bool drop)
 {
struct wfx_dev *wdev = hw->priv;
struct sk_buff_head dropped;
-   struct wfx_queue *queue;
struct wfx_vif *wvif;
struct hif_msg *hif;
struct sk_buff *skb;
-   int vif_id = -1;
-   int i;
 
-   if (vif)
-   vif_id = ((struct wfx_vif *)vif->drv_priv)->id;
skb_queue_head_init(&dropped);
-   for (i = 0; i < IEEE80211_NUM_ACS; i++) {
-   if (!(BIT(i) & queues))
-   continue;
-   queue = &wdev->tx_queue[i];
-   if (drop)
-   wfx_tx_queue_drop(wdev, queue, vif_id, &dropped);
-   if (wdev->chip_frozen)
-   continue;
-   if (wait_event_timeout(wdev->tx_dequeue,
-  wfx_tx_queue_empty(wdev, queue, vif_id),
-  msecs_to_jiffies(1000)) <= 0)
-   dev_warn(wdev->dev,
-"frames queued while flushing tx queues?");
+   if (vif) {
+   wvif = (struct wfx_vif *)vif->drv_priv;
+   wfx_flush_vif(wvif, queues, drop ? &dropped : NULL);
+   } else {
+   wvif = NULL;
+   while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
+   wfx_flush_vif(wvif, queues, drop ? &dropped : NULL);
}
wfx_tx_flush(wdev);
if (wdev->chip_frozen)
@@ -623,4 +639,3 @@ void wfx_flush(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
wfx_skb_dtor(wvif, skb);
}
 }
-
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 6bd96f4763884..80e4474cc3314 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -349,8 +349,9 @@ struct wfx_dev *wfx_init_common(struct device *dev,
init_completion(&wdev->firmware_ready);
INIT_DELAYED_WORK(&wdev->cooling_timeout_work,
  

[PATCH 00/13] staging: wfx: multiple fixes

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

Hello,

This series fixes a few issues/improvements discovered during the last months.

Jérôme Pouiller (13):
  staging: wfx: associate tx_queues to vifs
  staging: wfx: check the vif ID of the Tx confirmations
  staging: wfx: correctly retrieve vif ID from Tx confirmation
  staging: wfx: add tracepoint "queues_stats"
  staging: wfx: load the firmware faster
  staging: wfx: improve protection against malformed HIF messages
  staging: wfx: fix unexpected calls to ieee80211_sta_set_buffered()
  staging: wfx: drop counter of buffered frames
  staging: wfx: fix handling of frames without RSSI data
  staging: wfx: simplify handling of encrypted frames
  staging: wfx: fix CCMP/TKIP replay protection
  staging: wfx: add a debugfs entry to force ps_timeout
  staging: wfx: always enable FastPs in combo with new firmwares

 drivers/staging/wfx/bh.c  |  36 
 drivers/staging/wfx/data_rx.c |  85 ++-
 drivers/staging/wfx/data_tx.c | 127 +++-
 drivers/staging/wfx/data_tx.h |   3 +-
 drivers/staging/wfx/debug.c   |  23 +
 drivers/staging/wfx/fwio.c|   9 +-
 drivers/staging/wfx/hif_rx.c  |  22 +
 drivers/staging/wfx/main.c|   4 +-
 drivers/staging/wfx/queue.c   | 152 --
 drivers/staging/wfx/queue.h   |  13 ++-
 drivers/staging/wfx/sta.c |  36 +++-
 drivers/staging/wfx/sta.h |   4 +-
 drivers/staging/wfx/traces.h  |  51 
 drivers/staging/wfx/wfx.h |   5 +-
 14 files changed, 270 insertions(+), 300 deletions(-)

-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/13] staging: wfx: fix unexpected calls to ieee80211_sta_set_buffered()

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

When a station go to sleep, the driver receive the status REQUEUE and
forward this answer to mac80211. So, neither the driver, neither the
hardware buffer the frames. So the call to ieee80211_sta_set_buffered is
useless.

In add, it seems that mac80211 does not expect to receive
ieee80211_sta_set_buffered(false) after the station is asleep(). When
the device send data to a station, the following sequence can be
observed:

   - Mac80211 call wfx_sta_notify(awake).
   - The driver calls ieee80211_sta_set_buffered(true). Since the
 station is awake, its TIM is not set.
   - Mac80211 receive a power save notification from the station, so it
 calls wfx_sta_notify(asleep).
   - Then, since the driver has declared it has buffered some frames,
 the TIM of the station should be set. This action is delayed by
 mac80211.
   - The device also notice the station go to sleep. It replies the
 REQUEUE status for the buffered frames. The driver forward this
 status to mac80211.
   - There is no more frames in queues, so the driver call
 ieee80211_sta_set_buffered(false).
   - Mac80211 updates the TIM but since there is no frames buffered by
 the driver, it set the TIM for the station to 0.

Anyway, correctly use the ieee80211_sta_set_buffered() API solves the
problem.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_tx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index dcec722afb174..3244a768345c5 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -225,7 +225,6 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct 
ieee80211_hdr *hdr,
sta_priv = (struct wfx_sta_priv *)&sta->drv_priv;
spin_lock_bh(&sta_priv->lock);
sta_priv->buffered[tid]++;
-   ieee80211_sta_set_buffered(sta, tid, true);
spin_unlock_bh(&sta_priv->lock);
}
 }
@@ -471,8 +470,6 @@ static void wfx_tx_update_sta(struct wfx_vif *wvif, struct 
ieee80211_hdr *hdr)
spin_lock_bh(&sta_priv->lock);
WARN(!sta_priv->buffered[tid], "inconsistent notification");
sta_priv->buffered[tid]--;
-   if (!sta_priv->buffered[tid])
-   ieee80211_sta_set_buffered(sta, tid, false);
spin_unlock_bh(&sta_priv->lock);
} else {
dev_dbg(wvif->wdev->dev, "%s: sta does not exist anymore\n",
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/13] staging: wfx: simplify handling of encrypted frames

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

We don't want mac80211 try to check MMIC and other security mechanisms.
So, the driver remove all the data related to the encryption (IV, ICV,
MMIC).

However, enabling RX_FLAG_PN_VALIDATED is sufficient for that.

So, drop the useless function wfx_drop_encrypt_data() and enable
RX_FLAG_PN_VALIDATED.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_rx.c | 60 ++-
 1 file changed, 2 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 316c2f1537fe5..60e2e5cb4656a 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -13,57 +13,6 @@
 #include "bh.h"
 #include "sta.h"
 
-static int wfx_drop_encrypt_data(struct wfx_dev *wdev,
-const struct hif_ind_rx *arg,
-struct sk_buff *skb)
-{
-   struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
-   size_t hdrlen = ieee80211_hdrlen(frame->frame_control);
-   size_t iv_len, icv_len;
-
-   /* Oops... There is no fast way to ask mac80211 about
-* IV/ICV lengths. Even defineas are not exposed.
-*/
-   switch (arg->rx_flags.encryp) {
-   case HIF_RI_FLAGS_WEP_ENCRYPTED:
-   iv_len = 4 /* WEP_IV_LEN */;
-   icv_len = 4 /* WEP_ICV_LEN */;
-   break;
-   case HIF_RI_FLAGS_TKIP_ENCRYPTED:
-   iv_len = 8 /* TKIP_IV_LEN */;
-   icv_len = 4 /* TKIP_ICV_LEN */
-   + 8 /*MICHAEL_MIC_LEN*/;
-   break;
-   case HIF_RI_FLAGS_AES_ENCRYPTED:
-   iv_len = 8 /* CCMP_HDR_LEN */;
-   icv_len = 8 /* CCMP_MIC_LEN */;
-   break;
-   case HIF_RI_FLAGS_WAPI_ENCRYPTED:
-   iv_len = 18 /* WAPI_HDR_LEN */;
-   icv_len = 16 /* WAPI_MIC_LEN */;
-   break;
-   default:
-   dev_err(wdev->dev, "unknown encryption type %d\n",
-   arg->rx_flags.encryp);
-   return -EIO;
-   }
-
-   /* Firmware strips ICV in case of MIC failure. */
-   if (arg->status == HIF_STATUS_RX_FAIL_MIC)
-   icv_len = 0;
-
-   if (skb->len < hdrlen + iv_len + icv_len) {
-   dev_warn(wdev->dev, "malformed SDU received\n");
-   return -EIO;
-   }
-
-   /* Remove IV, ICV and MIC */
-   skb_trim(skb, skb->len - icv_len);
-   memmove(skb->data + iv_len, skb->data, hdrlen);
-   skb_pull(skb, iv_len);
-   return 0;
-}
-
 void wfx_rx_cb(struct wfx_vif *wvif,
   const struct hif_ind_rx *arg, struct sk_buff *skb)
 {
@@ -103,13 +52,8 @@ void wfx_rx_cb(struct wfx_vif *wvif,
hdr->signal = arg->rcpi_rssi / 2 - 110;
hdr->antenna = 0;
 
-   if (arg->rx_flags.encryp) {
-   if (wfx_drop_encrypt_data(wvif->wdev, arg, skb))
-   goto drop;
-   hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED;
-   if (arg->rx_flags.encryp == HIF_RI_FLAGS_TKIP_ENCRYPTED)
-   hdr->flag |= RX_FLAG_MMIC_STRIPPED;
-   }
+   if (arg->rx_flags.encryp)
+   hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_PN_VALIDATED;
 
/* Filter block ACK negotiation: fully controlled by firmware */
if (ieee80211_is_action(frame->frame_control) &&
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/13] staging: wfx: correctly retrieve vif ID from Tx confirmation

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

The device is able to send multiple Tx confirmations in the one reply.
In this case, there is only one vif identifier for all the
confirmations.

Unfortunately, to generate this kind of messages the device squashes all
the confirmations whatever their vif ID and use the vif ID of the first
confirmation. So, the driver cannot rely on the vif ID mentioned in the
header. Fortunately, using the packet_id, the driver can retrieve the Tx
request and the associated vif.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/data_tx.c | 16 ++--
 drivers/staging/wfx/data_tx.h |  2 +-
 drivers/staging/wfx/hif_rx.c  | 14 ++
 drivers/staging/wfx/queue.c   | 22 --
 drivers/staging/wfx/queue.h   |  2 +-
 5 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index ce3048c94961c..dcec722afb174 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -533,25 +533,29 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev,
dev_dbg(wdev->dev, "%d more retries than expected\n", tx_count);
 }
 
-void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg)
+void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
 {
struct ieee80211_tx_info *tx_info;
const struct wfx_tx_priv *tx_priv;
+   struct wfx_vif *wvif;
struct sk_buff *skb;
 
-   skb = wfx_pending_get(wvif, arg->packet_id);
+   skb = wfx_pending_get(wdev, arg->packet_id);
if (!skb) {
-   dev_warn(wvif->wdev->dev, "received unknown packet_id (%#.8x) 
from chip\n",
+   dev_warn(wdev->dev, "received unknown packet_id (%#.8x) from 
chip\n",
 arg->packet_id);
return;
}
+   wvif = wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface);
+   WARN_ON(!wvif);
+   if (!wvif)
+   return;
tx_info = IEEE80211_SKB_CB(skb);
tx_priv = wfx_skb_tx_priv(skb);
-   _trace_tx_stats(arg, skb,
-   wfx_pending_get_pkt_us_delay(wvif->wdev, skb));
+   _trace_tx_stats(arg, skb, wfx_pending_get_pkt_us_delay(wdev, skb));
 
// You can touch to tx_priv, but don't touch to tx_info->status.
-   wfx_tx_fill_rates(wvif->wdev, tx_info, arg);
+   wfx_tx_fill_rates(wdev, tx_info, arg);
if (tx_priv->has_sta)
wfx_tx_update_sta(wvif, wfx_skb_hdr80211(skb));
skb_trim(skb, skb->len - wfx_tx_get_icv_len(tx_priv->hw_key));
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index 54fff24508fb9..b1727ddecd5e2 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -44,7 +44,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work);
 
 void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
struct sk_buff *skb);
-void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg);
+void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg);
 void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
   u32 queues, bool drop);
 
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index bb156033d1e16..e3ebd910fabfd 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -63,13 +63,8 @@ static int hif_tx_confirm(struct wfx_dev *wdev,
  const struct hif_msg *hif, const void *buf)
 {
const struct hif_cnf_tx *body = buf;
-   struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
 
-   WARN_ON(!wvif);
-   if (!wvif)
-   return -EFAULT;
-
-   wfx_tx_confirm_cb(wvif, body);
+   wfx_tx_confirm_cb(wdev, body);
return 0;
 }
 
@@ -77,16 +72,11 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf)
 {
const struct hif_cnf_multi_transmit *body = buf;
-   struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
int i;
 
WARN(body->num_tx_confs <= 0, "corrupted message");
-   WARN_ON(!wvif);
-   if (!wvif)
-   return -EFAULT;
-
for (i = 0; i < body->num_tx_confs; i++)
-   wfx_tx_confirm_cb(wvif, &body->tx_conf_payload[i]);
+   wfx_tx_confirm_cb(wdev, &body->tx_conf_payload[i]);
return 0;
 }
 
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 6069143369f30..678f622639093 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -138,30 +138,32 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct 
sk_buff_head *dropped)
}
 }
 
-struct sk_buff *wfx_pending_get(struct wfx_vif *wvif, u32 packet_id)
+struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id)
 {
struct wfx_queue *queue;
struct hif_req_tx *req;

[PATCH 06/13] staging: wfx: improve protection against malformed HIF messages

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

As discussed here[1], if a message was smaller than the size of the
message header, it could be incorrectly processed.

[1] https://lore.kernel.org/driverdev-devel/2302785.6C7ODC2LYm@pc-42/

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/bh.c | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 1cbaf8bb4fa38..53ae0b5abcdd8 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -57,7 +57,6 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, 
int *is_cnf)
int release_count;
int piggyback = 0;
 
-   WARN(read_len < 4, "corrupted read");
WARN(read_len > round_down(0xFFF, 2) * sizeof(u16),
 "%s: request exceed WFx capability", __func__);
 
@@ -76,7 +75,27 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, 
int *is_cnf)
hif = (struct hif_msg *)skb->data;
WARN(hif->encrypted & 0x1, "unsupported encryption type");
if (hif->encrypted == 0x2) {
-   if (wfx_sl_decode(wdev, (void *)hif)) {
+   if (WARN(read_len < sizeof(struct hif_sl_msg), "corrupted 
read"))
+   goto err;
+   computed_len = le16_to_cpu(((struct hif_sl_msg *)hif)->len);
+   computed_len = round_up(computed_len - sizeof(u16), 16);
+   computed_len += sizeof(struct hif_sl_msg);
+   computed_len += sizeof(struct hif_sl_tag);
+   } else {
+   if (WARN(read_len < sizeof(struct hif_msg), "corrupted read"))
+   goto err;
+   computed_len = le16_to_cpu(hif->len);
+   computed_len = round_up(computed_len, 2);
+   }
+   if (computed_len != read_len) {
+   dev_err(wdev->dev, "inconsistent message length: %zu != %zu\n",
+   computed_len, read_len);
+   print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET, 16, 1,
+  hif, read_len, true);
+   goto err;
+   }
+   if (hif->encrypted == 0x2) {
+   if (wfx_sl_decode(wdev, (struct hif_sl_msg *)hif)) {
dev_kfree_skb(skb);
// If frame was a confirmation, expect trouble in next
// exchange. However, it is harmless to fail to decode
@@ -84,19 +103,6 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, 
int *is_cnf)
// piggyback is probably correct.
return piggyback;
}
-   computed_len =
-   round_up(le16_to_cpu(hif->len) - sizeof(hif->len), 16) +
-   sizeof(struct hif_sl_msg) +
-   sizeof(struct hif_sl_tag);
-   } else {
-   computed_len = round_up(le16_to_cpu(hif->len), 2);
-   }
-   if (computed_len != read_len) {
-   dev_err(wdev->dev, "inconsistent message length: %zu != %zu\n",
-   computed_len, read_len);
-   print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET, 16, 1,
-  hif, read_len, true);
-   goto err;
}
 
if (!(hif->id & HIF_ID_IS_INDICATION)) {
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/13] staging: wfx: always enable FastPs in combo with new firmwares

2020-07-01 Thread Jerome Pouiller
From: Jérôme Pouiller 

When multiple interface on different channels are in use. It is
necessary to advertise the AP that the device is no more awake before to
switch to the other channel.

Until now, PS-Poll was the preferred mechanism for that. However.  The
new firmwares (>= 3.7) now nicely support FastPS.

FastPS improves bandwidth and compatibility with AP.

This patch drop the complex and rarely used mechanism introduced in the
commit dd5eba1bb5b4f ("staging: wfx: fix support for AP that do not
support PS-Poll") and use FastPS as soon as it is possible.

Signed-off-by: Jérôme Pouiller 
---
 drivers/staging/wfx/hif_rx.c |  8 +---
 drivers/staging/wfx/sta.c| 16 +++-
 drivers/staging/wfx/wfx.h|  2 --
 3 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index e3ebd910fabfd..cc7c0cf226ba1 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -149,7 +149,6 @@ static int hif_event_indication(struct wfx_dev *wdev,
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_event *body = buf;
int type = le32_to_cpu(body->event_id);
-   int cause;
 
if (!wvif) {
dev_warn(wdev->dev, "received event for non-existent vif\n");
@@ -168,13 +167,8 @@ static int hif_event_indication(struct wfx_dev *wdev,
dev_dbg(wdev->dev, "ignore BSSREGAINED indication\n");
break;
case HIF_EVENT_IND_PS_MODE_ERROR:
-   cause = le32_to_cpu(body->event_data.ps_mode_error);
dev_warn(wdev->dev, "error while processing power save request: 
%d\n",
-cause);
-   if (cause == HIF_PS_ERROR_AP_NOT_RESP_TO_POLL) {
-   wvif->bss_not_support_ps_poll = true;
-   schedule_work(&wvif->update_pm_work);
-   }
+le32_to_cpu(body->event_data.ps_mode_error));
break;
default:
dev_warn(wdev->dev, "unhandled event indication: %.2x\n",
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index fdf4f48ddc2ce..4e30ab17a93d4 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -219,10 +219,10 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool 
*enable_ps)
*enable_ps = true;
if (wvif->wdev->force_ps_timeout > -1)
return wvif->wdev->force_ps_timeout;
-   else if (wvif->bss_not_support_ps_poll)
-   return 30;
-   else
+   else if (wfx_api_older_than(wvif->wdev, 3, 2))
return 0;
+   else
+   return 30;
}
if (enable_ps)
*enable_ps = wvif->vif->bss_conf.ps;
@@ -255,14 +255,6 @@ int wfx_update_pm(struct wfx_vif *wvif)
return hif_set_pm(wvif, ps, ps_timeout);
 }
 
-static void wfx_update_pm_work(struct work_struct *work)
-{
-   struct wfx_vif *wvif = container_of(work, struct wfx_vif,
-   update_pm_work);
-
-   wfx_update_pm(wvif);
-}
-
 int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
   u16 queue, const struct ieee80211_tx_queue_params *params)
 {
@@ -372,7 +364,6 @@ void wfx_reset(struct wfx_vif *wvif)
hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
wfx_tx_unlock(wdev);
wvif->join_in_progress = false;
-   wvif->bss_not_support_ps_poll = false;
cancel_delayed_work_sync(&wvif->beacon_loss_work);
wvif =  NULL;
while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
@@ -790,7 +781,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif)
 
init_completion(&wvif->set_pm_mode_complete);
complete(&wvif->set_pm_mode_complete);
-   INIT_WORK(&wvif->update_pm_work, wfx_update_pm_work);
INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);
 
mutex_init(&wvif->scan_lock);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 477c08fc713fa..38e24d7f72f24 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -93,8 +93,6 @@ struct wfx_vif {
boolscan_abort;
struct ieee80211_scan_request *scan_req;
 
-   boolbss_not_support_ps_poll;
-   struct work_struct  update_pm_work;
struct completion   set_pm_mode_complete;
 };
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v1] Staging: rtl8188eu: core: Fix coding style issue

2020-07-01 Thread Puranjay Mohan
Use %s and  __func__ in place of function names.
This solves following checkpatch.pl warning
WARNING: Prefer using '"%s...", __func__' to using 'rtw_do_join', this 
function's name, in a string

Signed-off-by: Puranjay Mohan 
---
V1: Add staging in the subject.
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 7bb26c362b10..9cc77ab4fd6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -25,7 +25,7 @@ u8 rtw_do_join(struct adapter *padapter)
phead = get_list_head(queue);
plist = phead->next;
 
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: 
phead = %p; plist = %p\n\n\n", phead, plist));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n %s: phead = %p; 
plist = %p\n\n\n", __func__, phead, plist));
 
pmlmepriv->cur_network.join_res = -2;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RESEND PATCH v5] drivers: most: add USB adapter driver

2020-07-01 Thread Christian Gromm
This patch adds the usb driver source file most_usb.c and
modifies the Makefile and Kconfig accordingly.

Signed-off-by: Christian Gromm 
---
v2:
Reported-by: Greg Kroah-Hartman 
- don't remove usb driver from staging area
- don't touch staging/most/Kconfig
- remove subdirectory for USB driver and put source file into
  drivers/most
v3:
- submitted fixes found during code audit to staging version
  first to be able to resend single patch that adds the driver
v4:
Reported-by: Dan Carpenter 

submitted patch set that fixes issues found during code audit
to staging version first to be able to resend single patch that
adds the driver. The patch series included:

- use function sysfs_streq
- add missing put_device calls
- use correct error codes
- replace code to calculate array index
- don't use error path to exit function on success
- move allocation of URB out of critical section
- return 0 instead of variable
- change return value of function drci_rd_reg
- don't use expressions that might fail in a declaration
- change order of function parameters

v5:
Reported-by: Dan Carpenter 

submitted patch set that fixes issues found during code audit
to staging version first to be able to resend single patch that
adds the driver. The patch series included:

- init return value in default path of switch/case expression

 drivers/most/Kconfig|   12 +
 drivers/most/Makefile   |2 +
 drivers/most/most_usb.c | 1170 +++
 3 files changed, 1184 insertions(+)
 create mode 100644 drivers/most/most_usb.c

diff --git a/drivers/most/Kconfig b/drivers/most/Kconfig
index 58d7999..7b65320 100644
--- a/drivers/most/Kconfig
+++ b/drivers/most/Kconfig
@@ -13,3 +13,15 @@ menuconfig MOST
  module will be called most_core.
 
  If in doubt, say N here.
+
+if MOST
+config MOST_USB_HDM
+   tristate "USB"
+   depends on USB && NET
+   help
+ Say Y here if you want to connect via USB to network transceiver.
+ This device driver depends on the networking AIM.
+
+ To compile this driver as a module, choose M here: the
+ module will be called most_usb.
+endif
diff --git a/drivers/most/Makefile b/drivers/most/Makefile
index e810cd3..6a3cb90 100644
--- a/drivers/most/Makefile
+++ b/drivers/most/Makefile
@@ -2,3 +2,5 @@
 obj-$(CONFIG_MOST) += most_core.o
 most_core-y := core.o \
configfs.o
+
+obj-$(CONFIG_MOST_USB_HDM) += most_usb.o
diff --git a/drivers/most/most_usb.c b/drivers/most/most_usb.c
new file mode 100644
index 000..2640c5b
--- /dev/null
+++ b/drivers/most/most_usb.c
@@ -0,0 +1,1170 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * usb.c - Hardware dependent module for USB
+ *
+ * Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define USB_MTU512
+#define NO_ISOCHRONOUS_URB 0
+#define AV_PACKETS_PER_XACT2
+#define BUF_CHAIN_SIZE 0x
+#define MAX_NUM_ENDPOINTS  30
+#define MAX_SUFFIX_LEN 10
+#define MAX_STRING_LEN 80
+#define MAX_BUF_SIZE   0x
+
+#define USB_VENDOR_ID_SMSC 0x0424  /* VID: SMSC */
+#define USB_DEV_ID_BRDG0xC001  /* PID: USB Bridge */
+#define USB_DEV_ID_OS81118 0xCF18  /* PID: USB OS81118 */
+#define USB_DEV_ID_OS81119 0xCF19  /* PID: USB OS81119 */
+#define USB_DEV_ID_OS81210 0xCF30  /* PID: USB OS81210 */
+/* DRCI Addresses */
+#define DRCI_REG_NI_STATE  0x0100
+#define DRCI_REG_PACKET_BW 0x0101
+#define DRCI_REG_NODE_ADDR 0x0102
+#define DRCI_REG_NODE_POS  0x0103
+#define DRCI_REG_MEP_FILTER0x0140
+#define DRCI_REG_HASH_TBL0 0x0141
+#define DRCI_REG_HASH_TBL1 0x0142
+#define DRCI_REG_HASH_TBL2 0x0143
+#define DRCI_REG_HASH_TBL3 0x0144
+#define DRCI_REG_HW_ADDR_HI0x0145
+#define DRCI_REG_HW_ADDR_MI0x0146
+#define DRCI_REG_HW_ADDR_LO0x0147
+#define DRCI_REG_BASE  0x1100
+#define DRCI_COMMAND   0x02
+#define DRCI_READ_REQ  0xA0
+#define DRCI_WRITE_REQ 0xA1
+
+/**
+ * struct most_dci_obj - Direct Communication Interface
+ * @kobj:position in sysfs
+ * @usb_device: pointer to the usb device
+ * @reg_addr: register address for arbitrary DCI access
+ */
+struct most_dci_obj {
+   struct device dev;
+   struct usb_device *usb_device;
+   u16 reg_addr;
+};
+
+#define to_dci_obj(p) container_of(p, struct most_dci_obj, dev)
+
+struct most_dev;
+
+struct clear_hold_work {
+   struct work_struct ws;
+   struct most_dev *mdev;
+   unsigned int channel;
+   int pipe;
+};
+
+#d

[PATCH] staging: rtl8712: use common ieee80211 constants

2020-07-01 Thread Michael Straube
Many defined constants in wifi.h are unused and/or available from
, some with slightly different names. Use the
common ones, rename where necessary and remove unused.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c |  2 +-
 drivers/staging/rtl8712/rtl871x_mlme.c|  8 +--
 drivers/staging/rtl8712/wifi.h| 51 ---
 3 files changed, 5 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 36c89cde525d..81482d5ae1a3 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1411,7 +1411,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2);
memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
bw_40MHz = (le16_to_cpu(pht_capie->cap_info) &
-   IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
+   IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
short_GI = (le16_to_cpu(pht_capie->cap_info) &
(IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c 
b/drivers/staging/rtl8712/rtl871x_mlme.c
index efd75add8e35..9ee1bfac0763 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -1660,14 +1660,14 @@ unsigned int r8712_restructure_ht_ie(struct _adapter 
*padapter, u8 *in_ie,
}
out_len = *pout_len;
memset(&ht_capie, 0, sizeof(struct rtl_ieee80211_ht_cap));
-   ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH |
+   ht_capie.cap_info = 
cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40 |
IEEE80211_HT_CAP_TX_STBC |
IEEE80211_HT_CAP_MAX_AMSDU |
IEEE80211_HT_CAP_DSSSCCK40);
-   ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR &
-   0x03) | (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
+   ht_capie.ampdu_params_info = (IEEE80211_HT_AMPDU_PARM_FACTOR &
+   0x03) | (IEEE80211_HT_AMPDU_PARM_DENSITY & 
0x00);
r8712_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_,
 sizeof(struct rtl_ieee80211_ht_cap),
 (unsigned char *)&ht_capie, pout_len);
@@ -1705,7 +1705,7 @@ static void update_ht_cap(struct _adapter *padapter, u8 
*pie, uint ie_len)
if (p && len > 0) {
pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2);
max_ampdu_sz = (pht_capie->ampdu_params_info &
-   IEEE80211_HT_CAP_AMPDU_FACTOR);
+   IEEE80211_HT_AMPDU_PARM_FACTOR);
/* max_ampdu_sz (kbytes); */
max_ampdu_sz = 1 << (max_ampdu_sz + 3);
phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 66e0634f07ba..601d4ff607bc 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -437,13 +437,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
  
*--
  */
 
-/* block-ack parameters */
-#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
-#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C
-#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0
-#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
-#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
-
 #define SetOrderBit(pbuf) ({ \
*(__le16 *)(pbuf) |= cpu_to_le16(_ORDER_); \
 })
@@ -481,49 +474,5 @@ struct ieee80211_ht_addt_info {
unsigned char   basic_set[16];
 } __packed;
 
-/* 802.11n HT capabilities masks */
-#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002
-#define IEEE80211_HT_CAP_SM_PS 0x000C
-#define IEEE80211_HT_CAP_GRN_FLD   0x0010
-#define IEEE80211_HT_CAP_SGI_200x0020
-#define IEEE80211_HT_CAP_SGI_400x0040
-#define IEEE80211_HT_CAP_TX_STBC   0x0080
-#define IEEE80211_HT_CAP_DELAY_BA  0x0400
-#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
-#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
-/* 802.11n HT capability AMPDU settings */
-#define IEEE80211_HT_CAP_AMPDU_FACTOR  0x03
-#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
-/* 802.11n HT capability MSC set */
-#define IEEE80211_SUPP_MCS_SET_UEQM4
-#define IEEE80211_HT_CAP_MAX_STREAMS   4
-#define IEEE80211_SUPP_MCS_S

[PATCH] Staging: atomisp: Fix __func__ style warnings

2020-07-01 Thread Baidyanath Kundu
This patch fixes the checkpatch.pl warning:

Prefer using '"%s...", __func__' to using '',
this function's name, in a string

Signed-off-by: Baidyanath Kundu 
---
 .../atomisp/pci/base/refcount/src/refcount.c  | 28 +--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c 
b/drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c
index cf02737cf8d4..a9c881631f4a 100644
--- a/drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c
+++ b/drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c
@@ -48,7 +48,7 @@ static struct ia_css_refcount_entry 
*refcount_find_entry(ia_css_ptr ptr,
return NULL;
if (!myrefcount.items) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
-   "refcount_find_entry(): Ref count not 
initialized!\n");
+   "%s(): Ref count not initialized!\n", 
__func__);
return NULL;
}
 
@@ -73,12 +73,12 @@ int ia_css_refcount_init(uint32_t size)
 
if (size == 0) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_init(): Size of 0 for Ref 
count init!\n");
+   "%s(): Size of 0 for Ref count init!\n", 
__func__);
return -EINVAL;
}
if (myrefcount.items) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_init(): Ref count is 
already initialized\n");
+   "%s(): Ref count is already initialized\n", 
__func__);
return -EINVAL;
}
myrefcount.items =
@@ -99,7 +99,7 @@ void ia_css_refcount_uninit(void)
u32 i;
 
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_uninit() entry\n");
+   "%s() entry\n", __func__);
for (i = 0; i < myrefcount.size; i++) {
/* driver verifier tool has issues with &arr[i]
   and prefers arr + i; as these are actually equivalent
@@ -120,7 +120,7 @@ void ia_css_refcount_uninit(void)
myrefcount.items = NULL;
myrefcount.size = 0;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_uninit() leave\n");
+   "%s() leave\n", __func__);
 }
 
 ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr)
@@ -133,7 +133,7 @@ ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr)
entry = refcount_find_entry(ptr, false);
 
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_increment(%x) 0x%x\n", id, ptr);
+   "%s(%x) 0x%x\n", __func__, id, ptr);
 
if (!entry) {
entry = refcount_find_entry(ptr, true);
@@ -145,7 +145,7 @@ ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr)
 
if (entry->id != id) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
-   "ia_css_refcount_increment(): Ref count IDS 
do not match!\n");
+   "%s(): Ref count IDS do not match!\n", 
__func__);
return mmgr_NULL;
}
 
@@ -165,7 +165,7 @@ bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr)
struct ia_css_refcount_entry *entry;
 
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_refcount_decrement(%x) 0x%x\n", id, ptr);
+   "%s(%x) 0x%x\n", __func__, id, ptr);
 
if (ptr == mmgr_NULL)
return false;
@@ -175,7 +175,7 @@ bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr)
if (entry) {
if (entry->id != id) {
ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
-   "ia_css_refcount_decrement(): Ref 
count IDS do not match!\n");
+   "%s(): Ref count IDS do not 
match!\n", __func__);
return false;
}
if (entry->count > 0) {
@@ -225,8 +225,8 @@ void ia_css_refcount_clear(s32 id, clear_func 
clear_func_ptr)
u32 count = 0;
 
assert(clear_func_ptr);
-   ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_refcount_clear(%x)\n",
-   id);
+   ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%s(%x)\n",
+   __func__, id);
 
for (i = 0; i < myrefcount.size; i++) {
/* driver verifier tool has issues with &arr[i]
@@ -236,14 +236,14 @@ void ia_css_refcount_clear(s32 id, clear_func 
clear_func_ptr)
entry = myrefcount.items + i;
if ((entry->data != mmgr_NULL) && (entry->id == id)) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
-   "ia_css_ref

[PATCH] staging: rtl8188eu: remove unused parameter

2020-07-01 Thread Michael Straube
Remove unused parameter 'padapter' from rtw_os_xmit_resource_alloc().

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c  | 6 +++---
 drivers/staging/rtl8188eu/include/xmit_osdep.h | 3 +--
 drivers/staging/rtl8188eu/os_dep/xmit_linux.c  | 3 +--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 258531bc1408..1b12afd33d95 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -124,10 +124,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, 
struct adapter *padapter)
pxmitbuf->ext_tag = false;
 
/* Tx buf allocation may fail sometimes, so sleep and retry. */
-   res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, 
(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
+   res = rtw_os_xmit_resource_alloc(pxmitbuf, (MAX_XMITBUF_SZ + 
XMITBUF_ALIGN_SZ));
if (res == _FAIL) {
msleep(10);
-   res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, 
(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
+   res = rtw_os_xmit_resource_alloc(pxmitbuf, 
(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
if (res == _FAIL)
goto exit;
}
@@ -162,7 +162,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
pxmitbuf->padapter = padapter;
pxmitbuf->ext_tag = true;
 
-   res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, 
max_xmit_extbuf_size + XMITBUF_ALIGN_SZ);
+   res = rtw_os_xmit_resource_alloc(pxmitbuf, max_xmit_extbuf_size 
+ XMITBUF_ALIGN_SZ);
if (res == _FAIL) {
res = _FAIL;
goto exit;
diff --git a/drivers/staging/rtl8188eu/include/xmit_osdep.h 
b/drivers/staging/rtl8188eu/include/xmit_osdep.h
index 5283a6d53700..5fd8ca51f156 100644
--- a/drivers/staging/rtl8188eu/include/xmit_osdep.h
+++ b/drivers/staging/rtl8188eu/include/xmit_osdep.h
@@ -22,8 +22,7 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct  net_device 
*pnetdev);
 
 void rtw_os_xmit_schedule(struct adapter *padapter);
 
-int rtw_os_xmit_resource_alloc(struct adapter *padapter,
-  struct xmit_buf *pxmitbuf, u32 alloc_sz);
+int rtw_os_xmit_resource_alloc(struct xmit_buf *pxmitbuf, u32 alloc_sz);
 void rtw_os_xmit_resource_free(struct xmit_buf *pxmitbuf);
 
 void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt);
diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c 
b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
index 017e1d628461..3ca1dc30efb7 100644
--- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
@@ -14,8 +14,7 @@
 #include 
 #include 
 
-int rtw_os_xmit_resource_alloc(struct adapter *padapter,
-  struct xmit_buf *pxmitbuf, u32 alloc_sz)
+int rtw_os_xmit_resource_alloc(struct xmit_buf *pxmitbuf, u32 alloc_sz)
 {
int i;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[driver-core:debugfs_cleanup] BUILD SUCCESS 80e37912bf208f2c9ceeedb16213f0ff0a743f0a

2020-07-01 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git  
debugfs_cleanup
branch HEAD: 80e37912bf208f2c9ceeedb16213f0ff0a743f0a  debugfs: remove return 
value of debugfs_create_devm_seqfile()

elapsed time: 3430m

configs tested: 128
configs skipped: 13

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
mips tb0287_defconfig
powerpc  mpc866_ads_defconfig
mips  pistachio_defconfig
sparc64  allyesconfig
arm ebsa110_defconfig
powerpc  g5_defconfig
mipse55_defconfig
s390 alldefconfig
riscv  rv32_defconfig
c6xevmc6457_defconfig
powerpc ep8248e_defconfig
arm   omap1_defconfig
armoxnas_v6_defconfig
openriscor1ksim_defconfig
powerpc   allnoconfig
m68k  hp300_defconfig
sh espt_defconfig
arm   stm32_defconfig
sparc   sparc64_defconfig
m68k  allnoconfig
mips   mtx1_defconfig
arm orion5x_defconfig
mipsbcm63xx_defconfig
arm pxa_defconfig
mips pnx8335_stb225_defconfig
mips  pic32mzda_defconfig
mips   xway_defconfig
sh  rts7751r2d1_defconfig
arm   viper_defconfig
powerpc  ppc44x_defconfig
arm  moxart_defconfig
shsh7763rdp_defconfig
armmvebu_v7_defconfig
arm  exynos_defconfig
c6xevmc6474_defconfig
mips   gcw0_defconfig
mips decstation_defconfig
arcnsim_700_defconfig
mips   rbtx49xx_defconfig
i386  allnoconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
nds32   defconfig
nds32 allnoconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc defconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
i386 randconfig-a006-20200629
i386 randconfig-a002-20200629
i386 randconfig-a003-20200629
i386 randconfig-a001-20200629
i386 randconfig-a005-20200629
i386 randconfig-a004-20200629
i386 randconfig-a013-20200629
i386 randconfig-a016-20200629
i386 randconfig-a014-20200629
i386   

[PATCH] staging: rtl8188eu: use common ieee80211 constants

2020-07-01 Thread Michael Straube
Many defined constants in wifi.h are unused and/or available from
, some with slightly different names. Use the
common ones, rename where necessary and remove unused.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c   | 12 ++---
 drivers/staging/rtl8188eu/core/rtw_mlme.c |  6 +--
 drivers/staging/rtl8188eu/include/wifi.h  | 46 ---
 .../staging/rtl8188eu/os_dep/ioctl_linux.c|  2 +-
 4 files changed, 10 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 817793b9aff2..41535441f82c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -535,7 +535,7 @@ void update_sta_info_apmode(struct adapter *padapter, 
struct sta_info *psta)
/*  bwmode */
if (le16_to_cpu(phtpriv_sta->ht_cap.cap_info &
phtpriv_ap->ht_cap.cap_info) &
-   IEEE80211_HT_CAP_SUP_WIDTH) {
+   IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
}
@@ -925,12 +925,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
 
if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
-   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
+   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_AMPDU_PARM_DENSITY & (0x07 << 2));
else
-   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
+   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
 
/* set  Max Rx AMPDU size  to 64K */
-   pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 
0x03);
+   pht_cap->ampdu_params_info |= (IEEE80211_HT_AMPDU_PARM_FACTOR & 
0x03);
 
pht_cap->mcs.rx_mask[0] = 0xff;
pht_cap->mcs.rx_mask[1] = 0x0;
@@ -1307,7 +1307,7 @@ static int rtw_ht_operation_update(struct adapter 
*padapter)
(pmlmepriv->ht_op_mode & 
HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT))
new_op_mode = OP_MODE_MIXED;
else if ((le16_to_cpu(phtpriv_ap->ht_cap.cap_info) &
- IEEE80211_HT_CAP_SUP_WIDTH) &&
+ IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
 pmlmepriv->num_sta_ht_20mhz)
new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
else if (pmlmepriv->olbc_ht)
@@ -1457,7 +1457,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
pmlmepriv->num_sta_ht_no_gf);
}
 
-   if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH) == 0) {
+   if ((ht_capab & IEEE80211_HT_CAP_SUP_WIDTH_20_40) == 0) {
if (!psta->ht_20mhz_set) {
psta->ht_20mhz_set = 1;
pmlmepriv->num_sta_ht_20mhz++;
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index b291ee6ca8f4..5d7a749f1aac 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -1882,7 +1882,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter 
*padapter, u8 *in_ie, u8 *out_
 
memset(&ht_cap, 0, sizeof(struct ieee80211_ht_cap));
 
-   ht_cap.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH |
+   ht_cap.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
  IEEE80211_HT_CAP_SGI_20 |
  IEEE80211_HT_CAP_SGI_40 |
  IEEE80211_HT_CAP_TX_STBC |
@@ -1900,9 +1900,9 @@ unsigned int rtw_restructure_ht_ie(struct adapter 
*padapter, u8 *in_ie, u8 *out_
ht_cap.ampdu_params_info = max_rx_ampdu_factor & 0x03;
 
if (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
-   ht_cap.ampdu_params_info |= 
IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2);
+   ht_cap.ampdu_params_info |= 
IEEE80211_HT_AMPDU_PARM_DENSITY & (0x07 << 2);
else
-   ht_cap.ampdu_params_info |= 
IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00;
+   ht_cap.ampdu_params_info |= 
IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00;
 
rtw_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_,
   sizeof(struct ieee80211_ht_cap),
diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index e12e3d0a45e0..791f287a546d 100644
--- a/drivers/staging/rtl8188

[PATCH 0/2] staging: rtl8712: Minor cleanups

2020-07-01 Thread Mauro Dreissig
This series applies minor cleanups for rtl8712 staging driver.

Mauro Dreissig (2):
  staging: rtl8712: Replace FIELD_OFFSET() with offsetof()
  staging: rtl8712: base_types: Remove unused macros

 drivers/staging/rtl8712/basic_types.h | 8 
 drivers/staging/rtl8712/hal_init.c| 4 ++--
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 ++--
 3 files changed, 4 insertions(+), 12 deletions(-)

-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rtl8712: Replace FIELD_OFFSET() with offsetof()

2020-07-01 Thread Mauro Dreissig
Use the existing offsetof() macro instead of duplicating code.

Signed-off-by: Mauro Dreissig 
---
 drivers/staging/rtl8712/basic_types.h | 1 -
 drivers/staging/rtl8712/hal_init.c| 4 ++--
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/basic_types.h 
b/drivers/staging/rtl8712/basic_types.h
index 4ad7f35b1644..b8ecd92ca9d4 100644
--- a/drivers/staging/rtl8712/basic_types.h
+++ b/drivers/staging/rtl8712/basic_types.h
@@ -21,7 +21,6 @@
 
 #define SIZE_T __kernel_size_t
 #define sint signed int
-#define FIELD_OFFSET(s, field) ((addr_t)&((s *)(0))->field)
 
 /* Should we extend this to be host_addr_t and target_addr_t for case:
  * host : x86_64
diff --git a/drivers/staging/rtl8712/hal_init.c 
b/drivers/staging/rtl8712/hal_init.c
index 40145c0338e4..7293cdc3a43b 100644
--- a/drivers/staging/rtl8712/hal_init.c
+++ b/drivers/staging/rtl8712/hal_init.c
@@ -133,7 +133,7 @@ static u8 chk_fwhdr(struct fw_hdr *pfwhdr, u32 ulfilelength)
if (pfwhdr->fw_priv_sz != sizeof(struct fw_priv))
return _FAIL;
/* check fw_sz & image_fw_sz */
-   fwhdrsz = FIELD_OFFSET(struct fw_hdr, fwpriv) + pfwhdr->fw_priv_sz;
+   fwhdrsz = offsetof(struct fw_hdr, fwpriv) + pfwhdr->fw_priv_sz;
fw_sz =  fwhdrsz + pfwhdr->img_IMEM_size + pfwhdr->img_SRAM_size +
 pfwhdr->dmem_size;
if (fw_sz != ulfilelength)
@@ -173,7 +173,7 @@ static u8 rtl8712_dl_fw(struct _adapter *adapter)
txdesc = (struct tx_desc *)(tmpchar + FWBUFF_ALIGN_SZ -
((addr_t)(tmpchar) & (FWBUFF_ALIGN_SZ - 1)));
payload = (u8 *)(txdesc) + txdscp_sz;
-   ptr = (u8 *)mappedfw + FIELD_OFFSET(struct fw_hdr, fwpriv) +
+   ptr = (u8 *)mappedfw + offsetof(struct fw_hdr, fwpriv) +
  fwhdr.fw_priv_sz;
/* Download FirmWare */
/* 1. determine IMEM code size and Load IMEM Code Section */
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 36c89cde525d..90ffb7c9f299 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -407,7 +407,7 @@ static int wpa_set_encryption(struct net_device *dev, 
struct ieee_param *param,
return -ENOMEM;
pwep->KeyLength = wep_key_len;
pwep->Length = wep_key_len +
-   FIELD_OFFSET(struct NDIS_802_11_WEP, KeyMaterial);
+   offsetof(struct NDIS_802_11_WEP, KeyMaterial);
if (wep_key_len == 13) {
padapter->securitypriv.PrivacyAlgrthm = _WEP104_;
padapter->securitypriv.XGrpPrivacy = _WEP104_;
@@ -1555,7 +1555,7 @@ static int r8711_wx_set_enc(struct net_device *dev,
if (erq->length > 0) {
wep.KeyLength = erq->length <= 5 ? 5 : 13;
wep.Length = wep.KeyLength +
-FIELD_OFFSET(struct NDIS_802_11_WEP, KeyMaterial);
+offsetof(struct NDIS_802_11_WEP, KeyMaterial);
} else {
wep.KeyLength = 0;
if (keyindex_provided == 1) { /* set key_id only, no given
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8712: base_types: Remove unused macros

2020-07-01 Thread Mauro Dreissig
Those #define's are not used anywhere, get rid of them.

Signed-off-by: Mauro Dreissig 
---
 drivers/staging/rtl8712/basic_types.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8712/basic_types.h 
b/drivers/staging/rtl8712/basic_types.h
index b8ecd92ca9d4..aecded87dd4c 100644
--- a/drivers/staging/rtl8712/basic_types.h
+++ b/drivers/staging/rtl8712/basic_types.h
@@ -14,12 +14,8 @@
 #ifndef __BASIC_TYPES_H__
 #define __BASIC_TYPES_H__
 
-#define SUCCESS0
-#define FAIL   (-1)
-
 #include 
 
-#define SIZE_T __kernel_size_t
 #define sint signed int
 
 /* Should we extend this to be host_addr_t and target_addr_t for case:
@@ -28,8 +24,5 @@
  */
 #define addr_t unsigned long
 
-#define MEM_ALIGNMENT_OFFSET   (sizeof(SIZE_T))
-#define MEM_ALIGNMENT_PADDING  (sizeof(SIZE_T) - 1)
-
 #endif /*__BASIC_TYPES_H__*/
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v6 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-01 Thread Jim Quinlan
The new field 'dma_range_map' in struct device is used to facilitate the
use of single or multiple offsets between mapping regions of cpu addrs and
dma addrs.  It subsumes the role of "dev->dma_pfn_offset" which was only
capable of holding a single uniform offset and had no region bounds
checking.

The function of_dma_get_range() has been modified so that it takes a single
argument -- the device node -- and returns a map, NULL, or an error code.
The map is an array that holds the information regarding the DMA regions.
Each range entry contains the address offset, the cpu_start address, the
dma_start address, and the size of the region.

of_dma_configure() is the typical manner to set range offsets but there are
a number of ad hoc assignments to "dev->dma_pfn_offset" in the kernel
driver code.  These cases now invoke the function
dma_attach_offset_range(dev, cpu_addr, dma_addr, size).

Signed-off-by: Jim Quinlan 
---
 arch/arm/include/asm/dma-mapping.h|  9 +-
 arch/arm/mach-keystone/keystone.c | 17 ++--
 arch/sh/drivers/pci/pcie-sh7786.c |  9 +-
 arch/sh/kernel/dma-coherent.c | 14 +--
 arch/x86/pci/sta2x11-fixup.c  |  7 +-
 drivers/acpi/arm64/iort.c |  5 +-
 drivers/gpu/drm/sun4i/sun4i_backend.c |  7 +-
 drivers/iommu/io-pgtable-arm.c|  2 +-
 .../platform/sunxi/sun4i-csi/sun4i_csi.c  |  6 +-
 .../platform/sunxi/sun6i-csi/sun6i_csi.c  |  5 +-
 drivers/of/address.c  | 95 ++-
 drivers/of/device.c   | 50 ++
 drivers/of/of_private.h   |  9 +-
 drivers/of/unittest.c | 35 +--
 drivers/remoteproc/remoteproc_core.c  |  2 +-
 .../staging/media/sunxi/cedrus/cedrus_hw.c|  8 +-
 drivers/usb/core/message.c|  4 +-
 drivers/usb/core/usb.c|  2 +-
 include/linux/device.h|  4 +-
 include/linux/dma-direct.h| 10 +-
 include/linux/dma-mapping.h   | 37 
 kernel/dma/coherent.c | 11 ++-
 kernel/dma/mapping.c  | 53 +++
 23 files changed, 279 insertions(+), 122 deletions(-)

diff --git a/arch/arm/include/asm/dma-mapping.h 
b/arch/arm/include/asm/dma-mapping.h
index bdd80ddbca34..b6796383f205 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -35,8 +35,9 @@ static inline const struct dma_map_ops 
*get_arch_dma_ops(struct bus_type *bus)
 #ifndef __arch_pfn_to_dma
 static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
 {
-   if (dev)
-   pfn -= dev->dma_pfn_offset;
+   if (dev && dev->dma_range_map)
+   pfn -= (unsigned long)PFN_DOWN(dma_offset_from_phys_addr(dev, 
PFN_PHYS(pfn)));
+
return (dma_addr_t)__pfn_to_bus(pfn);
 }
 
@@ -44,8 +45,8 @@ static inline unsigned long dma_to_pfn(struct device *dev, 
dma_addr_t addr)
 {
unsigned long pfn = __bus_to_pfn(addr);
 
-   if (dev)
-   pfn += dev->dma_pfn_offset;
+   if (dev && dev->dma_range_map)
+   pfn += (unsigned long)PFN_DOWN(dma_offset_from_dma_addr(dev, 
addr));
 
return pfn;
 }
diff --git a/arch/arm/mach-keystone/keystone.c 
b/arch/arm/mach-keystone/keystone.c
index 638808c4e122..a499ece6f054 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -8,6 +8,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -24,8 +25,6 @@
 
 #include "keystone.h"
 
-static unsigned long keystone_dma_pfn_offset __read_mostly;
-
 static int keystone_platform_notifier(struct notifier_block *nb,
  unsigned long event, void *data)
 {
@@ -38,9 +37,12 @@ static int keystone_platform_notifier(struct notifier_block 
*nb,
return NOTIFY_BAD;
 
if (!dev->of_node) {
-   dev->dma_pfn_offset = keystone_dma_pfn_offset;
-   dev_err(dev, "set dma_pfn_offset%08lx\n",
-   dev->dma_pfn_offset);
+   int ret = dma_attach_offset_range(dev, KEYSTONE_HIGH_PHYS_START,
+ KEYSTONE_LOW_PHYS_START,
+ KEYSTONE_HIGH_PHYS_SIZE);
+   dev_err(dev, "set dma_offset%08llx%s\n", 
KEYSTONE_HIGH_PHYS_START
+   - KEYSTONE_LOW_PHYS_START, ret ? " failed" : "");
+
}
return NOTIFY_OK;
 }
@@ -51,11 +53,8 @@ static struct notifier_block platform_nb = {
 
 static void __init keystone_init(void)
 {
-   if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START) {
-   keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START -
-  KEYSTONE_LOW_PHYS_START);
+   if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START)
bus_

[PATCH v6 00/12] PCI: brcmstb: enable PCIe for STB chips

2020-07-01 Thread Jim Quinlan
Patchset Summary:
  Enhance a PCIe host controller driver.  Because of its unusual design
  we are foced to change dev->dma_pfn_offset into a more general role
  allowing multiple offsets.  See the 'v1' notes below for more info.

v6:
  Commit "device core: Introduce DMA range map":
  -- of_dma_get_range() now takes a single argument and returns either
 NULL, a valid map, or an ERR_PTR. (Robin)
  -- offsets are no longer a PFN value but an actual address. (Robin)
  -- the bus_dma_region struct stores the range size instead of
 the cpu_end and pci_end values. (Robin)
  -- devices that were setting a single offset with no boundaries
 have been modified to have boundaries; in a few places
 where this informatino was unavilable a /* FIXME: ... */
 comment was added. (Robin)
  -- dma_attach_offset_range() can be called when an offset
 map already exists; if it's range is already present
 nothing is done and success is returned. (Robin)
  All commits:
  -- Man name/style/corrections/etc changed (Bjorn)
  -- rebase to Torvalds master

v5:
  Commit "device core: Introduce multiple dma pfn offsets"
  -- in of/address.c: "map_size = 0" => "*map_size = 0"
  -- use kcalloc instead of kzalloc (AndyS)
  -- use PHYS_ADDR_MAX instead of "~(phys_addr_t)0"
  Commit "PCI: brcmstb: Set internal memory viewport sizes"
  -- now gives error on missing dma-ranges property.
  Commit "dt-bindings: PCI: Add bindings for more Brcmstb chips"
  -- removed "Allof:" from brcm,scb-sizes definition (RobH)
  All Commits:
  -- indentation style, use max chars 100 (AndyS)
  -- rebased to torvalds master

v4:
  Commit "device core: Introduce multiple dma pfn offsets"
  -- of_dma_get_range() does not take a dev param but instead
 takes two "out" params: map and map_size.  We do this so
 that the code that parses dma-ranges is separate from
 the code that modifies 'dev'.   (Nicolas)
  -- the separate case of having a single pfn offset has
 been removed and is now processed by going through the
 map array. (Nicolas)
  -- move attach_uniform_dma_pfn_offset() from of/address.c to
 dma/mapping.c so that it does not depend on CONFIG_OF. (Nicolas)
  -- devm_kcalloc => devm_kzalloc (DanC)
  -- add/fix assignment to dev->dma_pfn_offset_map for func
 attach_uniform_dma_pfn_offset() (DanC, Nicolas)
  -- s/struct dma_pfn_offset_region/struct bus_dma_region/ (Nicolas)
  -- s/attach_uniform_dma_pfn_offset/dma_attach_uniform_pfn_offset/
  -- s/attach_dma_pfn_offset_map/dma_attach_pfn_offset_map/
  -- More use of PFN_{PHYS,DOWN,UP}. (AndyS)
  Commit "of: Include a dev param in of_dma_get_range()"
  -- this commit was sqaushed with "device core: Introduce ..."

v3:
  Commit "device core: Introduce multiple dma pfn offsets"
  Commit "arm: dma-mapping: Invoke dma offset func if needed"
  -- The above two commits have been squashed.  More importantly,
 the code has been modified so that the functionality for
 multiple pfn offsets subsumes the use of dev->dma_pfn_offset.
 In fact, dma_pfn_offset is removed and supplanted by
 dma_pfn_offset_map, which is a pointer to an array.  The
 more common case of a uniform offset is now handled as
 a map with a single entry, while cases requiring multiple
 pfn offsets use a map with multiple entries.  Code paths
 that used to do this:

 dev->dma_pfn_offset = mydrivers_pfn_offset;

 have been changed to do this:

 attach_uniform_dma_pfn_offset(dev, pfn_offset);

  Commit "dt-bindings: PCI: Add bindings for more Brcmstb chips"
  -- Add if/then clause for required props: resets, reset-names (RobH)
  -- Change compatible list from const to enum (RobH)
  -- Change list of u32-tuples to u64 (RobH)

  Commit "of: Include a dev param in of_dma_get_range()"
  -- modify of/unittests.c to add NULL param in of_dma_get_range() call.

  Commit "device core: Add ability to handle multiple dma offsets"
  -- align comment in device.h (AndyS).
  -- s/cpu_beg/cpu_start/ and s/dma_beg/dma_start/ in struct
 dma_pfn_offset_region (AndyS).

v2:
Commit: "device core: Add ability to handle multiple dma offsets"
  o Added helper func attach_dma_pfn_offset_map() in address.c (Chistoph)
  o Helpers funcs added to __phys_to_dma() & __dma_to_phys() (Christoph)
  o Added warning when multiple offsets are needed and !DMA_PFN_OFFSET_MAP
  o dev->dma_pfn_map => dev->dma_pfn_offset_map
  o s/frm/from/ for dma_pfn_offset_frm_{phys,dma}_addr() (Christoph)
  o In device.h: s/const void */const struct dma_pfn_offset_region */
  o removed 'unlikely' from unlikely(dev->dma_pfn_offset_map) since
guarded by CONFIG_DMA_PFN_OFFSET_MAP (Christoph)
  o Since dev->dma_pfn_offset is copied in usb/core/{usb,message}.c, now
dev->dma_pfn_offset_map is copied as well.
  o Merged two of the DMA commits into one (Christoph).

Commit "arm: dma-mapping: Invoke dma offset func if needed":
  o Use helper functions instead of #if CONFIG_DMA_PFN_OFFSET

Other commits' 

[PATCH AUTOSEL 5.7 12/53] staging: wfx: fix coherency of hif_scan() prototype

2020-07-01 Thread Sasha Levin
From: Jérôme Pouiller 

[ Upstream commit 29de523a6270a308d12d21f4fecf52dac491e226 ]

The function hif_scan() return the timeout for the completion of the
scan request. It is the only function from hif_tx.c that return another
thing than just an error code. This behavior is not coherent with the
rest of file. Worse, if value returned is positive, the caller can't
make say if it is a timeout or the value returned by the hardware.

Uniformize API with other HIF functions, only return the error code and
pass timeout with parameters.

Signed-off-by: Jérôme Pouiller 
Link: 
https://lore.kernel.org/r/20200529121256.1045521-1-jerome.pouil...@silabs.com
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Sasha Levin 
---
 drivers/staging/wfx/hif_tx.c | 6 --
 drivers/staging/wfx/hif_tx.h | 2 +-
 drivers/staging/wfx/scan.c   | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 20b3045d76674..15ff60a584668 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -222,7 +222,7 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 
mib_id, void *val,
 }
 
 int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
-int chan_start_idx, int chan_num)
+int chan_start_idx, int chan_num, int *timeout)
 {
int ret, i;
struct hif_msg *hif;
@@ -269,11 +269,13 @@ int hif_scan(struct wfx_vif *wvif, struct 
cfg80211_scan_request *req,
tmo_chan_fg = 512 * USEC_PER_TU + body->probe_delay;
tmo_chan_fg *= body->num_of_probe_requests;
tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg) + 512 * USEC_PER_TU;
+   if (timeout)
+   *timeout = usecs_to_jiffies(tmo);
 
wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len);
ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
kfree(hif);
-   return ret ? ret : usecs_to_jiffies(tmo);
+   return ret;
 }
 
 int hif_stop_scan(struct wfx_vif *wvif)
diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h
index f8520a14c14cd..7a21338470eeb 100644
--- a/drivers/staging/wfx/hif_tx.h
+++ b/drivers/staging/wfx/hif_tx.h
@@ -43,7 +43,7 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
 int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
  void *buf, size_t buf_size);
 int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
-int chan_start, int chan_num);
+int chan_start, int chan_num, int *timeout);
 int hif_stop_scan(struct wfx_vif *wvif);
 int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
 struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 9aa14331affd6..d47b8a3ba403c 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -56,10 +56,10 @@ static int send_scan_req(struct wfx_vif *wvif,
wfx_tx_lock_flush(wvif->wdev);
wvif->scan_abort = false;
reinit_completion(&wvif->scan_complete);
-   timeout = hif_scan(wvif, req, start_idx, i - start_idx);
-   if (timeout < 0) {
+   ret = hif_scan(wvif, req, start_idx, i - start_idx, &timeout);
+   if (ret) {
wfx_tx_unlock(wvif->wdev);
-   return timeout;
+   return -EIO;
}
ret = wait_for_completion_timeout(&wvif->scan_complete, timeout);
if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower)
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing] BUILD SUCCESS efa30b82ac7553c25405ac56034aecf03c182033

2020-07-01 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-testing
branch HEAD: efa30b82ac7553c25405ac56034aecf03c182033  staging: rtl8188eu: 
core: Fix coding style issue

elapsed time: 725m

configs tested: 110
configs skipped: 4

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
arm   aspeed_g4_defconfig
m68k   m5249evb_defconfig
armmmp2_defconfig
shshmin_defconfig
powerpc  pmac32_defconfig
parisc   allmodconfig
arm  pxa3xx_defconfig
arm   imx_v6_v7_defconfig
powerpc  ppc6xx_defconfig
mips  ath25_defconfig
pariscgeneric-64bit_defconfig
mipsjmr3927_defconfig
mips decstation_r4k_defconfig
i386  allnoconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
nds32   defconfig
nds32 allnoconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
powerpc defconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a002-20200701
i386 randconfig-a001-20200701
i386 randconfig-a006-20200701
i386 randconfig-a005-20200701
i386 randconfig-a004-20200701
i386 randconfig-a003-20200701
x86_64   randconfig-a012-20200701
x86_64   randconfig-a016-20200701
x86_64   randconfig-a014-20200701
x86_64   randconfig-a011-20200701
x86_64   randconfig-a015-20200701
x86_64   randconfig-a013-20200701
i386 randconfig-a011-20200701
i386 randconfig-a015-20200701
i386 randconfig-a014-20200701
i386 randconfig-a016-20200701
i386 randconfig-a012-20200701
i386 randconfig-a013-20200701
riscvallyesconfig
riscv allnoconfig
riscv   defconfig
riscvallmodconfig
s390 allyesconfig
s390  allnoconfig
s390 allmodconfig
s390defconfig
sparcallyesconfig
sparc   defconfig
sparc64 defconfig
sparc64   allnoconfig
sparc64  allyesconfig
sparc64  allmodconfig
um   allmodconfig
umallnoconfig
um

[PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues

2020-07-01 Thread B K Karthik
added blank spaces to improve code readability.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
index 49884cceb349..c115007d883d 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
@@ -30,11 +30,11 @@
 #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \
SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
 #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAdd r +4, 0, 8, __Value)
 #define SET_EARLYMODE_LEN3(__pAddr, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value)
 #define SET_EARLYMODE_LEN4(__pAddr, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value)

 /*  */
 /* defined for TX DESC Operation */
@@ -100,7 +100,7 @@ enum TXDESC_SC {

 #define txdesc_set_ccx_sw_88e(txdesc, value) \
do { \
-   ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \
+   ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); 
\
((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \
} while (0)

@@ -138,9 +138,9 @@ struct txrpt_ccx_88e {
u8 sw0;
 };

-#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8))
+#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 
8))
 #define txrpt_ccx_qtime_88e(txrpt_ccx) \
-   ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
+   ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8))

 void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
   u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull);
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: include: rtw_cmd.h: fixed a blank space coding style issue.

2020-07-01 Thread B K Karthik
add blank spaces for improved code readability.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h 
b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index fa5e212fc9e0..002a797c6d0a 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -115,7 +115,7 @@ struct  setopmode_parm {
  */

 #define RTW_SSID_SCAN_AMOUNT 9 /*  for WEXT_CSCAN_AMOUNT 9 */
-#define RTW_CHANNEL_SCAN_AMOUNT (14+37)
+#define RTW_CHANNEL_SCAN_AMOUNT (14 + 37)
 struct sitesurvey_parm {
int scan_mode;  /* active: 1, passive: 0 */
u8 ssid_num;
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed multiple parentheses coding style issues.

2020-07-01 Thread B K Karthik
add parentheses since complex valued macros must be enclosed within parentheses.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
index 404634999e35..c89328142731 100644
--- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
@@ -84,7 +84,7 @@ struct reportpwrstate_parm {
unsigned short rsvd;
 };

-#define LPS_DELAY_TIME 1*HZ /*  1 sec */
+#define LPS_DELAY_TIME (i*HZ) /*  1 sec */

 #define EXE_PWR_NONE   0x01
 #define EXE_PWR_IPS0x02
@@ -201,7 +201,7 @@ struct pwrctrl_priv {
 };

 #define rtw_get_ips_mode_req(pwrctrlpriv) \
-   (pwrctrlpriv)->ips_mode_req
+   ((pwrctrlpriv)->ips_mode_req)

 #define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \
((pwrctrlpriv)->ips_mode_req = (ips_mode))
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed a blank space coding style issue.

2020-07-01 Thread B K Karthik
add blank spaces to improve code readability.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
index c89328142731..b4cf0f1ce6d3 100644
--- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
@@ -84,7 +84,7 @@ struct reportpwrstate_parm {
unsigned short rsvd;
 };

-#define LPS_DELAY_TIME (1*HZ) /*  1 sec */
+#define LPS_DELAY_TIME (1 * HZ) /*  1 sec */

 #define EXE_PWR_NONE   0x01
 #define EXE_PWR_IPS0x02
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues

2020-07-01 Thread Kees Cook
On Thu, Jul 02, 2020 at 12:48:42AM -0400, B K Karthik wrote:
> added blank spaces to improve code readability.
> 
> Signed-off-by: B K Karthik 
> ---
>  drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h 
> b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
> index 49884cceb349..c115007d883d 100644
> --- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
> +++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
> @@ -30,11 +30,11 @@
>  #define SET_EARLYMODE_LEN2_1(__pAddr, __Value)   \
>   SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
>  #define SET_EARLYMODE_LEN2_2(__pAddr, __Value)   \
> - SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
> + SET_BITS_TO_LE_4BYTE(__pAdd r +4, 0, 8, __Value)
   ^

did this get compile tested? :)

-Kees

>  #define SET_EARLYMODE_LEN3(__pAddr, __Value) \
> - SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
> + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value)
>  #define SET_EARLYMODE_LEN4(__pAddr, __Value) \
> - SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
> + SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value)
> 
>  /*  */
>  /* defined for TX DESC Operation */
> @@ -100,7 +100,7 @@ enum TXDESC_SC {
> 
>  #define txdesc_set_ccx_sw_88e(txdesc, value) \
>   do { \
> - ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \
> + ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); 
> \
>   ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \
>   } while (0)
> 
> @@ -138,9 +138,9 @@ struct txrpt_ccx_88e {
>   u8 sw0;
>  };
> 
> -#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + 
> ((txrpt_ccx)->sw1<<8))
> +#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 
> 8))
>  #define txrpt_ccx_qtime_88e(txrpt_ccx)   \
> - ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
> + ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8))
> 
>  void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
>  u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull);
> --
> 2.20.1
> 



-- 
Kees Cook
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: include: rtw_recv.h: fixed a blank space coding style issue.

2020-07-01 Thread B K Karthik
added blank spaces to improve code readability.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_recv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h 
b/drivers/staging/rtl8188eu/include/rtw_recv.h
index e383cb119e1b..b281b9e7fcea 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -13,7 +13,7 @@
 #define NR_RECVFRAME 256

 #define RXFRAME_ALIGN  8
-#define RXFRAME_ALIGN_SZ   (1<

signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: include: rtl8188e_xmit.h: fixed multiple blank space coding style issues

2020-07-01 Thread B K Karthik
added blank spaces to improve code readability. (coding style issue)

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
index 49884cceb349..c115007d883d 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
@@ -30,11 +30,11 @@
 #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \
SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
 #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAddr + 4, 0, 8, __Value)
 #define SET_EARLYMODE_LEN3(__pAddr, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAddr + 4, 8, 12, __Value)
 #define SET_EARLYMODE_LEN4(__pAddr, __Value)   \
-   SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
+   SET_BITS_TO_LE_4BYTE(__pAddr + 4, 20, 12, __Value)

 /*  */
 /* defined for TX DESC Operation */
@@ -100,7 +100,7 @@ enum TXDESC_SC {

 #define txdesc_set_ccx_sw_88e(txdesc, value) \
do { \
-   ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \
+   ((struct txdesc_88e *)(txdesc))->sw1 = (((value) >> 8) & 0x0f); 
\
((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \
} while (0)

@@ -138,9 +138,9 @@ struct txrpt_ccx_88e {
u8 sw0;
 };

-#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8))
+#define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1 << 
8))
 #define txrpt_ccx_qtime_88e(txrpt_ccx) \
-   ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
+   ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1 << 8))

 void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
   u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull);
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed multiple parentheses coding style issues.

2020-07-01 Thread B K Karthik
add parentheses since complex valued macros must be enclosed within parentheses.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
index 404634999e35..c89328142731 100644
--- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
@@ -84,7 +84,7 @@ struct reportpwrstate_parm {
unsigned short rsvd;
 };

-#define LPS_DELAY_TIME 1*HZ /*  1 sec */
+#define LPS_DELAY_TIME (1*HZ) /*  1 sec */

 #define EXE_PWR_NONE   0x01
 #define EXE_PWR_IPS0x02
@@ -201,7 +201,7 @@ struct pwrctrl_priv {
 };

 #define rtw_get_ips_mode_req(pwrctrlpriv) \
-   (pwrctrlpriv)->ips_mode_req
+   ((pwrctrlpriv)->ips_mode_req)

 #define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \
((pwrctrlpriv)->ips_mode_req = (ips_mode))
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8188eu: include: rtw_pwrctrl.h: fixed a blank space coding style issue.

2020-07-01 Thread B K Karthik
add blank spaces to improve code readability.

Signed-off-by: B K Karthik 
---
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h 
b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
index c89328142731..b4cf0f1ce6d3 100644
--- a/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8188eu/include/rtw_pwrctrl.h
@@ -84,7 +84,7 @@ struct reportpwrstate_parm {
unsigned short rsvd;
 };

-#define LPS_DELAY_TIME (1*HZ) /*  1 sec */
+#define LPS_DELAY_TIME (1 * HZ) /*  1 sec */

 #define EXE_PWR_NONE   0x01
 #define EXE_PWR_IPS0x02
--
2.20.1



signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: include: rtw_cmd.h: fixed a blank space coding style issue.

2020-07-01 Thread Greg Kroah-Hartman
On Thu, Jul 02, 2020 at 12:50:04AM -0400, B K Karthik wrote:
> add blank spaces for improved code readability.
> 
> Signed-off-by: B K Karthik 
> ---
>  drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h 
> b/drivers/staging/rtl8188eu/include/rtw_cmd.h
> index fa5e212fc9e0..002a797c6d0a 100644
> --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
> +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
> @@ -115,7 +115,7 @@ structsetopmode_parm {
>   */
> 
>  #define RTW_SSID_SCAN_AMOUNT 9 /*  for WEXT_CSCAN_AMOUNT 9 */
> -#define RTW_CHANNEL_SCAN_AMOUNT (14+37)
> +#define RTW_CHANNEL_SCAN_AMOUNT (14 + 37)
>  struct sitesurvey_parm {
>   int scan_mode;  /* active: 1, passive: 0 */
>   u8 ssid_num;

You sent 8 patches, some of them duplicates (I think), with no sense of
what order to apply these in.

Please resend them all as a patch series, properly numbered, so that I
have a chance to figure this out, I have dropped all of your patches
from my review queue.

thanks,

greg k-h

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging/wilc1000: let wilc_mac_xmit() to NETDEV_TX_OK

2020-07-01 Thread Kalle Valo
 writes:

> Luc,
>
> Thanks for your patch...
>
> On 28/06/2020 at 20:32, Luc Van Oostenryck wrote:
>> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
>> which is a typedef for an enum type defining 'NETDEV_TX_OK' but this
>> driver returns '0' instead of 'NETDEV_TX_OK'.
>> 
>> Fix this by returning ''NETDEV_TX_OK' instead of 0.
>> 
>> Signed-off-by: Luc Van Oostenryck 
>> ---
>>   drivers/staging/wilc1000/netdev.c | 6 +++---
>
> ... would it be possible that you re-spin it so that it applies to the 
> new location of this driver:
> drivers/net/wireless/microchip/wilc1000/netdev.c
>
> You can rebase your patch on the wireless-driver-next tree with 
> wilc1000-move-out-of-staging branch:
>
> tree: 
> git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> branch: wilc1000-move-out-of-staging
>
> (Then you can also review the subject line of your patch, BTW)

And also cc linux-wireless so that our patchwork sees it (not sure if
the original patch had it or not, just making sure), more info in the
link below.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel