platform/kernel/linux-rpi3.git
6 years agostaging: fsl-dpaa2/eth: add the get_ts_info interface for ethtool
Yangbo Lu [Thu, 26 Apr 2018 10:23:48 +0000 (18:23 +0800)]
staging: fsl-dpaa2/eth: add the get_ts_info interface for ethtool

Since hardware timestmaping has been supported in driver, this
patch is to add the get_ts_info interface for ethtool to show
timestamping capability.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/eth: Add support for hardware timestamping
Ioana Radulescu [Thu, 26 Apr 2018 10:23:47 +0000 (18:23 +0800)]
staging: fsl-dpaa2/eth: Add support for hardware timestamping

Hardware timestamping is supported both on Rx and Tx paths.
On Rx, timestamping is enabled for all frames. On Tx, we
only instruct the hardware to timestamp the frames marked
accordingly by the stack.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: reorder functions to avoid forward declaration in linux_wlan
Ajay Singh [Wed, 25 Apr 2018 17:18:26 +0000 (22:48 +0530)]
staging: wilc1000: reorder functions to avoid forward declaration in linux_wlan

Reorder the functions in linux_wlan.c file to avoid having explicit
declaration of static functions. Forward declaration is avoided
with the help of reordering the function.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change function to static in linux_wlan
Ajay Singh [Wed, 25 Apr 2018 17:18:25 +0000 (22:48 +0530)]
staging: wilc1000: change function to static in linux_wlan

Defined function as static which are used only in single file. And also removed
their declaration from header file.
Below function are changed to static
wilc_wlan_initialize()
wilc_wlan_deinitialize()
wilc_wlan_get_firmware()

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove inner block '{}' in handle_remain_on_chan()
Ajay Singh [Wed, 25 Apr 2018 17:18:24 +0000 (22:48 +0530)]
staging: wilc1000: remove inner block '{}' in handle_remain_on_chan()

Cleanup patch to remove unnecessary inner block {\* *\} in
handle_remain_on_chan().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename P2P_LISTEN_STATE variable to use lowercase
Ajay Singh [Wed, 25 Apr 2018 17:18:23 +0000 (22:48 +0530)]
staging: wilc1000: rename P2P_LISTEN_STATE variable to use lowercase

Rename P2P_LISTEN_STATE variable to avoid using uppercase for variable
name to follow linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused enum 'stats_flags'
Ajay Singh [Wed, 25 Apr 2018 17:18:22 +0000 (22:48 +0530)]
staging: wilc1000: remove unused enum 'stats_flags'

Cleanup patch to remove the unused enum.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused elements in 'wilc_priv' struct
Ajay Singh [Wed, 25 Apr 2018 17:18:21 +0000 (22:48 +0530)]
staging: wilc1000: remove unused elements in 'wilc_priv' struct

Cleanup patch to remove unused element from 'wilc_priv' structure.

Below elements are removed in 'wilc_priv' structure:

struct WILC_WFI_packet *ppool;
struct WILC_WFI_packet *rx_queue; /* List of incoming packets */
int rx_int_enabled;
int tx_packetlen;
u8 *tx_packetdata;
struct napi_struct napi;

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename wlan init and deinit function prefixed with wil1000
Ajay Singh [Wed, 25 Apr 2018 17:18:20 +0000 (22:48 +0530)]
staging: wilc1000: rename wlan init and deinit function prefixed with wil1000

Rename wilc1000_wlan_init() & wilc1000_wlan_deinit() function to avoid
unecessary 'wilc1000' prefix in function to be inline with other
function naming convension.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename num_reg_frame macro to have uppercase in macro name
Ajay Singh [Wed, 25 Apr 2018 17:18:19 +0000 (22:48 +0530)]
staging: wilc1000: rename num_reg_frame macro to have uppercase in macro name

Cleanup patch to follow name as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WILC_WFI_stats to avoid uppercase
Ajay Singh [Wed, 25 Apr 2018 17:18:18 +0000 (22:48 +0530)]
staging: wilc1000: rename WILC_WFI_stats to avoid uppercase

