<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/net/wireless/realtek/rtlwifi/rtl8192cu, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>wifi: rtlwifi: 8192cu: fix tid out of range in rtl92cu_tx_fill_desc()</title>
<updated>2025-12-15T08:45:10+00:00</updated>
<author>
<name>Morning Star</name>
<email>alexbestoso@gmail.com</email>
</author>
<published>2025-11-27T08:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd39edb445f07400e748da967a07d5dca5c5f96e'/>
<id>dd39edb445f07400e748da967a07d5dca5c5f96e</id>
<content type='text'>
TID getting from ieee80211_get_tid() might be out of range of array size
of sta_entry-&gt;tids[], so check TID is less than MAX_TID_COUNT. Othwerwise,
UBSAN warn:

 UBSAN: array-index-out-of-bounds in drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:514:30
 index 10 is out of range for type 'rtl_tid_data [9]'

Fixes: 8ca4cdef9329 ("wifi: rtlwifi: rtl8192cu: Fix TX aggregation")
Signed-off-by: Morning Star &lt;alexbestoso@gmail.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/1764232628-13625-1-git-send-email-pkshih@realtek.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TID getting from ieee80211_get_tid() might be out of range of array size
of sta_entry-&gt;tids[], so check TID is less than MAX_TID_COUNT. Othwerwise,
UBSAN warn:

 UBSAN: array-index-out-of-bounds in drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:514:30
 index 10 is out of range for type 'rtl_tid_data [9]'

Fixes: 8ca4cdef9329 ("wifi: rtlwifi: rtl8192cu: Fix TX aggregation")
Signed-off-by: Morning Star &lt;alexbestoso@gmail.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/1764232628-13625-1-git-send-email-pkshih@realtek.com
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: rtl8192cu: Don't claim USB ID 07b8:8188</title>
<updated>2025-08-19T01:20:09+00:00</updated>
<author>
<name>Bitterblue Smith</name>
<email>rtl8821cerfe2@gmail.com</email>
</author>
<published>2025-08-11T15:32:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e798f2ac6040f46a04795d7de977341fa9aeabae'/>
<id>e798f2ac6040f46a04795d7de977341fa9aeabae</id>
<content type='text'>
This ID appears to be RTL8188SU, not RTL8188CU. This is the wrong driver
for RTL8188SU. The r8712u driver from staging used to handle this ID.

Closes: https://lore.kernel.org/linux-wireless/ee0acfef-a753-4f90-87df-15f8eaa9c3a8@gmx.de/
Cc: stable@vger.kernel.org
Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/2e5e2348-bdb3-44b2-92b2-0231dbf464b0@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This ID appears to be RTL8188SU, not RTL8188CU. This is the wrong driver
for RTL8188SU. The r8712u driver from staging used to handle this ID.

Closes: https://lore.kernel.org/linux-wireless/ee0acfef-a753-4f90-87df-15f8eaa9c3a8@gmx.de/
Cc: stable@vger.kernel.org
Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/2e5e2348-bdb3-44b2-92b2-0231dbf464b0@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: Use min()/max() to improve code</title>
<updated>2025-07-18T06:41:06+00:00</updated>
<author>
<name>Qianfeng Rong</name>
<email>rongqianfeng@vivo.com</email>
</author>
<published>2025-07-15T12:16:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94cd0ba1842ece06acc15bba5f2bff6b6043eb1d'/>
<id>94cd0ba1842ece06acc15bba5f2bff6b6043eb1d</id>
<content type='text'>
Use min()/max() to reduce the code and improve its readability.

Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Qianfeng Rong &lt;rongqianfeng@vivo.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/20250715121721.266713-8-rongqianfeng@vivo.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use min()/max() to reduce the code and improve its readability.

Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Qianfeng Rong &lt;rongqianfeng@vivo.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/20250715121721.266713-8-rongqianfeng@vivo.com
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: avoid stack size warning for _read_eeprom_info</title>
<updated>2025-06-16T03:45:49+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2025-06-10T09:22:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2baacfe833460fee2f54b2c7270d632c98052cdc'/>
<id>2baacfe833460fee2f54b2c7270d632c98052cdc</id>
<content type='text'>
txpower_info_{2g,5g} are too big to fit on the stack, but in most of the
rtlwifi variants this stays below the warning limit for stack frames.
In rtl8192ee and a few others, I see a case where clang decides to fully
inline this into rtl92ee_read_eeprom_info, triggering this warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c:2178:6: error: stack frame size (1312) exceeds limit (1280) in 'rtl92ee_read_eeprom_info' [-Werror,-Wframe-larger-than]

