[PATCH] x86/hyper-v: Fix indent in hv_do_fast_hypercall16()

2018-10-29 Thread Yi Wang
Remove the surplus TAB in hv_do_fast_hypercall16().

Signed-off-by: Yi Wang 
---
 arch/x86/include/asm/mshyperv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 0d6271c..1d0a777 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -232,7 +232,7 @@ static inline u64 hv_do_fast_hypercall16(u16 code, u64 
input1, u64 input2)
  : "cc");
}
 #endif
-   return hv_status;
+   return hv_status;
 }
 
 /*
-- 
1.8.3.1

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


慎继光

2018-10-29 Thread 南京林信管理认证咨询
SuBin___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/7] staging: vc04_services: Some dead code removal

2018-10-29 Thread Dave Stevenson
Hi Stefan

On Sun, 28 Oct 2018 at 08:31, Stefan Wahren  wrote:
>
> Hi Dave,
>
> > Dave Stevenson  hat am 26. Oktober 2018 um 
> > 19:15 geschrieben:
> >
> >
> > Thanks Stefan.
> > I've picked up your latest patches which mean I can get the driver
> > loaded via the (almost) approved method.
> > I do seem to still have issues with not getting the expected address
> > ranges, so the driver/VPU was trying to map cached alias memory. As
> > your patches only came through yesterday I haven't had a chance to dig
> > through why yet. I've done a temporary hack to ensure we always map
> > the uncached alias, but that can't persist.
>
> does it mean with DT probing it worked before and with platform change it's 
> broken?
> Or anything else cause this regression in 4.19?

Yes, probing via DT with the node under soc gave me the correct DMA
addresses (uncached alias). With the platform changes I get the cached
alias.
Both were under 4.14. I'll try again on a later branch.

> > The networking issue has been resolved :-)
> >
> > I've pushed where I've got to to
> > https://github.com/6by9/linux/tree/rpi-4.14.y-codecs-push-pt2b
> > It's a touch messy due to integrating in your patches in the last 24
> > hours. It needs a full rebase so that my changes are on top of yours
> > rather than haphazard.
> > As we're moving to 4.19 fairly soon I may well abandon my 4.14 tree
> > and jump to either that or directly on staging. I'll see where I get
> > to early next week.
>
> Sorry, but there is no need for a quick shot against a downstream 4.14. I 
> assumed you make your changes against upstream linux-next + Phil's and my 
> patches.
>
> You can use https://github.com/anholt/linux/commits/bcm2835-audio until 
> 4.20-rc1 is out.
> Using 4.14 or 4.19 doesn't make any sense to me.

As an employee of Raspberry Pi Trading my first responsibilty is to
them, and that means LTS releases feeding in to the downstream kernel.
If these drivers can be pushed upstream then that's a win as it avoids
divergence, but it is not my main goal. At least 4.19 and 4.20 aren't
far apart so there are likely to be fewer differences.

I had it all working on 4.14, therefore it made sense to see whether
your changes allowed me to load as a platform driver. It did, but with
this little niggle over cache aliases. I'll try again on a later
kernel and try to get some more info.

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


[GIT PULL] Staging/IIO driver patches for 4.20-rc1

2018-10-29 Thread Greg KH
The following changes since commit 7876320f88802b22d4e2daf7eb027dd14175a0f8:

  Linux 4.19-rc4 (2018-09-16 11:52:37 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
tags/staging-4.20-rc1

for you to fetch changes up to 4ab7e05dd070600833680bd318d6d962f010caa2:

  staging: gasket: Fix sparse "incorrect type in assignment" warnings. 
(2018-10-19 21:12:29 +0200)


Staging/IIO patches for 4.20-rc1

Here is the big staging and IIO driver pull request for 4.20-rc1.

There are lots of things here, we ended up adding more lines than
removing, thanks to a large influx of Comedi National Instrument device
support.  Someday soon we need to get comedi out of staging...

Other than the comedi drivers, the "big" things here are:
  - new iio drivers
  - delete dgnc driver (no one used it and no one had the hardware
anymore)
  - vbox driver updates and fixes
  - erofs fixes
  - tons and tons of tiny checkpatch fixes for almost all staging
drivers

All of these have been in linux-next, with the last few happening a bit
"late" due to them getting stuck on my laptop during travel to the
Mantainers summit.

When merging with your tree, there will be 2 merge conflicts, both files
will be simple to resolve, just delete them :)

Signed-off-by: Greg Kroah-Hartman 


Ajay Singh (55):
  staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' 
struct
  staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct
  staging: wilc1000: fix to use correct index to free scanned info in 
clear_shadow_scan()
  staging: wilc1000: remove unnecessary NULL check in clear_shadow_scan()
  staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to 
wilc_priv struct
  staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' 
struct
  staging: wilc1000: remove unused variable 'op_ifcs'
  staging: wilc1000: avoid use of extra 'if' condition in wilc_init()
  staging: wilc1000: move static variable clients_count to 'wilc' structure
  staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list 
global
  staging: wilc1000: move hif_workqueue static variables to 'wilc' structure
  staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct
  staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat'
  staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drv
  staging: wilc1000: refactor tcp_process() to avoid extra leading tabs
  staging: wilc1000: use lowercase for get_BSSID() and HIL variable
  staging: wilc1000: move tcp_ack_filter algo related variables to 
'wilc_vif' struct
  staging: wilc1000: avoid line over 80 chars in 
wilc_wlan_txq_filter_dup_tcp_ack()
  staging: wilc1000: use short names to fix over 80 issue in tcp_process()
  staging: wilc1000: remove unused code to set and get IP address
  staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' 
struct
  staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' 
struct
  staging: wilc1000: remove unnecessary static variable 'p2p_listen_state'
  staging: wilc1000: refactor code to move initilization in 
wilc_netdev_init()
  staging: wilc1000: refactor wilc_netdev_init() to handle memory free in 
error path
  staging: wilc1000: remove handle_hif_exit_work() function
  staging: wilc1000: change return type to 'void' for wilc_frame_register()
  staging: wilc1000: change return type to 'void' for wilc_wlan_set_bssid()
  staging: wilc1000: change return type to 'void' for lock init & deinit 
functions
  staging: wilc1000: change return type to 'void' for wilc_deinit_host_int()
  staging: wilc1000: change return type to 'void' for 
wilc_wfi_deinit_mon_interface()
  staging: wilc1000: use 'void' return type for 
host_int_get_assoc_res_info()
  staging: wilc1000: use 'void' return for wilc_wlan_txq_add_to_head()
  staging: wilc1000: change return type to 'void' tcp ack filter functions
  staging: wilc1000: use 'void' return for 
wilc_wlan_txq_filter_dup_tcp_ack()
  staging: wilc1000: change return type to 'void' for 
wilc_wlan_cfg_indicate_rx()
  staging: wilc1000: refactor wilc_wlan_parse_info_frame() function
  staging: wilc1000: set default value of cfg response type in 
wilc_wlan_cfg_indicate_rx()
  staging: wilc1000: changes 'val' type to u8 in wilc_cfg_byte struct
  staging: wilc1000: remove unused wid type values
  staging: wilc1000: remove unused wid from cfg struct
  staging: wilc1000: refactor code to remove 'mac_status' from 
'wilc_mac_cfg' struct
  staging: wilc1000: refactor code to avoid static variables for config 
parameters
  staging: wilc1000: rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_v

Re: [GIT PULL] Staging/IIO driver patches for 4.20-rc1

2018-10-29 Thread Linus Torvalds
On Mon, Oct 29, 2018 at 7:44 AM Greg KH  wrote:
>
> Here is the big staging and IIO driver pull request for 4.20-rc1.

Pulled,

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


Re: [PATCH] media: davinci_vpfe: fix a NULL pointer dereference bug

2018-10-29 Thread Wenwen Wang
Hello,

Can anyone please confirm this bug and apply the patch? Thanks!

Wenwen

On Thu, Oct 4, 2018 at 11:00 AM Wenwen Wang  wrote:
>
> In vpfe_isif_init(), there is a while loop to get the ISIF base address and
> linearization table0 and table1 address. In the loop body, the function
> platform_get_resource() is called to get the resource. If
> platform_get_resource() returns NULL, the loop is terminated and the
> execution goes to 'fail_nobase_res'. Suppose the loop is terminated at the
> first iteration because platform_get_resource() returns NULL and the
> execution goes to 'fail_nobase_res'. Given that there is another while loop
> at 'fail_nobase_res' and i equals to 0, one iteration of the second while
> loop will be executed. However, the second while loop does not check the
> return value of platform_get_resource(). This can cause a NULL pointer
> dereference bug if the return value is a NULL pointer.
>
> This patch avoids the above issue by adding a check in the second while
> loop after the call to platform_get_resource().
>
> Signed-off-by: Wenwen Wang 
> ---
>  drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c 
> b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> index 745e33f..b0425a6 100644
> --- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
> +++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
> @@ -2080,7 +2080,8 @@ int vpfe_isif_init(struct vpfe_isif_device *isif, 
> struct platform_device *pdev)
>
> while (i >= 0) {
> res = platform_get_resource(pdev, IORESOURCE_MEM, i);
> -   release_mem_region(res->start, res_len);
> +   if (res)
> +   release_mem_region(res->start, res_len);
> i--;
> }
> return status;
> --
> 2.7.4
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] binder: ipc namespace support for android binder

2018-10-29 Thread Todd Kjos
+christ...@brauner.io

On Sun, Oct 28, 2018 at 7:29 PM chouryzhou(周威)  wrote:
...
>
> > It's not obvious from this patch where this dependency comes
> > from...why is SYSVIPC required? I'd like to not have to require IPC_NS
> > either for devices.
>
> Yes, the patch is not highly dependent on SYSVIPC, but it will be convenient
> if require it. I will update it to drop dependency of it in V2 patch. This 
> patch
> doesn't need IPC_NS set at present.

Actually it is dependent on IPC_NS since it makes changes to
ipc/namespace.c which is
compiled only if CONFIG_IPC_NS.

There are a couple more implementations similar to this one.
https://lwn.net/Articles/577957/ and some submissions to AOSP derived
from that one
that introduce a generic registration function for namespace support [1], and
changes to binder to implement namespaces [2].

If this is really needed, then we should have a solution that works
for devices without
requiring IPC_NS or SYSVIPC. Also, we should not add binder-specific code to
ipc/namespace.c or include/linux/ipc_namespace.h.

-Todd

[1] https://android-review.googlesource.com/c/kernel/common/+/471961
[2] https://android-review.googlesource.com/c/kernel/common/+/471825
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] binder: ipc namespace support for android binder

2018-10-29 Thread 周威
> > > It's not obvious from this patch where this dependency comes 
> > > from...why is SYSVIPC required? I'd like to not have to require 
> > > IPC_NS either for devices.
> >
> > Yes, the patch is not highly dependent on SYSVIPC, but it will be 
> > convenient if require it. I will update it to drop dependency of it in 
> > V2 patch. This patch doesn't need IPC_NS set at present.
> 
> Actually it is dependent on IPC_NS since it makes changes to ipc/namespace.c 
> which is compiled only if CONFIG_IPC_NS.
> 

Actually it does not require IPC_NS, the code in ipc/namespace.c are namespace 
specific, and is *not needed* if ipc namespace is supported.

> There are a couple more implementations similar to this one.
> https://lwn.net/Articles/577957/ and some submissions to AOSP derived from 
> that one that introduce a generic registration function for namespace support 
> [1], and changes to binder to implement namespaces [2].
> 
> If this is really needed, then we should have a solution that works for 
> devices without requiring IPC_NS or SYSVIPC. Also, we should not add 
> binder-specific code to ipc/namespace.c or include/linux/ipc_namespace.h.
> 
> -Todd
> 
> [1] https://android-review.googlesource.com/c/kernel/common/+/471961
> [2] https://android-review.googlesource.com/c/kernel/common/+/471825
>

If the binder will be isolated by namespace, it must put binder proc and binder 
context in ipc_namespace (or with something like void* as [1] did)
I have sent the V2 patch, that patch does not require SYSVIPC or IPC_NS. If 
IPC_NS is not set, binder_init will put proc and context into init_ipc_ns.
If SYSVIPC and CONFIG_POSIX_MQUEUE are both unset, I will make a fake 
init_ipc_ns to put them. it is marked as no static intentionally to let compile 
generate an error if it has defined somewhere alse. The code in ipc/namespace.c 
is just to notify binder to do some installationwhere namespace are
creating, If no IPC_NS set, the initialization in binder_init will be enough.
So please review and test the V2 patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] binder: ipc namespace support for android binder

2018-10-29 Thread 周威
> > > It's not obvious from this patch where this dependency comes 
> > > from...why is SYSVIPC required? I'd like to not have to require 
> > > IPC_NS either for devices.
> >
> > Yes, the patch is not highly dependent on SYSVIPC, but it will be 
> > convenient if require it. I will update it to drop dependency of it in 
> > V2 patch. This patch doesn't need IPC_NS set at present.
> 
> Actually it is dependent on IPC_NS since it makes changes to ipc/namespace.c 
> which is compiled only if CONFIG_IPC_NS.
> 

Actually it does not require IPC_NS, the code in ipc/namespace.c are namespace 
specific, 
and is *not needed* if ipc namespace is not supported.  <-- fixed here

> There are a couple more implementations similar to this one.
> https://lwn.net/Articles/577957/ and some submissions to AOSP derived from 
> that one that introduce a generic registration function for namespace support 
> [1], and changes to binder to implement namespaces [2].
> 
> If this is really needed, then we should have a solution that works for 
> devices without requiring IPC_NS or SYSVIPC. Also, we should not add 
> binder-specific code to ipc/namespace.c or include/linux/ipc_namespace.h.
> 
> -Todd
> 
> [1] https://android-review.googlesource.com/c/kernel/common/+/471961
> [2] https://android-review.googlesource.com/c/kernel/common/+/471825
>

If the binder will be isolated by namespace, it must put binder proc and binder 
context in ipc_namespace (or with something like void* as [1] did)
I have sent the V2 patch, that patch does not require SYSVIPC or IPC_NS. If 
IPC_NS is not set, binder_init will put proc and context into init_ipc_ns.
If SYSVIPC and CONFIG_POSIX_MQUEUE are both unset, I will make a fake 
init_ipc_ns to put them. it is marked as no static intentionally to let compile 
generate an error if it has defined somewhere alse. The code in ipc/namespace.c 
is just to notify binder to do some installationwhere namespace are
creating, If no IPC_NS set, the initialization in binder_init will be enough.
So please review and test the V2 patch.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/4] staging: wilc1000: validate input to set_wiphy_param and return proper errors

2018-10-29 Thread Adham.Abozaeid
From: Adham Abozaeid 

Validate input parameters to set_wiphy_param before scheduling
handle_cfg_param() to validate them.
This way proper errors can be returned to caller.
Also cleaned up unused code in handle_cfg_param.

Changes since v1:
- Correction spelling in subject of patch#2
- Added From: tag to have correct email from value

Adham Abozaeid (4):
  staging: wilc1000: remove unused flags in handle_cfg_param()
  staging: wilc1000: validate cfg parameters before scheduling the work
  staging: wilc1000: Don't keep a copy of wiphy parameters in the driver
  staging: wilc1000: Remove unused mutex cfg_values_lock

 drivers/staging/wilc1000/host_interface.c | 291 +-
 drivers/staging/wilc1000/host_interface.h |  32 --
 .../staging/wilc1000/wilc_wfi_cfgoperations.c |  50 ++-
 drivers/staging/wilc1000/wilc_wlan_if.h   |   9 -
 4 files changed, 58 insertions(+), 324 deletions(-)
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.c
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.h
 mode change 100644 => 100755 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
 mode change 100644 => 100755 drivers/staging/wilc1000/wilc_wlan_if.h

-- 
2.17.1

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


[PATCH v2 1/4] staging: wilc1000: remove unused flags in handle_cfg_param()

2018-10-29 Thread Adham.Abozaeid
From: Adham Abozaeid 

handle_cfg_param() receives a bit map that describes what to be changed.
Some of these bits flags aren't referred to from elsewhere and can be
removed.

Signed-off-by: Adham Abozaeid 
---
 drivers/staging/wilc1000/host_interface.c | 216 --
 drivers/staging/wilc1000/host_interface.h |  29 ---
 drivers/staging/wilc1000/wilc_wlan_if.h   |   9 -
 3 files changed, 254 deletions(-)
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.c
 mode change 100644 => 100755 drivers/staging/wilc1000/host_interface.h
 mode change 100644 => 100755 drivers/staging/wilc1000/wilc_wlan_if.h

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
old mode 100644
new mode 100755
index 01db8999335e..1a1ac5e936a7
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -374,64 +374,6 @@ static void handle_cfg_param(struct work_struct *work)
 
mutex_lock(&hif_drv->cfg_values_lock);
 
-   if (param->flag & BSS_TYPE) {
-   u8 bss_type = param->bss_type;
-
-   if (bss_type < 6) {
-   wid_list[i].id = WID_BSS_TYPE;
-   wid_list[i].val = (s8 *)¶m->bss_type;
-   wid_list[i].type = WID_CHAR;
-   wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.bss_type = bss_type;
-   } else {
-   netdev_err(vif->ndev, "check value 6 over\n");
-   goto unlock;
-   }
-   i++;
-   }
-   if (param->flag & AUTH_TYPE) {
-   u8 auth_type = param->auth_type;
-
-   if (auth_type == 1 || auth_type == 2 || auth_type == 5) {
-   wid_list[i].id = WID_AUTH_TYPE;
-   wid_list[i].val = (s8 *)¶m->auth_type;
-   wid_list[i].type = WID_CHAR;
-   wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.auth_type = auth_type;
-   } else {
-   netdev_err(vif->ndev, "Impossible value\n");
-   goto unlock;
-   }
-   i++;
-   }
-   if (param->flag & AUTHEN_TIMEOUT) {
-   if (param->auth_timeout > 0) {
-   wid_list[i].id = WID_AUTH_TIMEOUT;
-   wid_list[i].val = (s8 *)¶m->auth_timeout;
-   wid_list[i].type = WID_SHORT;
-   wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.auth_timeout = param->auth_timeout;
-   } else {
-   netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
-   goto unlock;
-   }
-   i++;
-   }
-   if (param->flag & POWER_MANAGEMENT) {
-   u8 pm_mode = param->power_mgmt_mode;
-
-   if (pm_mode < 5) {
-   wid_list[i].id = WID_POWER_MANAGEMENT;
-   wid_list[i].val = (s8 *)¶m->power_mgmt_mode;
-   wid_list[i].type = WID_CHAR;
-   wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.power_mgmt_mode = pm_mode;
-   } else {
-   netdev_err(vif->ndev, "Invalid power mode\n");
-   goto unlock;
-   }
-   i++;
-   }
if (param->flag & RETRY_SHORT) {
u16 retry_limit = param->short_retry_limit;
 
@@ -492,160 +434,6 @@ static void handle_cfg_param(struct work_struct *work)
}
i++;
}
-   if (param->flag & PREAMBLE) {
-   u16 preamble_type = param->preamble_type;
-
-   if (param->preamble_type < 3) {
-   wid_list[i].id = WID_PREAMBLE;
-   wid_list[i].val = (s8 *)¶m->preamble_type;
-   wid_list[i].type = WID_CHAR;
-   wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.preamble_type = preamble_type;
-   } else {
-   netdev_err(vif->ndev, "Preamble Range(0~2) over\n");
-   goto unlock;
-   }
-   i++;
-   }
-   if (param->flag & SHORT_SLOT_ALLOWED) {
-   u8 slot_allowed = param->short_slot_allowed;
-
-   if (slot_allowed < 2) {
-   wid_list[i].id = WID_SHORT_SLOT_ALLOWED;
-   wid_list[i].val = (s8 *)¶m->short_slot_allowed;
-   wid_list[i].type = WID_CHAR;
-   wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.short_slot_allowed = slot_allowed;
-   } else {
-   netdev_err(vif->ndev, "Short slot(2) over\n");
-   goto unlock;
-   }
-   i

[PATCH v2 3/4] staging: wilc1000: Don't keep a copy of wiphy parameters in the driver

2018-10-29 Thread Adham.Abozaeid
From: Adham Abozaeid 

host_if_drv.cfg_values is a write only member, and can be removed

Signed-off-by: Adham Abozaeid 
---
 drivers/staging/wilc1000/host_interface.c | 13 -
 drivers/staging/wilc1000/host_interface.h |  1 -
 2 files changed, 14 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0bb3b4f6d04e..cdc495287949 100755
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -375,43 +375,31 @@ static void handle_cfg_param(struct work_struct *work)
mutex_lock(&hif_drv->cfg_values_lock);
 
if (param->flag & RETRY_SHORT) {
-   u16 retry_limit = param->short_retry_limit;
-
wid_list[i].id = WID_SHORT_RETRY_LIMIT;
wid_list[i].val = (s8 *)¶m->short_retry_limit;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.short_retry_limit = retry_limit;
i++;
}
if (param->flag & RETRY_LONG) {
-   u16 limit = param->long_retry_limit;
-
wid_list[i].id = WID_LONG_RETRY_LIMIT;
wid_list[i].val = (s8 *)¶m->long_retry_limit;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.long_retry_limit = limit;
i++;
}
if (param->flag & FRAG_THRESHOLD) {
-   u16 frag_th = param->frag_threshold;
-
wid_list[i].id = WID_FRAG_THRESHOLD;
wid_list[i].val = (s8 *)¶m->frag_threshold;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.frag_threshold = frag_th;
i++;
}
if (param->flag & RTS_THRESHOLD) {
-   u16 rts_th = param->rts_threshold;
-
wid_list[i].id = WID_RTS_THRESHOLD;
wid_list[i].val = (s8 *)¶m->rts_threshold;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.rts_threshold = rts_th;
i++;
}
 
@@ -3139,7 +3127,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv 
**hif_drv_handler)
mutex_lock(&hif_drv->cfg_values_lock);
 
hif_drv->hif_state = HOST_IF_IDLE;
-   hif_drv->cfg_values.scan_source = DEFAULT_SCAN;
 
hif_drv->p2p_timeout = 0;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 5f894fe7c896..60cb1a1fee1a 100755
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -238,7 +238,6 @@ struct host_if_drv {
enum host_if_state hif_state;
 
u8 assoc_bssid[ETH_ALEN];
-   struct cfg_param_attr cfg_values;
/*lock to protect concurrent setting of cfg params*/
struct mutex cfg_values_lock;
 
