#
db5ae2e1 |
| 25-Apr-2024 |
Bitterblue Smith <rtl8821cerfe2@gmail.com> |
wifi: rtlwifi: Move code from rtl8192de to rtl8192d-common
Create the new module rtl8192d-common and move some code into it from rtl8192de. Now the rtl8192de driver (PCI) and the new rtl8192du drive
wifi: rtlwifi: Move code from rtl8192de to rtl8192d-common
Create the new module rtl8192d-common and move some code into it from rtl8192de. Now the rtl8192de driver (PCI) and the new rtl8192du driver (USB) can share some of the code.
This is mostly the code that required little effort to make it shareable. There are a few more functions which they could share, with more changes.
Add phy_iq_calibrate member to struct rtl_hal_ops to allow moving the TX power tracking code from dm.c.
The other changes in this patch are adjusting whitespace, renaming some functions, making some arrays const, and making checkpatch.pl less unhappy.
rtl8192de is compile-tested only. rtl8192d-common is tested with the new rtl8192du driver.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/69c4358a-6fbf-4433-92a6-341c83e9dd48@gmail.com
show more ...
|
#
de4d4be4 |
| 25-Apr-2024 |
Bitterblue Smith <rtl8821cerfe2@gmail.com> |
wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power
Different channels have different TX power settings. rtl8192de is using the TX power setting from the wrong channel in the 5 GHz band because _rtl92c_phy
wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power
Different channels have different TX power settings. rtl8192de is using the TX power setting from the wrong channel in the 5 GHz band because _rtl92c_phy_get_rightchnlplace expects an array which includes all the channel numbers, but it's using an array which includes only the 5 GHz channel numbers.
Use the array channel_all (defined in rtl8192de/phy.c) instead of the incorrect channel5g (defined in core.c).
Tested only with rtl8192du, which will use the same TX power code.
Cc: stable@vger.kernel.org Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/c7653517-cf88-4f57-b79a-8edb0a8b32f0@gmail.com
show more ...
|
#
b8b2baad |
| 19-Dec-2023 |
Su Hui <suhui@nfschina.com> |
wifi: rtlwifi: rtl8192de: using calculate_bit_shift()
Using calculate_bit_shift() to replace _rtl92d_phy_calculate_bit_shift(). And fix the undefined bitwise shift behavior problem.
Fixes: 7274a8c2
wifi: rtlwifi: rtl8192de: using calculate_bit_shift()
Using calculate_bit_shift() to replace _rtl92d_phy_calculate_bit_shift(). And fix the undefined bitwise shift behavior problem.
Fixes: 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20231219065739.1895666-8-suhui@nfschina.com
show more ...
|
#
93fbc1eb |
| 01-Aug-2022 |
Ping-Ke Shih <pkshih@realtek.com> |
wifi: rtlwifi: 8192de: correct checking of IQK reload
Since IQK could spend time, we make a cache of IQK result matrix that looks like iqk_matrix[channel_idx].val[x][y], and we can reload the matrix
wifi: rtlwifi: 8192de: correct checking of IQK reload
Since IQK could spend time, we make a cache of IQK result matrix that looks like iqk_matrix[channel_idx].val[x][y], and we can reload the matrix if we have made a cache. To determine a cache is made, we check iqk_matrix[channel_idx].val[0][0].
The initial commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") make a mistake that checks incorrect iqk_matrix[channel_idx].val[0] that is always true, and this mistake is found by commit ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12"), so I recall the vendor driver to find fix and apply the correctness.
Fixes: 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220801113345.42016-1-pkshih@realtek.com
show more ...
|
#
ee3db469 |
| 20-May-2022 |
Jakub Kicinski <kuba@kernel.org> |
wifi: rtlwifi: remove always-true condition pointed out by GCC 12
The .value is a two-dim array, not a pointer.
struct iqk_matrix_regs { bool iqk_done; long value[1][IQK_MATRIX_REG_NUM]; }
wifi: rtlwifi: remove always-true condition pointed out by GCC 12
The .value is a two-dim array, not a pointer.
struct iqk_matrix_regs { bool iqk_done; long value[1][IQK_MATRIX_REG_NUM]; };
Acked-by: Kalle Valo <kvalo@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
69831173 |
| 19-Nov-2021 |
Kees Cook <keescook@chromium.org> |
rtlwifi: rtl8192de: Style clean-ups
Clean up some style issues: - Use ARRAY_SIZE() even though it's a u8 array. - Remove redundant CHANNEL_MAX_NUMBER_2G define. Additionally fix some dead code WARNs
rtlwifi: rtl8192de: Style clean-ups
Clean up some style issues: - Use ARRAY_SIZE() even though it's a u8 array. - Remove redundant CHANNEL_MAX_NUMBER_2G define. Additionally fix some dead code WARNs.
Acked-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://lore.kernel.org/lkml/57d0d1b6064342309f680f692192556c@realtek.com/ Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211119192233.1021063-1-keescook@chromium.org
show more ...
|
#
533ccdae |
| 23-Aug-2021 |
Nathan Chancellor <nathan@kernel.org> |
rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace()
Clang warns:
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning: variable 'place' is used uninit
rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace()
Clang warns:
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:6: warning: variable 'place' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (chnl > 14) { ^~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:909:9: note: uninitialized use occurs here return place; ^~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:901:2: note: remove the 'if' if its condition is always true if (chnl > 14) { ^~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:899:10: note: initialize the variable 'place' to silence this warning u8 place; ^ = '\0' 1 warning generated.
Commit 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations") removed the initialization of place but it appears that this removal was in the wrong function.
_rtl92c_phy_get_rightchnlplace() returns place's value at the end of the function so now if the if statement is false, place never gets initialized. Add that initialization back to address the warning.
place's initialization is not necessary in rtl92d_get_rightchnlplace_for_iqk() as place is only used within the if statement so it can be removed, which is likely what was intended in the first place.
Fixes: 369956ae5720 ("rtlwifi: rtl8192de: Remove redundant variable initializations") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210823222014.764557-1-nathan@kernel.org
show more ...
|
#
b05897ca |
| 03-Aug-2021 |
Colin Ian King <colin.king@canonical.com> |
rtlwifi: rtl8192de: make arrays static const, makes object smaller
Don't populate arrays the stack but instead make them static const. Replace array channel_info with channel_all since it contains t
rtlwifi: rtl8192de: make arrays static const, makes object smaller
Don't populate arrays the stack but instead make them static const. Replace array channel_info with channel_all since it contains the same data as channel_all. Makes object code smaller by 961 bytes.
Before: text data bss dec hex filename 128147 44250 1024 173421 2a56d ../realtek/rtlwifi/rtl8192de/phy.o
After text data bss dec hex filename 127122 44314 1024 172460 2a1ac ../realtek/rtlwifi/rtl8192de/phy.o
(gcc version 10.2.0)
Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210803144949.79433-2-colin.king@canonical.com
show more ...
|
#
369956ae |
| 03-Aug-2021 |
Colin Ian King <colin.king@canonical.com> |
rtlwifi: rtl8192de: Remove redundant variable initializations
The variables rtstatus and place are being initialized with a values that are never read, the initializations are redundant and can be r
rtlwifi: rtl8192de: Remove redundant variable initializations
The variables rtstatus and place are being initialized with a values that are never read, the initializations are redundant and can be removed.
Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210803144949.79433-1-colin.king@canonical.com
show more ...
|
#
0d5e743d |
| 17-Jun-2021 |
Kees Cook <keescook@chromium.org> |
rtlwifi: rtl8192de: Fully initialize curvecount_val
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentio
rtlwifi: rtl8192de: Fully initialize curvecount_val
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring array fields.
The size argument to memset() is bytes, but the array element size of curvecount_val is u32, so "CV_CURVE_CNT * 2" was only 1/4th of the contents of curvecount_val. Adjust memset() to wipe full buffer size.
Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210617171317.3410722-1-keescook@chromium.org
show more ...
|
#
0409d504 |
| 14-Nov-2020 |
Kaixu Xia <kaixuxia@tencent.com> |
rtlwifi: rtl8192de: remove the useless value assignment
The variable u4tmp is overwritten by the following call and the assignment is useless, so remove it.
Reported-by: Tosk Robot <tencent_os_robo
rtlwifi: rtl8192de: remove the useless value assignment
The variable u4tmp is overwritten by the following call and the assignment is useless, so remove it.
Reported-by: Tosk Robot <tencent_os_robot@tencent.com> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1605332735-9648-1-git-send-email-kaixuxia@tencent.com
show more ...
|
#
6c1d6191 |
| 19-Sep-2020 |
Joe Perches <joe@perches.com> |
rtlwifi: Use ffs in <foo>_phy_calculate_bit_shift
Remove the loop and use the generic ffs instead.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link
rtlwifi: Use ffs in <foo>_phy_calculate_bit_shift
Remove the loop and use the generic ffs instead.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/e2ab424d24b74901bc0c39f0c60f75e871adf2ba.camel@perches.com
show more ...
|
#
6bf8bc19 |
| 23-Jul-2020 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8192de: Rename RT_TRACE to rtl_dbg
Change the misleading macro name to one that is more descriptive for rtl8192de. Changes suggested by ckeckpatch.pl have been made.
Signed-off-by: Larr
rtlwifi: rtl8192de: Rename RT_TRACE to rtl_dbg
Change the misleading macro name to one that is more descriptive for rtl8192de. Changes suggested by ckeckpatch.pl have been made.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200723204244.24457-9-Larry.Finger@lwfinger.net
show more ...
|
#
92541dd9 |
| 18-Nov-2019 |
Ping-Ke Shih <pkshih@realtek.com> |
rtlwifi: rf_lock use non-irqsave spin_lock
rf_lock is used to protect RF register access, but they will not called from interrupt context, so *_irqsave version isn't necessary. Then, these delays do
rtlwifi: rf_lock use non-irqsave spin_lock
rf_lock is used to protect RF register access, but they will not called from interrupt context, so *_irqsave version isn't necessary. Then, these delays don't affect IRQ services.
The old code holds spin_lock_irqsave() that will be detected a long delay as below:
kworker/-276 4d... 0us : _raw_spin_lock_irqsave kworker/-276 4d... 0us : rtl8723_phy_rf_serial_read <-rtl8723de_phy_set_rf_reg kworker/-276 4d... 1us : rtl8723_phy_query_bb_reg <-rtl8723_phy_rf_serial_read kworker/-276 4d... 3us : rtl8723_phy_set_bb_reg <-rtl8723_phy_rf_serial_read kworker/-276 4d... 4us : __const_udelay <-rtl8723_phy_rf_serial_read kworker/-276 4d... 4us!: delay_mwaitx <-rtl8723_phy_rf_serial_read kworker/-276 4d... 1004us : rtl8723_phy_set_bb_reg <-rtl8723_phy_rf_serial_read [...]
Reported-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
b83faeda |
| 14-Feb-2019 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8188de: Remove CamelCase variables
If a macro is in CamelCase, it it converted to upper case. Variables and routine names are converted to lower case.
The following checkpatch exception
rtlwifi: rtl8188de: Remove CamelCase variables
If a macro is in CamelCase, it it converted to upper case. Variables and routine names are converted to lower case.
The following checkpatch exceptions are also fixed:
CHECK: No space is necessary after a cast #211: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:109: + (u8 *) (&rfstate));
CHECK: No space is necessary after a cast #241: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:277: + ptmp_byte = (u8 *) (®toset) + index;
Note that not all checkpatch exceptions are addressed. Those will be handled in later patches.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
5bd4f692 |
| 14-Feb-2019 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8192de: Replace old-style license information
The traditional license information is replaced by the SPDX form. There are no code changes.
Signed-off-by: Larry Finger <Larry.Finger@lwfi
rtlwifi: rtl8192de: Replace old-style license information
The traditional license information is replaced by the SPDX form. There are no code changes.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
b8c79f45 |
| 15-Dec-2016 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8192de: Remove all instances of DBG_EMERG
This is a step toward eliminating the RT_TRACE macros. Those calls that have DBG_EMERG as the level are always logged, and they represent error
rtlwifi: rtl8192de: Remove all instances of DBG_EMERG
This is a step toward eliminating the RT_TRACE macros. Those calls that have DBG_EMERG as the level are always logged, and they represent error conditions, thus they are replaced with pr_err().
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
531940f9 |
| 15-Dec-2016 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: Replace local debug macro RT_ASSERT
This macro can be replaced with WARN_ONCE. In addition to using a standard debugging macro for these critical errors, we also get a stack dump.
In rtl88
rtlwifi: Replace local debug macro RT_ASSERT
This macro can be replaced with WARN_ONCE. In addition to using a standard debugging macro for these critical errors, we also get a stack dump.
In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect indentation was fixed.
This patch also fixes two places in each of rtl8192ee, rtl8723be, and rtl8821ae where the logical condition was incorrect.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
0d3d253b |
| 05-Oct-2016 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8192de: Remove address of Free Software Foundation
Since this driver was added to the kernel, the checkpatch script was modified to request that the address of the FSF not be included.
rtlwifi: rtl8192de: Remove address of Free Software Foundation
Since this driver was added to the kernel, the checkpatch script was modified to request that the address of the FSF not be included.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
ad574889 |
| 23-Sep-2016 |
Joe Perches <joe@perches.com> |
rtlwifi: Add switch variable to 'switch case not processed' messages
Help along debugging by showing what switch/case variable is not being processed in these messages.
Signed-off-by: Joe Perches <
rtlwifi: Add switch variable to 'switch case not processed' messages
Help along debugging by showing what switch/case variable is not being processed in these messages.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
5856cd5b |
| 27-Aug-2016 |
Oleg Drokin <green@linuxhacker.ru> |
rtlwifi/rtl8192de: Fix print format string
%ul was likely meant as %lu to print an unsigned long, not an unsigned with a letter l at the end. But in fact the value printed is u32 anyway, so just dro
rtlwifi/rtl8192de: Fix print format string
%ul was likely meant as %lu to print an unsigned long, not an unsigned with a letter l at the end. But in fact the value printed is u32 anyway, so just drop the l completely.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
08aba42f |
| 15-Jun-2016 |
Arnd Bergmann <arnd@arndb.de> |
rtlwifi: use s8 instead of char
Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of incorrect code that results from 'char' being unsigned here, e.g.
realtek/rtlwifi/rc.c:113
rtlwifi: use s8 instead of char
Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of incorrect code that results from 'char' being unsigned here, e.g.
realtek/rtlwifi/rc.c:113:18: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8188ee/dm.c:1070:22: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192ce/trx.c:54:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192cu/mac.c:601:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192de/trx.c:53:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192ee/phy.c:1268:12: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192se/rf.c:150:20: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8723be/dm.c:877:29: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8723be/phy.c:386:16: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/dm.c:1514:38: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/phy.c:1558:11: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/phy.c:386:24: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/trx.c:55:12: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/stats.c:31:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
This patch changes all uses of 'char' in this driver that refer to 8-bit integers to use 's8' instead, which is signed on all architectures.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
bb6fa826 |
| 11-Feb-2016 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl8192de: Convert driver to use common 5G channels
This driver defines its owh copy of the 5G channels. Change it to use the common definitions.
Signed-off-by: Larry Finger <Larry.Finger@
rtlwifi: rtl8192de: Convert driver to use common 5G channels
This driver defines its owh copy of the 5G channels. Change it to use the common definitions.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|
#
f1d2b4d3 |
| 07-Sep-2015 |
Larry Finger <Larry.Finger@lwfinger.net> |
rtlwifi: rtl818x: Move drivers into new realtek directory
Now that a new mac80211-based driver for Realtek devices has been submitted, it is time to reorganize the directories. Rather than having di
rtlwifi: rtl818x: Move drivers into new realtek directory
Now that a new mac80211-based driver for Realtek devices has been submitted, it is time to reorganize the directories. Rather than having directories rtlwifi and rtl818x be in drivers/net/wireless/, they will now be in drivers/net/wireless/realtek/. This change simplifies the directory structure, but does not result in any configuration changes that are visable to the user.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
show more ...
|