Mark _rtl92ee_read_txpower_info_from_hwpg() as noinline_for_stack to
and mark _rtl92ee_get_chnl_group() as __always_inline to make clang
behave the same way as gcc. Inlining _rtl92ee_get_chnl_group helps
let the compiler see that the index is always in range. The same
change appears to be necessary in all rtlwifi variants.

A more thorough approach would be to avoid the use of the two structures
on the stack entirely and combine them with the struct rtl_efuse
data that is dynamically allocated and holds the same information.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/20250610092240.2639751-1-arnd@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
txpower_info_{2g,5g} are too big to fit on the stack, but in most of the
rtlwifi variants this stays below the warning limit for stack frames.
In rtl8192ee and a few others, I see a case where clang decides to fully
inline this into rtl92ee_read_eeprom_info, triggering this warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c:2178:6: error: stack frame size (1312) exceeds limit (1280) in 'rtl92ee_read_eeprom_info' [-Werror,-Wframe-larger-than]

Mark _rtl92ee_read_txpower_info_from_hwpg() as noinline_for_stack to
and mark _rtl92ee_get_chnl_group() as __always_inline to make clang
behave the same way as gcc. Inlining _rtl92ee_get_chnl_group helps
let the compiler see that the index is always in range. The same
change appears to be necessary in all rtlwifi variants.

A more thorough approach would be to avoid the use of the two structures
on the stack entirely and combine them with the struct rtl_efuse
data that is dynamically allocated and holds the same information.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/20250610092240.2639751-1-arnd@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: Constify struct rtl_hal_ops and rtl_hal_cfg</title>
<updated>2025-06-10T01:12:16+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2025-05-17T16:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4c95423b6f01a50505308d2eaec2da2a2bcd3139'/>
<id>4c95423b6f01a50505308d2eaec2da2a2bcd3139</id>
<content type='text'>
'struct rtl_hal_ops' and 'struct rtl_hal_cfg' are not modified in these
drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.

Constification of rtl_hal_cfg is only needed in rtl8192cu/sw.c

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  10167	   5512	    128	  15807	   3dbf	drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  10743	   4936	    128	  15807	   3dbf	drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/2c3f3d8d8b2f7dcb8cc64cebe89e55720d1d733d.1747500351.git.christophe.jaillet@wanadoo.fr
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'struct rtl_hal_ops' and 'struct rtl_hal_cfg' are not modified in these
drivers.

Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.

Constification of rtl_hal_cfg is only needed in rtl8192cu/sw.c

On a x86_64, with allmodconfig, as an example:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  10167	   5512	    128	  15807	   3dbf	drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  10743	   4936	    128	  15807	   3dbf	drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.o

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://patch.msgid.link/2c3f3d8d8b2f7dcb8cc64cebe89e55720d1d733d.1747500351.git.christophe.jaillet@wanadoo.fr
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: Constify rtl_hal_cfg.{ops,usb_interface_cfg} and rtl_priv.cfg</title>
<updated>2024-05-30T02:28:39+00:00</updated>
<author>
<name>Bitterblue Smith</name>
<email>rtl8821cerfe2@gmail.com</email>
</author>
<published>2024-05-23T14:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1d8b5003a55ccab64e865d2f34ab1fd7a4cfe3bb'/>
<id>1d8b5003a55ccab64e865d2f34ab1fd7a4cfe3bb</id>
<content type='text'>
This allows the drivers to declare the structs rtl_hal_cfg, rtl_hal_ops,
and rtl_hal_usbint_cfg as const.

Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/1b29994f-3d07-4297-875d-57c3a87a1ec6@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows the drivers to declare the structs rtl_hal_cfg, rtl_hal_ops,
and rtl_hal_usbint_cfg as const.

Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/1b29994f-3d07-4297-875d-57c3a87a1ec6@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: always assume QoS mode in rtl8192cu</title>
<updated>2024-03-22T06:50:25+00:00</updated>
<author>
<name>Dmitry Antipov</name>
<email>dmantipov@yandex.ru</email>
</author>
<published>2024-03-20T08:43:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=634cae97912782cd202971b37e45f22c62fe865c'/>
<id>634cae97912782cd202971b37e45f22c62fe865c</id>
<content type='text'>
In 'rtl92cu_set_hw_reg()', always assume that QoS mode is enabled
as it was hardcoded since an initial commit. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/20240320084324.109506-2-dmantipov@yandex.ru
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 'rtl92cu_set_hw_reg()', always assume that QoS mode is enabled
as it was hardcoded since an initial commit. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/20240320084324.109506-2-dmantipov@yandex.ru
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: drop WMM stubs from rtl8192cu</title>
<updated>2024-03-22T06:47:48+00:00</updated>
<author>
<name>Dmitry Antipov</name>
<email>dmantipov@yandex.ru</email>
</author>
<published>2024-03-20T08:43:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f8a6fc99c26c1a4a5b07917bae5a52543abe77bc'/>
<id>f8a6fc99c26c1a4a5b07917bae5a52543abe77bc</id>
<content type='text'>
Since WMM support was never actually implemented and related TODO is
more than 13 years old, it might be reasonable to remove all of the
WMM stubs from rtl8192cu and simplify related code. Minor comment
style adjustments suggested by checkpatch.pl, compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/20240320084324.109506-1-dmantipov@yandex.ru
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since WMM support was never actually implemented and related TODO is
more than 13 years old, it might be reasonable to remove all of the
WMM stubs from rtl8192cu and simplify related code. Minor comment
style adjustments suggested by checkpatch.pl, compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Link: https://msgid.link/20240320084324.109506-1-dmantipov@yandex.ru
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: set initial values for unexpected cases of USB endpoint priority</title>
<updated>2024-02-21T18:55:51+00:00</updated>
<author>
<name>Ping-Ke Shih</name>
<email>pkshih@realtek.com</email>
</author>
<published>2024-02-16T03:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9208e85c62720608aa6ec6e4265b584a48fb43b0'/>
<id>9208e85c62720608aa6ec6e4265b584a48fb43b0</id>
<content type='text'>
Map USB endpoints to hardware and AC queues according to number of USB
endpoints. However, original only give a warning for unexpected cases but
initial values are not given. Then, smatch warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.

