Commit Graph

436 Commits

Author SHA1 Message Date
Ajay Singh d29ad322e0 staging: wilc1000: remove use of unnecessary 'wilc_connected_ssid' variable
'wilc_connected_ssid' actually used to store the BSSID information for
connected BSSID. 'wilc_vif' already has 'bssid' variable to store the
same information. So refactor code to remove 'wilc_connected_ssid' and
instead used 'wilc_vif' struct 'bssid' element.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25 20:53:57 +02:00
Ajay Singh 39996811d5 staging: wilc1000: avoid the use of 'hif_driver_comp' completion variable
Instead of using extra completion variable to handle the sync call now
using msg->is_sync flag to handle the sync call.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25 20:53:57 +02:00
Ajay Singh 8f12491506 staging: wilc1000: change return type to 'void' for wilc_deinit_host_int()
Cleanup patch to use 'void' return type for wilc_deinit_host_int(),
as its return value is not used in caller.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25 20:53:56 +02:00
Ajay Singh a53b0b1392 staging: wilc1000: refactor wilc_netdev_init() to handle memory free in error path
Refactor the wilc_netdev_init() to cleanup the memory for error
scenario and remove unnecessary 'dev' pointer check.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 804146b4bd staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct
Move static variable 'wilc_connecting' as part of 'wilc_vif' private
struct. Remove "wilc_" prefix from name as its already part of wilc_vif
struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 18:06:51 +02:00
Ajay Singh 95e05b4bf2 staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' struct
Avoid use of static variables and move them as part of wilc_vif struct.
Move all the parameters related to tcp_ack_filter algo to wilc_vif
struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:39 +02:00
Ajay Singh 7814fb6ca8 staging: wilc1000: remove unused variable 'op_ifcs'
After code refactor in previous commit now 'op_ifcs' is not require any
more, so remove it.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh aa6ed22a03 staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' struct
Move global variable 'wilc_during_ip_timer' and 'wilc_optaining_ip' to
'wilc_vif' structure.

Rename these variables like below

wilc_during_ip_timer -> during_ip_timer
wilc_optaining_ip -> obtaining_ip.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 0e866cfb0d staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to wilc_priv struct
Avoid use of static variables and moved the varibles as part of private
data. last_scanned_shadow & last_scanned_cnt variable is moved to
'wilc_priv' to maintain for each interface. After moving static
variable, clear_shadow_scan() doesn't require check 'op_ifcs'
count as now for each interface the againg timer is initiated.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 009324daf6 staging: wilc1000: remove unnecessary NULL check in clear_shadow_scan()
Cleanup patch to remove the unnecessary NULL check before freeing up ies
information in clear_shadow_scan().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 19707ca295 staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan()
Fixes to use correct index to free the allocated memory for ies
information. The check was done using 'last_scanned_cnt' index and its
not correct, so use the correct index ('i') to check for before freeing
the allocated memory.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:38 +02:00
Ajay Singh 1803da60f7 staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct
Moved 'aging_timer' to wilc_priv struct instead of having it as static
variable.
As 'aging_timer' is maintained for each interfaces so 'op_ifcs' check is
not required before the timer_setup() and del_timer_sync() call.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:37 +02:00
Ajay Singh 4cf1339953 staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct
Instead of having 'wilc_enable_ps' as global variable moved it to 'wilc'
structure. Rename 'wilc_enable_ps' to 'enable_ps' as its already part of
'wilc' structure

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10 17:17:37 +02:00
Ajay Singh e61c7a1caa staging: wilc1000: added Microchip copyright notice header
Cleanup the copyright notice header from the WILC1000 files.
Replace copyright header of 'Atmel' & 'NewportMedia' with 'Microchip & its
subsidiaries'. Also added the same copyright notice header for all
wilc1000 driver source and header files.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05 16:15:32 +02:00
Ajay Singh 02211edc9a staging: wilc1000: fix endianness warnings reported by sparse
This patch fixes the sparse warnings by making use of le32_to_cpus() &
cpu_to_le32s() conversion API's.
Remove the unnecessary byte-order conversion in
wilc_wlan_parse_response_frame() as the data is copied using individual
byte operation.

Also added the byte-order conversion for 'header' in
wilc_wfi_monitor_rx() & wilc_wfi_p2p_rx() as received in LE byte-order.

The link [1] contains the details of discussion related to this patch.

