aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/host_interface.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-01staging: wilc1000: rename 'host_interface' source and headerAjay Singh1-2089/+0
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 Singh1-79/+37
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 unnecessary loop to traverse vif interfacesAjay Singh1-6/+1
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 Singh1-2/+1
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: 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 Abozaeid1-3/+15
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-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-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 Abozaeid1-17/+15
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 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-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: move macro and function prototype from wilc_wlan_if.h fileAjay Singh1-0/+1
Move data structure and function prototype from 'wilc_wlan_if.h file. Now, this file contains constant specific to the firmware. 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 Singh1-27/+27
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-07staging: wilc1000: avoid use of 'hif_deinit_lock' static variableAjay Singh1-11/+9
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-07staging: wilc1000: refactor code to use cookie informationAjay Singh1-50/+22
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-07staging: wilc1000: remove use of 'terminated_handle' static variableAjay Singh1-8/+7
Remove use of 'terminated_handle' variable and set the 'hif_drv' to NULL once it's free. 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 Singh1-4/+4
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-30staging: wilc1000: remove redundant reset of station statisticsAdham Abozaeid1-20/+2
Driver sends configuration wids to reset connection statistics in the device, but the device already resets it when starting a new connection Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-28Merge 5.0-rc4 into staging-nextGreg Kroah-Hartman1-3/+2
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 Singh1-6/+7
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: refactor handle_set_mcast_filter()Ajay Singh1-21/+16
Refactor handle_set_mcast_filter() by making use of put_unaligned32() to pack the data instead of byte operation. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: remove 'disconnect_info' structureAjay Singh1-19/+5
Remove 'disconnect_info' struct use because its passed values are not required in cfg_connect_result(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: refactor information message parsing logicAjay Singh1-50/+16
Refactor code to avoid maintaining an unnecessary buffer to keep the information type message ('I' msg type). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: use single struct for 'connect' related parametersAjay Singh1-164/+53
Use single structure to store the connect request and response information. It helped in avoiding unnecessary buffer allocation to handle request and response flow. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: rename hidden_network related data structureAjay Singh1-21/+19
Rename hidden_network related data structure to have more appropriate names, as it's used to keep search network SSID details. 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 join parameters for FWAjay Singh1-265/+139
Refactor code to use struct to construct the join parameters. Avoid use of extra buffer before sending to FW instead directly pass the struct pointer. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: corrected order to pack join param bufferAjay Singh1-4/+1
Modified packing order for join param as expected by firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: make use of cfg80211_inform_bss_frame()Ajay Singh1-116/+28
Use cfg80211_inform_bss_frame() api instead of cfg80211_inform_bss() to inform cfg80211 about the BSS frame, to avoid unnecessary parsing of frame in driver. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18staging: wilc1000: remove the use of scan shadow bufferAjay Singh1-60/+34
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-18staging: wilc1000: make use of get_unaligned_le16/le32 to pack dataAjay Singh1-12/+3
Make use of get_unaligned_le16/le32 framework api's to pack data. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: wilc1000: fix memory leak in wilc_add_rx_gtkGustavo A. R. Silva1-2/+1
In case *mode* happens to be different than WILC_AP_MODE and WILC_STATION_MODE, gtk_key is not released, hence leanding to a memory leak. So, in this case it is safer to release gtk_key just before returning to callers. Addresses-Coverity-ID: 1476020 ("Resource leak") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: wilc1000: fix registration frame sizeJúlius Milan1-1/+1
Fixes the following sparse warnings: drivers/staging/wilc1000/host_interface.c:2360:30: warning: incorrect type in assignment (different base types) expected restricted __le32 [addressable] [assigned] [usertype] frame_type got restricted __le16 [usertype] <noident> Fixes: 147ccfd451024 ("staging: wilc1000: handle mgmt_frame_register ops from cfg82011 context") Signed-off-by: Július Milan <jmilan.dev@gmail.com> Reviewed-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15staging: wilc1000: remove set but not used variable 'msa'YueHaibing1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/staging/wilc1000/host_interface.c: In function 'wilc_parse_network_info': drivers/staging/wilc1000/host_interface.c:748:16: warning: variable 'msa' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07staging: wilc1000: make function wilc_get_stats_async staticMarko Stankovic1-1/+1
Makes local function wilc_get_stats_async() static Cleans up sparse warning: symbol 'wilc_get_stats_async' was not declared. Should it be static? Signed-off-by: Marko Stankovic <dartnorris@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17staging: wilc1000: fix NULL dereference inside wilc_scan()Ajay Singh1-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>
2018-12-05staging: wilc1000: handle scan operation callback from cfg80211 contextAjay Singh1-119/+24
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>
2018-12-05staging: wilc1000: avoid extra buffer copy while connect cfg opsAjay Singh1-112/+17
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>
2018-12-05staging: wilc1000: handle connect ops callback from cfg80211 contextAjay Singh1-60/+44
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>
2018-12-05staging: wilc1000: avoid deferred handling of cfg80211 disconnect callbackAjay Singh1-35/+4
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>
2018-12-05staging: wilc1000: handle get_station() ops callback in cfg80211 contextAjay Singh1-19/+19
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>
2018-12-05staging: wilc1000: handle remain on channel cfg ops from cfg80211 contextAjay Singh1-25/+11
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>
2018-12-05staging: wilc1000: use correct 'struct remain_ch' variable in scan completeAjay Singh1-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>
2018-12-05staging: wilc1000: refactor wilc_get_mac_address() to avoid deferred handlingAjay Singh1-35/+8
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>
2018-12-05staging: wilc1000: delete the unused code after code refactorAjay Singh1-31/+0
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>
2018-12-05staging: wilc1000: handle key related cfg operation from cfg80211 contextAjay Singh1-496/+195
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-05staging: wilc1000: refactor wilc_get_inactive_time() to avoid deferred handlingAjay Singh1-68/+23
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>
2018-12-05staging: wilc1000: refactor wilc_set_wfi_drv_handler() to avoid deferred handlingAjay Singh1-62/+20
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>
2018-12-05staging: wilc1000: refactor wilc_set_operation_mode() to avoid deferred handlingAjay Singh1-33/+16
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>