aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-09-12staging: wilc1000: avoid twice IRQ handler execution for each single interruptAjay Singh1-1/+1
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-12staging: wilc1000: remove unused interrupt status handling codeAjay Singh2-34/+2
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-12staging: wilc1000: look for rtc_clk clockEugen Hristev2-0/+15
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-12staging: dt-bindings: wilc1000: add optional rtc_clk propertyEugen Hristev2-1/+15
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-08-12staging: wilc1000: return kernel error codes from wilc_wlan_stopAdham Abozaeid1-5/+5
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-12staging: wilc1000: Don't reset WILC CPU disgracefullyAdham Abozaeid3-60/+24
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-12Merge 5.3-rc4 into staging-nextGreg Kroah-Hartman1-0/+1
We need the iio/staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-08staging: wilc1000: use helper API to pack data for firmwareAjay Singh1-56/+18
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-02staging: wilc1000: remove unused functionAdham Abozaeid2-10/+0
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-02staging: wilc1000: merge drv_handle and operation_mode widsAdham Abozaeid5-51/+21
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-07-30staging: wilc1000: remove manual sleep modeAdham Abozaeid4-23/+1
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-30staging: wilc1000: apply power management regardless of open interfacesAdham Abozaeid1-3/+0
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-30staging: wilc1000: avoid overriding powersave stateAdham Abozaeid3-24/+3
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-30staging: wilc1000: remove unused membersAdham Abozaeid3-11/+2
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-30staging: wilc1000: remove ip timeout timerAdham Abozaeid2-18/+0
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-30staging: wilc1000: remove inetaddr notifierAdham Abozaeid1-65/+0
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-25staging: wilc1000: Merge memcpy + le32_to_cpus to get_unaligned_le32Chuhong Yuan3-10/+5
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-25staging: wilc1000: flush the workqueue before deinit the hostAdham Abozaeid1-0/+1
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-22staging: wilc1000: Replace function wilc_wlan_cfg_get_val()Nishka Dasgupta5-11/+5
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-01staging: wilc1000: rename 'host_interface' source and headerAjay Singh4-2/+2
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-01staging: wilc1000: remove extra argument passing to wilc_send_config_pkt()Ajay Singh3-81/+40
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-01staging: wilc1000: remove use of 'src_addr' element in 'wilc_vif' structAjay Singh3-4/+2
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-01staging: wilc1000: remove unnecessary loop to traverse vif interfacesAjay Singh2-17/+6
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-01staging: wilc1000: remove use of driver_handler_id & ifc_idAjay Singh5-9/+4
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-01staging: wilc1000: added support to dynamically add/remove interfacesAjay Singh9-390/+492
Removed the use of two hardcoded interfaces and added support to add/remove the network interfaces dynamically. Now the driver will have single default interface with name 'wlan0' and later other interface can be added from user space application e.g using 'iw add' command. Also taken care to maintain 'wilc_vif' as part of 'net_device' private data and 'wilc' struct as 'wiphy' private data. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: wilc1000: fix error path cleanup in wilc_wlan_initialize()Ajay Singh1-6/+6
For the error path in wilc_wlan_initialize(), the resources are not cleanup in the correct order. Reverted the previous changes and use the correct order to free during error condition. Fixes: b46d68825c2d ("staging: wilc1000: remove COMPLEMENT_BOOT") Cc: <stable@vger.kernel.org> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01staging: wilc1000: handle p2p operations in caller contextAjay Singh1-29/+17
Moved the handling of p2p related operation in the caller context instead of using workqueue. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-21staging: wilc1000: add passive scan supportAdham Abozaeid4-8/+25
Add passive scan support to the driver by passing the scan type to the HW and configure the HW scan time if configured by the cfg80211. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-20staging: wilc1000: Remove redundant memsetHariprasad Kelam1-1/+0
alloc_etherdev function internally calls kvzalloc . So we may not need explicit memset after this call. Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03Merge 5.2-rc3 into staging-nextGreg Kroah-Hartman1-2/+6
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22staging: wilc1000: remove redundant masking of pkt_offsetColin Ian King1-3/+0
The masking update of pkg_offset is redundant as the updated value is never read and pkg_offset is re-assigned on the next iteration of the loop. Clean this up by removing the redundant assignment. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup()Dan Carpenter1-2/+6
If ->hif_read_reg() or ->hif_write_reg() fail then the code unlocks and keeps executing. It should just return. Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-17staging: wilc1000: Avoid GFP_KERNEL allocation from atomic contextAdham Abozaeid1-1/+1
txq_add_mgmt_pkt allocates memory while being called from atomic context so needs to use GFP_ATOMIC Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: remove redundant 'default n' from KconfigBartlomiej Zolnierkiewicz1-1/+0
'default n' is the default value for any bool or tristate Kconfig setting so there is no need to write it explicitly. Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols") the Kconfig behavior is the same regardless of 'default n' being present or not: ... One side effect of (and the main motivation for) this change is making the following two definitions behave exactly the same: config FOO bool config FOO bool default n With this change, neither of these will generate a '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied). That might make it clearer to people that a bare 'default n' is redundant. ... Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: wilc1000: fix spelling mistake "dissconect" -> "disconnect"Colin Ian King1-1/+1
There is a spelling mistake in a netdev_err error message, fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: wilc1000: give usleep_range a rangeNicholas Mc Guire1-2/+2
usleep_range() is called in non-atomic context so there is little point in setting min==max as the jitter of hrtimer is determined by interruptions anyway. usleep_range can only perform the intended coalescence if some room for placing the hrtimer is provided. Given the range of milliseconds the delay will be 2+ anyway - so make it 2-2.5 ms which gives hrtimers space to optimize without negatively impacting performance. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: wilc1000: Avoid GFP_KERNEL allocation from atomic context.Tetsuo Handa1-1/+1
Since wilc_set_multicast_list() is called with dev->addr_list_lock spinlock held, we can't use GFP_KERNEL memory allocation. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Fixes: e624c58cf8eb ("staging: wilc1000: refactor code to avoid use of wilc_set_multicast_list global") Cc: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Adham Abozaeid <adham.abozaeid@microchip.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16staging: wilc1000: drop explicit conversion to boolNicholas Mc Guire1-1/+1
As the expression evaluates to a boolean anyway (relational and logical operators) conversion with the ternary operator is not needed here as coccinelle notes (boolconv.cocci) Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-29staging: wilc1000: assign scan result callback before starting the scanAdham Abozaeid1-2/+3
When scan is triggered, sometimes scan results are received before the scan result callback is assigned, causing the recieved results to be ignored. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-27staging: wilc1000: use cfg80211 ssid list instead of repacking itAdham Abozaeid3-95/+20
Avoid repacking ssid values into struct wilc_probe_ssid, and use the cfg80211 provided struct to pass the ssid list to wilc_scan. With this change, struct wilc_probe_ssid, struct wilc_probe_ssid_info and function wilc_wfi_cfg_alloc_fill_ssid will not be needed anymore. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22staging: wilc1000: Remove return variables from wilc_spi.cNishka Dasgupta1-8/+5
Remove return variables from wilc_spi.c. Issue found with Coccinelle using ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22staging: wilc1000: Remove return variable from host_interface.cNishka Dasgupta1-14/+6
Remove return variable from host_interface.c. Issue found with Coccinelle using ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: wilc1000: remove unnecessary local variablesHimadri Pandya1-9/+3
Remove unnecessary local variable "ret" and its assignments from functions wilc_set_tx_power and wilc_get_tx_power. Suggested by Coccinelle. Signed-off-by: Himadri Pandya <himadri18.07@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: wilc1000: Fix line over 80 charactersDebleena Sen1-1/+2
Break the line after '+' to remove the checkpatch.pl warning. Remove trailing whitespace after '+' if any: WARNING: line over 80 characters Signed-off-by: Debleena Sen <idebleenasen@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-28staging: wilc1000: fix incorrent type in initializerBo YU1-1/+1
Fix sparse warning: drivers/staging/wilc1000//host_interface.c:444:49: warning: incorrect type in initializer (different address spaces) drivers/staging/wilc1000//host_interface.c:444:49: expected struct cfg80211_bss_ies const *ies drivers/staging/wilc1000//host_interface.c:444:49: got struct cfg80211_bss_ies const [noderef] <asn:4> *ies Signed-off-by: Bo YU <tsu.yubo@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26staging: wilc1000: fix incorrent type assignmentBo YU1-2/+2
Fix sparse warning: drivers/staging/wilc1000/host_interface.c:450:30: warning: incorrect type in assignment (different base types) drivers/staging/wilc1000/host_interface.c:450:30: expected restricted __le16 [usertype] beacon_period drivers/staging/wilc1000/host_interface.c:450:30: got unsigned short [usertype] beacon_interval drivers/staging/wilc1000/host_interface.c:451:25: warning: incorrect type in assignment (different base types) drivers/staging/wilc1000/host_interface.c:451:25: expected restricted __le16 [usertype] cap_info drivers/staging/wilc1000/host_interface.c:451:25: got unsigned short [usertype] capability Signed-off-by: Bo YU <tsu.yubo@gmail.com> Reviewed-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07staging: wilc1000: rename linux_wlan.c and linux_mon.cAjay Singh3-1/+1
Rename linux_wlan.c and linux_mon.c to wilc_netdev.c and wilc_mon.c to include 'wilc_' prefix. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07staging: wilc1000: remove 'linux_' prefix in function namesAjay Singh2-14/+13
Remove 'linux_' prefix and replace it with 'wilc_' namespace. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07staging: wilc1000: rename wilc_frmw_to_linux()Ajay Singh3-5/+5
Rename wilc_frmw_to_linux() to wilc_frmw_to_host() to be remove the _linux suffix. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>