[1]. https://patchwork.kernel.org/patch/10436791/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02 09:41:37 +02:00
Ajay Singh a120adb8b6 staging: wilc1000: modified debug log messages description
Cleanup patch to update the debug logs message to provide correct
information. Also added the function name tag for same description log
to help identify the place from where log was captured.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02 09:35:05 +02:00
Ajay Singh 6bcba96e85 staging: wilc1000: move variable assignment along with its declaration
Cleanup patch to club the variable assignment along with the variable
declaration especially for private data.

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>
2018-07-21 09:04:48 +02:00
Ajay Singh cd46d1b114 staging: wilc1000: remove unnecessary 'NULL' check from cfg80211_ops callbacks
Cleanup patch to remove the unnecessary 'NULL' check used in 'cfg80211_ops'
callback functions.

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>
2018-07-21 09:04:48 +02:00
Ajay Singh 82120ec7af staging: wilc1000: use 'int' inplace of 's32' date type
Cleanup patch to use 'int' instead of 's32' to have the same data type
based on its usage.

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>
2018-07-21 09:04:48 +02:00
Ajay Singh d241877a1a staging: wilc1000: avoid setting default value for variable at declaration
Cleanup patch to avoid setting default value for local variables and
also clubbed similar variables together.

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>
2018-07-21 09:04:48 +02:00
Ajay Singh 74cffafb66 staging: wilc1000: use single space before opening brances '{'
Cleanup patch to use single space instead of multiple space before the
'{'.

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>
2018-07-21 09:04:48 +02:00
Ajay Singh 9542c441a7 staging: wilc1000: remove unnecessary blank line between variable declaration
Cleanup patch to remove the unnecessary blank line between variables
declaration inside the function.

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>
2018-07-21 09:04:47 +02:00
Ajay Singh 742a48699e staging: wilc1000: use lowercase for 'IFC_UP' struct element name
Cleanup patch to use lowercase for structure element name 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>
2018-07-21 09:04:47 +02:00
Ajay Singh e3da5d9d25 staging: wilc1000: remove the mutliple #define used for same macro
Moved the same #define in common header file instead of having their
declartion in different files.

Below macros are moved to header file:
TCP_ACK_FILTER_LINK_SPEED_THRESH
DEFAULT_LINK_SPEED
GET_PKT_OFFSET

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>
2018-07-21 09:04:47 +02:00
Ajay Singh 37d1a6dbb4 staging: wilc1000: remove unnecessary elements from 'wilc_priv' struct
Remove unused elements from 'wilc_priv' structure.

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>
2018-07-21 09:04:47 +02:00
Ajay Singh ecba6b7477 staging: wilc1000: rename enum AUTHTYPE to use lowercase
Cleanup patch to rename enum AUTHTYPE to lowercase.

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>
2018-07-21 09:04:47 +02:00
Ajay Singh 18da9e4ad2 staging: wilc1000: rename goto to avoid leading '_' in label name
Cleanup patch to avoid use of leading '_' in goto label name. Also used
proper string for lable names.

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>
2018-07-21 09:04:47 +02:00
Ajay Singh d300da1850 staging: wilc1000: remove enum connect_status instead use ieee80211_statuscode
Cleanup patch to remove the use of enum 'connect_status' and instead use
predefined 'ieee80211_statuscode' for error code values.

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>
2018-07-21 09:04:47 +02:00
Omer Efrat 5c6a5eb3aa staging: use BIT_ULL for NL80211_STA_INFO_* attribute types
The BIT macro uses unsigned long which some architectures handle as 32 bit
and therefore might cause macro's shift to overflow when used on a value
equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).

Since 'filled' member in station_info changed to u64, BIT_ULL macro
should be used with all NL80211_STA_INFO_* attribute types instead of BIT
to prevent future possible bugs when one will use BIT macro for higher
attributes by mistake.

This commit cleans up all usages of BIT macro with the above field
in cfg80211 by changing it to BIT_ULL instead.

Signed-off-by: Omer Efrat <omer.efrat@tandemg.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28 22:08:56 +09:00
Ajay Singh 5e6f8a8ae2 staging: wilc1000: added 'work_comp' completion as part of host_if_msg
Added 'work_comp' completion in 'host_if_msg'. It allows handling the
sync call to wait for sepecific completion event.
The commands can be run in sync way waiting for their specific
completion event.
Added is_sync flag in wilc_create_work_queue() to handle the sync call to
host interface.

After adding completion as part of host_if_msg now
below completion are not required
 comp_test_key_block;
 comp_test_disconn_block
 comp_get_rssi
 comp_inactive_time
 hif_wait_response

