Commit Graph

2336 Commits

Author SHA1 Message Date
Ajay Singh bd4217cb9d staging: wilc1000: avoid mutex unlock without lock in wilc_wlan_handle_txq()
In wilc_wlan_handle_txq(), mutex unlock was called without acquiring
it. Also error code for full VMM condition was incorrect as discussed in
[1]. Now used a proper code to indicate VMM is full, for which transfer
to VMM is required again. 'wilc_wlan_handle_txq()' should be called
again if the VMM space was full earlier or otherwise based on
'txq_event' signal.

1. https://lore.kernel.org/driverdev-devel/20191113183322.a54mh2w6dulklgsd@kili.mountain/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200123182129.4053-2-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23 19:16:12 +01:00
Ajay Singh 7a80aa23d0 staging: wilc1000: return zero on success and non-zero on function failure
Some of the HIF layer API's return zero for failure and non-zero for
success condition. Now, modified the functions to return zero for success
and non-zero for failure as its recommended approach suggested in [1].

1. https://lore.kernel.org/driverdev-devel/20191113183322.a54mh2w6dulklgsd@kili.mountain/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200123182129.4053-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23 19:16:12 +01:00
Ajay Singh b17028d289 staging: wilc1000: remove unused code prior to throughput enhancement in SPI
The firmware now uses throughput enhancement code by default for SPI so
remove the previous implementation as its not used anymore. Removed the
use of 'has_thrpt_enh' element as its always true.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200117160157.8706-5-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:53:45 +01:00
Ajay Singh 1d58fec42f staging: wilc1000: added 'wilc_' prefix for 'struct assoc_resp' name
Use 'wilc_' prefix for 'assoc_resp' struct to have proper naming
convention.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200117160157.8706-4-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:53:45 +01:00
Ajay Singh c5295d1a41 staging: wilc1000: move firmware API struct's to separate header file
It's recommended to keep the 'struct' used for passing data to firmware
in separate header file. So added 'fw.h' header file to keep struct's
used to pass data to firmware.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200117160157.8706-3-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:53:45 +01:00
Ajay Singh 9d442d2b9a staging: wilc1000: remove use of infinite loop conditions
Avoid the use of 'while (1)' infinite loop conditions. It's not
recommended to have infinite loop in kernel code because a small bug can
cause never ending loops so use terminator condition as suggested in
full driver review [1].

[1]. https://lore.kernel.org/linux-wireless/20191023100313.52B3F606CF@smtp.codeaurora.org/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200117160157.8706-2-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:53:45 +01:00
Colin Ian King 01fbbd42d1 staging: wilc1000: remove redundant assignment to variable result
The variable result is being initialized with a value that
is never read and is being re-assigned later on. The assignment
is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200114172720.376286-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-15 13:11:41 +01:00
Ajay Singh baf3f2f9d0 staging: wilc1000: use GENMASK to extract wid type
Refactor code by make use of 'GENMASK' to extract the WID type from
buffer received from firmware.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191122205153.30723-4-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:28:31 +01:00
Ajay Singh a02a9897cd staging: wilc1000: use kernel provided struct cast to extract mac header
To parse the mac header make use of *struct ieee80211_hdr* instead of
extracting individual fields separately using pointer operation.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191122205153.30723-3-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:28:31 +01:00
Ajay Singh 856be41e44 staging: wilc1000: remove unused compile time featurization
Removed the unused compile type featurization. It's not recommended to
have compile type feature. Currently removing these defines as they are
not used. If any of these parameters are needed later should be added
using run time feature.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191122205153.30723-2-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:28:30 +01:00
Ajay Singh c7e621bb98 staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param()
Do not copy the extended supported rates in 'param->supp_rates' if the
array is already full with basic rates values. The array size check
helped to avoid possible illegal memory access [1] while copying to
'param->supp_rates' array.