Cleanup patch to have struct name as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename mac status macros and moved related #define together
Ajay Singh [Wed, 25 Apr 2018 17:18:17 +0000 (22:48 +0530)]
staging: wilc1000: rename mac status macros and moved related #define together

Rename the mac status macro to follow the same naming style. Also move
them to keep together.

Renamed like below

>From ------------------------> To

WILC_MAC_STATUS_INIT -> MAC_STATUS_INIT
MAC_CONNECTED --------> MAC_STATUS_CONNECTED
MAC_DISCONNECTED -----> MAC_STATUS_DISCONNECTED

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused #define related to MAC status
Ajay Singh [Wed, 25 Apr 2018 17:18:16 +0000 (22:48 +0530)]
staging: wilc1000: remove unused #define related to MAC status

Remove below #define which are not used in code:

WILC_MAC_STATUS_READY
WILC_MAC_STATUS_CONNECT

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove used #define HIF_SDIO_GPIO_IRQ
Ajay Singh [Wed, 25 Apr 2018 17:18:15 +0000 (22:48 +0530)]
staging: wilc1000: remove used #define HIF_SDIO_GPIO_IRQ

Cleanup patch to remove unused #define.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unsed typedef wilc_debug_func
Ajay Singh [Wed, 25 Apr 2018 17:18:14 +0000 (22:48 +0530)]
staging: wilc1000: remove unsed typedef wilc_debug_func

Cleanup patch to remove the unused typedef and also removed the
unecessary comment about that typedef.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused variable scan_while_connected
Ajay Singh [Wed, 25 Apr 2018 17:18:13 +0000 (22:48 +0530)]
staging: wilc1000: remove unused variable scan_while_connected

Cleanup patch to remove the unused variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: simplified if conditions in spi_data_write()
Ajay Singh [Wed, 25 Apr 2018 17:18:12 +0000 (22:48 +0530)]
staging: wilc1000: simplified if conditions in spi_data_write()

Cleanup patch to simplify the if conditions logic in spi_data_write().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove inner {} in wilc_parse_network_info()
Ajay Singh [Wed, 25 Apr 2018 17:18:11 +0000 (22:48 +0530)]
staging: wilc1000: remove inner {} in wilc_parse_network_info()

Cleanup patch to remove the unnecessary {/**/} block in
wilc_parse_network_info().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wicl1000: removed the unsed variables in wilc_parse_network_info()
Ajay Singh [Wed, 25 Apr 2018 17:18:10 +0000 (22:48 +0530)]
staging: wicl1000: removed the unsed variables in wilc_parse_network_info()

Cleanup patch to remove the unused variables in
wilc_parse_network_info(). The value is assinged to these local
variables but assinged value is not used in that function.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove 'cmd' variable in wilc_spi functions
Ajay Singh [Wed, 25 Apr 2018 17:18:09 +0000 (22:48 +0530)]
staging: wilc1000: remove 'cmd' variable in wilc_spi functions

Cleanup patch to remove the 'cmd' variable in wilc_spi.c. Instead of
using cmd now passing the command directly.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unnecessary assingment from 'if' conditions
Ajay Singh [Wed, 25 Apr 2018 17:18:08 +0000 (22:48 +0530)]
staging: wilc1000: remove unnecessary assingment from 'if' conditions

Cleanup patch to remove the unnecessary use of '==' check used in if
conditions.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: align the #define in wilc_spi file
Ajay Singh [Wed, 25 Apr 2018 17:18:07 +0000 (22:48 +0530)]
staging: wilc1000: align the #define in wilc_spi file

Cleanup patch to align the #define used in wilc_spi.c file by adding the
tabs.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_translate_scan function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:55 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_translate_scan function

This commit refactors ks_wlan_translate_scan function with
the following changes:

    - reorder local variables
    - use ether_addr_copy to copy ethernet addresses
    - change style in 'current_ev' variable assignments
    - make use of some ternaries avoiding if-else code
    - use preferred style for comments
    - extract common code into a new ks_wlan_add_leader_event
      function

After this changes readability has been improved.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid blank line between declarations in ks_wlan_get_aplist
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:54 +0000 (16:01 +0200)]
staging: ks7010: avoid blank line between declarations in ks_wlan_get_aplist

