summaryrefslogtreecommitdiff
path: root/drivers/staging/ks7010
AgeCommit message (Collapse)Author
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>
2018-04-25staging: ks7010: check sdio_set_block_size return valueSergio Paracuellos
This commit checks sdio_set_block_size function return value. If it fails abort driver initialization. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: replace create_workqueue with alloc_workqueueSergio Paracuellos
This commit replaces deprecated create_workqueue call with the alloc_workqueue one which is the one to be used now for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: move MODULE_DEVICE_TABLE related codeSergio Paracuellos
This commit moves MODULE_DEVICE_TABLE related code to the end of the file. This is not necessary at all but moving it just before its use improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx functionSergio Paracuellos
This commit use an and operator in a if condition to avoid one indentation level which is not needed at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review debug and error messages in ks7010_sdio sourceSergio Paracuellos
This commit reviews debug and error messages in code located in ks7010_sdio source file avoiding to use 'error' or 'ks7010' because this file is using netdev_* functions and has non sense to repeat information in log messages. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review comment style in ks7010_sdio source fileSergio Paracuellos
This commit reviews comment style used in ks7010_sdio source file in order to be coherent with the rest of the code. Most comments in this source are before definitions but only two of them have been written at the right. So, be coherent moving this two to the top of definitions. Also fix one multiline comment style to use the normal preferred kernel style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: add REG suffix to sdio register definitionsSergio Paracuellos
This commit adds REG suffix to register definitions related with SDIO in order to improve readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: delete not used definitions in ks7010_sdio sourceSergio Paracuellos
This commit removes two definitions inside ks7010_sdio source file 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: move sdio specific register definitions into source fileSergio Paracuellos
This commit moves SDIO related register definitions from header to source file. There is no need to have those into the header because they are only being used in specific SDIO code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: move ROM_FILE definition into source fileSergio Paracuellos
This commit moves ROM_FILE from header to source file because there is not being used outside this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid casts in michael_mic_function callsSergio Paracuellos
This commit removes casts in calls to michael_mic_function. Most of them are nosense because types match perfectly function parameters. To avoid also int casting for len parameter just pass unsigned len to function which makes sense because is only being called with unsigned int len parameters. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: init local variables when they are declared in ↵Sergio Paracuellos
ks7010_sdio_probe This commit change init point of two variables to forward them to init time. This variables are just being assigned some lines after and it is more clear to init them when the init value is known and in this case this is known when they are declared. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: align comments in ks_wlan_private_handlerSergio Paracuellos
This commit align comment inside ks_wlan_private_handler WEXT private driver operations. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: review includes of michael_mic.c fileSergio Paracuellos
This commit reviews includes of michael_mic.c source file removing those which are not being used at all and reordering the remaining ones in alphabetically order. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: review includes of ks7010_sdio fileSergio Paracuellos
This commit reviews includes of ks7010_sdio.c source file removing those which are not being used at all. Kernel header includes have been ordered alphabetically also. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove enum from ks_wlan.h headerSergio Paracuellos
This commit removes an enum which is in ks_wlan.h and it 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-23staging: ks7010: review includes of ks_wlan.h fileSergio Paracuellos
This commit reviews includes of ks_wlan.h header file. It removes those which are not being used at all. It also reorder remaining ones in alphabetical order. The linux/module.h include file has been moved to the correct file which is ks7010_sdio.c in order to be able to compile the driver without problems. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: review includes of ks_wlan_net.c fileSergio Paracuellos
This commit reviews really needed includes in ks_wlan_net.c source file. It removes those which are not needed at all. It also reorder the remaining ones in alphabetical order. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: refactor ks_wlan_set_wps_enable functionSergio Paracuellos
This commit refactors ks_wlan_set_wps_enable function to improve readability handling the error first to avoid an 'else'. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: refactor ks_wlan_set_tx_gain functionSergio Paracuellos
This commit refactors ks_wlan_set_rx_gain function to improve readability: - error condition is handling the error to avoid an 'else' - ternary operator is used to clean if-else block assignment. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: refactor ks_wlan_set_rx_gain functionSergio Paracuellos
This commit refactors ks_wlan_set_rx_gain function to improve readability: - error condition is handling the error to avoid an 'else' - ternary operator is used to clean if-else block assignment. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: change if-else condition assignment to use ternary operatorSergio Paracuellos
This commit changes an if-else block used to just assign a variable to use a ternary operator to do the same improving readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: refactor ks_wlan_set_encode functionSergio Paracuellos
This commit refactors ks_wlan_set_encode function to improve readability. It just removes level indentation in some paths as well as removes not needed conditions paths which was checked before. Changes are as follows: - (dwrq->length > MAX_KEY_SIZE) check has been moved to the top. - extra check about (dwrq->length > 0) inside an if block where that was the condition to enter inside it has been removed. - (dwrq->flags & IW_ENCODE_NOKEY) check has been turned to avoid one level indentation. - extra check (index >= 0) && (index < 4) has been removed. In the top of the file invalid index values are being checked so it has no sense to check that again. - remove commented line. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove auxiliar zeros buffer in ks_wlan_get_encodeSergio Paracuellos
This commit removes the local buffer zeros in ks_wlan_get_encode function. It also refactors related conditions in order to fill 'extra' output parameter of the function. Originally this zeros is just memset to zeros and only being used if drw->length is truncated to zero because of priv->reg.wep_key[index].size is greater than 16 chars. In those cases the final if statement is just using zeros but it is using memcpy with a length of zero bytes which has no sense. Instead of that just handle the good case copying from the same source the number of bytes of priv->reg.wep_key[index].size. If it is zero the final 'extra' parameter won't be copied at all because the number of bytes to copy will be zero. With this change the code gets simplified. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove not used enum in eap_packet header fileSergio Paracuellos
This commit removes an anonymous enumerator inside eap_packet header file because it is not being used anymore. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove struct ieee802_1x_eapol_keySergio Paracuellos
This commit removes ieee802_1x_eapol_key struct because it is not being used at all. It also removes definitions related to some fields of the removed struct. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: group some cases in switch-case block in hostif_mib_set_confirmSergio Paracuellos
This commit groups some case statements because its behaviour is just do nothing which is the same as the default. Clean 'break' keyword in those which are affected. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: refactor code for hostif_sme_sleep_set functionSergio Paracuellos
This commit refactors code for hostif_sme_sleep_set function. This function was using a switch-case block to handle only two states where the action to do for them is the same. Just refactor a bit to check for return condition at first and doing the common action after in other case. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove nonsense break from case blockSergio Paracuellos
This commit removes 'break' from case block because the code is just using the 'default' break for some cases and this one can be included also there. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: change return value of ks_wlan_do_power_save functionSergio Paracuellos
This commit change return value of ks_wlan_do_power_save function from int to void. This function is just returning zero and return value is not being checked also, so it is nonsense to return an integer. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: use linux circular buffer header macros to handle tx and rx ↵Sergio Paracuellos
queues This commit replace current custom implementation of some circular buffer head and tail logic in favour of the use of macros defined in linux circ_buf.h header. Queue related inline function names have been review also. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: use msecs_to_jiffies in ks7010_rw_function functionSergio Paracuellos
This commit replaces custom time calculations done in ks7010_rw_function with msecs_to_jiffies() function which has the same behaviour. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: change sdio related read/write function parameter typesSergio Paracuellos
This commit reviews and changes SDIO related read and write functions parameter types to use the preferred u* kernel types. Also length parameter which was defined as int has nonsense because calls to this functions are called useing an unsigned instead. Because of this length parameters have been changed also into unsigned int. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: fix remaining long line warnings in ks7010_sdio sourceSergio Paracuellos
This commit fixes remaining checkpatch warnings because of the use of lines longer than 80 characters in ks7010_sdio source file. After this clean, this file has no remaining warnings around. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove nonsense commentSergio Paracuellos
This commit removes a comment which has nonsense because it is obvious what the code does just reading SET_NETDEV_DEV declaration. This also fixes a checkpatch warning because a line longer than 80 characters. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove '\' character from michael_block functionSergio Paracuellos
This commit removes '\' character from michael_block function. It seems these two were not removed properly in the following commit: - staging: ks7010: replace MichaelBlockFunction macro with inline function (c61cc2cc3be358da10121d119356dfe67fe240f2). Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove nosense #if 1 directiveSergio Paracuellos
This commit removes #if 1 directive from code to improve readability. It is always true, so it makes no sense to have it there. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove KS_WLAN_MEM_FLAG definitionSergio Paracuellos
This commit removes KS_WLAN_MEM_FLAG definition which is hiding GFP_ATOMIC along the code. It is better to use directly GFP_ATOMIC in kmalloc's because this it is easier to read. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: rewrite hif_align_size inline functionSergio Paracuellos
This commit rewrites hif_align_size inline function to improve readability. It also change parameters and return type from int to size_t which is the correct and the one which is being used when this function is called from several points of the code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove KS_ATOM preprocessor condtional codeSergio Paracuellos
This commit removes KS_ATOM preprocessor conditional code from hif_align_size because it is not defined anywhere. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: move and rename DEVICE_ALIGNMENT into correct headerSergio Paracuellos
This commit moves DEVICE_ALIGNMENT definition into the header ks_hostif.h which is where it is being used. This is also defined always so just remove nosense undef definitions also and clean some preprocessor conditional directives in hif_align_size function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: indent enum properly in eap_packet.h header fileSergio Paracuellos
This commit indents properly some enumeration values to improve code readability a bit. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: change ETHER_HDR_SIZE definition to use the size of struct ↵Sergio Paracuellos
ether_hdr This commit changes ETHER_HDR_SIZE definition which is a hardcoded number using the size of the structure ether_hdr which is the one for what this definition has been created. This improves readability and makes clear the intention of this definition along the code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: remove two redefined defines in eap_packet.h headerSergio Paracuellos
This commit removes GENERIC_INFO_ELEM and RSN_INFO_ELEM definitions from eap_packet.h header file which are not being used at all. These two are also defined in the ks_wlan_net.c source file as GENERIC_INFO_ELEM_ID and RSN_INFO_ELEM_ID with the same values. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>