1. https://marc.info/?l=linux-next&m=157301720517456&w=2

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1487400 ("Memory - illegal accesses")
Fixes: 4e0b0f42c9 ("staging: wilc1000: use struct to pack join parameters for FW")
Cc: stable@vger.kernel.org
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191106062127.3165-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-11 16:37:59 +01:00
Ajay Singh 156aafd2be staging: wilc1000: use defines for msg types received from firmware
Added defines for different types of messages received from firmware.
Removed the unnecessary comments because after the addition of macros
the message types are self-explanatory.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-7-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:53 +01:00
Ajay Singh 027caaab0d staging: wilc1000: added proper spacing for comments
Added proper space for the comments and added newline before the
comments inside a struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-6-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:53 +01:00
Ajay Singh f1f24260fc staging: wilc1000: avoid use of C++ style comments
Replace C++ style comment with C style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-5-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:52 +01:00
Ajay Singh 664578d581 staging: wilc1000: added 'WILC_' prefix in header guard macro
Use 'WILC_' prefix in header guard to follow the proper naming
convention for macro name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-4-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:52 +01:00
Ajay Singh 6cecbb2c67 staging: wilc1000: remove 'wilc_' prefix from filenames
Remove 'wilc_' prefix from filenames, the driver is already present
inside the 'wilc1000' directory so no need to add 'wilc_' in
filenames.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-3-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:52 +01:00
Ajay Singh 5e3bafbd14 staging: wilc1000: avoid 'bool' datatype in struct sent to firmware
Use 'u8' instead of 'bool' datatype for struct element sent to firmware
because storage of bool datatype is not guaranteed.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191105095058.24223-2-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05 18:08:52 +01:00
Adham Abozaeid 6df6f3849b staging: wilc1000: check if device is initialzied before changing vif
When killing hostapd, the interface is closed which deinitializes the
device, then change virtual interface is called.
This change checks if the device is initialized before sending the
interface change command to the device

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191028184019.31194-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-29 09:02:35 +01:00
Ajay Singh 3a4cffe67f staging: wilc1000: handle mgmt frames for both interfaces during concurrent mode
During concurrent mode(AP/STA + P2P), pass the mgmt frames received from
firmware to appropriate interface. Iterate the complete interface list
to pass frames on the interface which has registered to receive mgmt
frame. Added extra time for 'remain_on_ch' timer to ensure that timeout
for uncanceled remain_on_channel is not triggered & 'p2p_listen_state'
is not cleared before passing the mgmt frames to p2p interface.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191018124511.22751-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24 23:17:17 -04:00
Dan Carpenter d59dc92f1b staging: wilc1000: potential corruption in wilc_parse_join_bss_param()
The "rates_len" value needs to be capped so that the memcpy() doesn't
copy beyond the end of the array.

Fixes: c5c77ba18e ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191017091832.GB31278@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24 23:17:17 -04:00
Adham Abozaeid bfc0a0935a staging: wilc1000: store bss object and use cfg80211_connect_bss()
In a fast disconnect/connect sequence, cfg80211_connect_result() can
fail to find the bss object which the driver is connecting to. Detailed
sequence of events:
* Driver is connected in STA mode
* Disconnect request arrives from user space. Driver disconnects and
  calls cfg80211_disconnected() which adds new event to the
  cfg80211_wq worker thread
* Connect request arrives from user space. cfg80211_connect() stores
  ssid/ssid_len and calls rdev_connect()
* __cfg80211_disconnected() runs in worker thread and zero
  wdev->ssid_len
* Connect succeeds. Driver calls cfg80211_connect_result() which fails
  to find the bss because wdev->ssid_len is zero

To overcome this, upon connect request, store the bss object in the
driver and upon connect completion pass it to kernel using
cfg80211_connect_bss().

