History log of /linux-master/drivers/net/wireless/realtek/rtlwifi/usb.h
Revision Date Author Comments
# 42ffccd0 13-Feb-2024 Bitterblue Smith <rtl8821cerfe2@gmail.com>

wifi: rtlwifi: rtl_usb: Store the endpoint addresses

And use the stored addresses in rtl8192cu instead of hardcoding them.

This is what the vendor drivers do.

Perhaps this is not strictly necessary for RTL8192CU devices. However,
the dual mac version of RTL8192DU has two USB interfaces, each with its
own set of endpoints. Hardcoding their addresses in the upcoming
rtl8192du driver would require making some assumptions which I'm not
qualified to make.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/7b6a602a-6101-4bab-958d-bcff4d565b40@gmail.com


# 93665097 21-Feb-2019 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: Fix blank line errors in main header files

The errors consist of multiple blank lines, and a missing blank line
after the declarations.

There are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# e703c5dd 14-Feb-2019 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: Remove CamelCase variables from base code

There are a number of CamelCase variables remaining in the source
files of modules rtl_pci, rtl_usb, and rtlwifi.

The following checkpatch excettions are also fixed:

for_kalle1/0001-rtlwifi-Remove-CamelCase-variables-from-base-code.patch
-----------------------------------------------------------------------
CHECK: Unnecessary parentheses around 'rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]'
#68: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:377:
+ if ((rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
+ rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]) ||
+ (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
+ rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
1])) {

CHECK: Unnecessary parentheses around 'rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
1]'
#68: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:377:
+ if ((rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
+ rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]) ||
+ (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
+ rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
1])) {

WARNING: line over 80 characters
#70: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:379:
+ (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=

CHECK: No space is necessary after a cast
#186: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c:396:
+ status->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#208: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c:335:
+ stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#243: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:301:
+ stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#252: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:368:
+ stats.rx_is40mhzpacket = (bool) GET_RX_DESC_BW(rxdesc);

CHECK: No space is necessary after a cast
#265: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c:475:
+ stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

WARNING: Unnecessary space before function pointer arguments
#455: FILE: drivers/net/wireless/realtek/rtlwifi/wifi.h:1462:
+ void (*writen_sync) (struct rtl_priv *rtlpriv, u32 addr, void *buf,

WARNING: Unnecessary space before function pointer arguments
#483: FILE: drivers/net/wireless/realtek/rtlwifi/wifi.h:2257:
+ void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pdesc,

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>


# d27a76fa 14-Feb-2019 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: 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>


# d5efe153 07-Feb-2017 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: Move items out of rtl_pci_priv and rtl_usb_priv

In commit 6773386f977c ("rtlwifi: rtl8192c-common: Fix "BUG: KASAN:"),
a BUG detected when CONFIG_KASAN=y was fixed by reordering the layouts
of struct rtl_pci_priv, and struct rtl_usb_priv so that the variables
used by both PCI and USB drivers have the same offsets in both structs.
The better fix of relocating the critical variables into struct rtl_priv
was deferred as these changes do not have to be applied to stable
kernels.

This change also removes CamelCase variables with pLed0 => pled0.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 6773386f 05-Feb-2017 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: rtl8192c-common: Fix "BUG: KASAN:

Kernels built with CONFIG_KASAN=y report the following BUG for rtl8192cu
and rtl8192c-common:

==================================================================
BUG: KASAN: slab-out-of-bounds in rtl92c_dm_bt_coexist+0x858/0x1e40
[rtl8192c_common] at addr ffff8801c90edb08
Read of size 1 by task kworker/0:1/38
page:ffffea0007243800 count:1 mapcount:0 mapping: (null)
index:0x0 compound_mapcount: 0
flags: 0x8000000000004000(head)
page dumped because: kasan: bad access detected
CPU: 0 PID: 38 Comm: kworker/0:1 Not tainted 4.9.7-gentoo #3
Hardware name: Gigabyte Technology Co., Ltd. To be filled by
O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
Workqueue: rtl92c_usb rtl_watchdog_wq_callback [rtlwifi]
0000000000000000 ffffffff829eea33 ffff8801d7f0fa30 ffff8801c90edb08
ffffffff824c0f09 ffff8801d4abee80 0000000000000004 0000000000000297
ffffffffc070b57c ffff8801c7aa7c48 ffff880100000004 ffffffff000003e8
Call Trace:
[<ffffffff829eea33>] ? dump_stack+0x5c/0x79
[<ffffffff824c0f09>] ? kasan_report_error+0x4b9/0x4e0
[<ffffffffc070b57c>] ? _usb_read_sync+0x15c/0x280 [rtl_usb]
[<ffffffff824c0f75>] ? __asan_report_load1_noabort+0x45/0x50
[<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
[<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
[<ffffffffc06d0cbe>] ? rtl92c_dm_rf_saving+0x96e/0x1330 [rtl8192c_common]
...

The problem is due to rtl8192ce and rtl8192cu sharing routines, and having
different layouts of struct rtl_pci_priv, which is used by rtl8192ce, and
struct rtl_usb_priv, which is used by rtl8192cu. The problem was resolved
by placing the struct bt_coexist_info at the head of each of those private
areas.

Reported-and-tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> # 4.0+
Cc: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 1b489326 04-Oct-2016 Larry Finger <Larry.Finger@lwfinger.net>

rtlwifi: 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>


# 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 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>