summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010
Commit message (Collapse)AuthorAgeFilesLines
...
* staging: ks7010: avoid two long lines in hostif_sme_mode_setupSergio Paracuellos2018-05-061-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-063-5/+6
| | | | | | | | | | | | | | | | 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-061-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-061-116/+109
| | | | | | | | | | | | | | | | | | | 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-061-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: change some casts from uint8_t to u8 in ks_hostif headerSergio Paracuellos2018-05-061-12/+12
| | | | | | | | | This commit changes some type cast in rate related preprocessor definitions included in ks_hostif header file to use preferred u8 type. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: conver MIB attributes preprocessor defs into an enumSergio Paracuellos2018-05-061-45/+85
| | | | | | | | | This commit just change some preprocessor definitions related with MIB attributes into an enumeration which is much cleaner for this here. Also add kerneldoc to avoid long comment lines. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: convert MIB preprocessor defs into an enumSergio Paracuellos2018-05-061-5/+16
| | | | | | | | | This commit just change some preprocessor definitions related with MIB data types into an enumeration which is much cleaner for this here. 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-061-13/+10
| | | | | | | | | 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: remove nonsense comment in ks_wlan.h fileSergio Paracuellos2018-05-061-25/+24
| | | | | | | | | Header file ks_wlan.h has a lot of nonsense comments along the different declarations included on it. Most of them are just the same as the variable name. Just remove them all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change local variable type in ks_wlan_hw_rxSergio Paracuellos2018-05-061-1/+1
| | | | | | | | | Local variable event in ks_wlan_hw_rx function is declared as unsigned short and can be declared as u16 which is preferred style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks7010_sme_enqueue_events functionSergio Paracuellos2018-05-061-18/+13
| | | | | | | | | Event to send to init the card are always the same so change code to be more readable putting them into an array and enqueuing also using a for loop. 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-062-2/+2
| | | | | | | | | 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: change local variable type in ks7010_sdio_init_irqsSergio Paracuellos2018-05-061-1/+1
| | | | | | | | | | Local variable 'byte' in ks7010_sdio_init_irqs is declared as unsigned char and can be declared as u8 which is preferred. It is being used in calls to ks7010_sdio_writeb which is already expected an u8. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change some local variables type in ks_sdio_interruptSergio Paracuellos2018-05-061-1/+1
| | | | | | | | | | Local variables 'status', 'rsize' and 'byte' are declared as unsigned char and can be declared as u8 which is preferred. They are being used in ks7010_sdio_readb calls which is already expected an u8. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change local variable type in ks7010_rw_functionSergio Paracuellos2018-05-061-1/+1
| | | | | | | | | Local variable 'byte' in ks7010_rw_function is declared as unsigned char and can be declared as u8 which is preferred. It is being used in ks7010_sdio_readb which is already expecting an u8. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: change local variable type in _ks_wlan_hw_power_saveSergio Paracuellos2018-05-061-1/+1
| | | | | | | | | Local variable 'byte' in _ks_wlan_hw_power_save function is declared as unsigned char and can be declared as u8 which is preferred. It is being using with ks7010_sdio_readb which expects u8 already. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: use u8 instead of unsigned char in write_to_device functionSergio Paracuellos2018-05-061-3/+2
| | | | | | | | | | | Parameter buffer in write_to_device function is declared as a pointer to unsigned char and can be declared as an u8 type which is preferred. Internally it calls to ks7010_sdio_write which is using also u8 as parameter type. Update calls to this function as well. 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-062-8/+0
| | | | | | | | | 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: change netdev_dbg msg to avoid a long lineSergio Paracuellos2018-05-061-1/+6
| | | | | | | | This commit avoids a long line changing a bit message in _ks_wlan_hw_power_save function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid ks_sdio_card dependency in ks_wlan headerSergio Paracuellos2018-05-063-45/+37
| | | | | | | | | | | | | | | ks_wlan_private struct has a pointer to struct ks_sdio_card in its fields. Because of that a forward declaration in needed in ks_wlan.h header and also it makes necessary to have ks_sdio_card public in a ks7010_sdio.h header. Changing this pointer into a void pointer makes no longer necessary to have ks7010_sdio.h header as well as removes the forward dependency in ks_wlan.h. Declaration of ks_sdio_card has been moved to ks7010_sdio.c source file and To make code cleaner inside this file a new ks7010_to_func function has been added. The code has been updated to this changes. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move tx and rx queues definitions into ks_wlan.h headerSergio Paracuellos2018-05-063-108/+112
| | | | | | | | | | | | There are some definitions for rx and tx queues in ks7010_sdio which is not the best place to put them. Changing them into the ks_wlan header file there is no need to explicity include ks7010_sdio.h which makes no sense at all and can be resolved easily using forward declarations. The functions related with the queues circular buffers have been moved also into this header. 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-069-36/+9
| | | | | | | | | | | | | | | 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>
* staging: ks7010: refactor ks_wlan_translate_scan functionSergio Paracuellos2018-04-261-84/+66
| | | | | | | | | | | | | | | | | | This commit refactors ks_wlan_translate_scan function with the following changes: - reorder local variables - use ether_addr_copy to copy ethernet addresses - change style in 'current_ev' variable assignments - make use of some ternaries avoiding if-else code - use preferred style for comments - extract common code into a new ks_wlan_add_leader_event function After this changes readability has been improved. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid blank line between declarations in ks_wlan_get_aplistSergio Paracuellos2018-04-261-1/+0
| | | | | | | | This commit removes a blank line which is included between declarations and it has not sense at all. 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 ks_wlan_get_aplistSergio Paracuellos2018-04-261-2/+1
| | | | | | | | Use ether_addr_copy to copy ethernet addresses instead of using custom memcpy for that. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid if-else condition in ks_wlan_get_powerSergio Paracuellos2018-04-261-4/+1
| | | | | | | | The if-else code in ks_wlan_get_power function is not needed at all and can be achieved with a simple boolean assignation. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: avoid an 'else' in ks_wlan_set_powerSergio Paracuellos2018-04-261-3/+2
| | | | | | | | Change if logic to handle invalid case for operation_mode at first avoiding an 'else' path. 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 ks_wlan_get_wapSergio Paracuellos2018-04-261-1/+1
| | | | | | | | Use ether_addr_copy to copy ethernet addresses instead of a custom memcpy. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_wap functionSergio Paracuellos2018-04-261-8/+6
| | | | | | | | | Make use of ether_addr_copy instead of memcpy for copying ethernet address data in ks_wlan_set_wap function and avoid an 'else' just changing if logic to check invalid values first. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: align values in frequency_list arraySergio Paracuellos2018-04-261-1/+2
| | | | | | | | To avoid a long line align values in static array frequency_list array. 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 ks_wlan_set_encode_extSergio Paracuellos2018-04-261-1/+1
| | | | | | | | Instead of manually memcpy ethernet addresses use ether_addr_copy function for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_pmksa functionSergio Paracuellos2018-04-261-24/+21
| | | | | | | | | | This commit cleans a bit ks_wlan_set_pmksa function removing nonsense comments as well as make use of ether_addr_* family functions written to not do manually things that were being here. Minor single if brackets has been removed also. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_cts_mode functionSergio Paracuellos2018-04-261-11/+6
| | | | | | | | | This commit refactors ks_wlan_set_cts_mode function to handle invalid values first and then assign the good one changing a bit logic to use a ternary operator. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_preamble functionSergio Paracuellos2018-04-261-6/+2
| | | | | | | | Change if logic to handle invalid values first and just assign at the end the valid one 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: refactor ks_wlan_set_power_mgmt functionSergio Paracuellos2018-04-261-15/+8
| | | | | | | | | This commit change logic to simplify conditional paths in ks_wlan_set_power_mgmt function. It handles invalid's first and just finally assign a valid value. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_scan_type functionSergio Paracuellos2018-04-261-6/+3
| | | | | | | | This commit changes logic to handle invalid values first and just assign valid ones afterwards. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor ks_wlan_set_beacon_lost functionSergio Paracuellos2018-04-261-5/+5
| | | | | | | | Change if condition to handle invalid value first and avoid nonsense else's path improving readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: refactor hostif_sme_set_pmksa functionSergio Paracuellos2018-04-251-8/+6
| | | | | | | | | | 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>
* staging: ks7010: use ether_addr_copy in hostif_sme_multicast_setSergio Paracuellos2018-04-251-1/+1
| | | | | | | | 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>
* staging: ks7010: use ether_addr_equal in hostif_data_requestSergio Paracuellos2018-04-251-1/+1
| | | | | | | | 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>
* staging: ks7010: use ether_addr_equal in hostif_data_indicationSergio Paracuellos2018-04-251-1/+1
| | | | | | | | | 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>
* staging: ks7010: use ether_addr_copy in hostif_mib_get_confirmSergio Paracuellos2018-04-251-9/+2
| | | | | | | | 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>
* staging: ks7010: use ether_addr_copy() instead of custom copySergio Paracuellos2018-04-251-8/+1
| | | | | | | | | 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>
* staging: ks7010: remove duplicated ks_wlan_handler_def declarationSergio Paracuellos2018-04-251-3/+0
| | | | | | | | 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>
* staging: ks7010: remove WPS definition conditional codeSergio Paracuellos2018-04-253-25/+0
| | | | | | | | | 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>
* staging: ks7010: fix line exceding 80 characters in ks_wlan_get_rangeSergio Paracuellos2018-04-251-1/+2
| | | | | | | | 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>
* staging: ks7010: refactor ks_wlan_get_mode functionSergio Paracuellos2018-04-251-11/+2
| | | | | | | | 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>
* staging: ks7010: refactor ks_wlan_set_mode functionSergio Paracuellos2018-04-251-17/+6
| | | | | | | | | | | 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>
* staging: ks7010: remove some duplicated definitions in ks_wlan_net.cSergio Paracuellos2018-04-251-6/+0
| | | | | | | | 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>
OpenPOWER on IntegriCloud