History log of /linux-master/drivers/staging/ks7010/ks_hostif.c
Revision Date Author Comments
# d24927f4 22-Mar-2023 Khadija Kamran <kamrankhadijadj@gmail.com>

staging: ks7010: fix line ending with '('

Splitting function header to multiple lines because of 80 characters per
line limit, results in ending the function call line with '('.
This leads to CHECK reported by checkpatch.pl

Move the first parameter right after the '(' in the function call line.
Align the rest of the parameters to the opening parenthesis.

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Link: https://lore.kernel.org/r/ZBsEQzL3Oidsmg/L@khadija-virtual-machine
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3baab4bc 16-May-2022 Haowen Bai <baihaowen@meizu.com>

staging: ks7010: remove null check after call container_of()

container_of() will never return NULL, so remove useless code.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1652696322-17685-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 194193dd 13-Apr-2022 Aliya Rahmani <aliyarahmani786@gmail.com>

staging: ks7010: coding style fix: use tabs for indent

Added tabs for indent to fix the checkpatch error.

Signed-off-by: Aliya Rahmani <aliyarahmani786@gmail.com>
Link: https://lore.kernel.org/r/20220413204648.60358-1-aliyarahmani786@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a2b0b416 11-Apr-2022 Davidlohr Bueso <dave@stgolabs.net>

staging/ks7010: replace SME taslet with work

Tasklets have long been deprecated as being too heavy on the system
by running in irq context - and this is not a performance critical
path. If a higher priority process wants to run, it must wait for
the tasklet to finish before doing so.

The execution of the SME event will now occur in task context. There
are, however, changes in concurrency. Workqueues, unlike tasklets,
are not serialized among themselves and can run concurrently
updating sme_i.qhead. However, the current code is already exposed
in same ways, regardless of the deferral mechanism, in that
hostif_sme_enqueue() does unserialized enqueues updating sme_i.qtail.

Also get rid of the bogus (power save) tasklet enabling, as it
is never disabled to begin with.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20220411151620.129178-5-dave@stgolabs.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 349f631d 19-Oct-2021 Jakub Kicinski <kuba@kernel.org>

staging: use eth_hw_addr_set() instead of ether_addr_copy()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert staging from ether_addr_copy() to eth_hw_addr_set():

@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-3-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fbd39969 14-Apr-2021 Lee Jones <lee.jones@linaro.org>

staging: ks7010: ks_hostif: Remove a bunch of unused variables

Add comments to preserve documentation.

Fixes the following W=1 kernel build warning(s):

drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_mib_get_confirm’:
drivers/staging/ks7010/ks_hostif.c:528:6: warning: variable ‘mib_val_type’ set but not used [-Wunused-but-set-variable]
drivers/staging/ks7010/ks_hostif.c:527:6: warning: variable ‘mib_val_size’ set but not used [-Wunused-but-set-variable]
drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_infrastructure_set_confirm’:
drivers/staging/ks7010/ks_hostif.c:849:6: warning: variable ‘result_code’ set but not used [-Wunused-but-set-variable]
drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_phy_information_confirm’:
drivers/staging/ks7010/ks_hostif.c:929:19: warning: variable ‘noise’ set but not used [-Wunused-but-set-variable]

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210414181129.1628598-24-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 22f73079 16-Sep-2020 Allen Pais <apais@linux.microsoft.com>

staging: ks7010: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Link: https://lore.kernel.org/r/20200916062553.58532-1-allen.lkml@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 453431a5 07-Aug-2020 Waiman Long <longman@redhat.com>

mm, treewide: rename kzfree() to kfree_sensitive()

As said by Linus:

A symmetric naming is only helpful if it implies symmetries in use.
Otherwise it's actively misleading.

In "kzalloc()", the z is meaningful and an important part of what the
caller wants.

In "kzfree()", the z is actively detrimental, because maybe in the
future we really _might_ want to use that "memfill(0xdeadbeef)" or
something. The "zero" part of the interface isn't even _relevant_.

The main reason that kzfree() exists is to clear sensitive information
that should not be leaked to other future users of the same memory
objects.

Rename kzfree() to kfree_sensitive() to follow the example of the recently
added kvfree_sensitive() and make the intention of the API more explicit.
In addition, memzero_explicit() is used to clear the memory to make sure
that it won't get optimized away by the compiler.

The renaming is done by using the command sequence:

git grep -w --name-only kzfree |\
xargs sed -i 's/kzfree/kfree_sensitive/'

followed by some editing of the kfree_sensitive() kerneldoc and adding
a kzfree backward compatibility macro in slab.h.

[akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
[akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Joe Perches <joe@perches.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 536a4f75 30-Jul-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

staging: ks7010: Use %pM format specifier for MAC addresses

Convert to %pM instead of using custom code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200730152312.39076-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6ef7eef9 24-May-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: ks7010: Merge multiple return variables in ks_hostif.c

The function hostif_data_request had two return variables, ret and
result. When ret is assigned a value, in all cases (except one) this
assignment is followed immediately by a goto to the end of the
function. In the last case, the goto takes effect only if ret < 0;
however, if ret >= 0 then this value of ret is not needed in the
remainder of that branch. On the other hand result is used (assigned a
value and returned) only in those branches where ret >= 0 or ret has
not been used at all.
As the values of ret and result are not both required at the same point
in any branch, result can be removed and its occurrences replaced with
ret.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a7048b38 24-May-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: ks7010: Remove initialisation in ks_hostif.c

The initial value of return variable result is never used, so it can be
removed.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 877b5691 14-Apr-2019 Eric Biggers <ebiggers@google.com>

crypto: shash - remove shash_desc::flags

The flags field in 'struct shash_desc' never actually does anything.
The only ostensibly supported flag is CRYPTO_TFM_REQ_MAY_SLEEP.
However, no shash algorithm ever sleeps, making this flag a no-op.

With this being the case, inevitably some users who can't sleep wrongly
pass MAY_SLEEP. These would all need to be fixed if any shash algorithm
actually started sleeping. For example, the shash_ahash_*() functions,
which wrap a shash algorithm with the ahash API, pass through MAY_SLEEP
from the ahash API to the shash API. However, the shash functions are
called under kmap_atomic(), so actually they're assumed to never sleep.

Even if it turns out that some users do need preemption points while
hashing large buffers, we could easily provide a helper function
crypto_shash_update_large() which divides the data into smaller chunks
and calls crypto_shash_update() and cond_resched() for each chunk. It's
not necessary to have a flag in 'struct shash_desc', nor is it necessary
to make individual shash algorithms aware of this at all.

Therefore, remove shash_desc::flags, and document that the
crypto_shash_*() functions can be called from any context.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 7d6009f2 18-Mar-2019 Colin Ian King <colin.king@canonical.com>

staging: ks7010: remove redundant auth_type check

The range check on auth_type is redundant as there is a prior
check on the auth_type values and the only way the block is entered
is if auth_type is one of TYPE_PMK1, TYPE_GMK1 and TYPE_GMK2. Hence
the auth_type check can be removed.

Detected by static analysis with cppcheck.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b523f20 28-Feb-2019 Jeremy Sowden <jeremy@azazel.net>

staging: ks7010: removed custom Michael MIC implementation.

Changed the driver to use the kernel's own implementation.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 13a7287e 25-Feb-2019 Bhanusree Pola <bhanusreemahesh@gmail.com>

Staging: ks7010: Match alignments with open parenthesis

Adjust parameters of "netdev_dbg" to match alignment with
open parenthesis.
Issue found using checkpatch.pl

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 45a50ab1 22-Jan-2019 Matt McCoy <mattmccoy110@gmail.com>

staging: ks7010: remove unnecessary parentheses

Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Matt McCoy <mattmccoy110@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b8429b0 16-Oct-2018 Maya Nakamura <m.maya.nakamura@gmail.com>

staging: ks7010: Remove extra blank line

Remove extra blank line. Issue found by checkpatch.pl.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Vaishali Thakkar <vthakkar@vaishalithakkar.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e7f8f1df 30-Sep-2018 Aymen Qader <qader.aymen@gmail.com>

staging: ks7010: Remove unnecessary null check

Remove the unnecessary socket buffer null check in hostif_data_request.
There is already an appropriate null check in the calling function:

(ks_wlan_net.c) ks_wlan_start_xmit

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# eb37430d 13-Jul-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: call 'hostif_mib_set_request_int' instead of 'hostif_mib_set_request_bool'

'hostif_mib_set_request_bool' function receives a bool as value and
send the received value with MIB_VALUE_TYPE_BOOL type. There is
one case where the value passed is not a boolean one but
'MCAST_FILTER_PROMISC' which is '2'. Call hostif_mib_set_request_int
instead for related multicast enumeration. This changes original
code behaviour but seems to be the right way to do this.

Fixes: 8ce76bff0e6a ("staging: ks7010: add new helpers to achieve mib set request and simplify code")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 15fc3e4a 11-Jul-2018 Colin Ian King <colin.king@canonical.com>

staging: ks7010: remove redundant variable eth_proto

Variable eth_proto is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'eth_proto' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b2d187cc 16-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid casting inside cpu_to_* assignments

cpu_to_*() functions already have a cast to u* built in,
so the cast is never required. Review and remove all of
them along the code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b7369066 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace cast type in assignment in hostif_sme_set_pmksa

There is an assignment inside hostif_sme_set_pmksa function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 88c80162 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsn

There are some assignments inside hostif_sme_set_rsn function
which are being used together with cpu_to_le16 using uint16_t
as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 14b61a52 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change two parameter types in hostif_mic_failure_request

Parameters 'failure_count' and 'timer' was declared as unsigned
short and then there was being casted to u16 inside cpu_to_le16
to make the assignation. Just declare them as 'u16' and avoid
casting at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dea2f1fb 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_request

In function hostif_bss_scan_request parameters 'scan_ssid' and
'scan_ssid_len' are declared as uint8_t. Change them to be 'u8'
instead which is preferred. Also update two casts inside the same
function to use 'u32' instead of 'uint32_t'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9a1420e7 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace cast types in assignments in hostif_phy_information_request

There are some assignments inside hostif_phy_information_request
function which are being used together with cpu_to_le16 using
uint16_t as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bcbd1f18 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace cast type in assignment in hostif_adhoc_set_request

There is an assignment inside hostif_adhoc_set_request function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78e24171 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace cast type in assignments in hostif_infrastructure_set_request

There are some assignments inside hostif_infrastructure_set_request
function which are being used together with cpu_to_le16 using
uint16_t as cast type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 889d7063 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_request

There is an assignment inside hostif_ps_adhoc_set_request function
which is being used together with cpu_to_le16 using uint16_t as cast
type. Replace it to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 22bef066 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace casts to use type u16 in init_request

There are soem assignments inside init_request function which
are being used together with cpu_to_le16 using uint16_t as cast
type. Replace all of them to use 'u16' instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5503fd5a 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 as cast type in hostif_start_request

Use u16 as cast type in hostif_start_request function replacing
uint16_t which was being used.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f7761114 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid no needed cast in ks_wlan_cap

In ks_wlan_cap there is a cast to uint16_t to use cpu_to_le16
with variable 'capability' which is already defined as u16.
Avoid this cast to clean code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81ad5837 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change parameter type in hostif_mib_get_request

Second parameter 'mib_attribute' in function hostif_mib_get_request
is declared as unsigned long and inside the function a cast to uint32_t
is being used. Just pass a u32 instead and avoid the casting.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 521d3f26 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change some cast type from uint16_t to u16 in hostif_data_request

There are some castings inside the function hostif_data_request
which are being using with uint16_t type. Fields which have being
assigned are declared as u16. So update casts types to u16 in all
of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bc0b3f43 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 as type for casting in hostif_data_indication_wpa

Field 'counter' in mic_failure struct is being assigned casting
value using uint16_t. Replace with u16 which is the correct type
of the field and the preferred one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d82e5140 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: review local variable types in hostif_phy_information_confirm

This commit changes types for local variables declared in
hostif_phy_information_confirm function to use the preferred
one 'u8' and 'u32'. Its values are get using get_byte and get_dword
functions which returns 'u8' and 'u32' so it makes sense.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 677e281d 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u32 instead of unsigned int in hostif_bss_scan_confirm

Local variable 'result_code' is declared as unsigned int in
hostif_bss_scan_confirm function. Its value is got calling
get_dword which returns an 'u32' so change its type to u32
which is preferred

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ab0bb2a4 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 instead of unsigned short in hostif_connect_indication

Local variable 'connect_code' is declared as unsigned short in
hostif_connect_indication function. Its value is got calling
get_word which returns an 'u16' so change its type to u16
which is preferred.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 19e8a0d7 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 instead of unsigned short in hostif_data_indication

Local variable 'auth_type' is declared as unsigned short in
hostif_data_indication function. Its value is got calling get_word
which returns an 'u16' so change its type to u16 which is preferred.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5437e9b2 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use u16 instead of unsigned short in hostif_event_check

Local variable 'event' is declared as unsigned short in hostif_event_check
function. Its value is got calling get_word which returns an 'u16'
so change its type to u16 which is preferred.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d74d0899 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor LOCAL_EEPROM_SUM case in hostif_mib_get_confirm

This commit simplify conditional paths in LOCAL_EEPROM_SUM case
inside hostif_mib_get_confirm function. It change logic to handle
invalid values first and assign good ones at the end if it is the
case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5089cd41 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use CIRC_CNT_TO_END macro in cnt_smeqbody

This commit changes custom implementation of CIRC_CNT_TO_END.
Just use the linux kernel header one to simplify code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d87e9626 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor hostif_sme_power_mgmt_set function

This commit refactor hostif_sme_power_mgmt_set avoiding to
use switch-case statement and simplifying data paths. This
improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0d8be306 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change parameter types in hostif_power_mgmt_request

Parameters for hostif_power_mgmt_request are declared as unsigned
long and then are forced to be change to be u32. Also the caller
declares explicitly unsigned long parameters just to assign them
and pass into the function. Change types for those to be u32 instead
so no conversion is needed at all and code gets more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f20703b4 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor hostif_sme_set_rsn function

This commit make use of two introduced local variables
to make more readable code of hostif_sme_set_rsn function.
It just assign those local variables in different cases
where are needed and extract common code to assign them
at the end.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2152effa 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: add blank line between after definitions

Add blank line after definitions in hostif_aplist_init function
to fix a checkpatch script complain about that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e4c4cdf1 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: fix some style issues in ks_hostif.c

Fix some checkpatch complains about long lines in some
parts of the code. It also fix some lines where spaces
instead of tabs were inserted.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9e441a66 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: factor out send_request_to_device function

In all functions related with requests to the device the same
patter in used and is also adding a comment to make clear the
intention of the code. Just factor out the pattern into a new
send_request_to_device function to improve readability and make
clear code intention.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f2e8f6a6 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: move WLAN_EID_DS_PARAMS to different place inside switch

WLAN_EID_DS_PARAMS case inside switch case is just doing nothing
and it is located inside other cases. There is a place inside
the switch with other don't do anything cases are located. Move
this to that place.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a5f7d653 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in get_ap_information function

This commit make use of ether_addr_copy to copy ethernet
address instead of copy it using memcpy.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6663f11b 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy to copy ethernet address sa_data

Use ether_addr_copy kernel function to copy an ethernet address
instead of a simple memcpy with ETH_ALEN size.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d96f3a7c 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change type for rsn_enabled in wpa_status struct

Field rsn_enabled included in wpa_status struct is declared as
unsigned int but it is only be set using 0 and 1 values and
in conditional if code is just being used as a boolean. Change
its type to be a boolean.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# acfb2f32 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove non sense comments in ks_hostif.c source file

Comments which say the same as the code are not useful at all
so just remove them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2fa68297 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid two long lines in hostif_sme_mode_setup

This commit avoid two checkpatch script complains about
two long lines.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1c800aab 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: move two preprocessor definitions to ks_wlan.h

In ks_wlan_translate_scan function there are two preprocessor
definitions:

- RSN_INFO_ELEM_ID
- GENERIC_INFO_ELEM_ID

These can be moved to common ks_wlan.h because they can be used
in get_current_ap function instead of use hardcoded values.
GENERIC_INFO_ELEM_ID has been renamed to WPA_INFO_ELEM_ID which
is more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76b91c6f 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in get_current_ap

Instead of use memcpy to copy ethernet addresses use
ether_addr_copy created for that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8ce76bff 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: add new helpers to achieve mib set request and simplify code

New three functions have been created to centralice and simplify
calls related with set MIB requests:

- hostif_mib_set_request_int
- hostif_mib_set_request_bool
- hostif_mib_set_request_ostring

Using these in different calls simplify functions related with
this mainly when types are bool and int because no more conversions
are needed in the caller functions. Those conversion details are
now located in the new helpers improving a lot readability. Calls
in hostif_sme_set_wep function has change also some if's to check
invalid value first avoiding one level indentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 80020cd7 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change parameter types and reorder them in hostif_mib_set_request

This commit changes parameter types to use enum mib_attribute, enum
mib_data_type and size_t for size instead of unsigned short. It also
reorder them in a more sense way. Code is updated in different
calls to use new parameters order using 'size' auxiliar local variables
in some of them to improve readability a bit.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f398c5f4 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: clean SME_MIC_FAILURE_REQUEST case in hostif_sme_execute

This commit cleans code for the event SME_MIC_FAILURE_REQUEST
changing if logic to handle invalid value first and using a
local variable.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2059ebe9 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use the same parameter for 'event' in hostif_sme_enqueue

Declaration of second parameter 'event' in ks_hostif .h and .c
file is different using uint16_t and unsigned short respectively.
Just unify both using 'u16' which is preferred instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a98ebb8f 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove missing WPS preprocessor conditional code

Commit 92c1552caef3661f049c4e967550e933599e2663 removes WPS hardcoded
definition and its related conditional preprocessor code. There
was some missing stuff already in this files. Remove it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a0a954b1 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: add SPDX identifiers to all files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the all of the staging ks7010 files to have a proper SPDX
identifier, based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

Extra GPL text wording can be removed as it is no longer needed at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c9f90681 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor hostif_sme_set_pmksa function

This commits refactor a bit hostif_sme_set_pmksa function:
- avoid one level indentation changing if condition.
- use ether_addr_copy to copy bssid addresses.
- move 'i' initialization to declaration place.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# be4e1341 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in hostif_sme_multicast_set

Use ether_addr_copy to copy ethernet addresses in function
hostif_sme_multicast_set instead of memcpy.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f1e8524c 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_equal in hostif_data_request

Use ether_addr_equal to compare addresses in ether_addr_equal
function instead of comparing using memcmp.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e9eb9a9d 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_equal in hostif_data_indication

Instead of comparing ethernet address using memcmp in function
hostif_data_indication use ether_addr_equal function created
for this function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 39c3318c 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in hostif_mib_get_confirm

This commit improves readability changing custom ethernet
addresses copies in favour of using ether_addr_copy() function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cb3f0b4b 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid use of brackets in single line if

Singles if does not need at all to use brackets in its body
so just remove them which is the preferred style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9cfd8837 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor hostif_sme_power_mgmt_set function

Some minor changes have been done in this function to clean
it a bit:
- POWER_MGMT_ACTIVE and default case are the same so
just handle that with the same block of code,
- POWER_MGMT_SAVE1 replaces if-else with a ternary operator.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 04e7f80e 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use definitions from kernel headers in hostif_data_indication function

Function hostif_data_indication checks some hardcoded values in a
switch-case block. This values are defined in uapi/linux/llc.h
header. Just use them and avoid a comment in the code improving
readability a bit.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 16ab5400 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: join some debug traces in get_current_ap function

There is a lot of netdev_dbg calls related with the access point
in this function and all of them can be joined in only one call.
This makes code a bit simplier.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0ff7968d 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid some if-else code in get_current_ap function

This commits avoid some if-else code extracting common code before
its use and making use of a new variable 'size' which is assigned
using a ternary operator. This improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3df372e0 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: review includes of ks_hostif file

This commit reviews includes of ks_hostif.c source file.
Those which are not being used at all have been removed.
Driver header includes have been moved after the kernel
header includes to make style consistent in different
files of the driver. The need of ks_wlan.h header include
is only because of some preprocessor conditional code
of WPS definition. This definition is in ks_wlan.h
so this one must be included before the ks_hostif.h header
file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b684a8c5 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid blank line between definitions in hostif_data_request

This commit removes a blank line between definition in
hostif_data_request function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8a90f1a62 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: fix warning aout long line in init_request

This commit fix length of the definition line of init_request
function. Warning from checkpatch script for this is fixed.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 25b5fc27 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove superfluous comments in ks_hostif source file

This commit removes some comments which are not necessary at all
because code is clear enough to understand its intention.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81dac3c2 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid one level indentation in devio_rec_ind function

This commit changes logic to handle with the status of the device
at first checking for close state to return directly instead
of just do the stuff when device is open. This improves readability
avoiding one level indentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d892cc1c 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change name and type for device_open_status field

This commit changes type for device_open_status field of ks_wlan_private
structure from int to bool. This variable is only be set to 1
on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this
purpose it is not necessary at all to use an integer because a bool
is enough. This also renames field name from device_open_status to
is_device_open.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5e5cd808 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid casts in michael_mic_function calls

This commit removes casts in calls to michael_mic_function.
Most of them are nosense because types match perfectly function
parameters. To avoid also int casting for len parameter just
pass unsigned len to function which makes sense because is only
being called with unsigned int len parameters.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6704ddbb 15-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: group some cases in switch-case block in hostif_mib_set_confirm

This commit groups some case statements because its behaviour is
just do nothing which is the same as the default. Clean 'break'
keyword in those which are affected.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d6a72502 15-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor code for hostif_sme_sleep_set function

This commit refactors code for hostif_sme_sleep_set function. This
function was using a switch-case block to handle only two states
where the action to do for them is the same. Just refactor a bit
to check for return condition at first and doing the common action
after in other case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d3bef56b 15-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove nonsense break from case block

This commit removes 'break' from case block because the
code is just using the 'default' break for some cases and
this one can be included also there.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# abca20ad 15-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change return value of ks_wlan_do_power_save function

This commit change return value of ks_wlan_do_power_save function
from int to void. This function is just returning zero and return
value is not being checked also, so it is nonsense to return an
integer.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d0d3777c 06-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove KS_WLAN_MEM_FLAG definition

This commit removes KS_WLAN_MEM_FLAG definition which is
hiding GFP_ATOMIC along the code. It is better to use directly
GFP_ATOMIC in kmalloc's because this it is easier to read.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e5082ba1 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct michael_mic_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct michael_mic_t' with 'struct michael_mic'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b7402474 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct pmk_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct pmk_t' with 'struct pmk'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9b0b63a4 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct mic_failure_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct mic_failure_t' with 'struct mic_failure'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b76eb09 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct wpa_key_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct wpa_key_t' with 'struct wpa_key'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 01d391d4 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct local_ap_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct local_ap_t' with 'struct local_ap'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d56c80ca 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_mic_failure_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_mic_failure_request_t' with 'struct
hostif_mic_failure_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cee85e47 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_sleep_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_sleep_request_t' with 'struct
hostif_sleep_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3d01c771 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_phy_information_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_phy_information_request_t' with 'struct
hostif_phy_information_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81ac43bf 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_bss_scan_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_bss_scan_request_t' with 'struct
hostif_bss_scan_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f43036cc 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct association_response_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct association_response_t' with 'struct
association_response'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e80ce487 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct association_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct association_request_t' with 'struct
association_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9445eb38 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_adhoc_set2_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_adhoc_set2_request_t' with 'struct
hostif_adhoc_set2_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5dfcd3fb 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_adhoc_set_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_adhoc_set_request_t' with 'struct
hostif_adhoc_set_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3071e00c 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_infrastructure_set_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_infrastructure_set_request_t' with
'struct hostif_infrastructure_set_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54839a56 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_ps_adhoc_set_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_ps_adhoc_set_request_t' with 'struct
hostif_ps_adhoc_set_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0af037ab 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_request_t' with 'struct hostif_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9f2ae0a4 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_stop_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_stop_request_t' with 'struct
hostif_stop_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f86d60c 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct link_ap_info_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct link_ap_info_t' with 'struct link_ap_info'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 15265353 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct ap_info_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct ap_info_t' with 'struct ap_info'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 75bff08f 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_start_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_start_request_t' with 'struct
hostif_start_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 985d6eb9 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_power_mgmt_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_power_mgmt_request_t' with 'struct
hostif_power_mgmt_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81daad4b 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_mib_get_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_mib_get_request_t' with 'struct
hostif_mib_get_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5b8946b1 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct hostif_data_request_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct hostif_data_request_t' with 'struct
hostif_data_request'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d8f20c2f 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct pmk_cache_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct pmk_cache_t' with 'struct pmk_cache'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f4fb42e4 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct rsn_mode_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct rsn_mode_t' with 'struct rsn_mode'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c5ad1e94 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct wpa_suite_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct wpa_suite_t' with 'struct wpa_suite'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ea552237 29-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: IS_OFDM_EXT_RATE macro with inline function

This commit replaces IS_OFDM_EXT_RATE macro with is_11b_rate
inline function to improve readability.

It also fix a checkpatch script warning because a line with more
than 80 spaces.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8710f5b1 29-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace IS_11BG_RATE macro with inline function

This commit replaces IS_11BG_RATE macro with is_11b_rate inline
function to improve readability.

It also fix a checkpatch script warning because a line with more
than 80 spaces.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b67cd79f 29-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace IS_11B_RATE macro with inline function

This commit replaces IS_11B_RATE macro with is_11b_rate inline
function to improve readability.

It also fix a checkpatch script warning because a line with more
than 80 spaces.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f40cd66b 28-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Change mac_address_valid to a bool instead of int.

'mac_address_valid' is only ever assigned 0 or 1, so it makes more sense
to use a bool type for this variable.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c9be5632 28-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid camel cases in MichaelMICFunction

This commit replace camel cases for name and params used in
MichaelMICFunction. This improves a bit readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 52794767 26-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: factor out some functions from hostif_init

This commit factors out some init functions from hostif_init
to improve readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 07934dc8 26-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid camel case in function name get_DWORD

This commit renames function get_DWORD into get_dword to avoid
camel case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ef3f0d5f 26-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid camel case in function name get_WORD

This commit renames get_WORD function into get_word to avoid
camel case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 232a8bac 26-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid camel case in function name get_BYTE

This commit renames get_BYTE function in favour of get_byte
to avoid camel case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 16b102e7 23-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use lower case names in michael_mic_t struct fields

Replace upper case fields and camel cases for fields included in
michael_mic_t structure

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b90a6e10 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove hostif_infrastructure_set2_request_t.

The handling of hostif_infrastructure_set_request_t and
hostif_infrastructure_set2_request_t is identical, with the exception
of the event type value. Merge the two structs so they can be handled
by a single function ('hostif_infrastructure_set_request').

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72d73d63 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Factor out repeated code for reading IEs.

Some of the code for reading IEs is replicated multiple times in the
switch statement for get_ap_information(). Factor that code out into
read_ie().

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f9b280fa 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace memcmp() operation with ether_addr_equal().

Instead of using memcmp() to directly compare BSSIDs, use
ether_addr_equal() from 'linux/etherdevice.h'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6024089f 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Factor out common members in request structs.

Most of the request structures defined in ks_hostif.h have common
members:
* __le16 phy_type;
* __le16 cts_mode;
* __le16 scan_type;
* __le16 capability;
* struct rate_set16_t rate_set;

Factor out these members into a common substructure of type
'hostif_request_t'. This allows a large portion of the request
initialization code in ks_hostif.c to be factored out into the
'init_request' function.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 20e9cb0a 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Fix lines over 80 characters due to comments.

There are several instances where comments are spaced so far to the
right they cause the line to go over the 80 character limit. Move
these comments to above the statements they describe instead.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5927cb34 22-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Fix line over 80 characters.

There is no reason for comment describing the BSSID check for loop
to be spaced so far to the right. Move it above the for loop.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 38fc31e7 20-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h

This commit reviews some custom defines changing them for the
globals defined in if_ether header file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a00c38a3 20-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove max_event_count field which is only being used in debug

This patch removes max_event_count field of sme_info structure which is a
write only variable just being used for debug purposes.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 31ce0d86 20-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace KS_WLAN_DEBUG with DEBUG preprocessor directive

This commit replaces custom KS_WLAN_DEBUG which is not being used anymore
in favour of DEBUG which is the one included when debugging is enabled.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5259b329 15-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace DPRINTK traces in favour of netdev_*

This commit removes custom defined DPRINTK macro and replaces all the
associated debug and other traces for preferred ones netdev_*.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7acf4002 15-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove useless DPRINTK traces

This commit removes some useless traces in some source files

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81614813 14-Mar-2018 Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>

staging: ks7010: Remove braces around single statement

Remove braces around single statement. Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 33f328f7 06-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace literal with constant.

Replace literal bytestring with CIPHER_ID_WPA_WEP40 constant.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 58060d00 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace local frame type constants with kernel constants.

This driver defined constants FRAME_TYPE_* to represent frame control
field codes; however, these constants are already defined in the header
'linux/ieee80211.h' as IEEE80211_STYPE_*. This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c468d584 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace local capability constants with kernel constants.

This driver defined constants BSS_CAP_* to represent WLAN capability
codes; however, these constants are already defined in the header
'linux/ieee80211.h' as WLAN_CAPABILITY_*. This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ecad5e1e 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

The code that generates a WLAN capability mask is repeated in five
functions. This change refactors that code into a new function, which is
called now in each of those functions.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 15b6d73e 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace SSID_MAX_SIZE with IEEE80211_MAX_SSID_LEN.

SSID_MAX_SIZE is a constant defined locally in ks_hostif.h, but it should
be replaced with IEEE80211_MAX_SSID_LEN from the kernel's 802.11 header,
of which it is just a copy.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc13498a 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Use constants from ieee80211_eid instead of literal ints.

The case statement in get_ap_information() should not use literal integers
to parse information element IDs when these values are provided by name
in 'enum ieee80211_eid' in the header 'linux/ieee80211.h'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b6520468 19-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

Staging: ks7010: hostif: Convert the ps_confirm_wait_inc() macro to a real function.

Convert the unsafe macro into an inline function.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e4281f38 19-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

Staging: ks7010: hostif: Convert SME queue macros to real functions.

Convert the unsafe macros into inline functions.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d894e25b 28-Aug-2017 Jonathan Whitaker <jon.b.whitaker@gmail.com>

Staging: ks7010: Fix alignment should match open parenthesis.

This commit fixes alignment styling as reported by checkpatch.pl.

Signed-off-by: Jonathan Whitaker <jon.b.whitaker@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 59ae1d12 16-Jun-2017 Johannes Berg <johannes.berg@intel.com>

networking: introduce and use skb_put_data()

A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)

@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)

