summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
Commit message (Collapse)AuthorAgeFilesLines
...
* staging: wilc1000: fix NULL dereference inside wilc_scan()Ajay Singh2018-12-171-22/+26
| | | | | | | | | | Added NULL check before accessing 'hidden_net' pointer inside wilc_scan() to fix the issue found by static code checker. Fixes: 8f1a0ac1eba7 ("staging: wilc1000: handle scan operation callback from cfg80211 context") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: correct inconsistent indentingMichael Straube2018-12-051-6/+5Star
| | | | | | | | | | Correct inconsistent indenting reported by smatch. Instead of simply remove indentation, refactor the loop to also improve readabilitiy. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle scan operation callback from cfg80211 contextAjay Singh2018-12-052-123/+33Star
| | | | | | | | | Refactor code to handle scan operation callback from cfg80211 context. No need to maintain 'scan_attr' struct as the wid command is directly sent to firmware from cfg80211 context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: avoid extra buffer copy while connect cfg opsAjay Singh2018-12-053-112/+21Star
| | | | | | | | | | Refactor the code to avoid the use of an extra buffer to store the connection related parameter. No need to call cfg80211_disconnected in case of failure to send the wid command to firmware, an error status is directly returned in cfg80211 connect callback. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle connect ops callback from cfg80211 contextAjay Singh2018-12-051-60/+44Star
| | | | | | | | | Refactor the connect related cfg callback to be called from cfg80211 context. No need to post connect command internally in case scan is in progress instead simply return the error status in connect ops callback. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: avoid deferred handling of cfg80211 disconnect callbackAjay Singh2018-12-053-37/+6Star
| | | | | | | | | Refactor disconnect operation callback to handle from the cfg80211 context. The reason code is not required to pass as parameter to the function, so remove it. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle get_station() ops callback in cfg80211 contextAjay Singh2018-12-053-22/+21Star
| | | | | | | | | | Refactor code to handle the get_station() callback from cfg80211 context. Provided different API's to fetch the station statistics information in sync or async call. From cfg80211 get_station() ops callback calls the sync version of API. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle remain on channel cfg ops from cfg80211 contextAjay Singh2018-12-051-25/+11Star
| | | | | | | | Refactor wilc_remain_on_channel() to handle remain_on_channel callback from cfg80211 context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use correct 'struct remain_ch' variable in scan completeAjay Singh2018-12-051-1/+2
| | | | | | | | | | Use the correct reference to remain_ch variable in scan complete. Passing 'msg->body.remain_on_ch' to handle_remain_on_chan is not correct. So used the correct reference used to store roc related information during the scan. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: refactor wilc_get_mac_address() to avoid deferred handlingAjay Singh2018-12-052-39/+8Star
| | | | | | | | | Avoid handling of WID_MAC_ADDR wid command in deferred approach. Instead of posting the wid to workqueue now handle directly from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: delete the unused code after code refactorAjay Singh2018-12-052-58/+0Star
| | | | | | | | After code refactor some of the macro and variables are not required any more, so deleted the unused code. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle key related cfg operation from cfg80211 contextAjay Singh2018-12-054-506/+204Star
| | | | | | | | | 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>
* staging: wilc1000: refactor wilc_get_inactive_time() to avoid deferred handlingAjay Singh2018-12-051-68/+23Star
| | | | | | | | | Avoid handling of inactive time related wid command in deferred manner. Instead of posting the wid to workqueue now handle directly from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: refactor wilc_set_wfi_drv_handler() to avoid deferred ↵Ajay Singh2018-12-054-72/+23Star
| | | | | | | | | | | | handling Avoid handling of WID_SET_DRV_HANDLER wid command in deferred approach. Instead of posting the wid to work queue now handle directly from the caller context. Remove 'is_sync' parameter from the API as it's not required anymore. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: refactor wilc_set_operation_mode() to avoid deferred handlingAjay Singh2018-12-052-37/+16Star
| | | | | | | | | Avoid handling of WID_CURRENT_CHANNEL wid command in deferred approach. Instead of posting the wid to work queue now handle directly from the caller context. Use structure to fill in the firmware specific format. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle station dump cfg ops from cfg80211 contextAjay Singh2018-12-052-43/+13Star
| | | | | | | | | | Refactor code to handle dump_station() callback from cfg80211 context. Instead of deferring issue of wid command now send it directly from cfg context. Also making use of wilc_get_rssi() error status in case there is a failure to post the wid command to the firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: refactor wilc_hif_set_cfg() to avoid deferred handlingAjay Singh2018-12-051-63/+32Star
| | | | | | | | | | Avoid handling configuration params wid command in deferred approach. Instead of posting to workqueue now handle directly from the caller context. Reduce the size of wid array from 32 to 4 as maximum only 4 wid used at a time. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: refactor wilc_set_mac_chnl_num() to avoid deferred handlingAjay Singh2018-12-051-37/+9Star
| | | | | | | | | Avoid handling of WID_CURRENT_CHANNEL wid command in deferred approach. Instead of posting the wid to workqueue now handle directly from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle mgmt_frame_register ops from cfg82011 contextAjay Singh2018-12-052-54/+22Star
| | | | | | | | | Avoid handling of mgmt_frame_register operation callback in a deferred manner. Now set the wid command to firmware directly from caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle add beacon operation callback from cfg80211 contextAjay Singh2018-12-053-108/+32Star
| | | | | | | | | 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>
* staging: wilc1000: handle delete beacon cfg ops from cfg80211 context()Ajay Singh2018-12-051-29/+10Star
| | | | | | | | Refactor the code to handle delete beacon cfg operation from cfg80211 context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use is_zero_ether_addr() API to check mac addressAjay Singh2018-12-052-4/+2Star
| | | | | | | Use is_zero_ether_addr() API to check if mac address value is zero. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle delete station related callback ops from cfg80211 ↵Ajay Singh2018-12-051-114/+33Star
| | | | | | | | | | context Refactor the code to handle delete/delete_all station operation callback from cfg80211 context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use void return for wilc_hif_pack_sta_param()Ajay Singh2018-12-051-10/+4Star
| | | | | | | | | Change the return type from u32 to void for wilc_hif_pack_sta_param() as its value is not used. Also remove the use of extra pointer as it's not required now. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle add and edit station from the cfg80211 contextAjay Singh2018-12-053-167/+67Star
| | | | | | | | | | 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>
* staging: wilc1000: handle setting power management from cfg80211 contextAjay Singh2018-12-051-43/+13Star
| | | | | | | | Refactor the code to handle the power management cfg operation from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: handle tx power related callback from cfg80211 contextAjay Singh2018-12-051-71/+14Star
| | | | | | | | | Avoid the use of internal work queue to defer the handling of tx power related cfg operations callback. Now issuing the wid command to firmware directly from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use mutex lock to synchronized sending 'wid' cmd to firmwareAjay Singh2018-12-053-12/+14
| | | | | | | | | | | | 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>
* staging: wilc1000: avoid the use of the static variable to configure wiphy ↵Ajay Singh2018-12-052-72/+80
| | | | | | | | | | | 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>
* staging: wilc1000: make use of put_unaligned_le32 in ↵Ajay Singh2018-12-052-9/+2Star
| | | | | | | | | | handle_set_wfi_drv_handler() Make use of put_unaligned_le32() function to pack the wid command buffer for firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: remove unnecessary checks in wilc_mac_close()Ajay Singh2018-12-051-21/+1Star
| | | | | | | | Remove unnecessary 'if' check in wilc_mac_close() as those conditions will not happen. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: rename tsf_hi element of network_info structAjay Singh2018-11-123-8/+8
| | | | | | | | 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>
* staging: wilc1000: use ENOBUFS error code instead of WILC_TX_ERR_NO_BUF macroAjay Singh2018-11-123-4/+2Star
| | | | | | | | 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>
* staging: wilc1000: added 'WILC_' prefix for constants to have clear namespaceAjay Singh2018-11-126-150/+159
| | | | | | | 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>
* staging: wilc1000: rename firmware related constants to follow better namespaceAjay Singh2018-11-124-12/+18
| | | | | | | | | 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>
* staging: wilc1000: move current_tx_rate enum to wilc_wlan_if.h fileAjay Singh2018-11-123-17/+17
| | | | | | | | | Move 'current_tx_rate' enum to wilc_wlan_if.h, to have it along with the other FW related to constants. Also added prefix to have a better namespace. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use proper namespace for macros in wilc_wlan_if.h headerAjay Singh2018-11-127-135/+138
| | | | | | | | | 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>
* staging: wilc1000: restructure macros used to handle security typeAjay Singh2018-11-123-36/+38
| | | | | | | | | 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>
* staging: wilc1000: use enum contants for mac status & added 'WILC_' prefixAjay Singh2018-11-124-13/+16
| | | | | | | | 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>
* staging: wilc1000: move sdio_cmd52 & sdio_cmd53 struct to source fileAjay Singh2018-11-122-19/+19
| | | | | | | | Moved sdio_cmd52 & sdio_cmd53 struct from wilc_wlan_if.h, as its used in wilc_sdio.cfile. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: remove unused macros and struct members in host_interface.hAjay Singh2018-11-121-11/+0Star
| | | | | | | | Cleanup patch to remove the unused macros and struct members in host_interface.h header file. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: use WLAN_PMKID_LEN macro from ieee80211.h headerAjay Singh2018-11-124-7/+5Star
| | | | | | | | 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>
* staging: wilc1000: use macro from ieee80211.h in register frame api'sAjay Singh2018-11-123-7/+4Star
| | | | | | | | 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>
* staging: wilc1000: Remove unused mutex cfg_values_lockAdham Abozaeid2018-11-112-11/+0Star
| | | | | | | | After removing cfg_values member, cfg_values_lock that was used to protect it can also be removed. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: Don't keep a copy of wiphy parameters in the driverAdham Abozaeid2018-11-112-14/+0Star
| | | | | | | host_if_drv.cfg_values is a write only member, and can be removed Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: validate cfg parameters before scheduling the workAdham Abozaeid2018-11-112-45/+48
| | | | | | | | 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>
* staging: wilc1000: remove unused flags in handle_cfg_param()Adham Abozaeid2018-11-083-254/+0Star
| | | | | | | | | handle_cfg_param() receives a bit map that describes what to be changed. Some of these bits flags aren't referred to from elsewhere and can be removed. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: remove coreconfigurator.h fileAjay Singh2018-11-053-73/+59Star
| | | | | | | | | Remove the coreconfigurator header file, as its source file is deleted after code refactor. Moved the required structure and prototypes to hostinterface header. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: remove coreconfigurator.c fileAjay Singh2018-11-054-132/+118Star
| | | | | | | | | After use of framework API's most of the redundant functions are removed in coreconfigurator.c file. Now moved left over function to host_interface file and deleted the coreconfigurator.c file. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wilc1000: remove unnecessary MAX_STRING_LEN macroAjay Singh2018-11-051-2/+1Star
| | | | | | | Cleanup patch to remove the use of unnecessary 'MAX_STRING_LEN' macro. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>