This commit removes a blank line which is included between
declarations and it has not sense at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in ks_wlan_get_aplist
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:53 +0000 (16:01 +0200)]
staging: ks7010: use ether_addr_copy in ks_wlan_get_aplist

Use ether_addr_copy to copy ethernet addresses instead of
using custom memcpy for that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid if-else condition in ks_wlan_get_power
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:52 +0000 (16:01 +0200)]
staging: ks7010: avoid if-else condition in ks_wlan_get_power

The if-else code in ks_wlan_get_power function is not needed
at all and can be achieved with a simple boolean assignation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid an 'else' in ks_wlan_set_power
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:51 +0000 (16:01 +0200)]
staging: ks7010: avoid an 'else' in ks_wlan_set_power

Change if logic to handle invalid case for operation_mode
at first avoiding an 'else' path.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in ks_wlan_get_wap
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:50 +0000 (16:01 +0200)]
staging: ks7010: use ether_addr_copy in ks_wlan_get_wap

Use ether_addr_copy to copy ethernet addresses instead
of a custom memcpy. This improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_wap function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:49 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_wap function

Make use of ether_addr_copy instead of memcpy for copying
ethernet address data in ks_wlan_set_wap function and avoid
an 'else' just changing if logic to check invalid values first.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: align values in frequency_list array
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:48 +0000 (16:01 +0200)]
staging: ks7010: align values in frequency_list array

To avoid a long line align values in static array
frequency_list array.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: use ether_addr_copy in ks_wlan_set_encode_ext
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:47 +0000 (16:01 +0200)]
staging: ks7010: use ether_addr_copy in ks_wlan_set_encode_ext

Instead of manually memcpy ethernet addresses use ether_addr_copy
function for this purpose.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_pmksa function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:46 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_pmksa function

This commit cleans a bit ks_wlan_set_pmksa function removing
nonsense comments as well as make use of ether_addr_* family
functions written to not do manually things that were being
here. Minor single if brackets has been removed also.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_cts_mode function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:45 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_cts_mode function

This commit refactors ks_wlan_set_cts_mode function to
handle invalid values first and then assign the good
one changing a bit logic to use a ternary operator.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_preamble function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:44 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_preamble function

Change if logic to handle invalid values first and just
assign at the end the valid one if it is the case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_power_mgmt function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:43 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_power_mgmt function

This commit change logic to simplify conditional paths in
ks_wlan_set_power_mgmt function. It handles invalid's first
and just finally assign a valid value.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_scan_type function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:42 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_scan_type function

This commit changes logic to handle invalid values first
and just assign valid ones afterwards.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_beacon_lost function
Sergio Paracuellos [Wed, 25 Apr 2018 14:01:41 +0000 (16:01 +0200)]
staging: ks7010: refactor ks_wlan_set_beacon_lost function

Change if condition to handle invalid value first and
avoid nonsense else's path improving readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gdm724x: remove redundant license information
Greg Kroah-Hartman [Wed, 25 Apr 2018 13:11:18 +0000 (15:11 +0200)]
staging: gdm724x: remove redundant license information

Now that the SPDX tag is in all gdm724x files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gdm724x: add SPDX identifiers to all files.
Greg Kroah-Hartman [Wed, 25 Apr 2018 13:11:17 +0000 (15:11 +0200)]
staging: gdm724x: 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 gdm724x 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.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: kernel.h: Prevent macro expantion bug in container_of_safe()
Dan Carpenter [Thu, 26 Apr 2018 05:58:27 +0000 (08:58 +0300)]
staging: kernel.h: Prevent macro expantion bug in container_of_safe()

There aren't many users of this so it doesn't cause a problem, but we
obviously want to use "__mptr" here instead of "ptr" to prevent the
parameter from being executed twice.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: fix mode_valid's return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:15:26 +0000 (15:15 +0200)]
staging: vboxvideo: fix mode_valid's return type

The method struct drm_connector_helper_funcs::mode_valid is defined
as returning an 'enum drm_mode_status' but the driver implementation
for this method uses an 'int' for it.

Fix this by using 'enum drm_mode_status' in the driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: break long lines in pi433_if.c
Simon Sandström [Mon, 23 Apr 2018 17:44:56 +0000 (19:44 +0200)]
staging: pi433: break long lines in pi433_if.c