-- 
2.17.1

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


[PATCH v2 2/4] staging: wilc1000: validate cfg parameters before scheduling the work

2018-10-29 Thread Adham.Abozaeid
From: Adham Abozaeid 

Validate cfg parameters after being called by cfg80211 in set_wiphy_params
before scheduling the work executed in handle_cfg_param

Signed-off-by: Adham Abozaeid 
---
 drivers/staging/wilc1000/host_interface.c | 61 ++-
 .../staging/wilc1000/wilc_wfi_cfgoperations.c | 50 ---
 2 files changed, 62 insertions(+), 49 deletions(-)
 mode change 100644 => 100755 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1a1ac5e936a7..0bb3b4f6d04e 100755
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -377,61 +377,41 @@ static void handle_cfg_param(struct work_struct *work)
if (param->flag & RETRY_SHORT) {
u16 retry_limit = param->short_retry_limit;
 
-   if (retry_limit > 0 && retry_limit < 256) {
-   wid_list[i].id = WID_SHORT_RETRY_LIMIT;
-   wid_list[i].val = (s8 *)¶m->short_retry_limit;
-   wid_list[i].type = WID_SHORT;
-   wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.short_retry_limit = retry_limit;
-   } else {
-   netdev_err(vif->ndev, "Range(1~256) over\n");
-   goto unlock;
-   }
+   wid_list[i].id = WID_SHORT_RETRY_LIMIT;
+   wid_list[i].val = (s8 *)¶m->short_retry_limit;
+   wid_list[i].type = WID_SHORT;
+   wid_list[i].size = sizeof(u16);
+   hif_drv->cfg_values.short_retry_limit = retry_limit;
i++;
}
if (param->flag & RETRY_LONG) {
u16 limit = param->long_retry_limit;
 
-   if (limit > 0 && limit < 256) {
-   wid_list[i].id = WID_LONG_RETRY_LIMIT;
-   wid_list[i].val = (s8 *)¶m->long_retry_limit;
-   wid_list[i].type = WID_SHORT;
-   wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.long_retry_limit = limit;
-   } else {
-   netdev_err(vif->ndev, "Range(1~256) over\n");
-   goto unlock;
-   }
+   wid_list[i].id = WID_LONG_RETRY_LIMIT;
+   wid_list[i].val = (s8 *)¶m->long_retry_limit;
+   wid_list[i].type = WID_SHORT;
+   wid_list[i].size = sizeof(u16);
+   hif_drv->cfg_values.long_retry_limit = limit;
i++;
}
if (param->flag & FRAG_THRESHOLD) {
u16 frag_th = param->frag_threshold;
 
-   if (frag_th > 255 && frag_th < 7937) {
-   wid_list[i].id = WID_FRAG_THRESHOLD;
-   wid_list[i].val = (s8 *)¶m->frag_threshold;
-   wid_list[i].type = WID_SHORT;
-   wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.frag_threshold = frag_th;
-   } else {
-   netdev_err(vif->ndev, "Threshold Range fail\n");
-   goto unlock;
-   }
+   wid_list[i].id = WID_FRAG_THRESHOLD;
+   wid_list[i].val = (s8 *)¶m->frag_threshold;
+   wid_list[i].type = WID_SHORT;
+   wid_list[i].size = sizeof(u16);
+   hif_drv->cfg_values.frag_threshold = frag_th;
i++;
}
if (param->flag & RTS_THRESHOLD) {
u16 rts_th = param->rts_threshold;
 
-   if (rts_th > 255) {
-   wid_list[i].id = WID_RTS_THRESHOLD;
-   wid_list[i].val = (s8 *)¶m->rts_threshold;
-   wid_list[i].type = WID_SHORT;
-   wid_list[i].size = sizeof(u16);
-   hif_drv->cfg_values.rts_threshold = rts_th;
-   } else {
-   netdev_err(vif->ndev, "Threshold Range fail\n");
-   goto unlock;
-   }
+   wid_list[i].id = WID_RTS_THRESHOLD;
+   wid_list[i].val = (s8 *)¶m->rts_threshold;
+   wid_list[i].type = WID_SHORT;
+   wid_list[i].size = sizeof(u16);
+   hif_drv->cfg_values.rts_threshold = rts_th;
i++;
}
 