@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# f6e8716a 08-Jun-2017 Perry Hooker <perry.hooker@gmail.com>

staging: ks7010: use little-endian types

This patch fixes a number of sparse warnings of the form:
drivers/staging/ks7010/ks_hostif.c:2187:29:
warning: incorrect type in assignment (different base types)
generated when storing little-endian data in variables
that do not have a specified endianness.

Signed-off-by: Perry Hooker <perry.hooker@gmail.com>
Reviewed-By: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9f98c6e6 04-Jun-2017 Richard Porter <dick@acm.org>

staging: ks7010: use le16_to_cpu() to access __le16 field

Fixes sparse warning:
drivers/staging/ks7010/ks_hostif.c:959:24: warning: restricted __le16
degrades to integer

Signed-off-by: Richard Porter <dick@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 16bd2c48 16-May-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: avoid CamelCase: receiveDTIMs

Replace CamelCase variable name with underscores to comply
with the standard kernel coding style.

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95dddaa9 15-May-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: avoid CamelCase: local variables in ks_hostif.c

Replace CamelCase local variables' name with underscores to comply
with the standard kernel coding style.
Changed:
- LinkSpeed
- TransmittedFrameCount
- ReceivedFragmentCount
- FailedCount
- FCSErrorCount

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 683356d1 07-May-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: hostif, u16 data types to __le16

