summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_hostif.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: ks7010: removed custom Michael MIC implementation.Jeremy Sowden2019-02-281-19/+92
| | | | | | | Changed the driver to use the kernel's own implementation. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: Match alignments with open parenthesisBhanusree Pola2019-02-261-1/+1
| | | | | | | | | Adjust parameters of "netdev_dbg" to match alignment with open parenthesis. Issue found using checkpatch.pl Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unnecessary parenthesesMatt McCoy2019-01-251-3/+3
| | | | | | | Remove unnecessary parentheses reported by checkpatch. Signed-off-by: Matt McCoy <mattmccoy110@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: Remove extra blank lineMaya Nakamura2018-10-191-1/+0Star
| | | | | | | | | Remove extra blank line. Issue found by checkpatch.pl. Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: Vaishali Thakkar <vthakkar@vaishalithakkar.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: Remove unnecessary null checkAymen Qader2018-10-031-2/+2
| | | | | | | | | | Remove the unnecessary socket buffer null check in hostif_data_request. There is already an appropriate null check in the calling function: (ks_wlan_net.c) ks_wlan_start_xmit Signed-off-by: Aymen Qader <qader.aymen@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge 4.18-rc7 into staging-nextGreg Kroah-Hartman2018-07-301-6/+6
|\ | | | | | | | | | | We want the staging changes in here for testing and merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: ks7010: call 'hostif_mib_set_request_int' instead of ↵Sergio Paracuellos2018-07-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'hostif_mib_set_request_bool' 'hostif_mib_set_request_bool' function receives a bool as value and send the received value with MIB_VALUE_TYPE_BOOL type. There is one case where the value passed is not a boolean one but 'MCAST_FILTER_PROMISC' which is '2'. Call hostif_mib_set_request_int instead for related multicast enumeration. This changes original code behaviour but seems to be the right way to do this. Fixes: 8ce76bff0e6a ("staging: ks7010: add new helpers to achieve mib set request and simplify code") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: ks7010: remove redundant variable eth_protoColin Ian King2018-07-111-2/+0Star
|/ | | | | | | | | | | Variable eth_proto is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'eth_proto' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid casting inside cpu_to_* assignmentsSergio Paracuellos2018-05-201-30/+29Star
| | | | | | | | | cpu_to_*() functions already have a cast to u* built in, so the cast is never required. Review and remove all of them along the code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace cast type in assignment in hostif_sme_set_pmksaSergio Paracuellos2018-05-141-1/+1
| | | | | | | | | There is an assignment inside hostif_sme_set_pmksa function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use 'u16' for casts in assignments in hostif_sme_set_rsnSergio Paracuellos2018-05-141-3/+3
| | | | | | | | | There are some assignments inside hostif_sme_set_rsn function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change two parameter types in hostif_mic_failure_requestSergio Paracuellos2018-05-141-4/+3Star
| | | | | | | | | | Parameters 'failure_count' and 'timer' was declared as unsigned short and then there was being casted to u16 inside cpu_to_le16 to make the assignation. Just declare them as 'u16' and avoid casting at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace uint* type into the u* ones in hostif_bss_scan_requestSergio Paracuellos2018-05-141-4/+4
| | | | | | | | | | In function hostif_bss_scan_request parameters 'scan_ssid' and 'scan_ssid_len' are declared as uint8_t. Change them to be 'u8' instead which is preferred. Also update two casts inside the same function to use 'u32' instead of 'uint32_t'. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace cast types in assignments in ↵Sergio Paracuellos2018-05-141-4/+4
| | | | | | | | | | | hostif_phy_information_request There are some assignments inside hostif_phy_information_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace cast type in assignment in hostif_adhoc_set_requestSergio Paracuellos2018-05-141-1/+1
| | | | | | | | | There is an assignment inside hostif_adhoc_set_request function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace cast type in assignments in ↵Sergio Paracuellos2018-05-141-2/+2
| | | | | | | | | | | hostif_infrastructure_set_request There are some assignments inside hostif_infrastructure_set_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 as type for casting in hostif_ps_adhoc_set_requestSergio Paracuellos2018-05-141-1/+1
| | | | | | | | | There is an assignment inside hostif_ps_adhoc_set_request function which is being used together with cpu_to_le16 using uint16_t as cast type. Replace it to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: replace casts to use type u16 in init_requestSergio Paracuellos2018-05-141-3/+3
| | | | | | | | | There are soem assignments inside init_request function which are being used together with cpu_to_le16 using uint16_t as cast type. Replace all of them to use 'u16' instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 as cast type in hostif_start_requestSergio Paracuellos2018-05-141-1/+1
| | | | | | | | Use u16 as cast type in hostif_start_request function replacing uint16_t which was being used. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid no needed cast in ks_wlan_capSergio Paracuellos2018-05-141-1/+1
| | | | | | | | | In ks_wlan_cap there is a cast to uint16_t to use cpu_to_le16 with variable 'capability' which is already defined as u16. Avoid this cast to clean code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change parameter type in hostif_mib_get_requestSergio Paracuellos2018-05-141-4/+3Star
| | | | | | | | | Second parameter 'mib_attribute' in function hostif_mib_get_request is declared as unsigned long and inside the function a cast to uint32_t is being used. Just pass a u32 instead and avoid the casting. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change some cast type from uint16_t to u16 in ↵Sergio Paracuellos2018-05-141-7/+7
| | | | | | | | | | | | hostif_data_request There are some castings inside the function hostif_data_request which are being using with uint16_t type. Fields which have being assigned are declared as u16. So update casts types to u16 in all of them. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 as type for casting in hostif_data_indication_wpaSergio Paracuellos2018-05-141-1/+1
| | | | | | | | | Field 'counter' in mic_failure struct is being assigned casting value using uint16_t. Replace with u16 which is the correct type of the field and the preferred one. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: review local variable types in hostif_phy_information_confirmSergio Paracuellos2018-05-071-4/+4
| | | | | | | | | | This commit changes types for local variables declared in hostif_phy_information_confirm function to use the preferred one 'u8' and 'u32'. Its values are get using get_byte and get_dword functions which returns 'u8' and 'u32' so it makes sense. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u32 instead of unsigned int in hostif_bss_scan_confirmSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | | Local variable 'result_code' is declared as unsigned int in hostif_bss_scan_confirm function. Its value is got calling get_dword which returns an 'u32' so change its type to u32 which is preferred Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 instead of unsigned short in hostif_connect_indicationSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | | Local variable 'connect_code' is declared as unsigned short in hostif_connect_indication function. Its value is got calling get_word which returns an 'u16' so change its type to u16 which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 instead of unsigned short in hostif_data_indicationSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | Local variable 'auth_type' is declared as unsigned short in hostif_data_indication function. Its value is got calling get_word which returns an 'u16' so change its type to u16 which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u16 instead of unsigned short in hostif_event_checkSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | Local variable 'event' is declared as unsigned short in hostif_event_check function. Its value is got calling get_word which returns an 'u16' so change its type to u16 which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor LOCAL_EEPROM_SUM case in hostif_mib_get_confirmSergio Paracuellos2018-05-071-10/+7Star
| | | | | | | | | | This commit simplify conditional paths in LOCAL_EEPROM_SUM case inside hostif_mib_get_confirm function. It change logic to handle invalid values first and assign good ones at the end if it is the case. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use CIRC_CNT_TO_END macro in cnt_smeqbodySergio Paracuellos2018-05-071-3/+3
| | | | | | | | This commit changes custom implementation of CIRC_CNT_TO_END. Just use the linux kernel header one to simplify code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor hostif_sme_power_mgmt_set functionSergio Paracuellos2018-05-071-23/+10Star
| | | | | | | | | This commit refactor hostif_sme_power_mgmt_set avoiding to use switch-case statement and simplifying data paths. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change parameter types in hostif_power_mgmt_requestSergio Paracuellos2018-05-071-6/+5Star
| | | | | | | | | | | Parameters for hostif_power_mgmt_request are declared as unsigned long and then are forced to be change to be u32. Also the caller declares explicitly unsigned long parameters just to assign them and pass into the function. Change types for those to be u32 instead so no conversion is needed at all and code gets more clear. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor hostif_sme_set_rsn functionSergio Paracuellos2018-05-071-101/+44Star
| | | | | | | | | | | This commit make use of two introduced local variables to make more readable code of hostif_sme_set_rsn function. It just assign those local variables in different cases where are needed and extract common code to assign them at the end. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add blank line between after definitionsSergio Paracuellos2018-05-071-0/+1
| | | | | | | | Add blank line after definitions in hostif_aplist_init function to fix a checkpatch script complain about that. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix some style issues in ks_hostif.cSergio Paracuellos2018-05-071-20/+26
| | | | | | | | | Fix some checkpatch complains about long lines in some parts of the code. It also fix some lines where spaces instead of tabs were inserted. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: factor out send_request_to_device functionSergio Paracuellos2018-05-071-40/+20Star
| | | | | | | | | | | In all functions related with requests to the device the same patter in used and is also adding a comment to make clear the intention of the code. Just factor out the pattern into a new send_request_to_device function to improve readability and make clear code intention. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move WLAN_EID_DS_PARAMS to different place inside switchSergio Paracuellos2018-05-071-3/+1Star
| | | | | | | | | | WLAN_EID_DS_PARAMS case inside switch case is just doing nothing and it is located inside other cases. There is a place inside the switch with other don't do anything cases are located. Move this to that place. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use ether_addr_copy in get_ap_information functionSergio Paracuellos2018-05-071-1/+1
| | | | | | | | This commit make use of ether_addr_copy to copy ethernet address instead of copy it using memcpy. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use ether_addr_copy to copy ethernet address sa_dataSergio Paracuellos2018-05-071-2/+1Star
| | | | | | | | Use ether_addr_copy kernel function to copy an ethernet address instead of a simple memcpy with ETH_ALEN size. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change type for rsn_enabled in wpa_status structSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | | Field rsn_enabled included in wpa_status struct is declared as unsigned int but it is only be set using 0 and 1 values and in conditional if code is just being used as a boolean. Change its type to be a boolean. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove non sense comments in ks_hostif.c source fileSergio Paracuellos2018-05-071-8/+8
| | | | | | | | Comments which say the same as the code are not useful at all so just remove them. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid two long lines in hostif_sme_mode_setupSergio Paracuellos2018-05-071-2/+4
| | | | | | | | This commit avoid two checkpatch script complains about two long lines. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move two preprocessor definitions to ks_wlan.hSergio Paracuellos2018-05-071-2/+2
| | | | | | | | | | | | | | | | In ks_wlan_translate_scan function there are two preprocessor definitions: - RSN_INFO_ELEM_ID - GENERIC_INFO_ELEM_ID These can be moved to common ks_wlan.h because they can be used in get_current_ap function instead of use hardcoded values. GENERIC_INFO_ELEM_ID has been renamed to WPA_INFO_ELEM_ID which is more clear. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use ether_addr_copy in get_current_apSergio Paracuellos2018-05-071-1/+1
| | | | | | | | Instead of use memcpy to copy ethernet addresses use ether_addr_copy created for that. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add new helpers to achieve mib set request and simplify codeSergio Paracuellos2018-05-071-116/+109Star
| | | | | | | | | | | | | | | | | | | New three functions have been created to centralice and simplify calls related with set MIB requests: - hostif_mib_set_request_int - hostif_mib_set_request_bool - hostif_mib_set_request_ostring Using these in different calls simplify functions related with this mainly when types are bool and int because no more conversions are needed in the caller functions. Those conversion details are now located in the new helpers improving a lot readability. Calls in hostif_sme_set_wep function has change also some if's to check invalid value first avoiding one level indentation. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change parameter types and reorder them in ↵Sergio Paracuellos2018-05-071-70/+74
| | | | | | | | | | | | | hostif_mib_set_request This commit changes parameter types to use enum mib_attribute, enum mib_data_type and size_t for size instead of unsigned short. It also reorder them in a more sense way. Code is updated in different calls to use new parameters order using 'size' auxiliar local variables in some of them to improve readability a bit. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: clean SME_MIC_FAILURE_REQUEST case in hostif_sme_executeSergio Paracuellos2018-05-071-13/+10Star
| | | | | | | | | This commit cleans code for the event SME_MIC_FAILURE_REQUEST changing if logic to handle invalid value first and using a local variable. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use the same parameter for 'event' in hostif_sme_enqueueSergio Paracuellos2018-05-071-1/+1
| | | | | | | | | Declaration of second parameter 'event' in ks_hostif .h and .c file is different using uint16_t and unsigned short respectively. Just unify both using 'u16' which is preferred instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove missing WPS preprocessor conditional codeSergio Paracuellos2018-05-071-6/+0Star
| | | | | | | | | Commit 92c1552caef3661f049c4e967550e933599e2663 removes WPS hardcoded definition and its related conditional preprocessor code. There was some missing stuff already in this files. Remove it. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add SPDX identifiers to all filesSergio Paracuellos2018-05-071-4/+1Star
| | | | | | | | | | | | | | | It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the all of the staging ks7010 files to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Extra GPL text wording can be removed as it is no longer needed at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>