Commit Graph

449 Commits

Author SHA1 Message Date
Ajay Singh 976c89b562 staging: wilc1000: handle add beacon operation callback from cfg80211 context
Refactor add/change beacon cfg80211 operation callback to handle from
cfg context. Also avoided extra copy of information by packing directly
in firmware expected format.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:49:44 +01:00
Ajay Singh 78c0c4e845 staging: wilc1000: handle add and edit station from the cfg80211 context
Refactor the code to avoid handling of add/edit stations using work
queue and now set the wid value from caller context.
Avoid making an extra copy of buffer and directly copy the data in
firmware expected format.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:48:45 +01:00
Ajay Singh f78d5db98b staging: wilc1000: avoid the use of the static variable to configure wiphy struct
Refactor code to avoid the use of static variables to configure the
'wiphy' structure. Now move static variables as part of 'priv' data so
it helped to maintain this information per interface.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:48:45 +01:00
Ajay Singh e0f7d41e17 staging: wilc1000: rename tsf_hi element of network_info struct
Rename 'tsf_hi' element in network_info struct as it's not used to store
only the higher 32-bit value but the complete 64-bit tsf value.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:46:51 -08:00
Ajay Singh d0e41eff4c staging: wilc1000: added 'WILC_' prefix for constants to have clear namespace
For better namespace added 'WILC_' prefix for driver specific constants.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:46:51 -08:00
Ajay Singh d378599a6b staging: wilc1000: rename firmware related constants to follow better namespace
Rename the firmware related macro by prefix with 'WILC_FW_' prefix for
a better namespace. Also, move them to wilc_wlan_if.h file along with other
FW related macros.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:46:51 -08:00
Ajay Singh b997b84ffc staging: wilc1000: use proper namespace for macros in wilc_wlan_if.h header
Rename the macros defined in wilc_wlan_if.h header to have clear
namespace. As convention used 'WILC_FW_' prefix for constants defined for
firmware and 'WILC_' prefix for driver constants.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:43:16 -08:00
Ajay Singh 00d54198a7 staging: wilc1000: restructure macros used to handle security type
Restructure the code to have a proper namespace for macro defined to
handle the security types. Move them as part of wilc_wlan_if.h header as
along with other macro defined for firmware.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:43:16 -08:00
Ajay Singh 8c4574d6c8 staging: wilc1000: use enum contants for mac status & added 'WILC_' prefix
Clubbed mac status constants inside the enum constant and also added
'WILC_' prefix to have better namespace.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:43:16 -08:00
Ajay Singh 7e7e278fe3 staging: wilc1000: use WLAN_PMKID_LEN macro from ieee80211.h header
Make use of WLAN_PMKID_LEN macro provided by ieee80211.h header instead
of PMKID_LEN.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:43:15 -08:00
Ajay Singh 2bae293a4c staging: wilc1000: use macro from ieee80211.h in register frame api's
Make use of ieee80211.h provided macros and removed the extra macro
defined for the same purpose.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12 14:43:15 -08:00
Adham Abozaeid 6eb7207384 staging: wilc1000: validate cfg parameters before scheduling the work
Validate cfg parameters after being called by cfg80211 in set_wiphy_params
before scheduling the work executed in handle_cfg_param

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-11 11:38:54 -08:00
Ajay Singh f41cf2460e staging: wilc1000: remove p2p related static variables to wilc_vif struct
Avoid use of static variable and move them as part of private
data(wilc_priv) struct.

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 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