aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/host_interface.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-05-25staging: wilc1000: Avoid overriding rates_no while parsing ies element.Adham Abozaeid1-11/+13
Commit d4b4aaba515a ("staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param()") introduced a bug by not keeping the rates_no value while parsing ies elements. It also increments auth_total_cnt as a pointer instead of its reference. This commit fixes the bug by passing reference to rates_no to host_int_parse_join_bss_param() and by incrementing reference of auth_total_cnt Fixes: d4b4aaba515a (staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param()) Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: wilc1000: fix spelling mistake: "Preamle" -> "Preamble"Colin Ian King1-1/+1
Trivial fix to spelling mistake in netdev_err error message 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-05-14staging: wilc1000: refactor host_int_parse_assoc_resp_info() to remove unused codeAjay Singh1-18/+2
Remove 'connect_resp_info' structure as most of its elements are not used. Modified wilc_parse_assoc_resp_info() to directly parse and fill value in connect_info structure variable. Remove use of 'assoc_resp_len' variable. get_assoc_resp_cap_info() & get_asoc_id() functions are remove as its not used anymore. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: remove s8idxarray to avoid datatype in variable nameAjay Singh1-3/+1
Cleanup patch to have variable names as per linux coding style. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: replace kmalloc with kmemdup() in handle_connect_timeout()Ajay Singh1-4/+5
Instead of kmalloc and memcpy use kmemdup in handle_connect_timeout(). Also return -ENOMEM incase of failure to allocate the memory. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: fix line over 80 chars in host_int_parse_assoc_resp_info()Ajay Singh1-4/+5
Fix line over 80 characters issue in host_int_parse_assoc_resp_info() by using shorter name for the local variable. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param()Ajay Singh1-116/+131
Split host_int_parse_join_bss_param() to avoid the line over 80 character issue reported by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: fix line over 80 chars issue in host_int_handle_disconnect()Ajay Singh1-4/+4
Fix line over 80 char issue in host_int_handle_disconnect() by using temp variable to hold the 'wilc_connect_result' function pointer. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: fix line over 80 characters issue in handle_connect()Ajay Singh1-4/+2
Fix line over 80 character issue found by checkpatch.pl script by aligning the input argument in function call. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: fix line over 80 chars in handle_key()Ajay Singh1-22/+37
Fix checkpatch reported issue of line over 80 char in handle_key(). Introduced new functions by spliting existing function to address the checkpatch issue. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: remove 'ret' variable in handle_key()Ajay Singh1-12/+5
Remove the use of unnecessary 'ret' variable and use existing 'result' variable to hold the status. Also changed type of 'result' from s32 to int to confirm with the function return type. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: wilc1000: added complete() call for error scenario in handle_key()Ajay Singh1-8/+11
During memory allocation failure in handle_key() the complete() was not called for comp_test_key_block event. So now added the code to call complete() for event during error scenario. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: wilc1000: Remove useless functionNathan Chancellor1-12/+0
GCC warns that 'wid' is unused in wilc_remove_key and it's correct; the variable is only local. Get rid of the function (since it just returns zero) and shuffle the remaining code into one if statement. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: wilc1000: Remove unused variablesNathan Chancellor1-12/+0
GCC warns these variables are all set but never used so remove them. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03staging: wilc1000: remove unnecessary header file inclusion for wilcAjay Singh1-14/+0
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-05-03staging: wilc1000: remove unused macros in host_interfaceAjay Singh1-4/+2
Cleanup patch to remove the unused macro mentioned below. Also move macro up along with other macro declaration. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03staging: wilc1000: remove the use of cur_byte variable in functionsAjay Singh1-7/+1
Instead of using the intermediate variable to hold the value, now directly using the allocated variable. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03staging: wilc1000: remove static variable 'del_beacon' and null checkAjay Singh1-4/+1
Using local variable instead of static varible 'del_beacon'. Also removed the unnecessary 'if' check in handle_del_beacon(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-03staging: wilc1000: remove unnecessary 'out of memory' message in handle_key()Ajay Singh1-1/+0
Fix "Possible unnecessary 'out of memory' message" issue reported by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-30Merge 4.17-rc3 into staging-nextGreg Kroah-Hartman1-1/+1
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: wilc1000: remove inner block '{}' in handle_remain_on_chan()Ajay Singh1-11/+8
Cleanup patch to remove unnecessary inner block {\* *\} in handle_remain_on_chan(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: wilc1000: rename P2P_LISTEN_STATE variable to use lowercaseAjay Singh1-4/+4
Rename P2P_LISTEN_STATE variable to avoid using uppercase for variable name to follow linux coding style. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: wilc1000: rename mac status macros and moved related #define togetherAjay Singh1-11/+11
Rename the mac status macro to follow the same naming style. Also move them to keep together. Renamed like below >From ------------------------> To WILC_MAC_STATUS_INIT -> MAC_STATUS_INIT MAC_CONNECTED --------> MAC_STATUS_CONNECTED MAC_DISCONNECTED -----> MAC_STATUS_DISCONNECTED Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: wilc1000: remove unused variable scan_while_connectedAjay Singh1-17/+0
Cleanup patch to remove the unused variable. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: wilc1000: remove the use of goto label in wilc_init()Ajay Singh1-11/+8
Added direct return in wilc_init() instead of goto label. Changes are done to avoid the use of '_' in label name. 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 goto label '_done_' in handle_listen_state_expired()Ajay Singh1-2/+1
Remove the use of goto label '_done_' in handle_listen_state_expired(). Changes are done to avoid the use of '_' in label name. 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 unused macros in wilc moduleAjay Singh1-3/+0
Cleanup patch to remove the macros which are defined by not used. Below mentioned macros are removed: SCAN_DONE SCAN_EVENT_DONE_ABORTED WILC_WFI_RX_INTR WILC_WFI_TX_INTR WILC_WFI_TIMEOUT WILC_WFI_DWELL_PASSIVE WILC_WFI_DWELL_ACTIVE MAX_SURVEY_RESULT_FRAG_SIZE SURVEY_RESULT_LENGTH NUM_BASIC_SWITCHES NUM_FHSS_SWITCHES NUM_11N_BASIC_SWITCHES NUM_11N_HUT_SWITCHES BA_SESSION_DEFAULT_BUFFER_SIZE BA_SESSION_DEFAULT_TIMEOUT BLOCK_ACK_REQ_SIZE 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-23staging: wilc1000: fix NULL pointer exception in host_int_parse_assoc_resp_info()Ajay Singh1-1/+1
Commit fe014d4e6b55 (staging: wilc1000: free memory allocated for general info message from firmware) introduced a bug by using wrong source address in kmemdup(). 'conn_info.req_ies' is used for source address in kempdup() instead of 'hif_drv->usr_conn_req.ies'. This commit fixes the NULL pointer dereference issue in host_int_parse_assoc_resp_info() by using the correct source address in kmemdup(). Fixes: fe014d4e6b55 (staging: wilc1000: free memory allocated for general info message from firmware) Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28staging: wilc1000: fix memdup.cocci warningsFengguang Wu1-6/+4
drivers/staging/wilc1000/host_interface.c:946:32-39: WARNING opportunity for kmemdup drivers/staging/wilc1000/host_interface.c:970:30-37: WARNING opportunity for kmemdup Use kmemdup rather than duplicating its implementation Generated by: scripts/coccinelle/api/memdup.cocci Fixes: aaea2164bdff ("staging: wilc1000: check for kmalloc allocation failures") CC: Colin Ian King <colin.king@canonical.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28staging: wilc1000: free memory allocated for general info message from firmwareAjay Singh1-17/+31
Free allocated memory for failure scenario while processing the information message received from the firmware. Added NULL check and used kmemdup in the flow of handling information message. 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-28staging: wilc1000: split handle_rcvd_gnrl_async_info() to avoid leading tabsAjay Singh1-137/+149
Fix 'Too many leading tabs' issue found by checkpatch.pl script in handle_rcvd_gnrl_async_info(). 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-28staging: wilc1000: free allocated memory in wilc_add_rx_gtk()Ajay Singh1-6/+11
Free memory allocated in wilc_add_rx_gtk() before returing from the function. 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-28staging: wilc1000: fix to free allocated memory in wilc_add_ptk()Ajay Singh1-6/+7
Free allocated memory in wilc_add_ptk() when it fails to enqueue the command. 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-28staging: wilc1000: free allocated memory after processing wilc_send_config_pkt()Ajay Singh1-3/+5
Free allocated memory after completing wilc_send_config_pkt() function. Remove unncessary use of 'stamac' pointer in handle_get_inactive_time(). 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-28staging: wilc1000: free memory allocated in add wep key functionsAjay Singh1-10/+14
Free memory allocated for wep key when command enqueue is failed. 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-28staging: wilc1000: free allocated memory in edit and add station functionsAjay Singh1-2/+6
Added fix to free the allocated memory in case of failure to enqueue the command. 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-28staging: wilc1000: avoid 'NULL' pointer access in wilc_network_info_received()Ajay Singh1-3/+6
Added 'NULL' check before accessing the allocated memory. Free up the memory incase of failure to enqueue the command. Used kmemdup instead of kmalloc & memcpy. 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-28staging: wilc1000: remove unused global variables related to p2pAjay Singh1-59/+0
Cleanup patch to remove the unused global variables defined for p2p. 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-22staging: wilc1000: check for kmalloc allocation failuresColin Ian King1-0/+12
There are three kmalloc allocations that are not null checked which potentially could lead to null pointer dereference issues. Fix this by adding null pointer return checks. Detected by CoverityScan, CID#1466025-27 ("Dereference null return") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14staging: wilc1000: fix line over 80 char issue in handle_scan_done()Ajay Singh1-4/+5
Fix 'line over 80 characters' issue found by checkpatch.pl script in handle_scan_done(). 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-14staging: wilc1000: rename variables using camelCase in handle_rcvd_gnrl_async_info()Ajay Singh1-43/+43
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-03-14staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCaseAjay Singh1-3/+3
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-03-14staging: wilc1000: rename variables prefix using datatype 'u8'Ajay Singh1-68/+67
Rename variables with datatype 'u8' in their name to follow the linux coding style. Renamed following variables: u8abort_running_scan pu8Buffer pu8keybuf pu8msa u8remain_on_chan_flag 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-14staging: wilc1000: fix line over 80 character in handle_disconnect()Ajay Singh1-45/+45
Refactor handle_disconnect() to avoid line over 80 characters issue reported 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-03-14staging: wilc1000: fix line over 80 char in handle_connect()Ajay Singh1-21/+27
Fix 'line over 80 characters' issue reported 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-03-14staging: wilc1000: fix line over 80 char in handle_scan()Ajay Singh1-8/+10
Fix 'line over 80 character' issue reported by checkpatch.pl script in handle_scan(). 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-14staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase nameAjay Singh1-27/+27
Cleanup patch to avoid use of uppercase for label names, to follow 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-14staging: wilc1000: rename strConnectInfo to avoid camelCaseAjay Singh1-28/+28
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-03-14staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issueAjay Singh1-52/+52
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-03-06staging: wilc1000: rename u16DummyReasonCode to avoid camelCaseAjay Singh1-2/+2
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>