summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-25staging: wilc1000: rename WID_LOGTerminal_Switch to avoid camelCaseAjay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script. 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-04-25staging: wilc1000: fix line over 80 chars in change_station()Ajay Singh
Fix 'line over 80 chars' issue found by checkpatch.pl script. 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-04-25staging: wilc1000: use sizeof(variable) for memory allocated to store key infoAjay Singh
Changes to fix below checkpatch reported issues. CHECK: Prefer kmalloc(sizeof(*priv->wilc_gtk[idx])...) over kmalloc(sizeof(struct wilc_wfi_key)...) CHECK: Prefer kmalloc(sizeof(*priv->wilc_ptk[idx])...) over kmalloc(sizeof(struct wilc_wfi_key)...) 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-04-25staging: wilc1000: handle error condition in add_key() and remove auth_type ↵Ajay Singh
variable Added the code to return correct error code in add_key() and also removed 'auth_type' variable. Now passing diretly to function instead of using the 'auth_type' variable. 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-04-25staging: wilc1000: refactor add_key() to avoid duplicated codeAjay Singh
Cleanup fixes by removing the duplicated code in actor add_key(). 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-04-25staging: wilc1000: remove inner block {} and resetting of mode variableAjay Singh
Cleanup fixes to remove the uncessary inner block { /* */ } and setting of 'mode' variable. 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-04-25staging: wilc1000: split add_key() to avoid line over 80 charsAjay Singh
Cleanup changes to fix 'line over 80 chars' issue found by checkpatch.pl script by spliting the function. Also make use of kzalloc() instead kmalloc(). 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-04-25staging: wilc1000: rename variable using datatype in their name in add_key()Ajay Singh
Cleanup changes to use variable 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-04-25staging: wilc1000: rename WILC_WFI_wep_key & WILC_WFI_wep_key_lenAjay Singh
Cleanup patch to use lower case for variable 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-04-25staging: wilc1000: remove line over 80 char warning in few functionsAjay Singh
Remove 'line over 80 characters' issues found by checkpatch.pl script for following functions. disconnect() del_pmksa() wilc_create_wiphy() del_pmksa() Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: remove unused 'struct add_key_params'Ajay Singh
Cleanup patch to remove unused struct data structure. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: remove line over 80 char in cfg_connect_result()Ajay Singh
Fix 'line over 80 characters' issues reported by checkpatch.pl script in cfg_connect_result(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: fix line over 80 char issue in clear_shadow_scan()Ajay Singh
Remove 'line over 80 char' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: rename hAgingTimer to avoid camelCase issueAjay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: refactor mgmt_tx to fix line over 80 charsAjay Singh
Refactor mgmt_tx() to fix line over 80 characters issue. Split the function to avoid the checkpatch.pl warning. Returning the same error code in case of memory allocation failure. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCaseAjay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 charAjay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script. Refactor and split the function to avoid the checkpatch reported issues. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: remove line over 80 char warnings in set_wiphy_params()Ajay Singh
Fix 'line over 80 character' issue reported by checkpatch.pl script in set_wiphy_params(). Directly used the 'wiphy' pointer received as function argument instead of using 'priv->dev->ieee80211_ptr->wiphy'. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: removed unused static variables for gtk and ptk informationAjay Singh
Removed the unnecessary static variables used to store gtk and ptk information. Key data stored in the params was never access using these variables. Variables given below are removed g_add_gtk_key_params; g_key_gtk_params; g_add_ptk_key_params; g_key_ptk_params; g_key_wep_params; g_ptk_keys_saved; g_gtk_keys_saved; g_wep_keys_saved; Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: refactor scan() to free kmalloc memory on failure casesAjay Singh
Added changes to free the allocated memory in scan() for error condition. Also added 'NULL' check validation before accessing allocated memory. Copied the SSID information in consecutive slots to avoid inbetween holes while filling into array. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor hostif_sme_set_pmksa functionSergio Paracuellos
This commits refactor a bit hostif_sme_set_pmksa function: - avoid one level indentation changing if condition. - use ether_addr_copy to copy bssid addresses. - move 'i' initialization to declaration place. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use ether_addr_copy in hostif_sme_multicast_setSergio Paracuellos
Use ether_addr_copy to copy ethernet addresses in function hostif_sme_multicast_set instead of memcpy. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use ether_addr_equal in hostif_data_requestSergio Paracuellos
Use ether_addr_equal to compare addresses in ether_addr_equal function instead of comparing using memcmp. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use ether_addr_equal in hostif_data_indicationSergio Paracuellos
Instead of comparing ethernet address using memcmp in function hostif_data_indication use ether_addr_equal function created for this function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use ether_addr_copy in hostif_mib_get_confirmSergio Paracuellos
This commit improves readability changing custom ethernet addresses copies in favour of using ether_addr_copy() function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use ether_addr_copy() instead of custom copySergio Paracuellos
In order to achieve ethernet address copies, ether_addr_copy() function exists. So just use it and avoid the byte by byte copy. This increase readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove duplicated ks_wlan_handler_def declarationSergio Paracuellos
This declaration is declared twice so just remove this one because the other one is the one which contains static struct initializers. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove WPS definition conditional codeSergio Paracuellos
WPS definition was defined by default in ks_wlan.h header file. So it makes no sense to have conditional preprocessor stuff along the code about this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix line exceding 80 characters in ks_wlan_get_rangeSergio Paracuellos
Avoid very long if condition just changing its style. This makes checkpatch script not complains about this line. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor ks_wlan_get_mode functionSergio Paracuellos
Avoid the use of switch-case block which is not necessary at all and just use a ternary operator to achieve this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor ks_wlan_set_mode functionSergio Paracuellos
Most cases which are being handled in the switch-case of ks_wlan_set_mode function are just returning EINVAL. Avoid the use of switch-case stament and just use a simple if to handle those. This decrease LOC as well as improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove some duplicated definitions in ks_wlan_net.cSergio Paracuellos
This definitions are in linux/wireless.h header so it is not necessary at all to have this compatibility stuff duplicated here. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid use of brackets in single line ifSergio Paracuellos
Singles if does not need at all to use brackets in its body so just remove them which is the preferred style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor hostif_sme_power_mgmt_set functionSergio Paracuellos
Some minor changes have been done in this function to clean it a bit: - POWER_MGMT_ACTIVE and default case are the same so just handle that with the same block of code, - POWER_MGMT_SAVE1 replaces if-else with a ternary operator. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use definitions from kernel headers in ↵Sergio Paracuellos
hostif_data_indication function Function hostif_data_indication checks some hardcoded values in a switch-case block. This values are defined in uapi/linux/llc.h header. Just use them and avoid a comment in the code improving readability a bit. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: join some debug traces in get_current_ap functionSergio Paracuellos
There is a lot of netdev_dbg calls related with the access point in this function and all of them can be joined in only one call. This makes code a bit simplier. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid some if-else code in get_current_ap functionSergio Paracuellos
This commits avoid some if-else code extracting common code before its use and making use of a new variable 'size' which is assigned using a ternary operator. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove KSC_OPNOTSUPP related codeSergio Paracuellos
This commit reviews KSC_OPNOTSUPP related code. The preprocessor KSC_OPNOTSUPP is defined by default so related wext functions are not being used. Just clean code removing all of this stuff. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use IW_HANDLER macro in ks_wlan_handlerSergio Paracuellos
This commit make use of IW_HANDLER to set wext operations of the device. Using this, comments are not neccessary anymore and also NULL entries so readability is clearly increased. In order to avoid casting because of the use of a different prototype in all related functions, those which are affected have been updated also to make use of the union iwreq_data as third parameter updating code accordly. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review includes of ks_hostif fileSergio Paracuellos
This commit reviews includes of ks_hostif.c source file. Those which are not being used at all have been removed. Driver header includes have been moved after the kernel header includes to make style consistent in different files of the driver. The need of ks_wlan.h header include is only because of some preprocessor conditional code of WPS definition. This definition is in ks_wlan.h so this one must be included before the ks_hostif.h header file. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: removes data_buff field of ks_wlan_private structSergio Paracuellos
This commit removes data_buff array field of ks_wlan_private which is not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove two fields of ks_wlan_private structSergio Paracuellos
This commit removes l2_dev and l2_fd fields of ks_wlan_private struct because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid blank line between definitions in hostif_data_requestSergio Paracuellos
This commit removes a blank line between definition in hostif_data_request function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix warning aout long line in init_requestSergio Paracuellos
This commit fix length of the definition line of init_request function. Warning from checkpatch script for this is fixed. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove superfluous comments in ks_hostif source fileSergio Paracuellos
This commit removes some comments which are not necessary at all because code is clear enough to understand its intention. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid one level indentation in devio_rec_ind functionSergio Paracuellos
This commit changes logic to handle with the status of the device at first checking for close state to return directly instead of just do the stuff when device is open. This improves readability avoiding one level indentation. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: change name and type for device_open_status fieldSergio Paracuellos
This commit changes type for device_open_status field of ks_wlan_private structure from int to bool. This variable is only be set to 1 on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this purpose it is not necessary at all to use an integer because a bool is enough. This also renames field name from device_open_status to is_device_open. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: assign dev_alloc_name() result to variable before check itSergio Paracuellos
This commit assigns dev_alloc_name() call to 'ret' variable to check it after instead of check directly the call in the if condition. This improves a bit readability. It also add an empty line before the new assignment to separate it from the previous check statement block. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use u8 instead of unsigned char for firmware buffersSergio Paracuellos
This commit replaces type unsigned char which is the one which is being used for firmware buffers with u8 type which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix error paths in ks7010_sdio_remove functionSergio Paracuellos
This commit reviews and fixes error paths in ks7010_sdio_remove driver function. It change logic to handle error directly after priv dereference to avoid one level indentation. It also removes a temporal netdev variable which wasn't being used in all of the function calls. Also if send_stop_request call fails it was making a direct 'return' instead of doing a properly cleaning. Because of this a new 'err_free_card' label has been added. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>