summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtlwifi
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'kconfig-v4.16' of ↵Linus Torvalds2018-02-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig updates from Masahiro Yamada: "A pretty big batch of Kconfig updates. I have to mention the lexer and parser of Kconfig are now built from real .l and .y sources. So, flex and bison are the requirement for building the kernel. Both of them (unlike gperf) have been stable for a long time. This change has been tested several weeks in linux-next, and I did not receive any problem report about this. Summary: - add checks for mistakes, like the choice default is not in choice, help is doubled - document data structure and complex code - fix various memory leaks - change Makefile to build lexer and parser instead of using pre-generated C files - drop 'boolean' keyword, which is equivalent to 'bool' - use default 'yy' prefix and remove unneeded Make variables - fix gettext() check for xconfig - announce that oldnoconfig will be finally removed - make 'Selected by:' and 'Implied by' readable in help and search result - hide silentoldconfig from 'make help' to stop confusing people - fix misc things and cleanups" * tag 'kconfig-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (37 commits) kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help kconfig: make "Selected by:" and "Implied by:" readable kconfig: announce removal of oldnoconfig if used kconfig: fix make xconfig when gettext is missing kconfig: Clarify menu and 'if' dependency propagation kconfig: Document 'if' flattening logic kconfig: Clarify choice dependency propagation kconfig: Document SYMBOL_OPTIONAL logic kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX kconfig: use default 'yy' prefix for lexer and parser kconfig: make conf_unsaved a local variable of conf_read() kconfig: make xfgets() really static kconfig: make input_mode static kconfig: Warn if there is more than one help text kconfig: drop 'boolean' keyword kconfig: use bool instead of boolean for type definition attributes, again kconfig: Remove menu_end_entry() kconfig: Document important expression functions kconfig: Document automatic submenu creation code kconfig: Fix choice symbol expression leak ...
| * kconfig: use bool instead of boolean for type definition attributes, againMasahiro Yamada2018-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6341e62b212a ("kconfig: use bool instead of boolean for type definition attributes") did treewide replacement of 'boolean', and also mentioned the keyword 'boolean' would be dropped later on. Some years have passed, but it has not happened yet. Meanwhile, some new instances have come up. I am really going to drop this keyword. I need to do the replacement once again. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: remove redundant initialization of 'cfg_cmd'Colin Ian King2018-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The initialization of cfg_cmd is redundant as the value is never read and it is being re-assigned to cfg_cmd = pwrcfgcmd[ary_idx] inside a loop, hence it can be removed. Cleans up clang warning: drivers/staging/rtlwifi/core.c:1819:22: warning: Value stored to 'cfg_cmd' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: remove unused RTLHALMAC_ST and RTLPHYDM_STCorentin Labbe2018-01-251-10/+0
| | | | | | | | | | | | | | | | | | Since nothing builds/depends on RTLHALMAC_ST and RTLPHYDM_ST, we could remove them. Furthermore, they are totally undocumented Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: rtlwifi: Remove unused variable and the codeShreeya Patel2018-01-081-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused variable and also remove unused code associated with initializing the unused variable. Unused variable was detected using the following semantic patch by coccinelle. @@ type T; identifier i; constant C; @@ ( extern T i; | - T i; <+... when != i - i = C; ...+> ) Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
* | staging: rtl8822be: fix missing null check on dev_alloc_skb returnColin Ian King2017-11-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | dev_alloc_skb can potentially return NULL, so add a null check to avoid a null pointer dereference on skb Detected by CoverityScan, CID#1454558 ("Dereference on null return") Fixes: 7e5b796cde7e ("staging: r8822be: Add the driver code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: rtlwifi: use ktime_get_real_seconds() for suspend timeArnd Bergmann2017-11-272-7/+3
| | | | | | | | | | | | | | | | | | | | do_gettimeofday() is deprecated and slower than necessary for the purpose of reading the seconds. This changes rtl_op_suspend/resume to use ktime_get_real_seconds() instead, which is simpler and avoids confusion about whether it is y2038-safe or not. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: remove redundant assignments to ul_enc_algoColin Ian King2017-11-271-2/+2
|/ | | | | | | | | | | | Variable ul_enc_algo is being initialized with a value that is never read, it is being set again in the following switch statements in all of the case and default paths. Hence the unitialization is redundant and can be removed. Cleans up two clang warnings: Value stored to 'ul_enc_algo' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8822be: fix wrong dma unmap lenStanislaw Gruszka2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch fixes splat: r8822be 0000:04:00.0: DMA-API: device driver frees DMA memory with different size [device address=0x0000000078477000] [map size=4096 bytes] [unmap size=424 bytes] <snip> Call Trace: debug_dma_unmap_page+0xa5/0xb0 ? unmap_single+0x2f/0x40 _rtl8822be_send_bcn_or_cmd_packet+0x2c5/0x300 [r8822be] ? _rtl8822be_send_bcn_or_cmd_packet+0x2c5/0x300 [r8822be] rtl8822b_halmac_cb_write_data_rsvd_page+0x51/0xc0 [r8822be] _halmac_write_data_rsvd_page+0x22/0x30 [r8822be] halmac_download_rsvd_page_88xx+0xee/0x1f0 [r8822be] halmac_dlfw_to_mem_88xx+0x80/0x120 [r8822be] halmac_download_firmware_88xx.part.47+0x477/0x600 [r8822be] halmac_download_firmware_88xx+0x32/0x40 [r8822be] rtl_halmac_dlfw+0x70/0x120 [r8822be] rtl_halmac_init_hal+0x5f/0x1b0 [r8822be] rtl8822be_hw_init+0x8a2/0x1040 [r8822be] Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: Remove unused variableKees Cook2017-11-031-1/+0
| | | | | | | | This removes an unused variable to silence the associated build warning. Fixes: f8af6a323368 ("staging: rtlwifi: Convert timers to use timer_setup()") Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtlwifi: pci: fixed a coding style issueWoohyung Jeon2017-11-031-1/+1
| | | | | | | | | Fixed a coding style issue. There was a prohibited space. Removed. Signed-off-by: Woohyung-Jeon <w.h.jeon329@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: mark expected switch fall-throughsGustavo A. R. Silva2017-10-181-0/+2
| | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: phydm: Remove useless parenthesesFrank A. Cancio Bello2017-10-185-22/+22
| | | | | | | | | | | Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's message: 'CHECK: Unnecessary parentheses around'. Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: Remove unnecessary parenthesesFrank A. Cancio Bello2017-10-184-35/+35
| | | | | | | | | | | | Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's message: 'CHECK: Unnecessary parentheses around'. Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* rtlwifi: Fix typo in if ... else if ... else constructLarry Finger2017-10-181-2/+2
| | | | | | | | | | | | | | | The kbuild test robot reports two conditions with no effect (if == else). These are the result of copy and paste typographical errors. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Cc: kbuild-all@01.org Cc: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: halmac: mark expected switch fall-throughGustavo A. R. Silva2017-10-181-1/+1
| | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: mark expected switch fall-through in rtl_make_smps_actionGustavo A. R. Silva2017-10-181-3/+1
| | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: Convert timers to use timer_setup()Kees Cook2017-10-186-48/+15
| | | | | | | | | | | | | | | In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Also drops unused odm timer code. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: shaofu <shaofu@realtek.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: rtl8822be: Align the * in block commentFrank A. Cancio Bello2017-10-181-3/+3
| | | | | | | | | | | Align the * on each line of a block comment to comply with kernel coding style and address the following checkpatch message: 'WARNING: Block comments should align the * on each line'. Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: rtl8822be: Remove useless parenthesesFrank A. Cancio Bello2017-10-184-17/+17
| | | | | | | | | | | Remove unnecessary parentheses to comply with preferred coding style for the linux kernel and avoid the following checkpatch's message: 'CHECK: Unnecessary parentheses around'. Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: rtl8822be: Use __func__ instead of hardcoded nameFrank A. Cancio Bello2017-10-181-3/+3
| | | | | | | | | | | | | Switch hardcoded function name with a reference to __func__ making the code more maintenable and addressing the checkpatch warning: WARNING: Prefer using '"%s...", __func__' to using 'rtl8822be_sc_mapping', this function's name, in a string + "rtl8822be_sc_mapping: Not Correct Primary40MHz Setting\n"); Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: rtl8822be: Balance braces in else statementFrank A. Cancio Bello2017-10-182-2/+4
| | | | | | | | | | | Add braces to else statements to comply with section 3) of 'Linux kernel coding style' and avoid the following checkpatch message: 'CHECK: Unbalanced braces around else statement' Credits to checkpatch. Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8822be: Keep array subscript no lower than zeroLarry Finger2017-10-181-0/+2
| | | | | | | | | | | | | | | The kbuild test robot reports the following: drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 'odm_pause_dig': drivers/staging//rtlwifi/phydm/phydm_dig.c:494:45: warning: array subscript is below array bounds [-Warray-bounds] odm_write_dig(dm, dig_tab->pause_dig_value[max_level]); This condition is caused when a loop falls through. The fix is to pin max_level to be >= 0. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> c: kbuild test robot <fengguang.wu@intel.com> Fixes: 9ce99b04b5b82fdf11e4c76b60a5f82c1e541297 staging: r8822be: Add phydm mini driver Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge 4.14-rc4 into staging-nextGreg Kroah-Hartman2017-10-092-8/+9
|\ | | | | | | | | | | We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8822be: fix null pointer dereferences with a null driver_adapterColin Ian King2017-09-182-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null pointer deference on a null driver_adapter. Fix this by assigning driver_adapter earlier to halmac_adapter->driver_adapter before the tracing call so that a non-null driver_adapter is passed instead. I should have spotted these with an earlier patch I sent, but I overlooked these in the rather large CoverityScan logs. Detected by CoverityScan, CID#1454550, CID#1454554, CID#1454565, CID#1454591, CID#1454598 ("Explicit null dereferenced") Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: pr_err() strings should end with newlinesArvind Yadav2017-10-032-5/+5
| | | | | | | | | | | | | | | | pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: make various structures staticColin Ian King2017-10-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | The structures created from macros RTL_DEBUG_IMPL_MAC_SERIES, RTL_DEBUG_IMPL_BB_SERIES, RTL_DEBUG_IMPL_RF_SERIES and RTL_DEBUG_IMPL_CAM_SERIES are all local to the source and do not need to be in global scope, so make them static. Cleans up 37 sparse warnings of the form: symbol 'rtl_debug_priv_mac_0' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: silence underflow warningDan Carpenter2017-10-031-1/+2
| | | | | | | | | | | | | | | | | | I'm not totally certain that it's necessary to put an upper limit here. I think it happens at lower levels. But if we are going to do that then we should have a lower bound as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: use ARRAY_SIZEJérémy Lefaure2017-10-034-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the ARRAY_SIZE macro improves the readability of the code. Also, it is useless to use a variable to store this constant calculated at compile time. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: rtlwifi: halmac: Remove unnecessary 'out of memory' messagesGeorgiana Chelu2017-09-221-33/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary messages because OOM (Out Of Memory Manager) reports memory allocation fail messages. The return value is clear regarding the problem, so there is no need for the 'out of memory' comments. Also, delete braces {} for single if statement blocks to improve the coding style. Fix issues found by by checkpatch.pl. WARNING: Possible unnecessary 'out of memory' message. WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Georgiana Chelu <georgiana.chelu93@example.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Staging: rtlwifi: Remove unnecessary 'out of memory' message.Shreeya Patel2017-09-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging messages that show some type of "out of memory" error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem. These messages generally increase kernel size without much added value. Problem found by checkpatch. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: remove unused functionsTobin C. Harding2017-09-172-41/+0
| | | | | | | | | | | | | | | | | | | | | | Functions rtl_rfreg_delay() and rtl_bb_delay() are unused within the driver. Both functions call rtl_addr_delay(), this function is unused outside of these call sites.The driver (and kernel) code base is cleaner if unused functions are removed. Remove unused functions. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: use kcalloc instead of multiplyTobin C. Harding2017-09-171-3/+2
| | | | | | | | | | | | | | | | | | | | checkpatch emits multiple warnings of type WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply Replace two calls to kzalloc() with calls to kcalloc(). Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | staging: rtlwifi: fix parenthesis alignmentTobin C. Harding2017-09-171-3/+3
|/ | | | | | | | | | Checkpatch emits multiple warnings of type CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis Fix parenthesis alignment in line with checkpatch suggestion. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: Simplify deinit_priv()Larry Finger2017-08-311-7/+1
| | | | | | | | | | | | | | | Now that the extraneous debugging code is removed, routine deinit_priv() clearly contains code that serves no useful purpose. A null test before a call to kfree() and a spurious cast are also removed. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: Remove some dead codeLarry Finger2017-08-311-20/+0
| | | | | | | | | | | | | | | The code found inside an #ifdef CONFIG_RTL_DEBUG ... #endif section is left over from debugging of the original driver, and should be deleted. Reported by: Andreas Ziegler <andreas.ziegler@fau.de> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: remove memset before memcpyHimanshu Jha2017-08-291-1/+0
| | | | | | | | calling memcpy immediately after memset with the same region of memory makes memset redundant. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: remove some dead codeDan Carpenter2017-08-281-7/+0
| | | | | | | | | "hdr" can't be NULL. We take skb->data which is non-NULL and add an offset to get "hdr". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: fix null pointer dereference with a null driver_adapterColin Ian King2017-08-281-2/+1
| | | | | | | | | | | | | | The call to _rtl_dbg_trace via macro HALMAC_RT_TRACE will trigger a null pointer deference on the null driver_adapter. Fix this by assigning driver_adapter earlier to halmac_adapter->driver_adapter before the tracing call so that a non-null driver_adapter is passed instead. Detected by CoverityScan, CID#1454613 ("Explicit null dereferenced") Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: fix memory leak of eeprom_map on error exit returnColin Ian King2017-08-281-1/+3
| | | | | | | | | | | A memory leak of eeprom_map occurs if the call to halmac_eeprom_parser_88xx fails. Fix this by kfree'ing it before returning. Detected by CoverityScan, CID#1454569 ("Resource leak") Fixes: 938a0447f094 ("staging: r8822be: Add code for halmac sub-driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: Improve debugging by using debugfsLarry Finger2017-08-281-91/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes in this commit are also being sent to the main rtlwifi drivers in wireless-next; however, these changes will also be useful for any debugging of r8822be before it gets moved into the main tree. Use debugfs to dump register and btcoex status, and also write registers and h2c. We create topdir in /sys/kernel/debug/rtlwifi/, and use the MAC address as subdirectory with several entries to dump mac_reg, bb_reg, rf_reg etc. An example is /sys/kernel/debug/rtlwifi/00-11-22-33-44-55-66/mac_0 This change permits examination of device registers in a dynamic manner, a feature not available with the current debug mechanism. We use seq_file to replace RT_TRACE to dump status, then we can use 'cat' to access btcoex's status through debugfs. (i.e. /sys/kernel/debug/rtlwifi/00-11-22-33-44-55-66/btcoex) Other related changes are 1. implement btc_disp_dbg_msg() to access btcoex's common status. 2. remove obsolete field bt_exist Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: check for array overflowDan Carpenter2017-08-281-0/+4
| | | | | | | | | | | Smatch is distrustful of the "capab" value and marks it as user controlled. I think it actually comes from the firmware? Anyway, I looked at other drivers and they added a bounds check and it seems like a harmless thing to have so I have added it here as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: remove unnecessary call to memsetHimanshu Jha2017-08-272-7/+0
| | | | | | | | | | | call to memset to assign 0 value immediately after allocating memory with kzalloc is unnecesaary as kzalloc allocates the memory filled with 0 value. Build and tested it. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: add MAC80211 dependencyArnd Bergmann2017-08-231-1/+1
| | | | | | | | | | | | | | | | Like the version in drivers/net/wireless, this driver requires the MAC80211 framework, otherwise we run into a link error: ERROR: "ieee80211_rx_irqsafe" [drivers/staging/rtlwifi/r8822be.ko] undefined! ERROR: "cfg80211_unlink_bss" [drivers/staging/rtlwifi/r8822be.ko] undefined! ERROR: "ieee80211_beacon_get_tim" [drivers/staging/rtlwifi/r8822be.ko] undefined! ERROR: "ieee80211_resume_disconnect" [drivers/staging/rtlwifi/r8822be.ko] undefined! This adds the Kconfig dependency for it. Fixes: 56bde846304e ("staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: simplify logical operationArnd Bergmann2017-08-231-3/+1
| | | | | | | | | | | | | | | | | | | | gcc notices a very complicated way to check a value for being equal to one, and warns about it: drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c: In function 'halbtc8822b1ant_set_ext_ant_switch': drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c:2105:9: error: '~' on a boolean expression [-Werror=bool-operation] ~switch_polatiry_inverse : ^ drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c:2105:9: note: did you mean to use logical not? ~switch_polatiry_inverse : ^ This simplifies this expression to make it more readable and to make gcc happy. Fixes: 56bde846304e ("staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: shut up -Wmaybe-uninitialized warningArnd Bergmann2017-08-231-10/+7
| | | | | | | | | | | | | | | | This function contains a series of interdependent conditions, slightly more than gcc can follow handle apparently: drivers/staging/rtlwifi/base.c: In function 'rtl_check_beacon_key': drivers/staging/rtlwifi/base.c:2546:34: error: 'ht_cap_ie' may be used uninitialized in this function [-Werror=maybe-uninitialized] This moves the code around a bit, to simplify the conditions enough that gcc can see that all variables are correctly initialized. Fixes: 56bde846304e ("staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: fix a couple of spelling mistakesColin Ian King2017-08-222-9/+9
| | | | | | | | | | Trivial fixes to spelling mistake in pr_err error messages: errorr -> error mismactch -> mismatch Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: fix multiple build errorsRandy Dunlap2017-08-221-1/+1
| | | | | | | | Fix many build errors when NETDEVICES is not enabled. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtlwifi: Reviewers fixesLarry Finger2017-08-204-21/+17
| | | | | | | | | | | | | This commit adds the TODO file and implements some reviewers comments made against some patches to the wireless tree. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8822be: Add Makefiles and Kconfig for new driverLarry Finger2017-08-207-246/+134
| | | | | | | | | | | | | | | | | | | The RTL8822BE, an 802.11ac wireless network card, is now appearing in new computers. Its driver is being placed in staging to reduce the time that users of this new card will have access to in-kernel drivers. This commit enables building of the new driver. For this version, all routines are built into a single module r8822be. When this driver is moved to the wireless tree, halmac, phydm, and rtl8822be will become new modules. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud