summaryrefslogtreecommitdiff
path: root/drivers/staging/wilc1000/wilc_wlan.c
AgeCommit message (Collapse)Author
2019-02-07staging: wilc1000: rename wilc_frmw_to_linux()Ajay Singh
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>
2019-02-07staging: wilc1000: add 'wilc_' prefix to have proper namespaceAjay Singh
Cleanup patch to rename data structure and function name to have 'wilc_' prefix. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04staging: wilc1000: rename timeout related macrosAjay Singh
Rename timeout related macros to have their unit clear from their name. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-28Merge 5.0-rc4 into staging-nextGreg Kroah-Hartman
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: avoid the use of typedef for function pointersAjay Singh
Remove typedef for function pointers. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: use 'struct' to pack cfg header frame in ↵Ajay Singh
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-15Staging: wilc1000: unlock on error in init_chip()Dan Carpenter
When there is an error in init_bus() then we need to call release_bus() before we 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>
2018-12-05staging: wilc1000: use mutex lock to synchronized sending 'wid' cmd to firmwareAjay Singh
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-11-12staging: wilc1000: use ENOBUFS error code instead of WILC_TX_ERR_NO_BUF macroAjay Singh
Make use of 'ENOBUFS' instead of WILC_TX_ERR_NO_BUF macro. The value of WILC_TX_ERR_NO_BUF is -2, which is confusing with ENOENT error code. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-12staging: wilc1000: added 'WILC_' prefix for constants to have clear namespaceAjay Singh
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-12staging: wilc1000: use proper namespace for macros in wilc_wlan_if.h headerAjay Singh
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-09-25staging: wilc1000: use usleep_range() in place of udelay()Ajay Singh
Changes to avoid the below checkpatch warning: 'usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt;' Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: refactor code to avoid static variables for config parametersAjay Singh
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-25staging: wilc1000: use 'void' return for wilc_wlan_txq_filter_dup_tcp_ack()Ajay Singh
Use 'void' return for wilc_wlan_txq_filter_dup_tcp_ack() as it always return value '1' and its not used by the caller. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: change return type to 'void' tcp ack filter functionsAjay Singh
Use 'void' return type for below functions as they always return '0' and their return value is not used by caller. add_tcp_pending_ack() update_tcp_session() add_tcp_pending_ack() Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: use 'void' return for wilc_wlan_txq_add_to_head()Ajay Singh
Use 'void' return for wilc_wlan_txq_add_to_head() as its always return '0' value. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-16Merge 4.19-rc4 into staging-nextGreg Kroah-Hartman
Handle the merge issues and take the iio and staging driver fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' structAjay Singh
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-10staging: wilc1000: use short names to fix over 80 issue in tcp_process()Ajay Singh
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-10staging: wilc1000: avoid line over 80 chars in ↵Ajay Singh
wilc_wlan_txq_filter_dup_tcp_ack() Cleanup patch to avoid line over 80 chars checkpatch issue introduced in previous code refactor commit. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' ↵Ajay Singh
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-10staging: wilc1000: use lowercase for get_BSSID() and HIL variableAjay Singh
Cleanup patch to use lowercase name for get_BSSID() and HIL variable. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: refactor tcp_process() to avoid extra leading tabsAjay Singh
Refactor tcp_process() to avoid unnecessary leading tabs in the function. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: wilc1000: revert "fix TODO to compile spi and sdio components in ↵Arnd Bergmann
single module" The TODO item named "make spi and sdio components coexist in one build" was apparently addressed a long time ago, but never removed from the TODO file. However, the new patch that tries to address it actually makes it worse again by duplicating the common parts of the driver into two separate modules rather than sharing them. This also introduces a build regression when one of the two is built-in while the other is a loadable module: drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined reference to `__this_module' Reverting the patch makes it build again. I'm leaving the TODO file modification though, as there is nothing left to do for this item. A related problem however still seems to exist: one still cannot have multiple concurrent instances of wilc1000 devices present in the system, as there are lots of shared global variables such as host_interface.c:static struct wilc_vif *periodic_rssi_vif; wilc_sdio.c:static struct wilc_sdio g_sdio; wilc_wlan.c:static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP; wilc_wlan.c:static u32 pending_acks; wilc_wfi_cfgoperations.c:int wilc_connecting; In order to have multiple instances working (sdio, spi, or mixed), all such variables need to be dynamically allocated per instance and stored in 'struct wilc' or one of the structures referenced by it. Fixes: 9abc44ba4e2f ("staging: wilc1000: fix TODO to compile spi and sdio components in single module") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: wilc1000: replace ISWILC1000() macro with inline functionAjay Singh
Cleanup patch to avoid below checkpatch issue by replacing the macro with inline function. Macro argument 'id' may be better as '(id)' to avoid precedence issues. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging: wilc1000: added Microchip copyright notice headerAjay Singh
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-02staging: wilc1000: fix endianness warnings reported by sparseAjay Singh
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-02staging: wilc1000: refactor wilc_wlan_handle_isr_ext to avoid goto statementAjay Singh
Refactor wilc_wlan_handle_isr_ext() to avoid the use of the goto label. Also avoid the unnecessary NULL check for 'wilc->rx_buffer' and calling wilc_wlan_handle_rxq() only after wilc_wlan_rxq_add() call. The link [1] contains details for discussion related to this changes. [1]. https://patchwork.kernel.org/patch/10533601/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging: wilc1000: modified debug log messages descriptionAjay Singh
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-02staging: wilc1000: fix TODO to compile spi and sdio components in single moduleAjay Singh
Changes to compile module component along with SPI and SDIO module. Previously 'wilc1000.ko' used to generate along with wilc-spi.ko or wilc1000-sdio.ko module. After these changes only wilc1000-spi.ko or wilc1000-sdio.ko modules are required for SPI and SDIO respectively. These changes are done to address below TODO item. - make SPI and SDIO components coexist in one build Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-21staging: wilc1000: move variable assignment along with its declarationAjay Singh
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-21staging: wilc1000: use single space before opening brances '{'Ajay Singh
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-21staging: wilc1000: remove unused elements in 'wilc' structAjay Singh
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-21staging: wilc1000: rename goto to avoid leading '_' in label nameAjay Singh
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-06-28staging: wilc1000: Use common structs to parse ip packetsThibaut Robert
Use structs ethhdr, iphdr and tcphdr instead of manual parsing in tcp_process. This commit fix handling of ip packets containing options. It also fixes the following sparse warning: drivers/staging/wilc1000//wilc_wlan.c:201:19: warning: cast to restricted __be16 Signed-off-by: Thibaut Robert <thibaut.robert@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: wilc1000: move 'txq_spinlock_flags' from 'wilc' structure to local ↵Ajay Singh
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-17staging: wilc1000: remove 'rxq_entries' from 'wilc' structAjay Singh
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-17staging: wilc1000: use list_head to maintain 'rxq_entry_t elements in rx queueAjay Singh
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-17staging: wilc1000: use list_head to maintain 'txq_entry_t' elements of tx queueAjay Singh
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-05-14staging: wilc1000: remove 'flag' argument from wilc_mac_indicate()Ajay Singh
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-03staging: wilc1000: remove unnecessary header file inclusion for wilcAjay Singh
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-04-25staging: wilc1000: rename goto label '_fail_' linux naming convensionAjay Singh
Rename '_fail_' goto label to have name as per 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-03-06staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()Ajay Singh
Refactor wilc_wlan_handle_rxq() to fix line over 80 character issue found by checkpatch.pl script. Added a new function to split 'wilc_wlan_handle_rxq' function code. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: wilc1000: fix open parenthesis mismatch in wilc_wlan_cfg_get()Ajay Singh
Fix 'Alignment should match open parenthesis' issue found by checkpatch.pl script. Reduce the leading tab, to make space for open parenthesis match. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: wilc1000: rename WILC_WFI_mgmt_rx() to avoid camelCaseAjay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: wilc1000: move multiple definition of same macro to common headerAjay Singh
Move the same #define from multiple '.c' files to common header file. Instead of having same macro in different '.c' files, now kept in common '.h' file. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: wilc1000: fix line over 80 char in wilc_wlan_handle_txq()Ajay Singh
Refactor wilc_wlan_handle_txq() to fix 'line over 80 char' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: wilc1000: rename label _end_ in wilc_wlan_handle_txq()Ajay Singh
Rename label name starting with '_' 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-03-01staging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq()Ajay Singh
Refactor wilc_wlan_handle_txq() by removing unnecessary while(0) loop. "Line over 80 char" issues in wilc_wlan_handle_txq() are fix by reducing extra leading tab. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>