Breaks long lines in pi433_if.c, fixing checkpatch.pl warnings:
"WARNING: line over 80 characters"

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gdm724x: fix gdm_lte_tx()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:18:17 +0000 (15:18 +0200)]
staging: gdm724x: fix gdm_lte_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: fix rtw_cfg80211_monitor_if_xmit_entry()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:18:26 +0000 (15:18 +0200)]
staging: rtl8723bs: fix rtw_cfg80211_monitor_if_xmit_entry()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: visornic: fix visornic_xmit()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:18:31 +0000 (15:18 +0200)]
staging: visornic: fix visornic_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: fix p80211knetdev_hard_start_xmit()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:18:35 +0000 (15:18 +0200)]
staging: wlan-ng: fix p80211knetdev_hard_start_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/wilc1000: fix wilc_mac_xmit()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:18:57 +0000 (15:18 +0200)]
staging/wilc1000: fix wilc_mac_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: updated TODO list
Ajay Singh [Tue, 24 Apr 2018 17:07:03 +0000 (22:37 +0530)]
staging: wilc1000: updated TODO list

Removed the items from WILC1000 TODO list, which are already addressed
to keep it updated. The removed items are already taken care by
previously submitted patches.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove registering of ndo_do_ioctl callback
Ajay Singh [Tue, 24 Apr 2018 17:07:02 +0000 (22:37 +0530)]
staging: wilc1000: remove registering of ndo_do_ioctl callback

Remove registering of ndo_do_ioctl in wilc_netdev_ops structure.
As RSSI information is already avaliable through cfg80211, so remove
the IOCTL call use to fetch the same information. Wext support is not
present in the driver. Its also done to address the TODO list item
mentioned below:

"use wext-core handling instead of private SIOCSIWPRIV implementation"

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename pu32InactiveTime to avoid camelCase issue
Ajay Singh [Mon, 23 Apr 2018 16:33:35 +0000 (22:03 +0530)]
staging: wilc1000: rename pu32InactiveTime to avoid camelCase issue

