* [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants
@ 2024-01-16 9:50 Martin Kaistra
2024-01-16 11:13 ` Kalle Valo
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Martin Kaistra @ 2024-01-16 9:50 UTC (permalink / raw)
To: linux-wireless
Cc: Jes Sorensen, Kalle Valo, Ping-Ke Shih, Bitterblue Smith,
Sebastian Andrzej Siewior
Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
It was missed to set this number for all variants except 8188f, which
caused rtl8xxxu_get_free_sec_cam() to always return 0.
Fix it by adding the numbers for all variants. The values are taken from
the vendor drivers and rtlwifi.
Fixes: b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP mode")
Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 1 +
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
7 files changed, 7 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
index cbeac9386ae51..afe9cc1b49dcf 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
@@ -1882,6 +1882,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops = {
.has_tx_report = 1,
.init_reg_pkt_life_time = 1,
.gen2_thermal_meter = 1,
+ .max_sec_cam_num = 32,
.adda_1t_init = 0x0b1b25a0,
.adda_1t_path_on = 0x0bdb25a0,
/*
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
index b30a9a513cb8b..3ee7d8f87da6c 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
@@ -613,6 +613,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops = {
.rx_agg_buf_size = 16000,
.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ .max_sec_cam_num = 32,
.adda_1t_init = 0x0b1b25a0,
.adda_1t_path_on = 0x0bdb25a0,
.adda_2t_path_on_a = 0x04db25a4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
index 47bcaec6f2db4..63b73ace27ec7 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
@@ -1769,6 +1769,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops = {
.needs_full_init = 1,
.supports_ap = 1,
.max_macid_num = 128,
+ .max_sec_cam_num = 64,
.adda_1t_init = 0x0fc01616,
.adda_1t_path_on = 0x0fc01616,
.adda_2t_path_on_a = 0x0fc01616,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
index 585b1a5eed69a..21e4204769d07 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
@@ -2095,6 +2095,7 @@ struct rtl8xxxu_fileops rtl8192fu_fops = {
.max_aggr_num = 0x1f1f,
.supports_ap = 1,
.max_macid_num = 128,
+ .max_sec_cam_num = 64,
.trxff_boundary = 0x3f3f,
.pbp_rx = PBP_PAGE_SIZE_256,
.pbp_tx = PBP_PAGE_SIZE_256,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c
index 871b8cca8a188..46d57510e9fc6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c
@@ -1877,6 +1877,7 @@ struct rtl8xxxu_fileops rtl8710bu_fops = {
.max_aggr_num = 0x0c14,
.supports_ap = 1,
.max_macid_num = 16,
+ .max_sec_cam_num = 32,
.adda_1t_init = 0x03c00016,
.adda_1t_path_on = 0x03c00016,
.trxff_boundary = 0x3f7f,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
index 15a30e496221b..ad1bb9377ca2e 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
@@ -510,6 +510,7 @@ struct rtl8xxxu_fileops rtl8723au_fops = {
.rx_agg_buf_size = 16000,
.tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
+ .max_sec_cam_num = 32,
.adda_1t_init = 0x0b1b25a0,
.adda_1t_path_on = 0x0bdb25a0,
.adda_2t_path_on_a = 0x04db25a4,
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
index 954369ed6226c..9640c841d20a8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
@@ -1744,6 +1744,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops = {
.max_aggr_num = 0x0c14,
.supports_ap = 1,
.max_macid_num = 128,
+ .max_sec_cam_num = 64,
.adda_1t_init = 0x01c00014,
.adda_1t_path_on = 0x01c00014,
.adda_2t_path_on_a = 0x01c00014,
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants
2024-01-16 9:50 [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants Martin Kaistra
@ 2024-01-16 11:13 ` Kalle Valo
2024-01-16 11:28 ` Martin Kaistra
2024-01-16 11:49 ` Ping-Ke Shih
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2024-01-16 11:13 UTC (permalink / raw)
To: Martin Kaistra
Cc: linux-wireless, Jes Sorensen, Ping-Ke Shih, Bitterblue Smith,
Sebastian Andrzej Siewior
Martin Kaistra <martin.kaistra@linutronix.de> writes:
> Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
> mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
> It was missed to set this number for all variants except 8188f, which
> caused rtl8xxxu_get_free_sec_cam() to always return 0.
>
> Fix it by adding the numbers for all variants. The values are taken from
> the vendor drivers and rtlwifi.
Does this fix a user visible regression? It would be good to add that to
the commit message. I can do it, just let me know what to add.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants
2024-01-16 11:13 ` Kalle Valo
@ 2024-01-16 11:28 ` Martin Kaistra
0 siblings, 0 replies; 6+ messages in thread
From: Martin Kaistra @ 2024-01-16 11:28 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-wireless, Jes Sorensen, Ping-Ke Shih, Bitterblue Smith,
Sebastian Andrzej Siewior
Hi Kalle,
Am 16.01.24 um 12:13 schrieb Kalle Valo:
> Martin Kaistra <martin.kaistra@linutronix.de> writes:
>
>> Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
>> mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
>> It was missed to set this number for all variants except 8188f, which
>> caused rtl8xxxu_get_free_sec_cam() to always return 0.
>>
>> Fix it by adding the numbers for all variants. The values are taken from
>> the vendor drivers and rtlwifi.
>
> Does this fix a user visible regression? It would be good to add that to
> the commit message. I can do it, just let me know what to add.
>
Yes, traffic to encrypted networks was broken for all hw variants except 8188f.
This was reported by Zenm Chen in [1].
Maybe you could add something like:
[..]
caused rtl8xxxu_get_free_sec_cam() to always return 0 and therefore breaking
encrypted traffic.
[1] https://lore.kernel.org/linux-wireless/20240111163603.2325-1-zenmchen@gmail.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants
2024-01-16 9:50 [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants Martin Kaistra
2024-01-16 11:13 ` Kalle Valo
@ 2024-01-16 11:49 ` Ping-Ke Shih
2024-01-16 13:46 ` Zenm Chen
2024-01-19 17:31 ` Kalle Valo
3 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2024-01-16 11:49 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org, zenmchen@gmail.com,
martin.kaistra@linutronix.de
Cc: Jes.Sorensen@gmail.com, kvalo@kernel.org, rtl8821cerfe2@gmail.com,
bigeasy@linutronix.de
+ Zenm
Hi Zenm,
On Tue, 2024-01-16 at 10:50 +0100, Martin Kaistra wrote:
>
> Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
> mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
> It was missed to set this number for all variants except 8188f, which
> caused rtl8xxxu_get_free_sec_cam() to always return 0.
>
> Fix it by adding the numbers for all variants. The values are taken from
> the vendor drivers and rtlwifi.
>
> Fixes: b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP mode")
> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
>
Could you please try if this patch can fix your problem?
Thanks
Ping-Ke
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants
2024-01-16 9:50 [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants Martin Kaistra
2024-01-16 11:13 ` Kalle Valo
2024-01-16 11:49 ` Ping-Ke Shih
@ 2024-01-16 13:46 ` Zenm Chen
2024-01-19 17:31 ` Kalle Valo
3 siblings, 0 replies; 6+ messages in thread
From: Zenm Chen @ 2024-01-16 13:46 UTC (permalink / raw)
To: linux-wireless
Cc: martin.kaistra, Jes.Sorensen, bigeasy, kvalo, pkshih,
rtl8821cerfe2, zenmchen
>Hi Zenm,
>
>On Tue, 2024-01-16 at 10:50 +0100, Martin Kaistra wrote:
>>
>> Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
>> mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
>> It was missed to set this number for all variants except 8188f, which
>> caused rtl8xxxu_get_free_sec_cam() to always return 0.
>>
>> Fix it by adding the numbers for all variants. The values are taken from
>> the vendor drivers and rtlwifi.
>>
>> Fixes: b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP mode")
>> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
>>
>
> Could you please try if this patch can fix your problem?
>
Yes, my devices work fine now, thank you and Martin for fixing this!
devices tested: MERCUSYS MW300UM (RTL8192EU)
MERCURY MW310UH (RTL8192FU)
> Thanks
> Ping-Ke
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: wifi: rtl8xxxu: add missing number of sec cam entries for all variants
2024-01-16 9:50 [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants Martin Kaistra
` (2 preceding siblings ...)
2024-01-16 13:46 ` Zenm Chen
@ 2024-01-19 17:31 ` Kalle Valo
3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2024-01-19 17:31 UTC (permalink / raw)
To: Martin Kaistra
Cc: linux-wireless, Jes Sorensen, Ping-Ke Shih, Bitterblue Smith,
Sebastian Andrzej Siewior
Martin Kaistra <martin.kaistra@linutronix.de> wrote:
> Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
> mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
> It was missed to set this number for all variants except 8188f, which
> caused rtl8xxxu_get_free_sec_cam() to always return 0 and therefore breaking
> encrypted traffic.
>
> Fix it by adding the numbers for all variants. The values are taken from
> the vendor drivers and rtlwifi.
>
> Link: https://lore.kernel.org/linux-wireless/20240111163603.2325-1-zenmchen@gmail.com/
> Fixes: b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP mode")
> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
Patch applied to wireless-next.git, thanks.
563d5025cf3b wifi: rtl8xxxu: add missing number of sec cam entries for all variants
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240116095001.399500-1-martin.kaistra@linutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-19 17:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 9:50 [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all variants Martin Kaistra
2024-01-16 11:13 ` Kalle Valo
2024-01-16 11:28 ` Martin Kaistra
2024-01-16 11:49 ` Ping-Ke Shih
2024-01-16 13:46 ` Zenm Chen
2024-01-19 17:31 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).