summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2018-04-23staging: ks7010: remove EAPOL_VERSION preprocessor definitionSergio Paracuellos
This commit removes EAPOL_VERSION define from eap_packet.h header file because it is not being used anywhere. 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 values from eap_packet.h headerSergio Paracuellos
This commit removes not used at all enum values from eap_packet.h header file. This values are defined in the kernel ieee80211.h header and the only one that is being used in ks_wlan_net.c source which is WLAN_REASON_MIC_FAILURE is being used from this header. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010_sdio: fix NULL pointer dereference and memory leakGustavo A. R. Silva
priv is being explicitly dereferenced when it is still null, when jumping to goto label err_free_netdev, before it is properly updated with a valid memory address. Also, when this happens, memory allocated for netdev at line 854: netdev = alloc_etherdev(sizeof(*priv)) is not being free'd before return, hence there is a memory leak. The current code looks a bit too complicated and can be replaced by just directly freeing netdev before return. Notice that card->priv = NULL isn't required because the next thing we do to card is kfree(card). Addresses-Coverity-ID: 1467844 ("Explicit null dereferenced") Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Replace mdelay with usleep_range in ks7010_upload_firmwareJia-Ju Bai
ks7010_upload_firmware() is never called in atomic context. The call chain ending up at ks7010_upload_firmware() is: [1] ks7010_upload_firmware() <- ks7010_sdio_probe() ks7010_sdio_probe() is set as ".probe" in struct sdio_driver. This function is not called in atomic context. Despite never getting called from atomic context, ks7010_upload_firmware() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: replace kmalloc() + memcpy() with kmemdup()Ji-Hun Kim
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: fix some style issues about long linesSergio Paracuellos
This commit just fixes some checkpatch reported issues about lines longer than 80 characters. A new blank line has been added also to improve readability. 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>
2018-04-23staging: ks7010: ks7010: factor out firmware copy process into ↵Sergio Paracuellos
ks7010_copy_firmware This commit extracts firmware copy process into a new function ks7010_copy_firmware. Because rom_buf is only needed for this process, memory request for it has been also moved to this new function so the error handling label release_host_and_free has been renamed to release_host into ks7010_upload_firmware original function. 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>
2018-04-23staging: ks7010: fix error handling in ks7010_upload_firmwareSergio Paracuellos
This commit checks missing error code check when checking if the firmware is running reading General Communication Register A (GCR_A). It also set ret to EBUSY if firmware is running before copying it. 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>
2018-04-23staging: ks7010: factor out initial enqueue process into ↵Sergio Paracuellos
ks7010_sme_enqueue_events This commit extract initial enqueue process into a new ks7010_sme_enqueue_events function. 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>
2018-04-23staging: ks7010: factor out ks_wlan_private init process into ↵Sergio Paracuellos
ks7010_private_init This commit extract ks_wlan_private initialization process into a new function ks7010_private_init to improve a bit readability. 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>
2018-04-23staging: ks7010: factor out irq setup process to ks7010_sdio_setup_irqsSergio Paracuellos
This commit extract sdio irq setup process into a new function ks7010_sdio_setup_irqs to improve readability. 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>
2018-04-23staging: ks7010: fix label to jump to in error caseSergio Paracuellos
This commit fixs the label to jump to when in case an error occurs disabling interrupts. At this point of the code sdio_enable_func() function has been successfully called. 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>
2018-04-23staging: ks7010: factor out irq enable process to ks7010_sdio_init_irqsSergio Paracuellos
This commit extracts sdio irq enable process to a new function ks7010_sdio_init_irqs to improve readability. 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>
2018-04-23staging: ks7010: remove unnecessary 'out of memory' messageSergio Paracuellos
This commit removes unnecessay out of memory message fixing the following checkpach.pl warning: WARNING: Possible unnecessary 'out of memory' message 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>
2018-04-23staging: ks7010: Remove unnecessary casts in 'struct ks_wlan_handler_def'.Quytelda Kahja
The casts used when initializing members of this data structure mirror the types the variables already have. Remove the casts. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Change 'device_open_status' to a bool.Quytelda Kahja
The 'device_open_status' member of 'struct ks_wlan_private' is only ever set to zero or one, so it makes more sense for it to be a bool instead of an int. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Rename ks_wlan_set_multicast_list()Quytelda Kahja
All of the net_device_ops callbacks are named after their counterparts in the kernel's 'struct net_device_ops', except ks_wlan_set_multicast_list(). Rename it to ks_wlan_set_rx_mode() for greater consistency. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct michael_mic_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct michael_mic_t' with 'struct michael_mic'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct wps_status_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct wps_status_t' with 'struct wps_status'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct pmk_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct pmk_t' with 'struct pmk'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct pmk_list_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct pmk_list_t' with 'struct pmk_list'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct wpa_status_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct wpa_status_t' with 'struct wpa_status'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct mic_failure_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct mic_failure_t' with 'struct mic_failure'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct wpa_key_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct wpa_key_t' with 'struct wpa_key'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct scan_ext_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct scan_ext_t' with 'struct scan_ext'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct sleep_status_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct sleep_status_t' with 'struct sleep_status'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct power_save_status_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct power_save_status_t' with 'struct power_save_status'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct local_eeprom_sum_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct local_eeprom_sum_t' with 'struct local_eeprom_sum'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct local_gain_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct local_gain_t' with 'struct local_gain'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct local_aplist_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct local_aplist_t' with 'struct local_aplist'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct local_ap_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct local_ap_t' with 'struct local_ap'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct wps_ie_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct wps_ie_t' with 'struct wps_ie'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct rsn_ie_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct rsn_ie_t' with 'struct rsn_ie'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct hostt_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct hostt_t' with 'struct hostt'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove unused 'struct hostif_mic_failure_confirm_t'.Quytelda Kahja
'struct hostif_mic_failure_confirm_t' is not used in this driver. Remove 'struct hostif_mic_failure_confirm_t'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct hostif_mic_failure_request_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct hostif_mic_failure_request_t' with 'struct hostif_mic_failure_request'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove unused 'struct hostif_sleep_confirm_t'.Quytelda Kahja
'struct hostif_sleep_confirm_t' is not used in this driver. Remove 'struct hostif_sleep_confirm_t'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct hostif_sleep_request_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct hostif_sleep_request_t' with 'struct hostif_sleep_request'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove unused 'struct hostif_phy_information_confirm_t'.Quytelda Kahja
'struct hostif_phy_information_confirm_t' is not used in this driver. Remove 'struct hostif_phy_information_confirm_t'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct ↵Quytelda Kahja
hostif_phy_information_request_t'. The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct hostif_phy_information_request_t' with 'struct hostif_phy_information_request'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove unused 'struct hostif_bss_scan_confirm_t'.Quytelda Kahja
'struct hostif_bss_scan_confirm_t' is not used in this driver. Remove 'struct hostif_bss_scan_confirm_t'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove trailing _t from 'struct hostif_bss_scan_request_t'.Quytelda Kahja
The "_t" suffix is not needed for structure names in this driver, and is a reflection of an older typedef system that is no longer in place. Replace all occurences of 'struct hostif_bss_scan_request_t' with 'struct hostif_bss_scan_request'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: ks7010: Remove unused 'struct hostif_associate_indication_t'.Quytelda Kahja
'struct hostif_associate_indication_t' is not used in this driver. Remove 'struct hostif_associate_indication_t'. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>