9fba6befef53300b5fa19b5eff7df8aa889d39ae
[openwrt/staging/ansuel.git] /
1 From 563d5025cf3b51c7bf20e6966af433ed5f838875 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Tue, 16 Jan 2024 10:50:01 +0100
4 Subject: [PATCH] wifi: rtl8xxxu: add missing number of sec cam entries for all
5 variants
6
7 Commit b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP
8 mode") introduced max_sec_cam_num as a member of rtl8xxxu_fileops.
9 It was missed to set this number for all variants except 8188f, which
10 caused rtl8xxxu_get_free_sec_cam() to always return 0 and therefore breaking
11 encrypted traffic.
12
13 Fix it by adding the numbers for all variants. The values are taken from
14 the vendor drivers and rtlwifi.
15
16 Link: https://lore.kernel.org/linux-wireless/20240111163603.2325-1-zenmchen@gmail.com/
17 Fixes: b837f78fbffa ("wifi: rtl8xxxu: add hw crypto support for AP mode")
18 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
19 Signed-off-by: Kalle Valo <kvalo@kernel.org>
20 Link: https://msgid.link/20240116095001.399500-1-martin.kaistra@linutronix.de
21 ---
22 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 1 +
23 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 1 +
24 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
25 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c | 1 +
26 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c | 1 +
27 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 1 +
28 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 +
29 7 files changed, 7 insertions(+)
30
31 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
32 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
33 @@ -1882,6 +1882,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
34 .has_tx_report = 1,
35 .init_reg_pkt_life_time = 1,
36 .gen2_thermal_meter = 1,
37 + .max_sec_cam_num = 32,
38 .adda_1t_init = 0x0b1b25a0,
39 .adda_1t_path_on = 0x0bdb25a0,
40 /*
41 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
42 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
43 @@ -613,6 +613,7 @@ struct rtl8xxxu_fileops rtl8192cu_fops =
44 .rx_agg_buf_size = 16000,
45 .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
46 .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
47 + .max_sec_cam_num = 32,
48 .adda_1t_init = 0x0b1b25a0,
49 .adda_1t_path_on = 0x0bdb25a0,
50 .adda_2t_path_on_a = 0x04db25a4,
51 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
52 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
53 @@ -1769,6 +1769,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
54 .needs_full_init = 1,
55 .supports_ap = 1,
56 .max_macid_num = 128,
57 + .max_sec_cam_num = 64,
58 .adda_1t_init = 0x0fc01616,
59 .adda_1t_path_on = 0x0fc01616,
60 .adda_2t_path_on_a = 0x0fc01616,
61 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
62 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192f.c
63 @@ -2095,6 +2095,7 @@ struct rtl8xxxu_fileops rtl8192fu_fops =
64 .max_aggr_num = 0x1f1f,
65 .supports_ap = 1,
66 .max_macid_num = 128,
67 + .max_sec_cam_num = 64,
68 .trxff_boundary = 0x3f3f,
69 .pbp_rx = PBP_PAGE_SIZE_256,
70 .pbp_tx = PBP_PAGE_SIZE_256,
71 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c
72 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8710b.c
73 @@ -1877,6 +1877,7 @@ struct rtl8xxxu_fileops rtl8710bu_fops =
74 .max_aggr_num = 0x0c14,
75 .supports_ap = 1,
76 .max_macid_num = 16,
77 + .max_sec_cam_num = 32,
78 .adda_1t_init = 0x03c00016,
79 .adda_1t_path_on = 0x03c00016,
80 .trxff_boundary = 0x3f7f,
81 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
82 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c
83 @@ -510,6 +510,7 @@ struct rtl8xxxu_fileops rtl8723au_fops =
84 .rx_agg_buf_size = 16000,
85 .tx_desc_size = sizeof(struct rtl8xxxu_txdesc32),
86 .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc16),
87 + .max_sec_cam_num = 32,
88 .adda_1t_init = 0x0b1b25a0,
89 .adda_1t_path_on = 0x0bdb25a0,
90 .adda_2t_path_on_a = 0x04db25a4,
91 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
92 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
93 @@ -1744,6 +1744,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops =
94 .max_aggr_num = 0x0c14,
95 .supports_ap = 1,
96 .max_macid_num = 128,
97 + .max_sec_cam_num = 64,
98 .adda_1t_init = 0x01c00014,
99 .adda_1t_path_on = 0x01c00014,
100 .adda_2t_path_on_a = 0x01c00014,