1
0
Fork 0
Commit Graph

170 Commits (458e303bdc395909360f65178ea9830ac5c4cc69)

Author SHA1 Message Date
Ajay Singh 458e303bdc staging: wilc1000: move static variable 'wlan_channel' to 'wilc' struct
Avoid use of static variable 'wlan_channel' by moving it inside the wilc
structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07 13:31:20 +01:00
Ajay Singh 98f83d3d01 staging: wilc1000: avoid use of 'hif_deinit_lock' static variable
Avoid use of static variable 'hif_deinit_lock' and move it as part of
wilc struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07 13:31:20 +01:00
Ajay Singh b6c6cd11c7 staging: wilc1000: refactor code to use cookie information
Make use of cookie information to pass to wpa_s and handle cookie value
received in the cfg80211_ops callbacks.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07 13:31:20 +01:00
Ajay Singh 588713006e staging: wilc1000: avoid the use of 'wilc_wfi_mon' static variable
Avoid use of static variable for monitor net_device and move it inside
wilc structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04 12:38:40 +01:00
Ajay Singh 6c2cfb4e87 staging: wilc1000: remove the use of scan shadow buffer
Remove scan shadow buffer, which is used to store a copy of scan
results. Instead, use cfg80211 provided API's to retrieve required
info. Remove the helper functions which are operating on shadow buffer,
as it's not require now.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:39:15 +01:00
Ajay Singh 8ffcedd6f4 staging: wilc1000: use 'struct' to pack cfg header frame in wilc_wlan_cfg_commit()
Make use of 'struct' to pack cfg header in wilc_wlan_cfg_commit()
instead of byte by byte filling.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:39:15 +01:00
Ajay Singh b61c8064f5 staging: wilc1000: handle key related cfg operation from cfg80211 context
Refactor add/delete key operation to handle directly from cfg80211
context. Also, avoid an extra copy of the information in hif layer and
directly fill the buffer in firmware format.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:49:45 +01:00
Ajay Singh 6dea33021f staging: wilc1000: use mutex lock to synchronized sending 'wid' cmd to firmware
Use mutex lock to protect the issuing of wid cmd to the firmware.
Currently the wid commands are synchronized by use of hif_workqueue work
queue.
Now, these changes are required to synchronize the access to wid
command, so the commands can be issued directly from cfg80211 context
and 'WILC_wq' thread.

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 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 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 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 97eaff578b staging: wilc1000: avoid use of 'g_sdio' static variable
Instead of using static variable 'g_sdio' move it as part of 'wilc'
struct. Also allocating the memory in the probe function and free during
deinitialization.

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 acceb12a9f staging: wilc1000: refactor code to avoid static variables for config parameters
Refactor the code in wilc_wlan_cfg.c file to avoid the use of static
variables. Move the static variables as part of wilc struct and also
dynamically allocating memory for keeping those variables.

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 de11f709df staging: wilc1000: refactor code to remove 'mac_status' from 'wilc_mac_cfg' struct
Refactor the code by removing use of 'mac_status' from 'wilc_mac_cfg'
and only have the string type configuration values in 'wilc_mac_cfg'
struct. Now fetch the value 'WID_STATUS' configuration from 'g_cfg_byte'
array.

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 080de24913 staging: wilc1000: change return type to 'void' for wilc_wlan_set_bssid()
Cleanup patch to use 'void' return type for wilc_wlan_set_bssid(),
as its always returns the same value.

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 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 3124a1f7bf staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' struct
Move the static variable as part of 'wilc' priv 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 f31e5584dc staging: wilc1000: use short names to fix over 80 issue in tcp_process()
Use short variable names to avoid line over 80 chars checkpatch warning
in tcp_process().