Target device is little endian. Host interface data structures used
for building frames to pass to target device should use little endian
data types. All u16 structure members in ks_hostif.h need to be
changed to __le16, Sparse can then be used to make sure we update all
code that touches these data.

Change all u16 data types in host interface structures to be
__le16. Update all code that touches modified data types. Check using
Sparse.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1d6c2622 29-Apr-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: avoid CamelCase: reqIEs_size and respIEs_size

Replace CamelCase association_request_t and association_response_t
struct field names with underscores to comply with the standard kernel
coding style.

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 93270634 29-Apr-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: avoid CamelCase in fields of struct local_gain_t

Replace CamelCase fields of struct with underscores to comply
with the standard kernel coding style

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ec4d9227 28-Apr-2017 Ilia Sergachev <ilia.sergachev@unibas.ch>

staging: ks7010: remove line continuations in quoted strings

Checkpatch emits WARNING: Avoid line continuations in quoted strings.

Remove line continuations - split strings using quotes.

Signed-off-by: Ilia Sergachev <ilia.sergachev@unibas.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72f78682 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: clean up macro ps_confirm_wait_inc

Macro includes commented out code. Removing dead code line enables
braces to be removed. Macro is easier to read if the code is clean.

Clean up macro ps_confirm_wait_inc.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e04f2ec6 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: continue from loop on unmatched mac