Avoid camelCase issues found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove the use of goto label in wilc_spi_clear_int_ext()
Ajay Singh [Mon, 23 Apr 2018 16:33:34 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_spi_clear_int_ext()

Remove goto label '_fail_' used in wilc_spi_clear_int_ext(), to avoid
the label name starting with '_'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename goto labels starting with '_' in wilc1000_wlan_init()
Ajay Singh [Mon, 23 Apr 2018 16:33:33 +0000 (22:03 +0530)]
staging: wilc1000: rename goto labels starting with '_' in wilc1000_wlan_init()

Rename goto labels starting with '_' in wilc1000_wlan_init() to follow
linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename goto label '_fail_' linux naming convension
Ajay Singh [Mon, 23 Apr 2018 16:33:32 +0000 (22:03 +0530)]
staging: wilc1000: rename goto label '_fail_' linux naming convension

Rename '_fail_' goto label to have name as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove the use of goto label in wilc_init()
Ajay Singh [Mon, 23 Apr 2018 16:33:31 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_init()

Added direct return in wilc_init() instead of goto label. Changes
are done to avoid the use of '_' in label name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove goto label '_done_' in handle_listen_state_expired()
Ajay Singh [Mon, 23 Apr 2018 16:33:30 +0000 (22:03 +0530)]
staging: wilc1000: remove goto label '_done_' in handle_listen_state_expired()

Remove the use of goto label '_done_' in handle_listen_state_expired().
Changes are done to avoid the use of '_' in label name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove the use of goto label in wilc_spi_read_int()
Ajay Singh [Mon, 23 Apr 2018 16:33:29 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_spi_read_int()

In wilc_spi_read_int() remove the use of goto label '_fail_'. Changes
are done to avoid the use of '_' in label name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove the use of goto label in wilc_spi_read_size()
Ajay Singh [Mon, 23 Apr 2018 16:33:28 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in wilc_spi_read_size()

In wilc_spi_read_size() remove the use of goto label '_fail_'. Changes
are done to avoid the use of '_' in label name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove the use of goto label in spi_cmd_complete()
Ajay Singh [Mon, 23 Apr 2018 16:33:27 +0000 (22:03 +0530)]
staging: wilc1000: remove the use of goto label in spi_cmd_complete()

In spi_cmd_complete() remove the use of goto label '_error_'. Changes
were done to avoid the use of '_' in label name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove multiple define for mac connect and disconnect
Ajay Singh [Mon, 23 Apr 2018 16:33:26 +0000 (22:03 +0530)]
staging: wilc1000: remove multiple define for mac connect and disconnect

Cleanup patch to have commonly used macro in common header file to avoid
same defination in mulitple file. Removed MAC_CONNECTED &
MAC_DISCONNECTED macro from coreconfigurator.h header.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove multiple define used for MAX_SSID_LEN
Ajay Singh [Mon, 23 Apr 2018 16:33:25 +0000 (22:03 +0530)]
staging: wilc1000: remove multiple define used for MAX_SSID_LEN

Cleanup patch to have commonly used macro in common header file to avoid
same defination in mulitple file. Removed MAX_SSID_LEN macro from
coreconfigurator.h header as its already defined in wilc_wlan_if.h.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused macros in wilc module
Ajay Singh [Mon, 23 Apr 2018 16:33:24 +0000 (22:03 +0530)]
staging: wilc1000: remove unused macros in wilc module

Cleanup patch to remove the macros which are defined by not used.
Below mentioned macros are removed:
SCAN_DONE
SCAN_EVENT_DONE_ABORTED
WILC_WFI_RX_INTR
WILC_WFI_TX_INTR
WILC_WFI_TIMEOUT
WILC_WFI_DWELL_PASSIVE
WILC_WFI_DWELL_ACTIVE
MAX_SURVEY_RESULT_FRAG_SIZE
SURVEY_RESULT_LENGTH
NUM_BASIC_SWITCHES
NUM_FHSS_SWITCHES
NUM_11N_BASIC_SWITCHES
NUM_11N_HUT_SWITCHES
BA_SESSION_DEFAULT_BUFFER_SIZE
BA_SESSION_DEFAULT_TIMEOUT
BLOCK_ACK_REQ_SIZE

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: added identifiers name in function definations
Ajay Singh [Mon, 23 Apr 2018 16:33:23 +0000 (22:03 +0530)]
staging: wilc1000: added identifiers name in function definations

Fix identifier names required for functions definition issues reported
by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WID_LOGTerminal_Switch to avoid camelCase
Ajay Singh [Mon, 23 Apr 2018 16:33:22 +0000 (22:03 +0530)]
staging: wilc1000: rename WID_LOGTerminal_Switch to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 chars in change_station()
Ajay Singh [Mon, 23 Apr 2018 16:33:21 +0000 (22:03 +0530)]
staging: wilc1000: fix line over 80 chars in change_station()

Fix 'line over 80 chars' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use sizeof(variable) for memory allocated to store key info
Ajay Singh [Mon, 23 Apr 2018 16:33:20 +0000 (22:03 +0530)]
staging: wilc1000: use sizeof(variable) for memory allocated to store key info

Changes to fix below checkpatch reported issues.

CHECK: Prefer kmalloc(sizeof(*priv->wilc_gtk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)

CHECK: Prefer kmalloc(sizeof(*priv->wilc_ptk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: handle error condition in add_key() and remove auth_type variable
Ajay Singh [Mon, 23 Apr 2018 16:33:19 +0000 (22:03 +0530)]
staging: wilc1000: handle error condition in add_key() and remove auth_type variable

Added the code to return correct error code in add_key() and also removed
'auth_type' variable. Now passing diretly to function instead of using
the 'auth_type' variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor add_key() to avoid duplicated code
Ajay Singh [Mon, 23 Apr 2018 16:33:18 +0000 (22:03 +0530)]
staging: wilc1000: refactor add_key() to avoid duplicated code

Cleanup fixes by removing the duplicated code in actor add_key().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove inner block {} and resetting of mode variable
Ajay Singh [Mon, 23 Apr 2018 16:33:17 +0000 (22:03 +0530)]
staging: wilc1000: remove inner block {} and resetting of mode variable

Cleanup fixes to remove the uncessary inner block { /* */ } and setting
of 'mode' variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: split add_key() to avoid line over 80 chars
Ajay Singh [Mon, 23 Apr 2018 16:33:16 +0000 (22:03 +0530)]
staging: wilc1000: split add_key() to avoid line over 80 chars

Cleanup changes to fix 'line over 80 chars' issue found by checkpatch.pl
script by spliting the function. Also make use of kzalloc() instead
kmalloc().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename variable using datatype in their name in add_key()
Ajay Singh [Mon, 23 Apr 2018 16:33:15 +0000 (22:03 +0530)]
staging: wilc1000: rename variable using datatype in their name in add_key()

Cleanup changes to use variable name as per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WILC_WFI_wep_key & WILC_WFI_wep_key_len
Ajay Singh [Mon, 23 Apr 2018 16:33:14 +0000 (22:03 +0530)]
staging: wilc1000: rename WILC_WFI_wep_key & WILC_WFI_wep_key_len

Cleanup patch to use lower case for variable name as per linux coding
style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove line over 80 char warning in few functions
Ajay Singh [Mon, 23 Apr 2018 16:33:13 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char warning in few functions

Remove 'line over 80 characters' issues found by checkpatch.pl script
for following functions.

disconnect()
del_pmksa()
wilc_create_wiphy()
del_pmksa()

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused 'struct add_key_params'
Ajay Singh [Mon, 23 Apr 2018 16:33:12 +0000 (22:03 +0530)]
staging: wilc1000: remove unused 'struct add_key_params'

Cleanup patch to remove unused struct data structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove line over 80 char in cfg_connect_result()
Ajay Singh [Mon, 23 Apr 2018 16:33:11 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char in cfg_connect_result()

Fix 'line over 80 characters' issues reported by checkpatch.pl script in
cfg_connect_result().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix line over 80 char issue in clear_shadow_scan()
Ajay Singh [Mon, 23 Apr 2018 16:33:10 +0000 (22:03 +0530)]
staging: wilc1000: fix line over 80 char issue in clear_shadow_scan()

Remove 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename hAgingTimer to avoid camelCase issue
Ajay Singh [Mon, 23 Apr 2018 16:33:09 +0000 (22:03 +0530)]
staging: wilc1000: rename hAgingTimer to avoid camelCase issue

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor mgmt_tx to fix line over 80 chars
Ajay Singh [Mon, 23 Apr 2018 16:33:08 +0000 (22:03 +0530)]
staging: wilc1000: refactor mgmt_tx to fix line over 80 chars

Refactor mgmt_tx() to fix line over 80 characters issue. Split the
function to avoid the checkpatch.pl warning. Returning the same error
code in case of memory allocation failure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCase
Ajay Singh [Mon, 23 Apr 2018 16:33:07 +0000 (22:03 +0530)]
staging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 char
Ajay Singh [Mon, 23 Apr 2018 16:33:06 +0000 (22:03 +0530)]
staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 char

Fix 'line over 80 characters' issue found by checkpatch.pl script.
Refactor and split the function to avoid the checkpatch reported issues.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove line over 80 char warnings in set_wiphy_params()
Ajay Singh [Mon, 23 Apr 2018 16:33:05 +0000 (22:03 +0530)]
staging: wilc1000: remove line over 80 char warnings in set_wiphy_params()

Fix 'line over 80 character' issue reported by checkpatch.pl script in
set_wiphy_params(). Directly used the 'wiphy' pointer received as
function argument instead of using 'priv->dev->ieee80211_ptr->wiphy'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: removed unused static variables for gtk and ptk information
Ajay Singh [Mon, 23 Apr 2018 16:33:04 +0000 (22:03 +0530)]
staging: wilc1000: removed unused static variables for gtk and ptk information

Removed the unnecessary static variables used to store gtk and ptk
information. Key data stored in the params was never access using these
variables.

Variables given below are removed

g_add_gtk_key_params;
g_key_gtk_params;
g_add_ptk_key_params;
g_key_ptk_params;
g_key_wep_params;
g_ptk_keys_saved;
g_gtk_keys_saved;
g_wep_keys_saved;

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor scan() to free kmalloc memory on failure cases
Ajay Singh [Mon, 23 Apr 2018 16:33:03 +0000 (22:03 +0530)]
staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

Added changes to free the allocated memory in scan() for error condition.
Also added 'NULL' check validation before accessing allocated memory.
Copied the SSID information in consecutive slots to avoid inbetween
holes while filling into array.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor hostif_sme_set_pmksa function
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:07 +0000 (15:50 +0200)]
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>
6 years agostaging: ks7010: use ether_addr_copy in hostif_sme_multicast_set
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:06 +0000 (15:50 +0200)]
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>
6 years agostaging: ks7010: use ether_addr_equal in hostif_data_request
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:05 +0000 (15:50 +0200)]
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>
6 years agostaging: ks7010: use ether_addr_equal in hostif_data_indication
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:04 +0000 (15:50 +0200)]
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>
6 years agostaging: ks7010: use ether_addr_copy in hostif_mib_get_confirm
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:03 +0000 (15:50 +0200)]
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>
6 years agostaging: ks7010: use ether_addr_copy() instead of custom copy
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:02 +0000 (15:50 +0200)]
staging: ks7010: use ether_addr_copy() instead of custom copy

In order to achieve ethernet address copies, ether_addr_copy()
function exists. So just use it and avoid the byte by byte copy.
This increase readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove duplicated ks_wlan_handler_def declaration
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:01 +0000 (15:50 +0200)]
staging: ks7010: remove duplicated ks_wlan_handler_def declaration

This declaration is declared twice so just remove this one because
the other one is the one which contains static struct initializers.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove WPS definition conditional code
Sergio Paracuellos [Tue, 24 Apr 2018 13:50:00 +0000 (15:50 +0200)]
staging: ks7010: remove WPS definition conditional code

WPS definition was defined by default in ks_wlan.h header
file. So it makes no sense to have conditional preprocessor
stuff along the code about this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: fix line exceding 80 characters in ks_wlan_get_range
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:59 +0000 (15:49 +0200)]
staging: ks7010: fix line exceding 80 characters in ks_wlan_get_range

Avoid very long if condition just changing its style. This makes
checkpatch script not complains about this line.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_get_mode function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:58 +0000 (15:49 +0200)]
staging: ks7010: refactor ks_wlan_get_mode function