struct pending_acks_info     --> struct pending_ack
int tcp_pending_ack_idx      --> int ack_idx
u32 pending_ack              --> u32 pending_ack_idx

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 8b89ba7611 staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat'
Cleanup patch to use appropriate variable name to fetch the periodic
statistics.

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 5fefe58f7f staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct
Refactor code to move 'periodic_rssi' as part of wilc_vif struct. Move
'dummy_statistics' from 'wilc' struct to 'wilc_vif' to maintain for
each interface separately.

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 87de37fe2a staging: wilc1000: move hif_workqueue static variables to 'wilc' structure
Avoid use of static variable hif_workqueue and move it inside '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:38 +02:00
Ajay Singh 0b68334d48 staging: wilc1000: move static variable clients_count to 'wilc' structure
Avoid use of static variable 'clients_count' and move it 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: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 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 97ed6d34e3 staging: wilc1000: added comments for 'hif_cs' mutex lock
Added comments for 'hif_cs' mutex to avoid checkpatch.pl reported
issues.

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 f131bbe556 staging: wilc1000: remove unnecessary comments and comments description
Cleanup patch to remove the unnecessary comments and commented code.
Also updated description for few of comments.

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 367b955907 staging: wilc1000: use descriptor-based interface for GPIO
Now making use of descriptor-based interface instead of integer-based
interface for IRQ GPIO.
Added device tree binding reference for WILC SDIO and SPI interface
module. Also moved the code to free gpio descriptor in module remove
as the reference was fetched in probe function.
Updated the TODO file

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-24 13:52:32 +02:00
Ajay Singh 4b6cfa87b1 staging: wilc1000: rename variable from 'gpio' to 'gpio_irq'
Rename from 'gpio' to 'gpio_irq', so its inlcude the information about
the purpose of GPIO.

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-24 13:52:32 +02:00
Ajay Singh 847794a1a7 staging: wilc1000: remove gpio parameter from wilc_netdev_init()
Instead of passing the gpio as parameter to wilc_netdev_init() now
setting its value after finishing wilc_netdev_init() call. Avoided
passing of extra parameter to wilc_netdev_init().

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-24 13:52:32 +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 9fdc7420f2 staging: wilc1000: remove unused elements in 'wilc' struct
Cleanup patch to remove unused elements from 'wilc' struct.

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 089a137ad2 staging: wilc1000: move 'txq_spinlock_flags' from 'wilc' structure to local variable
Cleanup patch to remove 'txq_spinlock_flags' element in 'wilc' and used
local variable 'flag' in wilc_wlan_txq_filter_dup_tcp_ack().

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-17 09:05:13 +02:00
Ajay Singh 42e4a3adb0 staging: wilc1000: remove 'rxq_entries' from 'wilc' struct
Removed unnecessary 'rxq_entries' element from 'wilc' struct, as its
value is not used.

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-17 09:05:13 +02:00
Ajay Singh 6adc35d973 staging: wilc1000: use list_head to maintain 'rxq_entry_t elements in rx queue
Make use of 'list_head' data structure to maintain the rx buffer queue.
Modified wilc_wlan_rxq_add() to add the element at the tail by using
list_head API and wilc_wlan_rxq_remove() to remove the element from
head.

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-17 09:05:13 +02:00
Ajay Singh 3d9241d652 staging: wilc1000: use list_head to maintain 'txq_entry_t' elements of tx queue
Use list_head data structure for the doubly linked list instead of own
implementation.
Only 'txq_head' is required, so removed the txq_tail pointer from
'wilc' structure.

Following functions are modified to provide data using list_head API's
wilc_wlan_txq_remove()
wilc_wlan_txq_remove_from_head()
wilc_wlan_txq_add_to_tail()
wilc_wlan_txq_add_to_head()
wilc_wlan_txq_get_first()
wilc_wlan_txq_get_next()

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-17 09:05:13 +02:00
Ajay Singh aaf5df9d0c staging: wilc1000: remove unused 'lock' varible in 'wilc_priv' structure
Cleanup patch to remove the unused variable from 'wilc_priv' structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14 14:04:49 +02:00
Ajay Singh 1275022a10 staging: wilc1000: added comments for mutex and spinlock_t
Added comments for mutex and spinlock_t to avoid 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:49 +02:00
Ajay Singh c7ceac21e7 staging: wilc1000: remove 'flag' argument from wilc_mac_indicate()
Remove 'flag' function parameter in wilc_mac_indicate() as only one
condition was handled using that parameter. Also removed unnecessary
call to wilc_mac_indicate() as no operation was performed in that
function call.
After above changes below macros are not required anymore.
WILC_MAC_INDICATE_STATUS	0x1
WILC_MAC_INDICATE_SCAN		0x2

This changes also helped in resolving the line over 80 chars issue
found by checkatpch.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:49 +02:00
Ajay Singh 25a757b781 staging: wilc1000: move macro after the #include file in wilc_wfi_netdevice
Cleanup patch to organize macro in a file together after #include
statements.

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 73d359a08b staging: wilc1000: rename WILC_WFI_mon_priv to avoid uppercase for struct name
Cleanup patch to avoid 'struct' name with uppercase letters.

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
Ajay Singh 06ec2c9309 staging: wilc1000: remove unnecessary file and function header comments
Cleanup patch to remove the unnecessary comments used for file and functions
header.

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
Ajay Singh ead6cb0508 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>
2018-04-26 09:43:05 +02:00
Ajay Singh 02e25860cd 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>
2018-04-26 09:43:05 +02:00