@@ -441,7 +421,6 @@ static void handle_cfg_param(struct work_struct *work)
if (ret)
netdev_err(vif->ndev, "Error in setting CFG params\n");
 
-unlock:
mutex_unlock(&hif_drv->cfg_values_lock);
kfree(msg);
 }
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
old mode 100644
new mode 100755
index 4fd5a64b..26bb78a49d81
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1149,21 +1149,55 

[PATCH v2 4/4] staging: wilc1000: Remove unused mutex cfg_values_lock

2018-10-29 Thread Adham.Abozaeid
From: Adham Abozaeid 

After removing cfg_values member, cfg_values_lock that was used to protect
it can also be removed.

Signed-off-by: Adham Abozaeid 
---
 drivers/staging/wilc1000/host_interface.c | 9 -
 drivers/staging/wilc1000/host_interface.h | 2 --
 2 files changed, 11 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index cdc495287949..165330b494f5 100755
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -369,11 +369,8 @@ static void handle_cfg_param(struct work_struct *work)
struct cfg_param_attr *param = &msg->body.cfg_info;
int ret;
struct wid wid_list[32];
-   struct host_if_drv *hif_drv = vif->hif_drv;
int i = 0;
 
-   mutex_lock(&hif_drv->cfg_values_lock);
-
if (param->flag & RETRY_SHORT) {
wid_list[i].id = WID_SHORT_RETRY_LIMIT;
wid_list[i].val = (s8 *)¶m->short_retry_limit;
@@ -409,7 +406,6 @@ static void handle_cfg_param(struct work_struct *work)
if (ret)
netdev_err(vif->ndev, "Error in setting CFG params\n");
 
-   mutex_unlock(&hif_drv->cfg_values_lock);
kfree(msg);
 }
 