Modified wilc_get_statistics() API to handle get statistic in sync &
async way.

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>
2018-06-28 21:55:51 +09:00
Ajay Singh 977febc9cf staging: wilc1000: refactor del_station() to avoid parenthesis misalignment
Refactor the code to fix open parenthesis alignment issue reported by
checkpatch.pl script in del_station().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 2cfcc2fc1b staging: wilc1000: rename u8security to avoid datatype in variable name
Cleanup patch to avoid use of datatype in variable name to follow as
per linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 2b26ae0095 staging: wilc1000: fix line over 80 chars issue in connect()
Fix line over 80 characters in connect() by using temporary variables.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 0142ca35d0 staging: wilc1000: fix line over 80 chars in scan()
Fix line over 80 characters issues found by checkpatch.pl script with
the help of local variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 36fef228ed staging: wilc1000: fix line over 80 characters in add_key()
Fix line over 80 character issue found by checkpatch.pl script in
add_key().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 783cfc8bd3 staging: wilc1000: fix line over 80 chars in get_station()
Fix line over 80 characters issue in get_station().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 31c61cd7b4 staging: wilc1000: fix line over 80 chars in wilc_wfi_cfg_tx_vendor_spec()
Fix line over 80 characters issues reported by checkpatch.pl script in
wilc_wfi_cfg_tx_vendor_spec() by using temporary variable. Simplified
'if else' condition with 'if'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 4d03c3d51b staging: wilc1000: fix line over 80 charas in wilc_wfi_remain_on_channel_expired()
Refactor wilc_wfi_remain_on_channel_expired() to avoid line over 80
character issue reported by checkpatch.pl script. Also assigned value in the
variable at the time of declaration.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 7ca6ba24c3 staging: wilc1000: use kmemdup instead of kmalloc in add_network_to_shadow()
Use kmemdup instead of kmalloc & memcpy in add_network_to_shadow(). Also
added  code to set 'ies_len' to zero in case of memory allocation
failure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 30300a1cbd staging: wilc1000: fix line over 80 chars in add_network_to_shadow()
Fix line over 80 characters issue reported by checkpatch in
add_network_to_shadow() by using temporary variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 50fdf8142d staging: wilc1000: rename clear_duringIP() to avoid camelCase issue
Rename clear_duringIP() function to avoid camelCase issue reported by
checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh 151c8b920c staging: wilc1000: use kmalloc(sizeof(*mgmt_tx)...) in mgmt_tx()
Fix below checkpatch issue found in mgmt_tx()

Prefer kmalloc(sizeof(*mgmt_tx)...) over kmalloc(sizeof(struct
p2p_mgmt_data)...)

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Ajay Singh c0a7882312 staging: wilc1000: use sizeof(*wdev) to allocate memory in wilc_wfi_cfg_alloc()
Fix below reported checkpatch issues in wilc_wfi_cfg_alloc().
kzalloc(sizeof(*wdev)...) over kzalloc(sizeof(struct wireless_dev)

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:48 +02:00
Nathan Chancellor 1cbe5fe261 staging: wilc1000: Remove unnecessary array index check
This statment triggers GCC's -Wtype-limit since key_index is an
unsigned integer so it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Nathan Chancellor 7aa48d37ae staging: wilc1000: Remove useless function
GCC warns that 'wid' is unused in wilc_remove_key and it's correct; the
variable is only local. Get rid of the function (since it just returns
zero) and shuffle the remaining code into one if statement.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Nathan Chancellor 17521b1a1e staging: wilc1000: Remove unused variables
GCC warns these variables are all set but never used so remove them.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06 19:11:23 -07:00
Ajay Singh 7f907bf69d staging: wilc1000: rename WILC_WFI_band_2ghz variable to avoid mixedcase
Rename 'WILC_WFI_band_2ghz' to avoid mixedcase for variable name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03 13:56:36 -07:00
Ajay Singh e78775bc90 staging: wilc1000: rename 'during_ip_time' macro to have uppercase name for macro
Rename 'during_ip_time' to 'DURING_IP_TIME_OUT' to have uppercase letter
for macros(#define).

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03 13:56:36 -07:00
Ajay Singh 880e404e8f staging: wilc1000: remove unnecessary header file inclusion for wilc
Remove the unnecessary file inclusion in the source code. Also follow
the convension to first include the system header then project specific
header files.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03 13:56:36 -07:00
Ajay Singh e5bf9759bd staging: wilc1000: rename WILC_WFI_init_mon_interface to avoid uppercase in function name
Changes to avoid the use of uppercase for function name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03 13:56:35 -07:00