aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-11staging: wilc1000: prefer 'help' in KConfigIoannis Valasakis1-4/+4
Fix for a style warning using the help without the deprecated help included between dashes. Reported by checkpatch. Signed-off-by: Ioannis Valasakis <code@wizofe.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-28staging: wilc1000: fix incorrect allocation size for structureColin Ian King1-1/+1
Currently the allocation for str_vals is for the sizeof the pointer rather than the size of the structure. Fix this. Detected by smatch "wilc_wlan_cfg_init() error: not allocating enough data 392 vs 8" Fixes: acceb12a9f8b ("staging: wilc1000: refactor code to avoid static variables for config parameters") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: return exact error of register_netdev() from wilc_netdev_init()Ajay Singh1-4/+10
Refactor wilc_netdev_init() to return the error code received from register_netdev() during the failure condition. Earlier discussion link [1]. https://www.spinics.net/lists/linux-wireless/msg177304.html Suggested-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: refactor wilc_set_multicast_list() functionAjay Singh1-10/+10
Refactor wilc_set_multicast_list() by making below changes: o use kmalloc_array o remove unnecessary res o add u8 *cur_mc o use i as index o use '%pM' extension in netdev_dbg() The below checkpatch issue is also resolved after code refactor. 'spaces preferred around that '/' (ctx:VxV)' Suggested-by: Joe Perches <joe@perches.com> 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 Singh1-1/+1
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: remove unnecessary option used with ccflags-y in MakefileAjay Singh1-2/+0
Cleanup patch to remove -I(src) and -DWILC_ASIC_A0 option used in ccflag-y in Makefile. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove wilc_debugfs.c file as its not usedAjay Singh2-118/+2
Deleted wilc_debugfs.c file as it's not used. Earlier discussion link: [1]. https://www.spinics.net/lists/linux-wireless/msg176076.html Suggested-by: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove p2p related static variables to wilc_vif structAjay Singh3-31/+38
Avoid use of static variable and move them as part of private data(wilc_priv) struct. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove unnecessary memset in sdio_init() & wilc_spi_init()Ajay Singh2-6/+1
Cleanup changes to avoid unnecessary setting 'wilc->bus_data' value to zero as the buffer was allocated using kzalloc(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: avoid use of 'g_spi' static variableAjay Singh1-22/+36
Instead of using static variable 'g_spi' move it as part of 'wilc' struct. Also allocating the memory in the probe function and free is taken care in wilc_netdev_cleanup(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: avoid use of 'g_sdio' static variableAjay Singh3-20/+36
Instead of using static variable 'g_sdio' move it as part of 'wilc' struct. Also allocating the memory in the probe function and free during deinitialization. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove use of unnecessary 'wilc_connected_ssid' variableAjay Singh3-35/+15
'wilc_connected_ssid' actually used to store the BSSID information for connected BSSID. 'wilc_vif' already has 'bssid' variable to store the same information. So refactor code to remove 'wilc_connected_ssid' and instead used 'wilc_vif' struct 'bssid' element. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: avoid the use of 'hif_driver_comp' completion variableAjay Singh4-15/+15
Instead of using extra completion variable to handle the sync call now using msg->is_sync flag to handle the sync call. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_vals'Ajay Singh2-9/+9
Rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_vals' as its more appropriate for structure to store the values of string configuration. 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 Singh6-70/+138
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: refactor code to remove 'mac_status' from 'wilc_mac_cfg' structAjay Singh3-12/+17
Refactor the code by removing use of 'mac_status' from 'wilc_mac_cfg' and only have the string type configuration values in 'wilc_mac_cfg' struct. Now fetch the value 'WID_STATUS' configuration from 'g_cfg_byte' array. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove unused wid from cfg structAjay Singh1-107/+0
Cleanup patch to remove the unused element stored in cfg struct. Removed those wid from the cfg variables whose value is not fetched(GET_CFG) from the code. In case the wid is only set to the firmware then there is need to store them as part of cfg variables, so removed the unused code. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: remove unused wid type valuesAjay Singh1-4/+0
Cleanup patch to remove the wid type not used in the code. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: changes 'val' type to u8 in wilc_cfg_byte structAjay Singh1-1/+1
Use the correct datatype for storing the byte value in 'wilc_cfg_byte' struct. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: set default value of cfg response type in wilc_wlan_cfg_indicate_rx()Ajay Singh1-2/+1
Handle the setting of default value for 'wilc_cfg_rsp' type for all cases in wilc_wlan_cfg_indicate_rx() as the caller make use of this value to know the type of the received message. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: refactor wilc_wlan_parse_info_frame() functionAjay Singh1-8/+4
Return 'void' from wilc_wlan_parse_info_frame() as same constant value is returned always. Also removed the 'size' from input parameter as its not used in the function. 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' for wilc_wlan_cfg_indicate_rx()Ajay Singh2-8/+4
Cleanup patch to use 'void' return type for wilc_wlan_cfg_indicate_rx(), as its return value is not used in caller. The value set in 'rsp' argument is used to get the success status. 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 Singh1-3/+1
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 Singh1-9/+6
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 Singh1-8/+3
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-25staging: wilc1000: use 'void' return type for host_int_get_assoc_res_info()Ajay Singh1-6/+5
Change return type to 'void' for host_int_get_assoc_res_info() as its return value is not used. 'rcvd_assoc_resp_info_len' parameter value is used to know the status. 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' for wilc_wfi_deinit_mon_interface()Ajay Singh2-3/+2
Use 'void' return type for wilc_wfi_deinit_mon_interface(), as same value always return. 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' for wilc_deinit_host_int()Ajay Singh2-4/+2
Cleanup patch to use 'void' return type for wilc_deinit_host_int(), as its return value is not used in 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' for lock init & deinit functionsAjay Singh1-6/+2
Cleanup patch to use 'void' return type for wlan_deinit_locks() & wlan_init_locks(), as same value is return. 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' for wilc_wlan_set_bssid()Ajay Singh2-4/+2
Cleanup patch to use 'void' return type for wilc_wlan_set_bssid(), as its always returns the same value. 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' for wilc_frame_register()Ajay Singh2-5/+3
Cleanup patch to use 'void' return type for wilc_frame_register(), as its return value is not used. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25staging: wilc1000: Remove unnecessary pointer checkNathan Chancellor1-3/+0
Clang warns that the address of a pointer will always evaluated as true in a boolean context: drivers/staging/wilc1000/linux_wlan.c:267:20: warning: address of 'vif->ndev->dev' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!(&vif->ndev->dev)) ~ ~~~~~~~~~~~^~~ 1 warning generated. Since this statement always evaluates to false due to the logical not, remove it. Link: https://github.com/ClangBuiltLinux/linux/issues/121 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-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-Hartman5-8/+16
Handle the merge issues and take the iio and staging driver fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14staging: wilc1000: fix null checks on wilcColin Ian King1-3/+6
Currently the pointer wilc is being null checked several times and yet not checked for the final workqueue flush and destroy (which can lead to a null pointer dereference if wilc is null); these missing null checks were overlooked in an earlier core refactoring commit. Clean up the code by checking wilc at the start and bailing out early if it is null allowing the subsequent null checks to be removed, this also fixes the potential null pointer deferences on the workqueue flush and destroy calls. Detected by CoverityScan, CID#1473305 ("Dereference after null check") Fixes: b3ee105c332e ("staging: wilc1000: refactor code to move initilization in wilc_netdev_init()") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: remove handle_hif_exit_work() functionAjay Singh1-8/+0
Cleanup to remove handle_hif_exit_work(), as after code refactoring its not required anymore. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: refactor wilc_netdev_init() to handle memory free in error pathAjay Singh2-12/+30
Refactor the wilc_netdev_init() to cleanup the memory for error scenario and remove unnecessary 'dev' pointer check. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: refactor code to move initilization in wilc_netdev_init()Ajay Singh2-23/+8
Refactor code to move the initialization of wilc related parameters in wilc_netdev_init() and move their deinitialization in wilc_netdev_cleanup(). For 'hif_workqueue' creation 'clients_count' check is not required as the single instance is maintained. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: remove unnecessary static variable 'p2p_listen_state'Ajay Singh1-4/+2
Remove the use of unnecessary static variable 'p2p_listen_state'. Already 'p2p_listen_state' is present in 'wilc_priv' struct. So making use of that variable as its getting set in channel ready and remain on channel expired callback. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' structAjay Singh4-14/+11
Move static variable 'wilc_connecting' as part of 'wilc_vif' private struct. Remove "wilc_" prefix from name as its already part of 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: move 'chip_ps_state' static variable as part of 'wilc' structAjay Singh3-6/+6
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: remove unused code to set and get IP addressAjay Singh3-111/+0
Cleanup code to remove the variables related to setting and getting IP address as this case was not handled from firmware side. 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 Singh3-21/+21
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 wilc_wlan_txq_filter_dup_tcp_ack()Ajay Singh1-5/+6
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' structAjay Singh5-67/+77
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 Singh2-6/+6
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 Singh1-24/+28
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-09-10staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drvAjay Singh2-5/+4
Avoid use of static variable and move 'rcv_assoc_resp' as part of 'hif_drv' struct. Rename from 'rcv_assoc_resp' to 'assoc_resp'. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat'Ajay Singh2-2/+2
Cleanup patch to use appropriate variable name to fetch the periodic statistics. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' structAjay Singh2-12/+10
Refactor code to move 'periodic_rssi' as part of wilc_vif struct. Move 'dummy_statistics' from 'wilc' struct to 'wilc_vif' to maintain for each interface separately. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: wilc1000: move hif_workqueue static variables to 'wilc' structureAjay Singh2-5/+9
Avoid use of static variable hif_workqueue and move it inside 'wilc' structure. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>