summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/core/rtw_cmd.c
AgeCommit message (Collapse)Author
2019-03-24staging: rtl8723bs: Remove function rtw_alloc_network()Nishka Dasgupta
Remove function rtw_alloc_network() as all it does is call _rtw_alloc_network(). Rename _rtw_alloc_network() to rtw_alloc_network(). Change references to _rtw_alloc_network() to refer to rtw_alloc_network(). Issue first noticed while using Coccinelle and ret.cocci. Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21Staging: rtl8723bs: Change return type and type of local variableMadhumitha Prabakaran
rtw_startbss_cmd can return the result of calling rtw_enqueue_cmd, which can return the result of calling _rtw_enqueue_cmd, but they all have different return types (u8, u32, and sint, respectively). As all of these functions return error codes, change all the return types to int, in preparation for converting these functions to use standard kernel error codes. Also, remove extern from the function declaration to maintain Linux kernel coding style. Issue suggested by Coccinelle. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Add missing NULL check for kmallocMadhumitha Prabakaran
Include missing NULL check for kmalloc in function rtw_init_evt_priv. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Replace NULL comparison with !Madhumitha Prabakaran
Replace NULL comparison with ! in function rtw_init_cmd_priv, to maintain Linux kernel coding style. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Change values to standard error codes in functionsMadhumitha Prabakaran
Change values for standard error codes in functions rtw_init_cmd_priv and rtw_init_evt_priv, as _SUCCESS should be 0 and _FAIL should be -ENOMEM. Also, change the values in corresponding call sites of the functions. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19Staging: rtl8723bs: Remove unnecessary local variable in functionMadhumitha Prabakaran
Remove unnecessary local variable 'res' in function and replace the value directly in the return of the function. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove unreachable Code in core/rtw_cmd.cEmanuel Bennici
The `case INTEl_WIDI_WK_CID`-Statement in Function `u8 rtw_drvextra_cmd_hdl` wouldn't be used because of CONFIG_INTEL_WIDI. Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Change type of variables and return typeMadhumitha Prabakaran
Change type of local variables 'res' and return type of functions 'rtw_init_cmd_pri' and 'rtw_init_evt_priv', as function's return types are defined for standard error codes _SUCCESS and _FAIL. Also, change return type of functions declarations corresponding to change made in function definitions. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: rtl8723bs: Remove wrapper functions and change function namesMadhumitha Prabakaran
Drop wrappers rtw_init_cmd_priv and rtw_init_evt_priv and remove their function declarations, as their only purpose is to call other functions. Change function names from _rtw_init_cmd_priv to rtw_init_cmd_priv, and _rtw_init_evt_priv to rtw_init_evt_priv in function definitions and function declarations. Also, remove externs in function declarations rtw_init_cmd_priv and rtw_init_evt_priv, to maintain Linux kernel coding style. Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-07Staging: rtl8723bs: remove some dead codeDan Carpenter
"psecnetwork" is the address of &psecuritypriv->sec_bss. Since ->sec_bss isn't the first member of the struct that means that "psecnetwork" can't be NULL. We can just remove this dead code. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17Staging: rtl8723bs: Fix code style issue in rtl8723bs driverHardik Singh Rathore
Add space between 'else' and '{' to solve code style issue in all the files for rtl8723bs driver. Signed-off-by: Hardik Singh Rathore <hardiksingh.k@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: change pwrctrl lock to a mutexArnd Bergmann
This semaphore is used like a mutex, so it should use the regular mutex API, as we do in the other copies of this driver. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: rtl8723bs: change semaphores to completionsArnd Bergmann
This driver uses many semaphores, most of them are equivalent to completions. The other copies of this driver got moved over to completions a while ago, so do the same here. In this usage scenario, the two are equivalent, so the behavior should not change. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-11staging: rtl8723bs: Replace license boilerplate with SPDX identifiersNathan Chancellor
This satisfies a checkpatch.pl warning and is the preferred method for notating the license due to its lack of ambiguity. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14staging: rtl8723bs: core: rtw_cmd: remove unnecessary initializationJi-Hun Kim
Clean up checkpatch error: ERROR: do not initialise globals to 0 Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21Staging: rtl8723bs: Do not check for NOT NULL before kfree()Shreeya Patel
Do not check for NOT NULL before calling kfree because if the pointer is NULL, no action occurs. Done using the following semantic patch by coccinelle. @@ expression ptr; @@ - if (ptr != NULL) kfree(ptr); Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18Staging: rtl8723bs: core: rtw_cmd: Remove cast to pointer types in kfreeSrishti Sharma
The cast to pointer types in kfree is not needed and can be dropped. This was done using the following semantic patch by coccinelle, except kfree((unsigned char*) pcmd->parmbuf) which was transformed by hand because coccinelle didn't have enough type information. @r@ type T,P; T* x; @@ kfree( -(P *) x ) Signed-off-by: Srishti Sharma <srishtishar@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-17staging: rtl8723bs: Remove unnecessary rtw_z?malloc castsJoe Perches
These functions now return void * and no longer need casts. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-29staging: rtl8723bs: core: remove cast to void pointerHimanshu Jha
casting to void pointer from any pointer type and vice-versa is done implicitly and therefore casting is not needed in such a case. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: rtl8723bs: rework debug configuration handlingArnd Bergmann
I ran into this warning during randconfig testing: drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable] drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace': drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable] The problem is that the code procfs code gets built even when CONFIG_PROC_FS is disabled, but some functions are turned into empty stubs then. This is easily addressed by adding an #ifdef around the definition of the CONFIG_PROC_DEBUG macro. However, I could not bear looking at the macro name that clashes with the Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same way. This is consistent with how we handle the same checks in the non-staging rtlwifi driver. As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it turned out to be incorrect and requires adding 'static inline' annotations for the stub handlers, and moving some variables around. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-09staging: rtl8723bs: core: rtw_cmd: drop unneeded null testsJulia Lawall
kfree returns immediately on NULL so the tests are not needed. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: Add rtl8723bs sdio wifi driverHans de Goede
The rtl8723bs is found on quite a few systems used by Linux users, such as on Atom systems (Intel Computestick and various other Atom based devices) and on many (budget) ARM boards such as the CHIP. The plan moving forward with this is for the new clean, written from scratch, rtl8xxxu driver to eventually gain support for sdio devices. But there is no clear timeline for that, so lets add this driver included in staging for now. Cc: Bastien Nocera <hadess@hadess.net> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Jes Sorensen <jes.sorensen@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>