Inside loop, code block is guarded with an 'if' statement. Instead of
guarding the block we can invert the 'if' statement conditional and
continue the loop. Doing so allows subsequent code indentation to be
reduced and aids the readability of the code.

Invert 'if' statement conditional, continue loop if new conditional
evaluates to true. Reduce subsequent code indentation level. Do not
change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8fb8e05c 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: make abbreviation mgmt uniform

Driver currently uses abbreviations 'mgt' and 'mngmt' for
'management'. Also 'power' is sometimes abbreviated to 'pow' and other
times not. It makes the code easier to read and easier to modify if
one abbreviation is used throughout the driver. 'mgmt' is widely
accepted as an abbreviation of 'management'. 'power' can be spelled
out in full, the extra two characters aids readability without an
excessive cost.

Make abbreviation of 'management' uniform across the driver, function
names, preprocessor defined constants, and enumeration types.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 27476f01 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch LINE_SPACING

Checkpatch emits CHECK: Please don't use multiple blank lines.

Remove multiple blank lines.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 63c31af3 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add enum sleep_mode_type

Driver uses preprocessor directives to define SLP_ASLEEP and
SLP_ACTIVE. These can be defined using an enumeration type. Doing so
adds to the readability and gives the usual compiler benefits of
having an enum. Functions that currently accept integer types can now
use the new enumeration type, further aiding readability.

Add enumeration type sleep_mode_type. Update code that handles sleep
mode to use the new enumeration type.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0e24eb8a 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: abstract connection status