@@ -3123,15 +3119,10 @@ int wilc_init(struct net_device *dev, struct 
host_if_drv **hif_drv_handler)
timer_setup(&hif_drv->connect_timer, timer_connect_cb, 0);
timer_setup(&hif_drv->remain_on_ch_timer, listen_timer_cb, 0);
 
-   mutex_init(&hif_drv->cfg_values_lock);
-   mutex_lock(&hif_drv->cfg_values_lock);
-
hif_drv->hif_state = HOST_IF_IDLE;
 
hif_drv->p2p_timeout = 0;
 
-   mutex_unlock(&hif_drv->cfg_values_lock);
-
wilc->clients_count++;
 
return 0;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 60cb1a1fee1a..c78e0682a248 100755
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -238,8 +238,6 @@ struct host_if_drv {
enum host_if_state hif_state;
 
u8 assoc_bssid[ETH_ALEN];
-   /*lock to protect concurrent setting of cfg params*/
-   struct mutex cfg_values_lock;
 
struct timer_list scan_timer;
struct wilc_vif *scan_timer_vif;
-- 
2.17.1

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


[PATCH] staging: wilc1000: update wilc1000 driver maintainer ids

2018-10-29 Thread Ajay.Kathat
From: Ajay Singh 

We would like to update the maintainer email id's for wilc1000 driver.

Signed-off-by: Ajay Singh 
Signed-off-by: Adham Abozaeid 
---
 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c7af53..9647ec7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13837,8 +13837,8 @@ S:  Odd Fixes
 F: drivers/staging/vt665?/
 
 STAGING - WILC1000 WIFI DRIVER
-M: Aditya Shankar 
-M: Ganesh Krishna 
+M: Adham Abozaeid 
+M: Ajay Singh 
 L: linux-wirel...@vger.kernel.org
 S: Supported
 F: drivers/staging/wilc1000/
-- 
2.7.4

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