The regular selection is high and low queues, so move default (unexpected)
case along with that.

Compile tested only.

Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://msgid.link/20240216033949.34765-1-pkshih@realtek.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Map USB endpoints to hardware and AC queues according to number of USB
endpoints. However, original only give a warning for unexpected cases but
initial values are not given. Then, smatch warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.

The regular selection is high and low queues, so move default (unexpected)
case along with that.

Compile tested only.

Signed-off-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://msgid.link/20240216033949.34765-1-pkshih@realtek.com
</pre>
</div>
</content>
</entry>
<entry>
<title>wifi: rtlwifi: rtl8192cu: Fix TX aggregation</title>
<updated>2024-02-21T18:54:57+00:00</updated>
<author>
<name>Bitterblue Smith</name>
<email>rtl8821cerfe2@gmail.com</email>
</author>
<published>2024-02-15T18:57:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8ca4cdef93297c9b9bf08da39bc940bd20acbb94'/>
<id>8ca4cdef93297c9b9bf08da39bc940bd20acbb94</id>
<content type='text'>
rtl8192cu is checking rtl_mac.tids when deciding if it should enable
aggregation. This is wrong because rtl_mac.tids is not initialised
anywhere. Check rtl_sta_info.tids instead, which is initialised.

Also, when enabling aggregation also enable RTS. The vendor driver does
this, my router does this. It seems like the thing to do.

Also also, it seems right to set the AMPDU density only when enabling
aggregation.

Also also also, delete the unused member rtl_mac.tids and the unused
macros RTL_AGG_ON and RTL_AGG_OFF.

Naturally, with working AMPDU the download/upload speeds are better.
Before: 59/32 Mbps.
After:  68/46 Mbps.

Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://msgid.link/4e936334-5f81-403f-a495-0628ebfb6903@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rtl8192cu is checking rtl_mac.tids when deciding if it should enable
aggregation. This is wrong because rtl_mac.tids is not initialised
anywhere. Check rtl_sta_info.tids instead, which is initialised.

Also, when enabling aggregation also enable RTS. The vendor driver does
this, my router does this. It seems like the thing to do.

Also also, it seems right to set the AMPDU density only when enabling
aggregation.

Also also also, delete the unused member rtl_mac.tids and the unused
macros RTL_AGG_ON and RTL_AGG_OFF.

Naturally, with working AMPDU the download/upload speeds are better.
Before: 59/32 Mbps.
After:  68/46 Mbps.

Signed-off-by: Bitterblue Smith &lt;rtl8821cerfe2@gmail.com&gt;
Acked-by: Ping-Ke Shih &lt;pkshih@realtek.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://msgid.link/4e936334-5f81-403f-a495-0628ebfb6903@gmail.com
</pre>
</div>
</content>
</entry>
</feed>