Host interface connection status is handled using a 32 bit type. Top
byte is used as for FORCE_DISCONNECT status, low bits are used for
connect/disconnect status. Driver masks and checks integers to
ascertain status. If functions are defined to do the masking and
equality check then the details of how the status integer is used are
abstracted away. This makes the code easier to read. Also future
updates to the status handling will be easier because the code is in
one place.

Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as
values, as apposed to opaque values. Because of this driver code
checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as
apposed to negating a single check (ie 'foo != CONNECT_STATUS). In
order to maintain the current functionality we define two separate
functions is_connect_status() and is_disconnect_status().

Add functions to abstract the status integer check. Update all sites
that do the check manually to use the newly defined functions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 11ce16da 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add hostif_generic_request()

Driver contains duplicate code. Host interface has numerous request
functions which allocate memory for a request header. Each request
header is different but all contain, as the first member, a hostif_hdr
structure. This structure has size and event members which need to be
set. By defining a helper function to allocate the memory and set the
initial hostif_hdr members code duplication is reduced.

Add function to allocate memory for a host interface request. Set
'size' and 'event' members. Remove duplicate code using newly defined
function.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95e72fba 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: clean memory allocation

Memory allocation code contains unneeded debug statements, failed
kmalloc() calls typically do not require a debug message. Introduction
of a local 'size' variable allows kmalloc() call to be marginally
cleaner, still uses magic numbers but these require a more substantial
fix. Moving the magic numbers onto a single line opens the way for
further refactoring.

Clean memory allocation code, remove debug statements.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8215fc60 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove duplicate code

Current switch statement has duplicate code in branches. This code can
be put after the switch statement so as to remove the duplication.

Move code to after switch statement, remove duplicate code. Make error
branch return so as not to execute the moved code block. Do not change
the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 08484ef4 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove magic numbers

Driver includes magic numbers. Defining constants or using existing
constants aids the readability of the code.

Magic number '12' is used for two ethernet addresses (6 bytes
each). ETH_ALEN is already defined within the kernel to 6. We can us
the expression '2 * ETH_ALEN' to make this code explicit.

Magic number '20' refers to the data size, in bytes, of a struct
ether_hdr (described in eap_packet.h). We can define a constant for
this purpose, making the code explicit and easier to read.

Define constant. Remove magic numbers, using newly defined constant
and/or expression using existing kernel constant.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8cd1dbe1 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move skb null check near allocation

Currently, after allocating an sk_buff, driver fills the sk_buff
within code block guarded by a NULL check on the sk_buff. If a NULL
check is done immediately after the allocation, and code returns on
error, then the subsequent code need not be guarded and the level of
indentation may be reduced. This aids the readability of the code and
makes explicit the error path.

Check for NULL directly after allocating the sk_buff, return if
allocation fails. Reduce indentation of subsequent code. Do not change
the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 69f3fecc 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove unused local variable eap_key

Code declares and assigns to a local variable that is never used, it
can be safely removed.

Remove unused local variable.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 208c66f2 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove unnecessary address check

Currently source and destination ethernet addresses are checked twice,
once in hostif_data_indication() and then again in
hostif_data_indication_wpa(). The second of these functions is called
from the first right after the address check is done. This check is a
duplicate and is unnecessary.

Remove unnecessary duplicate address check.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 18bd6dd1 17-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move hw info into dev private data

Currently driver uses a hardware information struct description to
group some SDIO related functionality (work, work queue, sdio private
data pointer). This structure is then embedded in the device private
data structure. Having nested structures described in different header
files means that to view the device private data programmers must open
two header files. This structure could be embedded anonymously in the
device private data and achieve the same result (grouping of function
specific to SDIO) without the need to open multiple headers. However,
the SDIO private data structure already has various different data and
pointers, adding the embedded structure adds little extra meaning and
lengthens all the dereferences throughout the driver, often meaning
addition line breaks and braces. We can increase readability and
reduce code complexity by moving the hardware information data and
pointers to directly be within the device private data structure
description.

While preparing for this refactoring it was noted that the identifier
currently used for the delayed work is 'rw_wq', this is confusing
since the 'wq' suffix typically means 'work queue'. This identifier
would be more meaningful if it used the suffix 'dwork' as does the
declaration of queue_delayed_work() (include/linux/workqueue.h).

The identifier for the work queue is currently 'ks7010sdio_wq'. This
identifier can be shortened without loss of meaning because there is
only one work queue within the driver. Identifier 'wq' is typical
within in-tree driver code and aptly describes the pointer.

Current pointer to the SDIO private data is identified by 'sdio_card',
this is sufficiently meaningful from within the hw_info structure but
once the hw_info_t structure is removed the pointer would be better to
have a prefix appended to it to retain the prior level of meaning.

Move members from struct hw_info_t to struct ks_wlan_private.

Rename identifiers;
struct delayed_work pointer 'rw_wq' to 'rw_dwork'.
struct workqueue_struct pointer 'ks7010sdio_wq' to 'wq'.
struct ks_sdio_card pointer 'sdio_card' to 'ks_sdio_card'.

Remove structure description hw_info_t. Fix init/destroy calls. Fix
all call sites, SDIO private data access calls, and queuing calls.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 07e483c1 17-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename wakeup work struct

struct work_struct uses identifier ks_wlan_wakeup_task, this is
confusing because the 'task' suffix implies that this is a
tasklet_struct instead of a work struct. Suffix 'work' would be more
clear. The code would be easier to read if it followed the principle
of least surprise and used the 'work' suffix for a work_struct
identifier.

Rename work_struct structure 'ks_wlan_wakeup_task' to 'wakeup_work'.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 055da4f9 17-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix complete_handler

complete_handler() takes void * types as parameters. void * parameters are then
cast to struct types. Call sites for this function either pass in NULL
or pointers to the struct types cast to void *. This casting is
unnecessary and can be removed.

Struct tx_device_buffer (which contains a pointer member to the
complete_handler() function) has as member 'ks_wlan_priv *priv' this is
unnecessary, we always have a pointer to this struct there is no need
to store it here.

The complete_handler can be more clearly defined by using struct
pointer types instead of void * types. The code is currently
unnecessarily complex, storing and passing extraneous pointer
parameters.

Remove unnecessary parameters, unnecessary casting to/from 'void
*'. Fix all call sites involving complete_handler().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d317d054 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move check and break to top of loop

Function uses an if statement within a for loop to guard a block of
code. If 'if' statement conditional evaluates to false, loop breaks. The
same logic can be expressed by inverting the conditional and breaking
when new conditional evaluates to true. This allows the subsequent code
to be indented one level less, aiding readability. Reduced indentation
also allows for the code to be laid out more clearly and fixes two
checkpatch warnings.

Invert if statement conditional, break from for loop if new
conditional evaluates to true. Reduce indentation in subsequent code,
fix whitespace issues. Do not change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# eb8c4e54 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove multi-way decision

Function uses multi-way decision for control flow. Final statement of
function is spin_unlock(). Code can be simplified by adding a goto label
labelling the call to spin_unlock() and jumping to label instead of
using multi-way decision. This allows the code to be indented one
level less which adds to the readability.

Add goto label. Remove multi-way decision by jumping to label. Reduce
indentation in subsequent code. Do not change program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e0aa795 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove unused macro

Macro CHECK_ALINE is defined and never used.

Remove unused macro.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4906be24 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch MULTILINE_DEREFERENCE

Checkpatch emits WARNING: Avoid multiple line dereference.

Fix up layout of function call, move dereference to single line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 331454f4 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch LOGICAL_CONTINUATIONS

Checkpatch emits multiple CHECK: Logical continuations should be on the
previous line.

Move logical continuations to the end of the previous line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78037ef1 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename identifier packet to skb

Kernel networking code predominately uses the identifier 'skb' for a struct
sk_buff pointer. Of 8088 instances of 'struct sk_buff *' within
net/ 6670 are named 'skb'. Following the principle of least surprise,
new networking code should use the identifier 'skb' for variables of
type 'struct sk_buff *'.

Rename identifier 'packet' to 'skb'.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 37ab542e 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename RecvMIC to recv_mic

Identifier uses camel case, standard kernel style does not use camel
case.

Rename buffer 'RecvMIC' to 'recv_mic'.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2c4951ad 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: invert if statement conditionals

Checkpatch emits WARNING: Avoid multiple line dereference.

Function uses if statement blocks to guard the body of the
function. If we invert these conditionals and return, then the code
becomes more readable and subsequent code is indented less. The
checkpatch fix then follows trivially.

Invert conditionals, return from function if new conditional evaluates
to true. Reduce the level of indentation in subsequent code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6ad6e21b 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove redundant check

Function checks for condition inside a loop that checks the same
condition, this is redundant. Fix also removes checkpatch CHECK.

Remove redundant check.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 61082bf6 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add braces to multi-line indent

The addition of curly braces around single statements that span
multiple lines makes the code more readable in general.

Add curly braces to multi-line indented statement.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 310e916f 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add explicit check to 'size' variables

When checking the value of a variable that holds a 0 an explicit check
is good style. i.e

- if (!size)
+ if (size == 0)

Update checks on 'numerical' variables to use explicit checks.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b5ca039a 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add explicit check to memcmp() calls

Calls to functions memcmp() and strcmp() are more clearly readable
when the return value is explicitly checked. i.e

if (memcmp(foo, bar, size) == 0)

Modify driver to use an explicit check on the value returned by
memcmp().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1770ae9d 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename return value identifier

Driver uses multiple identifier names for the same task (retval, ret,
rc). It would be easier to read the code if a single task is
identified with a single name. 'ret' is the most common return value
identifier name found in the kernel tree, following the principle of
least surprise using 'ret' is a decent choice.

Rename rc -> ret
Rename retval -> ret

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c133b9bd 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove non-zero comparison

Comparison, does not equal zero, is redundant

'if (foo != 0)' is equal to 'if (foo)'

Typical kernel coding style is to use the shorter form.

Remove unnecessary non-zero comparison.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0185f6c9 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch MULTIPLE_ASSIGNMENTS

Checkpatch emits CHECK: multiple assignments should be avoided.

Move multiple line assignment to individual lines.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5a21405d 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch BRACES

Checkpatch emits CHECK: Unbalanced braces around else
statement. Statements in question are single statements so we do not
need braces. Checkpatch also warns about multiple line dereference for
this code.

Fix if/else/else if statement use of braces. Fix function argument layout
at the same time since it is the same statement.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# aa6ca807 14-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove custom return values

Driver code uses custom return values (often positive) to signal error
condition instead of using standard kernel error codes.

Replace custom return values with standard kernel error codes.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 86ea6167 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix spelling of Michael MIC

Driver mixes spelling michael and michel in symbol names and
comments. Michael here references the IEEE 802.11i Message Integrity
Code. It is incorrect to spell it michel and confusing having two
spellings for the same thing.

Change michel -> micheal in both symbol names and comments.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dfe41b4f 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add variables key, key_index

'auth_type - 1' is used as an index into a key table. Adding a variable
appropriately named simplifies the code and adds meaning when
reading. Adding a pointer variable of type struct *kpa_key_t adds to
readability by removing the table access each time the key is used.

The key index is used to create a string so having it named adds
additional meaning when creating the string.

Declare variable 'key_index' and define it at declaration time. Declare
a pointer variable 'key' and define it to point to the correct key in
the key table.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1b45ba65 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: reduce length of comment string

Comment string is unnecessarily verbose. Checkpatch emits WARNING:
line over 80 characters.

Reduce comment string without loss of meaning.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6e37c715 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move quoted string onto single line

Checkpatch emits WARNING: quoted string split across lines. Line is
already over 80 characters long, adding 3 more does little to effect
line length while improving readibility.

Concatenate split string into single line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c60b486d 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: refactor newly separated function

Checkpatch emits various warnings and checks;

WARNING: Avoid multiple line dereference
CHECK: Alignment should match open parenthesis
WARNING: line over 80 characters
CHECK: Blank lines aren't necessary before a close brace '}'