Ref: bcdd49b074 ("store bss object and use cfg80211_connect_bss()")

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191017165105.27429-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24 23:17:16 -04:00
Adham Abozaeid ef0abd6f24 staging: wilc1000: don't use wdev while setting tx power
WILC doesn't support per-vif tx power, and hence, wdev will always be
null in calls to set_tx_power.
Instead, wiphy should be used to execute the operation

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191004214011.7623-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-07 12:25:46 +02:00
Adham Abozaeid 854d66df74 staging: wilc1000: look for rtc_clk clock in spi mode
If rtc_clk is provided from DT, use it and enable it.
This is optional.
The signal may be hardcoded and no need to be requested,
but if DT provides it, use it.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190916193701.20755-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:03 +02:00
Ajay Singh 8399918f30 staging: wilc1000: use RCU list to maintain vif interfaces list
Make use of RCU list to maintain virtual interfaces instead of an array.
The update operation on 'vif' list is less compare to the read
operations. Mostly the 'vif' list elements are accessed for the read
operation, so RCU list is more suited for this requirement.
The shifting of interface index id's during the delete interface is not
required. As the firmware only supports 2 interfaces so make use of
available free slot index id during add interface.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190926151436.27819-3-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:03 +02:00
Ajay Singh fb2d74342f staging: wilc1000: move wlan_deinit_locks() in wilc_netdev_cleanup()
Move deinitialization of lock during the module remove and the
initialization of lock wilc_cfg80211_init(). This to ensure locks are
available during module load and gets free during unload.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190926151436.27819-2-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:02 +02:00
Ajay Singh 82e465642f staging: wilc1000: remove unnecessary netdev validation check in del_key()
Removed unnecessary check to compare vif interface with zeroth index
element in vif array. Already the caller takes care of passing the
appropriate netdev handler during the del key operation.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190926151436.27819-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:02 +02:00
Ajay Singh 9a4c56be67 staging: wilc1000: avoid twice IRQ handler execution for each single interrupt
The IRQ handler(isr_bh_routine()) was called twice for each interrupt
from firmware. The data was read completely during the first call and
the second call was doing nothing.
Now changed the IRQ flag from ‘level’ to ‘edge’ trigger i.e
IRQF_TRIGGER_LOW to IRQF_TRIGGER_FALLING to avoid extra interrupt
trigger.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190910074514.3073-2-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:37:26 +01:00
Ajay Singh a76e712a5a staging: wilc1000: remove unused interrupt status handling code
Remove interrupt handling for unused interrupt status(PLL update and
Sleep). The firmware only initiates the interrupt for the data transfer
to host and rest are not used anymore.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190910074514.3073-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:37:26 +01:00
Eugen Hristev 8692b047e8 staging: wilc1000: look for rtc_clk clock
If rtc_clk is provided from DT, use it and enable it.
This is optional.
The signal may be hardcoded and no need to be requested,
but if DT provides it, use it.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/1568037993-4646-2-git-send-email-eugen.hristev@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:35:51 +01:00
Eugen Hristev ae8779e198 staging: dt-bindings: wilc1000: add optional rtc_clk property
Add bindings for optional rtc clock pin.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/1568037993-4646-1-git-send-email-eugen.hristev@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:35:51 +01:00
Adham Abozaeid 133716f4ec staging: wilc1000: return kernel error codes from wilc_wlan_stop
return -EIO for bus failures, 0 otherwise.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190809182510.22443-3-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-12 16:35:39 +02:00
Adham Abozaeid 0d1b57c1f0 staging: wilc1000: Don't reset WILC CPU disgracefully
Send abort request to WILC from wilc_wlan_stop instead of resetting the
CPU.
The abort request was being sent from wilc_wlan_cleanup after the CPU
was reset which wasn't the correct order. The abort request handler
in the chip will take care of resetting the CPU.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190809182510.22443-2-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-12 16:35:39 +02:00
Greg Kroah-Hartman b2a878de11 Merge 5.3-rc4 into staging-next
We need the iio/staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-12 07:41:14 +02:00
Ajay Singh b0d525a007 staging: wilc1000: use helper API to pack data for firmware
As discussed in [1] use put_unaligned_le16() & put_unaligned_le32()
helper to pack the data before sending to firmware.

[1]. https://lore.kernel.org/linux-wireless/86bc79ccd379497d56bade79ec8f717603110ef7.camel@sipsolutions.net/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190806103325.14063-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-08 18:59:18 +02:00
Adham Abozaeid 9104688c32 staging: wilc1000: remove unused function
function wilc_resolve_disconnect_aberration isn't referenced, so
removing it

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190801200909.12605-3-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-02 13:58:11 +02:00
Adham Abozaeid 4b1b8b08ab staging: wilc1000: merge drv_handle and operation_mode wids
wilc_set_wfi_drv_handler and wilc_set_operation_mode sends the same
parameters to the FW, so it's better to combine them together.