Avoid the use of switch-case block which is not necessary
at all and just use a ternary operator to achieve this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: refactor ks_wlan_set_mode function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:57 +0000 (15:49 +0200)]
staging: ks7010: refactor ks_wlan_set_mode function

Most cases which are being handled in the switch-case of
ks_wlan_set_mode function are just returning EINVAL. Avoid
the use of switch-case stament and just use a simple if
to handle those. This decrease LOC as well as improves
readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: remove some duplicated definitions in ks_wlan_net.c
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:56 +0000 (15:49 +0200)]
staging: ks7010: remove some duplicated definitions in ks_wlan_net.c

This definitions are in linux/wireless.h header so it is not
necessary at all to have this compatibility stuff duplicated here.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: avoid use of brackets in single line if
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:54 +0000 (15:49 +0200)]
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>
6 years agostaging: ks7010: refactor hostif_sme_power_mgmt_set function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:53 +0000 (15:49 +0200)]
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>
6 years agostaging: ks7010: use definitions from kernel headers in hostif_data_indication function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:52 +0000 (15:49 +0200)]
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>
6 years agostaging: ks7010: join some debug traces in get_current_ap function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:51 +0000 (15:49 +0200)]
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>
6 years agostaging: ks7010: avoid some if-else code in get_current_ap function
Sergio Paracuellos [Tue, 24 Apr 2018 13:49:50 +0000 (15:49 +0200)]
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>
6 years agostaging: ks7010: remove KSC_OPNOTSUPP related code
Sergio Paracuellos [Mon, 23 Apr 2018 13:44:57 +0000 (15:44 +0200)]
staging: ks7010: remove KSC_OPNOTSUPP related code

This commit reviews KSC_OPNOTSUPP related code. The
preprocessor KSC_OPNOTSUPP is defined by default so
related wext functions are not being used. Just clean
code removing all of this stuff.

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