These are all whitespace fixes.

Refactor whitespace inline with kernel coding style. Fix various
checkpatch warnings.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6422c6ef 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix line continuations

Checkpatch emits CHECK: Logical continuations should be on the
previous line. Also the same code section causes checkpatch to emit
WARNING: Avoid multiple line dereference.

Move logical line continuations onto the previous line. Move multiple
line dereferences onto single line.

Make these two changes in a single patch to give review a chance
to critique the final layout of the *complex* logical statement.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dfd6b480 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: reduce level of indentation

Code is deeply nested. One level of indentation may be removed by
inverting if statement conditional.

Invert conditional, return if new conditional evaluates to true.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 034a7178 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move WPA code to separate function

Checkpatch emits WARNING: Too many leading tabs - consider code
refactoring. Function contains 5 levels of nesting and 14 local
variables. Code can be simplified and nesting reduced by refactoring
into separate functions.

WPA code is contained and may be factored out into a separate
function. This will reduce the length and complexity of
hostif_data_indication(). At times within the WPA code errors result
in the function returning. In order to maintain this behaviour new
function should return a status integer.

Factor out WPA code into separate function. Add only code needed to
get compilation to pass, including modifying return statements. Make
no other code changes, program logic is unchanged.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5e4e2ef7 11-Mar-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_hostif.*: Use preferred 'u32' kernel type over 'uint32_t'

Fix prefer kernel type 'u32' over 'uint32_t' checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81952f38 11-Mar-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_hostif.*: Use preferred 'u16' kernel type over 'uint16_t'

Fix prefer kernel type 'u16' over 'uint16_t' checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 184eb0c5 11-Mar-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Use preferred 'u8' kernel type over 'uint8_t'

Fix prefer kernel type 'u8' over 'uint8_t' checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 745cab03 08-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch CONSTANT_COMPARISON

Checkpatch emits WARNING: Comparisons should place the constant on the
right side of the test.

Move comparison constant to the right side of the test.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c88ff5ae 08-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch whitespace warnings

Checkpatch emits various warnings/errors pointing to misplaced
spaces.

- trailing whitespace
- please, no spaces at the start of a line
- please, no space before tabs
- Unnecessary space before function pointer arguments
- unnecessary whitespace before a quoted newline
- code indent should use tabs where possible

Remove all undesirable whitespace.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# be046617 01-Mar-2017 Arushi Singhal <arushisinghal19971997@gmail.com>

staging: ks7010: Unnecessary parentheses removed and improved coding style.

Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as it's often nicer to read if
&(foo[0]) is converted to foo like:
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1935c145 28-Feb-2017 Arushi Singhal <arushisinghal19971997@gmail.com>

staging: ks7010: Unnecessary parentheses removed and improved coding style.

Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as it's often nicer to read if
&(foo[0]) is converted to foo like:
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d680d24e 19-Feb-2017 Katie Dunne <kdunne@mail.ccsf.edu>

staging: ks7010: remove unecessary spaces after casts

Remove spaces after casts found by checkpatch.pl. In some cases,
remove returns after casts and place them on a single line.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f4d00cd 17-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Braces should be used on all arms of these statements

Braces should be used on all arms of these statements (CHECK)..

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# db224d31 16-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: Add required and preferred spaces around operators

Spaces should be added around operators to improve readability
and are required in some cases.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fac103e0 10-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Removed blank lines before and after braces.

Removing unnecessary blank lines around braces to solve CHECKS.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4a7c9726 18-Jan-2017 Tobias Klauser <tklauser@distanz.ch>

net: Remove usage of net_device last_rx member

The network stack no longer uses the last_rx member of struct net_device
since the bonding driver switched to use its own private last_rx in
commit 9f242738376d ("bonding: use last_arp_rx in slave_last_rx()").

However, some drivers still (ab)use the field for their own purposes and
some driver just update it without actually using it.