Kept wilc_set_wfi_drv_handler implementation since it sends all the
required parameters, and renamed it to wilc_set_operation_mode to be
more descriptive.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190801200909.12605-2-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-02 13:56:59 +02:00
Adham Abozaeid 25f12201a4 staging: wilc1000: remove manual sleep mode
manual sleep mode was used to put the wilc1000 chip in sleep while in
disconnected state. This is taken care of in the firmware

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-7-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:46 +02:00
Adham Abozaeid 7e0cf3e3bf staging: wilc1000: apply power management regardless of open interfaces
Don't ignore power management if 2 interfaces are open

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-6-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:46 +02:00
Adham Abozaeid ded11ab181 staging: wilc1000: avoid overriding powersave state
Don't override powersave state with respect to the open interfaces and
let the firmware take care of when it's appropriate to do so

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-5-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:45 +02:00
Adham Abozaeid 5a28d3fd40 staging: wilc1000: remove unused members
remove obtaining_ip from struct wilc_vif

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-4-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:45 +02:00
Adham Abozaeid 98af3e7ed6 staging: wilc1000: remove ip timeout timer
during_ip_timer is not required after removing the code that disables
powersave while the ip is being obtained.
Its handler clear_during_ip is also removed

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-3-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:45 +02:00
Adham Abozaeid f68dc00ee7 staging: wilc1000: remove inetaddr notifier
Driver registers an inetaddr notifier to disable powersave while the ip
address is being obtained which should be controlled only by cfg80211.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-2-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:56:45 +02:00
Chuhong Yuan 7a047abbb6 staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32
Merge the combo use of memcpy and le32_to_cpus.
Use get_unaligned_le32 instead.
This simplifies the code.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20190725025203.8772-1-hslester96@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-25 09:48:14 +02:00
Adham Abozaeid fb2b055b7e staging: wilc1000: flush the workqueue before deinit the host
Before deinitializing the host interface, the workqueue should be flushed
to handle any pending deferred work

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190722213837.21952-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-25 09:38:15 +02:00
Nishka Dasgupta 4ad366015d staging: wilc1000: Replace function wilc_wlan_cfg_get_val()
Include wilc_wlan_cfg.h in wilc_netdev.c to enable it to call functions
in wilc_wlan_cfg.c.
Remove function wilc_wlan_cfg_get_val as all it does is call
wilc_wlan_cfg_get_wid_value in file wilc_wlan_cfg.c.
Rename function wilc_wlan_cfg_get_wid_value to wilc_wlan_cfg_get_val to
maintain compatibility with call sites (including in wilc_netdev.c).
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712072009.2550-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:12 +02:00
Ajay Singh 7ff9f78ea6 staging: wilc1000: rename 'host_interface' source and header
Rename 'host_interface' source and header file to include the 'wilc_'
prefix in its name.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:01:41 +02:00
Ajay Singh 93592a65ad staging: wilc1000: remove extra argument passing to wilc_send_config_pkt()
Cleanup patch to remove the passing of driver handler, get the 'idx'
value inside the called function.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:01:41 +02:00
Ajay Singh 39cf54fc6a staging: wilc1000: remove use of 'src_addr' element in 'wilc_vif' struct
Remove use of 'src_addr' element in wilc_vif, as the same information
already copied to net_device->dev_addr.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:01:41 +02:00
Ajay Singh 264a472d29 staging: wilc1000: remove unnecessary loop to traverse vif interfaces
Cleanup patch to avoid loop to traverse the interfaces instead make use
of vif received from net_device priv data.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:01:41 +02:00
Ajay Singh 2f5e568b28 staging: wilc1000: remove use of driver_handler_id & ifc_id
Removed the 'driver_handler_id' & 'ifc_id' elements and used 'idx' to
identify the handler.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:01:41 +02:00