Previously, there was an accompanying comment for the last_rx member
added in commit 4dc89133f49b ("net: add a comment on netdev->last_rx")
which asked drivers not to update is, unless really needed. However,
this commend was removed in commit f8ff080dacec ("bonding: remove
useless updating of slave->dev->last_rx"), so some drivers added later
on still did update last_rx.

Remove all usage of last_rx and switch three drivers (sky2, atp and
smc91c92_cs) which actually read and write it to use their own private
copy in netdev_priv.

Compile-tested with allyesconfig and allmodconfig on x86 and arm.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 35092b6d 18-Oct-2016 Wei Yongjun <weiyongjun1@huawei.com>

staging: ks7010: convert list_for_each to entry variant

convert list_for_each() to list_for_each_entry() where
applicable.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bd46a801 16-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: Remove braces around single statement blocks

Fixes checkpatch warning: braces{} are not necessary for
single statment blocks

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ab1effc0 16-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: Add blank line after declarations

Fixes checkpatch.pl warning :Missing a blank line
after declarations

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4ba165e7 09-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: use netdev_* instead of printk()

1. Fixes checkpatch warning on printk usage in ks_hostif.c
2. Dropped "ks_wlan" prefix from the messages
3. Removed the "Memory squeeze,dropping packet" messages

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c44893aa 08-Oct-2016 Mihaela Muraru <mihaela.muraru21@gmail.com>

Staging: ks7010: Delete unnecessary return statement

This is a patch to ks_hostif.c file that fixes up a checkpatch.pl

WARNING: void function return statements are not generally useful.

The 'return' statement is not useful here, because it is not necessary to be
forced the exit of the function.

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 31a86a53 07-Oct-2016 Mihaela Muraru <mihaela.muraru21@gmail.com>

Staging: ks7010: __packed instedad of __attribute__((packed))

Fix a issue found by checkpatch.pl tool:

"WARNING: __packed is preferred over __attribute__((packed))".

Replace __attribute__((packed)) with __packed.

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a98abcc 06-Oct-2016 Pontus Fuchs <pontus.fuchs@gmail.com>

staging: ks7010: Use printk format specifier for MAC addresses

Convert to %pM instead of custom code.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f64b35e 02-Oct-2016 Philipp Hoefflin <p.hoefflin@posteo.de>

staging: ks7010: fix checkpatch "space after #ifdef" error

Fix checkpatch "ERROR: exactly one space required after that #ifdef"
error in ks_hostif.c.

Signed-off-by: Philipp Hoefflin <p.hoefflin@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0157403e 02-Oct-2016 Philipp Hoefflin <p.hoefflin@posteo.de>

staging: ks7010: reformat makro ps_confirm_wait_inc()

Reformat the makro ps_confirm_wait_inc() to fix several checkpatch
errors and warnings:
- ERROR: space required before the open brace '{'
- ERROR: space required before the open parenthesis '('
- ERROR: code indent should use tabs where possible
- ERROR: space required after that close brace '}'
- ERROR: space required before the open parenthesis '('
- WARNING: line over 80 characters
- WARNING: please, no spaces at the start of a line

Signed-off-by: Philipp Hoefflin <p.hoefflin@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ec9d6dce 02-Oct-2016 Philipp Hoefflin <p.hoefflin@posteo.de>

staging: ks7010: use tabs for indentation

Fix all occurences of checkpatch "ERROR: code indent should use tabs
where possible" errors in ks_hostif.c.

Signed-off-by: Philipp Hoefflin <p.hoefflin@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6f880068 02-Oct-2016 Philipp Hoefflin <p.hoefflin@posteo.de>

staging: ks7010: fix "prohibited space" errors reported by checkpatch

Fix all occurences of the following checkpatch errors in ks_hostif.c:
- ERROR: space prohibited after that '&' (ctx:WxW)
- ERROR: space prohibited after that open parenthesis '('
- ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Philipp Hoefflin <p.hoefflin@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d30924a0 22-Sep-2016 Johan Svensson <johan.svensson692@gmail.com>

staging: ks7010: add blank line after variable declarations

Fixes warnings found by checkpatch
Missing a blank line after declarations

Signed-off-by: Johan Svensson <johan.svensson692@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 55d6aacd 19-Sep-2016 Sandhya Bankar <bankarsandhya512@gmail.com>

Staging: ks7010: Use "foo *bar" instead of "foo * bar"

This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0525a57b 18-Sep-2016 sayli karnik <karniksayli1995@gmail.com>

staging: ks7010: Remove unnecessary variable used to store return value

This patch removes an unnecessary variable used to store return values in order
to reduce memory usage.
Done using coccinelle:
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
return
- ret
+ C
;

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 197cc86e 18-Sep-2016 Hariharan R <hariharanrangasamy@gmail.com>

staging: ks7010: fixes typo in ks_hostif.c

Fixes typo,
FAILUER -> FAILURE
Recieve -> Receive

Signed-off-by: Hariharan R <hariharanrangasamy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2751bc91 17-Sep-2016 Bhumika Goyal <bhumirks@gmail.com>

Staging: ks7010: Remove extern keyword from function declaration

Remove extern specifier from function declaration as they have
it by default. Also move extern declaration from .c files to
their respective header file 'ks_hostif.h'. Coccinelle was used
to remove extern and other changes were done by hand.
Script:
@@
identifier func;
type T;
@@
- extern
T func(...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 30b48e2d 16-Sep-2016 Bhumika Goyal <bhumirks@gmail.com>

Staging: ks7010: Replace memset with eth_zero_addr

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
Script:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a1a736df 15-Sep-2016 sayli karnik <karniksayli1995@gmail.com>

staging: ks7010: Remove the explicit cast on kmalloc

The assignment operator implicitly converts a void pointer to the type of the
pointer it is assigned to. Hence an explicit cast on the result of the kmalloc
function is not required.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c8abeaf8 14-Sep-2016 Rehas Sachdeva <aquannie@gmail.com>

staging: ks7010: Remove whitespace before newline

This patch fixes the checkpatch.pl warning:
WARNING: unnecessary whitespace before a quoted newline.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c7e65f4d 12-Sep-2016 sayli karnik <karniksayli1995@gmail.com>

staging: ks7010: Remove the explicit NULL comparison

The patch removes the explicit null comparisons entirely for the ks7010 driver.
This was detected by checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# aeaf5d86 09-Sep-2016 Colin Ian King <colin.king@canonical.com>

staging: ks7010: fix two memory leaks on error return path

On the error case where there is an invalid MAC address there is
memory leak on packet and pp on the error return. Free these first
before returning to fix the leak.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95d2a324 15-Aug-2016 Colin Ian King <colin.king@canonical.com>

staging: ks7010: don't print skb->dev->name if skb is null

A null pointer dereference will occur when skb is null and
skb->dev->name is printed. Replace the skb->dev->name with
plain text "ks_wlan" to fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9afe11e9 25-Jul-2016 Nicholas Mc Guire <hofrat@osadl.org>

staging: ks7010: declare private functions static

Private functions in ks_hostif.c can be declared static.

Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository")

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9d29f14d 25-Jul-2016 Nicholas Mc Guire <hofrat@osadl.org>

staging: ks7010: fix wait_for_completion_interruptible_timeout return handling

wait_for_completion_interruptible_timeout return 0 on timeout and
-ERESTARTSYS if interrupted. The check for
!wait_for_completion_interruptible_timeout() would report an interrupt
as timeout. Further, while HZ/50 will work most of the time it could
fail for HZ < 50, so this is switched to msecs_to_jiffies(20).

Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository")

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c5d9a030 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: cleanup file headers

Remove svn-ids and fix typos in the licence declaration. Add my
copyright to the sdio code which I worked on mainly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 20c4f9c5 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: indent ks_hostif.c

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# feedcf1a 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove unecessary typedef

Let's simply specify the struct to keep in sync with kernel coding
style.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f88e6d33 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: really iterate over multicast addresses

The loop variable was defined but not really used. Fix this.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 564efd79 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: delete seperate debug header

Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72bf7500 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove code for old kernel versions

No need to be backwards compatible.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4ab27401 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove checks for WIRELESS_EXT version

We are by far newer than that anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 021873f6 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove non-SDIO code and #ifdefs

I couldn't find any trace of code or even products using ks7010 with
something else than SDIO. So, remove the conditionals.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 13a9930d 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: add driver from Nanonote extra-repository

See the TODO for details where this driver came from. Only a few minor
changes were made to make the driver suitable for staging:

* updated Kconfig help text and dependencies
* added TODO
* removed two __DATE__ and __TIME__ printouts to allow reproducible builds
* added to staging main Kconfig + Makefile

Tested on a Renesas Salvator-X board with a Spectec SDW-823 card. I
could connect to a WPA-protected network.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>