diff options
author | Ernest Van Hoecke <ernest.vanhoecke@toradex.com> | 2025-03-28 18:17:25 +0100 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2025-04-02 11:26:33 +0000 |
commit | c294cfef162ef8fb18309edac757da85216d2a44 (patch) | |
tree | 510fb4741de36fb309d73535ead80aa0cba21489 | |
parent | 965dfc7a7f0d67efa38efd28fffb1c8ca600cf3b (diff) | |
download | meta-freescale-c294cfef162ef8fb18309edac757da85216d2a44.tar.gz |
kernel-module-nxp-wlan: Apply wireless patch
NXP released a patch for the MXM driver that is supposed to be applied
on top of the checked out branch. Among other things, this patch adds a
"MODULE_DEVICE_TABLE" which means the SDIO device driver is probed at
runtime, which will not happen without this patch.
Link: https://www.nxp.com/webapp/Download?colCode=Wireless-Patch-Release-IW612-W8997-W8801-v0.1&appType=license
Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
(cherry picked from commit 388a83026d24cfd8cb20899228e8f8e1fcb782a6)
-rw-r--r-- | recipes-kernel/kernel-modules/kernel-module-nxp-wlan/wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch | 1904 | ||||
-rw-r--r-- | recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb | 5 |
2 files changed, 1908 insertions, 1 deletions
diff --git a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch new file mode 100644 index 00000000..94a24db6 --- /dev/null +++ b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch | |||
@@ -0,0 +1,1904 @@ | |||
1 | diff --git a/Makefile b/Makefile | ||
2 | index 024e977..d61798e 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,6 +1,6 @@ | ||
6 | # File: Makefile | ||
7 | # | ||
8 | -# Copyright 2008-2024 NXP | ||
9 | +# Copyright 2008-2025 NXP | ||
10 | # | ||
11 | # This software file (the File) is distributed by NXP | ||
12 | # under the terms of the GNU General Public License Version 2, June 1991 | ||
13 | @@ -188,7 +188,7 @@ APPDIR= $(shell if test -d "mapp"; then echo mapp; fi) | ||
14 | ############################################################################# | ||
15 | |||
16 | ccflags-y += -I$(KERNELDIR)/include | ||
17 | - ccflags-y += -DMLAN_RELEASE_VERSION='"505.p4"' | ||
18 | + ccflags-y += -DMLAN_RELEASE_VERSION='"505.p7.1"' | ||
19 | |||
20 | ccflags-y += -DFPNUM='"92"' | ||
21 | |||
22 | diff --git a/mlan/mlan_cmdevt.c b/mlan/mlan_cmdevt.c | ||
23 | index 49c645e..dc0c8ba 100644 | ||
24 | --- a/mlan/mlan_cmdevt.c | ||
25 | +++ b/mlan/mlan_cmdevt.c | ||
26 | @@ -4,7 +4,7 @@ | ||
27 | * @brief This file contains the handling of CMD/EVENT in MLAN | ||
28 | * | ||
29 | * | ||
30 | - * Copyright 2009-2024 NXP | ||
31 | + * Copyright 2009-2025 NXP | ||
32 | * | ||
33 | * This software file (the File) is distributed by NXP | ||
34 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
35 | @@ -5272,6 +5272,17 @@ mlan_status wlan_adapter_init_cmd(pmlan_adapter pmadapter) | ||
36 | } | ||
37 | } | ||
38 | #endif | ||
39 | + if (pmpriv && (pmadapter->init_para.disable_11h_tpc)) { | ||
40 | + /* Send command to FW to disable 11h tpc */ | ||
41 | + ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_SNMP_MIB, | ||
42 | + HostCmd_ACT_GEN_SET, | ||
43 | + Dot11h_disable_tpc_i, MNULL, | ||
44 | + &pmadapter->init_para.disable_11h_tpc); | ||
45 | + if (ret) { | ||
46 | + ret = MLAN_STATUS_FAILURE; | ||
47 | + goto done; | ||
48 | + } | ||
49 | + } | ||
50 | #ifdef STA_SUPPORT | ||
51 | if (pmpriv_sta && (pmadapter->ps_mode == Wlan802_11PowerModePSP)) { | ||
52 | ret = wlan_prepare_cmd(pmpriv_sta, | ||
53 | diff --git a/mlan/mlan_decl.h b/mlan/mlan_decl.h | ||
54 | index d1367d6..97bc08f 100644 | ||
55 | --- a/mlan/mlan_decl.h | ||
56 | +++ b/mlan/mlan_decl.h | ||
57 | @@ -3,7 +3,7 @@ | ||
58 | * @brief This file declares the generic data structures and APIs. | ||
59 | * | ||
60 | * | ||
61 | - * Copyright 2008-2022, 2024 NXP | ||
62 | + * Copyright 2008-2022, 2025 NXP | ||
63 | * | ||
64 | * This software file (the File) is distributed by NXP | ||
65 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
66 | @@ -2782,6 +2782,7 @@ typedef struct _mlan_device { | ||
67 | t_u32 max_tx_pending; | ||
68 | t_u16 tx_budget; | ||
69 | t_u8 mclient_scheduling; | ||
70 | + t_u8 disable_11h_tpc; | ||
71 | } mlan_device, *pmlan_device; | ||
72 | |||
73 | /** MLAN API function prototype */ | ||
74 | diff --git a/mlan/mlan_fw.h b/mlan/mlan_fw.h | ||
75 | index 6ce0451..df8efa6 100644 | ||
76 | --- a/mlan/mlan_fw.h | ||
77 | +++ b/mlan/mlan_fw.h | ||
78 | @@ -5,7 +5,7 @@ | ||
79 | * in MLAN module. | ||
80 | * | ||
81 | * | ||
82 | - * Copyright 2008-2024 NXP | ||
83 | + * Copyright 2008-2025 NXP | ||
84 | * | ||
85 | * This software file (the File) is distributed by NXP | ||
86 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
87 | @@ -1674,11 +1674,14 @@ typedef MLAN_PACK_START struct _RxPD { | ||
88 | t_u32 rx_info; | ||
89 | |||
90 | /** Reserved */ | ||
91 | - t_u8 reserved3[8]; | ||
92 | + t_u8 reserved3[7]; | ||
93 | + t_u8 rx_pkt_flags; | ||
94 | t_u8 ta_mac[6]; | ||
95 | t_u8 reserved4[2]; | ||
96 | } MLAN_PACK_END RxPD, *PRxPD; | ||
97 | |||
98 | +#define RX_PKT_FLAG_MEF_MATCH_PKT MBIT(0) | ||
99 | + | ||
100 | /** IEEEtypes_FrameCtl_t*/ | ||
101 | #ifdef BIG_ENDIAN_SUPPORT | ||
102 | typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t { | ||
103 | @@ -3686,6 +3689,7 @@ typedef enum _SNMP_MIB_INDEX { | ||
104 | StopDeauth_i = 44, | ||
105 | Dot11H_fakeRadar = 45, | ||
106 | ChanTrackParam_i = 46, | ||
107 | + Dot11h_disable_tpc_i = 47, | ||
108 | } SNMP_MIB_INDEX; | ||
109 | |||
110 | /** max SNMP buf size */ | ||
111 | diff --git a/mlan/mlan_join.c b/mlan/mlan_join.c | ||
112 | index f4c8860..34fe4e7 100644 | ||
113 | --- a/mlan/mlan_join.c | ||
114 | +++ b/mlan/mlan_join.c | ||
115 | @@ -7,7 +7,7 @@ | ||
116 | * to the firmware. | ||
117 | * | ||
118 | * | ||
119 | - * Copyright 2008-2024 NXP | ||
120 | + * Copyright 2008-2025 NXP | ||
121 | * | ||
122 | * This software file (the File) is distributed by NXP | ||
123 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
124 | @@ -1046,6 +1046,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, | ||
125 | t_u32 rates_size; | ||
126 | t_u16 tmp_cap; | ||
127 | t_u8 *pos; | ||
128 | + IEEEtypes_CapInfo_t *pcap_info; | ||
129 | t_u8 ft_akm = 0; | ||
130 | t_u8 oper_class; | ||
131 | t_u8 oper_class_flag = MFALSE; | ||
132 | @@ -1524,6 +1525,11 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv, | ||
133 | memcpy_ext(pmadapter, &tmp_cap, &pbss_desc->cap_info, | ||
134 | sizeof(passo->cap_info), sizeof(tmp_cap)); | ||
135 | |||
136 | + /* retain spectrum_mgmt capability */ | ||
137 | + pcap_info = &passo->cap_info; | ||
138 | + if (pcap_info->spectrum_mgmt) | ||
139 | + SPECTRUM_MGMT_ENABLED(tmp_cap); | ||
140 | + | ||
141 | if (pmpriv->config_bands == BAND_B) | ||
142 | SHORT_SLOT_TIME_DISABLED(tmp_cap); | ||
143 | |||
144 | diff --git a/mlan/mlan_main.h b/mlan/mlan_main.h | ||
145 | index 2e41d37..258bd1f 100644 | ||
146 | --- a/mlan/mlan_main.h | ||
147 | +++ b/mlan/mlan_main.h | ||
148 | @@ -5,7 +5,7 @@ | ||
149 | * in MLAN module. | ||
150 | * | ||
151 | * | ||
152 | - * Copyright 2008-2024 NXP | ||
153 | + * Copyright 2008-2025 NXP | ||
154 | * | ||
155 | * This software file (the File) is distributed by NXP | ||
156 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
157 | @@ -2042,6 +2042,7 @@ typedef struct _mlan_init_para { | ||
158 | t_u16 tx_budget; | ||
159 | t_u8 mclient_scheduling; | ||
160 | t_u32 reject_addba_req; | ||
161 | + t_u8 disable_11h_tpc; | ||
162 | } mlan_init_para, *pmlan_init_para; | ||
163 | |||
164 | #ifdef SDIO | ||
165 | diff --git a/mlan/mlan_pcie.c b/mlan/mlan_pcie.c | ||
166 | index 3575a9a..c29fb6e 100644 | ||
167 | --- a/mlan/mlan_pcie.c | ||
168 | +++ b/mlan/mlan_pcie.c | ||
169 | @@ -3,7 +3,7 @@ | ||
170 | * @brief This file contains PCI-E specific code | ||
171 | * | ||
172 | * | ||
173 | - * Copyright 2008-2021, 2024 NXP | ||
174 | + * Copyright 2008-2021, 2025 NXP | ||
175 | * | ||
176 | * This software file (the File) is distributed by NXP | ||
177 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
178 | @@ -2134,6 +2134,8 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter) | ||
179 | ptx_bd_buf->flags = 0; | ||
180 | ptx_bd_buf->frag_len = 0; | ||
181 | ptx_bd_buf->offset = 0; | ||
182 | + pcb->moal_spin_lock(pmadapter->pmoal_handle, | ||
183 | + pmadapter->pmlan_pcie_lock); | ||
184 | pmadapter->pcard_pcie->txbd_rdptr++; | ||
185 | if ((pmadapter->pcard_pcie->txbd_rdptr & | ||
186 | txrx_rw_ptr_mask) == num_tx_buffs) | ||
187 | @@ -2141,6 +2143,8 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter) | ||
188 | ((pmadapter->pcard_pcie->txbd_rdptr & | ||
189 | txrx_rw_ptr_rollover_ind) ^ | ||
190 | txrx_rw_ptr_rollover_ind); | ||
191 | + pcb->moal_spin_unlock(pmadapter->pmoal_handle, | ||
192 | + pmadapter->pmlan_pcie_lock); | ||
193 | } | ||
194 | #endif | ||
195 | #if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEAW693) || \ | ||
196 | @@ -2154,9 +2158,13 @@ static mlan_status wlan_pcie_send_data_complete(mlan_adapter *pmadapter) | ||
197 | padma_bd_buf->flags = 0; | ||
198 | padma_bd_buf->pkt_size = 0; | ||
199 | padma_bd_buf->reserved = 0; | ||
200 | + pcb->moal_spin_lock(pmadapter->pmoal_handle, | ||
201 | + pmadapter->pmlan_pcie_lock); | ||
202 | pmadapter->pcard_pcie->txbd_rdptr++; | ||
203 | pmadapter->pcard_pcie->txbd_rdptr &= | ||
204 | ADMA_RW_PTR_WRAP_MASK; | ||
205 | + pcb->moal_spin_unlock(pmadapter->pmoal_handle, | ||
206 | + pmadapter->pmlan_pcie_lock); | ||
207 | } | ||
208 | #endif | ||
209 | } | ||
210 | diff --git a/mlan/mlan_shim.c b/mlan/mlan_shim.c | ||
211 | index 0752d7f..d27ab7e 100644 | ||
212 | --- a/mlan/mlan_shim.c | ||
213 | +++ b/mlan/mlan_shim.c | ||
214 | @@ -3,7 +3,7 @@ | ||
215 | * @brief This file contains APIs to MOAL module. | ||
216 | * | ||
217 | * | ||
218 | - * Copyright 2008-2021, 2024 NXP | ||
219 | + * Copyright 2008-2021, 2025 NXP | ||
220 | * | ||
221 | * This software file (the File) is distributed by NXP | ||
222 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
223 | @@ -474,6 +474,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter) | ||
224 | #endif | ||
225 | pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg; | ||
226 | pmadapter->init_para.dfs_offload = pmdevice->dfs_offload; | ||
227 | + pmadapter->init_para.disable_11h_tpc = pmdevice->disable_11h_tpc; | ||
228 | pmadapter->priv_num = 0; | ||
229 | pmadapter->priv[0] = MNULL; | ||
230 | |||
231 | diff --git a/mlan/mlan_sta_cmd.c b/mlan/mlan_sta_cmd.c | ||
232 | index 4dd1712..2e16779 100644 | ||
233 | --- a/mlan/mlan_sta_cmd.c | ||
234 | +++ b/mlan/mlan_sta_cmd.c | ||
235 | @@ -5,7 +5,7 @@ | ||
236 | * it is ready. | ||
237 | * | ||
238 | * | ||
239 | - * Copyright 2008-2024 NXP | ||
240 | + * Copyright 2008-2025 NXP | ||
241 | * | ||
242 | * This software file (the File) is distributed by NXP | ||
243 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
244 | @@ -242,6 +242,18 @@ static mlan_status wlan_cmd_802_11_snmp_mib(pmlan_private pmpriv, | ||
245 | cmd->size += sizeof(t_u16); | ||
246 | } | ||
247 | break; | ||
248 | + case Dot11h_disable_tpc_i: | ||
249 | + psnmp_mib->oid = wlan_cpu_to_le16((t_u16)Dot11h_disable_tpc_i); | ||
250 | + if (cmd_action == HostCmd_ACT_GEN_SET) { | ||
251 | + psnmp_mib->query_type = | ||
252 | + wlan_cpu_to_le16(HostCmd_ACT_GEN_SET); | ||
253 | + psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u16)); | ||
254 | + ul_temp = *(t_u32 *)pdata_buf; | ||
255 | + *((t_u16 *)(psnmp_mib->value)) = | ||
256 | + wlan_cpu_to_le16((t_u16)ul_temp); | ||
257 | + cmd->size += sizeof(t_u16); | ||
258 | + } | ||
259 | + break; | ||
260 | case WwsMode_i: | ||
261 | psnmp_mib->oid = wlan_cpu_to_le16((t_u16)WwsMode_i); | ||
262 | if (cmd_action == HostCmd_ACT_GEN_SET) { | ||
263 | diff --git a/mlan/mlan_sta_cmdresp.c b/mlan/mlan_sta_cmdresp.c | ||
264 | index 116506c..f88f91d 100644 | ||
265 | --- a/mlan/mlan_sta_cmdresp.c | ||
266 | +++ b/mlan/mlan_sta_cmdresp.c | ||
267 | @@ -4,7 +4,7 @@ | ||
268 | * responses generated by firmware. | ||
269 | * | ||
270 | * | ||
271 | - * Copyright 2008-2024 NXP | ||
272 | + * Copyright 2008-2025 NXP | ||
273 | * | ||
274 | * This software file (the File) is distributed by NXP | ||
275 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
276 | @@ -643,6 +643,13 @@ static mlan_status wlan_ret_802_11_snmp_mib(pmlan_private pmpriv, | ||
277 | (ul_temp & SLAVE_RADAR_DET_MASK) ? MTRUE : | ||
278 | MFALSE; | ||
279 | } | ||
280 | + /* Update state for 11h tpc disable */ | ||
281 | + if (oid == Dot11h_disable_tpc_i) { | ||
282 | + /* Set 11h tpc to private */ | ||
283 | + ul_temp = wlan_le16_to_cpu(*((t_u16 *)(psmib->value))); | ||
284 | + PRINTM(MCMND, "SNMP_RESP: Dot11h_disable_tpc_i =%u\n", | ||
285 | + ul_temp); | ||
286 | + } | ||
287 | } | ||
288 | |||
289 | if (pioctl_buf) { | ||
290 | diff --git a/mlan/mlan_uap_cmdevent.c b/mlan/mlan_uap_cmdevent.c | ||
291 | index 6c50db9..66c01c5 100644 | ||
292 | --- a/mlan/mlan_uap_cmdevent.c | ||
293 | +++ b/mlan/mlan_uap_cmdevent.c | ||
294 | @@ -3,7 +3,7 @@ | ||
295 | * @brief This file contains the handling of AP mode command and event | ||
296 | * | ||
297 | * | ||
298 | - * Copyright 2009-2024 NXP | ||
299 | + * Copyright 2009-2025 NXP | ||
300 | * | ||
301 | * This software file (the File) is distributed by NXP | ||
302 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
303 | @@ -3024,6 +3024,7 @@ static mlan_status wlan_uap_cmd_snmp_mib(pmlan_private pmpriv, | ||
304 | switch (cmd_oid) { | ||
305 | case Dot11D_i: | ||
306 | case Dot11H_i: | ||
307 | + case Dot11h_disable_tpc_i: | ||
308 | psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid); | ||
309 | psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u16)); | ||
310 | ul_temp = *(t_u32 *)pdata_buf; | ||
311 | diff --git a/mlan/mlan_wmm.c b/mlan/mlan_wmm.c | ||
312 | index 9a8083a..6da49ea 100644 | ||
313 | --- a/mlan/mlan_wmm.c | ||
314 | +++ b/mlan/mlan_wmm.c | ||
315 | @@ -3,7 +3,7 @@ | ||
316 | * @brief This file contains functions for WMM. | ||
317 | * | ||
318 | * | ||
319 | - * Copyright 2008-2021, 2024 NXP | ||
320 | + * Copyright 2008-2021, 2025 NXP | ||
321 | * | ||
322 | * This software file (the File) is distributed by NXP | ||
323 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
324 | @@ -840,11 +840,11 @@ static raListTbl *wlan_wmm_get_highest_priolist_ptr(pmlan_adapter pmadapter, | ||
325 | * | ||
326 | * @return byte budget | ||
327 | */ | ||
328 | -static t_u32 wlan_wmm_get_byte_budget(pmlan_adapter pmadapter, t_u32 time_budget_us, t_u32 phy_rate_kbps) | ||
329 | +static t_u32 wlan_wmm_get_byte_budget(t_u32 time_budget_us, t_u32 phy_rate_kbps) | ||
330 | { | ||
331 | const t_u32 min_budget = MV_ETH_FRAME_LEN; | ||
332 | - t_u64 byte_budget = pmadapter->callbacks.moal_do_div((t_u64)phy_rate_kbps * time_budget_us, | ||
333 | - 8 * 1000u); | ||
334 | + t_u64 byte_budget = | ||
335 | + ((t_u64)phy_rate_kbps * time_budget_us) / (8 * 1000u); | ||
336 | |||
337 | if (byte_budget > INT_MAX) | ||
338 | return INT_MAX; | ||
339 | @@ -891,7 +891,7 @@ wlan_wmm_allocate_sta_table(pmlan_adapter pmadapter, t_u8 *ra) | ||
340 | |||
341 | sta_table->budget.time_budget_init_us = pmadapter->init_para.tx_budget; | ||
342 | sta_table->budget.byte_budget_init = wlan_wmm_get_byte_budget( | ||
343 | - pmadapter, sta_table->budget.time_budget_init_us, default_rate); | ||
344 | + sta_table->budget.time_budget_init_us, default_rate); | ||
345 | sta_table->budget.queue_packets = default_queue_packets; | ||
346 | sta_table->budget.phy_rate_kbps = default_rate; | ||
347 | |||
348 | @@ -900,14 +900,14 @@ wlan_wmm_allocate_sta_table(pmlan_adapter pmadapter, t_u8 *ra) | ||
349 | sta_table->budget.mpdu_no_amsdu_pps_cap = | ||
350 | pmadapter->tx_mpdu_no_amsdu_pps; | ||
351 | |||
352 | - sta_table->budget.mpdu_with_amsdu_budget_init = pmadapter->callbacks.moal_do_div( | ||
353 | - (t_u64)sta_table->budget.mpdu_with_amsdu_pps_cap * | ||
354 | - sta_table->budget.time_budget_init_us, | ||
355 | - 1000000); | ||
356 | - sta_table->budget.mpdu_no_amsdu_budget_init = pmadapter->callbacks.moal_do_div( | ||
357 | - (t_u64)sta_table->budget.mpdu_no_amsdu_pps_cap * | ||
358 | - sta_table->budget.time_budget_init_us, | ||
359 | - 1000000); | ||
360 | + sta_table->budget.mpdu_with_amsdu_budget_init = | ||
361 | + ((t_u64)sta_table->budget.mpdu_with_amsdu_pps_cap * | ||
362 | + sta_table->budget.time_budget_init_us) / | ||
363 | + 1000000; | ||
364 | + sta_table->budget.mpdu_no_amsdu_budget_init = | ||
365 | + ((t_u64)sta_table->budget.mpdu_no_amsdu_pps_cap * | ||
366 | + sta_table->budget.time_budget_init_us) / | ||
367 | + 1000000; | ||
368 | |||
369 | for (i = 0; i < NELEMENTS(sta_table->budget.bytes); ++i) { | ||
370 | sta_table->budget.bytes[i] = sta_table->budget.byte_budget_init; | ||
371 | @@ -3142,12 +3142,12 @@ static t_void wlan_wmm_update_queue_packets_budget(pmlan_adapter pmadapter, | ||
372 | list_entry, struct wmm_sta_table, active_sta_entry); | ||
373 | const t_u64 sta_capacity = sta->budget.byte_budget_init; | ||
374 | const t_u32 max_pkts_by_airtime = | ||
375 | - wlan_wmm_get_byte_budget(pmadapter, max_pending_tx_time_us, | ||
376 | + wlan_wmm_get_byte_budget(max_pending_tx_time_us, | ||
377 | sta->budget.phy_rate_kbps) / | ||
378 | MV_ETH_FRAME_LEN; | ||
379 | - t_u32 sta_share = pmadapter->callbacks.moal_do_div((t_u64)queue_packets_limit * sta_capacity, | ||
380 | - total_capacity); | ||
381 | |||
382 | + t_u32 sta_share = | ||
383 | + queue_packets_limit * sta_capacity / total_capacity; | ||
384 | sta_share = MAX(sta_share, min_sta_share); | ||
385 | sta_share = MIN(sta_share, queue_packets_limit * 7 / 8); | ||
386 | sta_share = MIN(sta_share, max_pkts_by_airtime); | ||
387 | @@ -5183,7 +5183,6 @@ static void wlan_wmm_adjust_sta_tx_budget(pmlan_private priv, | ||
388 | struct wmm_sta_table *sta, | ||
389 | HostCmd_TX_RATE_QUERY *rate) | ||
390 | { | ||
391 | - mlan_adapter *pmadapter = priv->adapter; | ||
392 | const t_u8 ppdu_type_legacy = 0; | ||
393 | const t_u8 ppdu_type_ht = 1; | ||
394 | const t_u8 ppdu_type_vht = 2; | ||
395 | @@ -5211,7 +5210,7 @@ static void wlan_wmm_adjust_sta_tx_budget(pmlan_private priv, | ||
396 | if (phy_rate > 0) { | ||
397 | const t_u32 old_phy_rate = sta->budget.phy_rate_kbps; | ||
398 | sta->budget.byte_budget_init = wlan_wmm_get_byte_budget( | ||
399 | - pmadapter, sta->budget.time_budget_init_us, phy_rate); | ||
400 | + sta->budget.time_budget_init_us, phy_rate); | ||
401 | sta->budget.phy_rate_kbps = phy_rate; | ||
402 | |||
403 | if (old_phy_rate / phy_rate >= 2 || | ||
404 | diff --git a/mlinux/mlan_decl.h b/mlinux/mlan_decl.h | ||
405 | index d1367d6..97bc08f 100644 | ||
406 | --- a/mlinux/mlan_decl.h | ||
407 | +++ b/mlinux/mlan_decl.h | ||
408 | @@ -3,7 +3,7 @@ | ||
409 | * @brief This file declares the generic data structures and APIs. | ||
410 | * | ||
411 | * | ||
412 | - * Copyright 2008-2022, 2024 NXP | ||
413 | + * Copyright 2008-2022, 2025 NXP | ||
414 | * | ||
415 | * This software file (the File) is distributed by NXP | ||
416 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
417 | @@ -2782,6 +2782,7 @@ typedef struct _mlan_device { | ||
418 | t_u32 max_tx_pending; | ||
419 | t_u16 tx_budget; | ||
420 | t_u8 mclient_scheduling; | ||
421 | + t_u8 disable_11h_tpc; | ||
422 | } mlan_device, *pmlan_device; | ||
423 | |||
424 | /** MLAN API function prototype */ | ||
425 | diff --git a/mlinux/moal_cfg80211.c b/mlinux/moal_cfg80211.c | ||
426 | index 074fd59..0e54436 100644 | ||
427 | --- a/mlinux/moal_cfg80211.c | ||
428 | +++ b/mlinux/moal_cfg80211.c | ||
429 | @@ -3,7 +3,7 @@ | ||
430 | * @brief This file contains the functions for CFG80211. | ||
431 | * | ||
432 | * | ||
433 | - * Copyright 2011-2024 NXP | ||
434 | + * Copyright 2011-2025 NXP | ||
435 | * | ||
436 | * This software file (the File) is distributed by NXP | ||
437 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
438 | @@ -1105,10 +1105,7 @@ void woal_cancel_cac(moal_private *priv) | ||
439 | if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) | ||
440 | PRINTM(MERROR, "%s: cancel chan report failed \n", | ||
441 | __func__); | ||
442 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
443 | - cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
444 | - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); | ||
445 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
446 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
447 | cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
448 | NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); | ||
449 | #else | ||
450 | @@ -1203,12 +1200,7 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, | ||
451 | PRINTM(MERROR, | ||
452 | "%s: cancel chan report failed \n", | ||
453 | __func__); | ||
454 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
455 | - cfg80211_cac_event(priv->netdev, | ||
456 | - &priv->phandle->dfs_channel, | ||
457 | - NL80211_RADAR_CAC_ABORTED, | ||
458 | - GFP_KERNEL, 0); | ||
459 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
460 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
461 | cfg80211_cac_event(priv->netdev, | ||
462 | &priv->phandle->dfs_channel, | ||
463 | NL80211_RADAR_CAC_ABORTED, | ||
464 | @@ -1322,8 +1314,8 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, | ||
465 | #endif /* WIFI_DIRECT_SUPPORT */ | ||
466 | #if defined(STA_SUPPORT) && defined(UAP_SUPPORT) | ||
467 | if (priv->bss_type == MLAN_BSS_TYPE_UAP) { | ||
468 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
469 | - IMX_ANDROID_12_BACKPORT) | ||
470 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
471 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
472 | woal_cfg80211_del_beacon(wiphy, dev, 0); | ||
473 | #else | ||
474 | woal_cfg80211_del_beacon(wiphy, dev); | ||
475 | @@ -1562,7 +1554,8 @@ fail: | ||
476 | */ | ||
477 | #endif | ||
478 | int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, | ||
479 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
480 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
481 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
482 | int link_id, | ||
483 | #endif | ||
484 | t_u8 key_index, | ||
485 | @@ -1638,7 +1631,8 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, | ||
486 | */ | ||
487 | #endif | ||
488 | int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, | ||
489 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
490 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
491 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
492 | int link_id, | ||
493 | #endif | ||
494 | t_u8 key_index, | ||
495 | @@ -1655,13 +1649,9 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, | ||
496 | LEAVE(); | ||
497 | return -EFAULT; | ||
498 | } | ||
499 | - /* del_key will be trigger from cfg80211_rx_mlme_mgmt funtion | ||
500 | - * where we receive deauth/disassoicate packet in rx_work | ||
501 | - * use MOAL_NO_WAIT to avoid dead lock | ||
502 | - */ | ||
503 | if (MLAN_STATUS_FAILURE == | ||
504 | woal_cfg80211_set_key(priv, 0, 0, NULL, 0, NULL, 0, key_index, | ||
505 | - mac_addr, 1, 0, MOAL_NO_WAIT)) { | ||
506 | + mac_addr, 1, 0, MOAL_IOCTL_WAIT)) { | ||
507 | PRINTM(MERROR, "Error deleting the crypto keys\n"); | ||
508 | LEAVE(); | ||
509 | return -EFAULT; | ||
510 | @@ -1697,7 +1687,8 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, | ||
511 | #endif | ||
512 | int woal_cfg80211_set_default_key(struct wiphy *wiphy, | ||
513 | struct net_device *netdev, | ||
514 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
515 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
516 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
517 | int link_id, | ||
518 | #endif | ||
519 | t_u8 key_index | ||
520 | @@ -1736,7 +1727,8 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, | ||
521 | #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE | ||
522 | int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, | ||
523 | struct net_device *netdev, | ||
524 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
525 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
526 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
527 | int link_id, | ||
528 | #endif | ||
529 | t_u8 key_index) | ||
530 | @@ -1750,7 +1742,8 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, | ||
531 | #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE | ||
532 | int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, | ||
533 | struct net_device *netdev, | ||
534 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
535 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
536 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
537 | int link_id, | ||
538 | #endif | ||
539 | t_u8 key_index) | ||
540 | @@ -2337,8 +2330,8 @@ done: | ||
541 | * @return 0 -- success, otherwise fail | ||
542 | */ | ||
543 | int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, | ||
544 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
545 | - IMX_ANDROID_12_BACKPORT) | ||
546 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
547 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
548 | unsigned int link_id, | ||
549 | #endif | ||
550 | const u8 *peer, | ||
551 | @@ -5484,11 +5477,11 @@ void woal_cfg80211_notify_channel(moal_private *priv, | ||
552 | CFG80211_VERSION_CODE < KERNEL_VERSION(6, 9, 0) | ||
553 | cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); | ||
554 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && \ | ||
555 | - IMX_ANDROID_13)) && \ | ||
556 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33))) && \ | ||
557 | CFG80211_VERSION_CODE < KERNEL_VERSION(6, 9, 0) | ||
558 | cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); | ||
559 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
560 | - IMX_ANDROID_13 || IMX_ANDROID_12_BACKPORT) | ||
561 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
562 | cfg80211_ch_switch_notify(priv->netdev, &chandef, 0); | ||
563 | #else | ||
564 | cfg80211_ch_switch_notify(priv->netdev, &chandef); | ||
565 | diff --git a/mlinux/moal_cfg80211.h b/mlinux/moal_cfg80211.h | ||
566 | index 3323055..1b8484b 100644 | ||
567 | --- a/mlinux/moal_cfg80211.h | ||
568 | +++ b/mlinux/moal_cfg80211.h | ||
569 | @@ -3,7 +3,7 @@ | ||
570 | * @brief This file contains the CFG80211 specific defines. | ||
571 | * | ||
572 | * | ||
573 | - * Copyright 2011-2022, 2024 NXP | ||
574 | + * Copyright 2011-2022, 2025 NXP | ||
575 | * | ||
576 | * This software file (the File) is distributed by NXP | ||
577 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
578 | @@ -133,7 +133,8 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, | ||
579 | int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed); | ||
580 | |||
581 | int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, | ||
582 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
583 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
584 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
585 | int link_id, | ||
586 | #endif | ||
587 | t_u8 key_index, | ||
588 | @@ -143,7 +144,8 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, | ||
589 | const t_u8 *mac_addr, struct key_params *params); | ||
590 | |||
591 | int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, | ||
592 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
593 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
594 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
595 | int link_id, | ||
596 | #endif | ||
597 | t_u8 key_index, | ||
598 | @@ -167,8 +169,8 @@ int woal_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev); | ||
599 | #endif | ||
600 | |||
601 | int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, | ||
602 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
603 | - IMX_ANDROID_12_BACKPORT) | ||
604 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
605 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
606 | unsigned int link_id, | ||
607 | #endif | ||
608 | const u8 *peer, | ||
609 | @@ -219,7 +221,8 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy, | ||
610 | |||
611 | #if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE | ||
612 | int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, | ||
613 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
614 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
615 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
616 | int link_id, | ||
617 | #endif | ||
618 | t_u8 key_index, bool ucast, bool mcast); | ||
619 | @@ -231,7 +234,8 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, | ||
620 | #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE | ||
621 | int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, | ||
622 | struct net_device *netdev, | ||
623 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
624 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
625 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
626 | int link_id, | ||
627 | #endif | ||
628 | t_u8 key_index); | ||
629 | @@ -240,7 +244,8 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, | ||
630 | #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE | ||
631 | int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, | ||
632 | struct net_device *netdev, | ||
633 | -#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13) | ||
634 | +#if ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || \ | ||
635 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33)) | ||
636 | int link_id, | ||
637 | #endif | ||
638 | t_u8 key_index); | ||
639 | @@ -453,8 +458,8 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, | ||
640 | struct beacon_parameters *params); | ||
641 | #endif | ||
642 | |||
643 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
644 | - IMX_ANDROID_12_BACKPORT) | ||
645 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
646 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
647 | int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, | ||
648 | unsigned int link_id); | ||
649 | #else | ||
650 | @@ -472,12 +477,7 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, | ||
651 | #endif | ||
652 | |||
653 | #if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE | ||
654 | -#if KERNEL_VERSION(6, 12, 0) <= CFG80211_VERSION_CODE | ||
655 | -int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, | ||
656 | - struct net_device *dev, | ||
657 | - struct cfg80211_chan_def *chandef, | ||
658 | - u32 cac_time_msi, int link_id); | ||
659 | -#elif KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE | ||
660 | +#if KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE | ||
661 | int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, | ||
662 | struct net_device *dev, | ||
663 | struct cfg80211_chan_def *chandef, | ||
664 | diff --git a/mlinux/moal_init.c b/mlinux/moal_init.c | ||
665 | index f790666..845d272 100644 | ||
666 | --- a/mlinux/moal_init.c | ||
667 | +++ b/mlinux/moal_init.c | ||
668 | @@ -4,7 +4,7 @@ | ||
669 | * driver. | ||
670 | * | ||
671 | * | ||
672 | - * Copyright 2018-2022, 2024 NXP | ||
673 | + * Copyright 2018-2022, 2025 NXP | ||
674 | * | ||
675 | * This software file (the File) is distributed by NXP | ||
676 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
677 | @@ -336,6 +336,9 @@ static int mon_filter = DEFAULT_NETMON_FILTER; | ||
678 | |||
679 | int dual_nb; | ||
680 | |||
681 | +/** disable 802.11h tpc configuration */ | ||
682 | +static int disable_11h_tpc = 0; | ||
683 | + | ||
684 | #ifdef DEBUG_LEVEL1 | ||
685 | #ifdef DEBUG_LEVEL2 | ||
686 | #define DEFAULT_DEBUG_MASK (0xffffffff) | ||
687 | @@ -1597,6 +1600,14 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size, | ||
688 | params->reject_addba_req = out_data; | ||
689 | PRINTM(MMSG, "reject_addba_req=%x\n", | ||
690 | params->reject_addba_req); | ||
691 | + } else if (strncmp(line, "disable_11h_tpc", | ||
692 | + strlen("disable_11h_tpc")) == 0) { | ||
693 | + if (parse_line_read_int(line, &out_data) != | ||
694 | + MLAN_STATUS_SUCCESS) | ||
695 | + goto err; | ||
696 | + params->disable_11h_tpc = out_data; | ||
697 | + PRINTM(MMSG, "disable_11h_tpc=%x\n", | ||
698 | + params->disable_11h_tpc); | ||
699 | } | ||
700 | } | ||
701 | |||
702 | @@ -2000,6 +2011,13 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params) | ||
703 | handle->params.dual_nb = dual_nb; | ||
704 | if (params) | ||
705 | handle->params.dual_nb = params->dual_nb; | ||
706 | + | ||
707 | + handle->params.disable_11h_tpc = disable_11h_tpc; | ||
708 | + /* Ignore country IE when 11h tpc is disabled */ | ||
709 | + if (disable_11h_tpc) | ||
710 | + moal_extflg_set(handle, EXT_COUNTRY_IE_IGNORE); | ||
711 | + if (params) | ||
712 | + handle->params.disable_11h_tpc = params->disable_11h_tpc; | ||
713 | } | ||
714 | |||
715 | /** | ||
716 | @@ -2568,6 +2586,12 @@ void woal_init_from_dev_tree(void) | ||
717 | data); | ||
718 | reject_addba_req = data; | ||
719 | } | ||
720 | + } else if (!strncmp(prop->name, "disable_11h_tpc", | ||
721 | + strlen("disable_11h_tpc"))) { | ||
722 | + if (!of_property_read_u32(dt_node, prop->name, &data)) { | ||
723 | + PRINTM(MERROR, "disable_11h_tpc=0x%x\n", data); | ||
724 | + disable_11h_tpc = data; | ||
725 | + } | ||
726 | } | ||
727 | #if defined(STA_CFG80211) || defined(UAP_CFG80211) | ||
728 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
729 | @@ -3187,3 +3211,7 @@ module_param(reject_addba_req, int, 0); | ||
730 | MODULE_PARM_DESC( | ||
731 | reject_addba_req, | ||
732 | "Bit1: Reject the addba request when FW auto re-connect enabled (STA BSS only); Bit0: Reject the addba request when HS activated"); | ||
733 | + | ||
734 | +module_param(disable_11h_tpc, int, 0); | ||
735 | +MODULE_PARM_DESC(disable_11h_tpc, | ||
736 | + "0: Enable 802.11h tpc; 1: Disable 802.11h tpc"); | ||
737 | diff --git a/mlinux/moal_ioctl.c b/mlinux/moal_ioctl.c | ||
738 | index 94b8b2a..49711ea 100644 | ||
739 | --- a/mlinux/moal_ioctl.c | ||
740 | +++ b/mlinux/moal_ioctl.c | ||
741 | @@ -3,7 +3,7 @@ | ||
742 | * @brief This file contains ioctl function to MLAN | ||
743 | * | ||
744 | * | ||
745 | - * Copyright 2008-2024 NXP | ||
746 | + * Copyright 2008-2025 NXP | ||
747 | * | ||
748 | * This software file (the File) is distributed by NXP | ||
749 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
750 | @@ -6101,13 +6101,19 @@ mlan_status woal_cancel_scan(moal_private *priv, t_u8 wait_option) | ||
751 | #ifdef STA_CFG80211 | ||
752 | unsigned long flags; | ||
753 | #endif | ||
754 | + | ||
755 | +#ifdef STA_CFG80211 | ||
756 | + // cancel scan timeout | ||
757 | + if (IS_STA_CFG80211(handle->params.cfg80211_wext) && | ||
758 | + handle->scan_request) | ||
759 | + cancel_delayed_work(&handle->scan_timeout_work); | ||
760 | +#endif | ||
761 | /* If scan is in process, cancel the scan command */ | ||
762 | if (!handle->scan_pending_on_block || !scan_priv) { | ||
763 | #ifdef STA_CFG80211 | ||
764 | spin_lock_irqsave(&handle->scan_req_lock, flags); | ||
765 | if (IS_STA_CFG80211(handle->params.cfg80211_wext) && | ||
766 | handle->scan_request) { | ||
767 | - cancel_delayed_work(&handle->scan_timeout_work); | ||
768 | /* some supplicant cannot handle SCAN abort event */ | ||
769 | if (scan_priv && | ||
770 | (scan_priv->bss_type == MLAN_BSS_TYPE_STA)) | ||
771 | @@ -6138,7 +6144,6 @@ mlan_status woal_cancel_scan(moal_private *priv, t_u8 wait_option) | ||
772 | spin_lock_irqsave(&handle->scan_req_lock, flags); | ||
773 | if (IS_STA_CFG80211(handle->params.cfg80211_wext) && | ||
774 | handle->scan_request) { | ||
775 | - cancel_delayed_work(&handle->scan_timeout_work); | ||
776 | /** some supplicant can not handle SCAN abort event */ | ||
777 | if (scan_priv->bss_type == MLAN_BSS_TYPE_STA) | ||
778 | woal_cfg80211_scan_done(handle->scan_request, MTRUE); | ||
779 | diff --git a/mlinux/moal_main.c b/mlinux/moal_main.c | ||
780 | index e7f3242..a478a2c 100644 | ||
781 | --- a/mlinux/moal_main.c | ||
782 | +++ b/mlinux/moal_main.c | ||
783 | @@ -4,7 +4,7 @@ | ||
784 | * driver. | ||
785 | * | ||
786 | * | ||
787 | - * Copyright 2008-2024 NXP | ||
788 | + * Copyright 2008-2025 NXP | ||
789 | * | ||
790 | * This software file (the File) is distributed by NXP | ||
791 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
792 | @@ -174,6 +174,7 @@ static struct _card_info card_info_SD8887 = { | ||
793 | .fw_reset_val = 1, | ||
794 | .fw_wakeup_reg = 0, | ||
795 | .fw_wakeup_val = 2, | ||
796 | + .fw_winner_status_reg = 0x90, | ||
797 | .slew_rate_reg = 0x80002328, | ||
798 | .slew_rate_bit_offset = 12, | ||
799 | #endif | ||
800 | @@ -214,6 +215,7 @@ static struct _card_info card_info_SD8897 = { | ||
801 | .fw_reset_val = 1, | ||
802 | .fw_wakeup_reg = 0, | ||
803 | .fw_wakeup_val = 2, | ||
804 | + .fw_winner_status_reg = 0xC0, | ||
805 | .slew_rate_reg = 0x80002328, | ||
806 | .slew_rate_bit_offset = 12, | ||
807 | #endif | ||
808 | @@ -299,6 +301,7 @@ static struct _card_info card_info_SD8977 = { | ||
809 | .fw_reset_val = 0x99, | ||
810 | .fw_wakeup_reg = 0, | ||
811 | .fw_wakeup_val = 2, | ||
812 | + .fw_winner_status_reg = 0xFC, | ||
813 | .slew_rate_reg = 0x80002328, | ||
814 | .slew_rate_bit_offset = 12, | ||
815 | #endif | ||
816 | @@ -342,6 +345,7 @@ static struct _card_info card_info_SD8978 = { | ||
817 | .fw_reset_val = 0x99, | ||
818 | .fw_wakeup_reg = 0, | ||
819 | .fw_wakeup_val = 2, | ||
820 | + .fw_winner_status_reg = 0xFC, | ||
821 | .slew_rate_reg = 0x80002328, | ||
822 | .slew_rate_bit_offset = 12, | ||
823 | #endif | ||
824 | @@ -385,6 +389,7 @@ static struct _card_info card_info_SD8997 = { | ||
825 | .fw_reset_val = 0x99, | ||
826 | .fw_wakeup_reg = 0, | ||
827 | .fw_wakeup_val = 2, | ||
828 | + .fw_winner_status_reg = 0xFC, | ||
829 | .slew_rate_reg = 0x80002328, | ||
830 | .slew_rate_bit_offset = 12, | ||
831 | #endif | ||
832 | @@ -429,6 +434,7 @@ static struct _card_info card_info_SD9098 = { | ||
833 | .fw_reset_val = 0x99, | ||
834 | .fw_wakeup_reg = 0, | ||
835 | .fw_wakeup_val = 2, | ||
836 | + .fw_winner_status_reg = 0xFC, | ||
837 | .slew_rate_reg = 0x90002328, | ||
838 | .slew_rate_bit_offset = 12, | ||
839 | #endif | ||
840 | @@ -473,6 +479,7 @@ static struct _card_info card_info_SD9097 = { | ||
841 | .fw_reset_val = 0x99, | ||
842 | .fw_wakeup_reg = 0, | ||
843 | .fw_wakeup_val = 2, | ||
844 | + .fw_winner_status_reg = 0xFC, | ||
845 | .slew_rate_reg = 0x90002328, | ||
846 | .slew_rate_bit_offset = 12, | ||
847 | #endif | ||
848 | @@ -517,6 +524,7 @@ static struct _card_info card_info_SDIW624 = { | ||
849 | .fw_reset_val = 0x99, | ||
850 | .fw_wakeup_reg = 0, | ||
851 | .fw_wakeup_val = 2, | ||
852 | + .fw_winner_status_reg = 0xFC, | ||
853 | .slew_rate_reg = 0x90002328, | ||
854 | .slew_rate_bit_offset = 12, | ||
855 | #endif | ||
856 | @@ -561,6 +569,7 @@ static struct _card_info card_info_SDAW693 = { | ||
857 | .fw_reset_val = 0x99, | ||
858 | .fw_wakeup_reg = 0, | ||
859 | .fw_wakeup_val = 2, | ||
860 | + .fw_winner_status_reg = 0xFC, | ||
861 | .slew_rate_reg = 0x90002328, | ||
862 | .slew_rate_bit_offset = 12, | ||
863 | #endif | ||
864 | @@ -605,6 +614,7 @@ static struct _card_info card_info_SD9177 = { | ||
865 | .fw_reset_val = 0x99, | ||
866 | .fw_wakeup_reg = 0, | ||
867 | .fw_wakeup_val = 2, | ||
868 | + .fw_winner_status_reg = 0xFC, | ||
869 | .slew_rate_reg = 0x90002328, | ||
870 | .slew_rate_bit_offset = 12, | ||
871 | #endif | ||
872 | @@ -649,6 +659,7 @@ static struct _card_info card_info_SDIW610 = { | ||
873 | .fw_reset_val = 0x99, | ||
874 | .fw_wakeup_reg = 0, | ||
875 | .fw_wakeup_val = 2, | ||
876 | + .fw_winner_status_reg = 0xFC, | ||
877 | .slew_rate_reg = 0x45001064, | ||
878 | .slew_rate_bit_offset = 16, | ||
879 | #endif | ||
880 | @@ -976,6 +987,7 @@ static struct _card_info card_info_SD8987 = { | ||
881 | .fw_reset_val = 0x99, | ||
882 | .fw_wakeup_reg = 0, | ||
883 | .fw_wakeup_val = 2, | ||
884 | + .fw_winner_status_reg = 0xFC, | ||
885 | .slew_rate_reg = 0x80002328, | ||
886 | .slew_rate_bit_offset = 12, | ||
887 | #endif | ||
888 | @@ -989,8 +1001,7 @@ static struct _card_info card_info_SD8987 = { | ||
889 | |||
890 | /** Driver version */ | ||
891 | char driver_version[] = | ||
892 | - INTF_CARDTYPE KERN_VERSION "--" MLAN_RELEASE_VERSION "-GPL" | ||
893 | - "-(" | ||
894 | + INTF_CARDTYPE KERN_VERSION "--" MLAN_RELEASE_VERSION "-(" | ||
895 | "FP" FPNUM ")" | ||
896 | #ifdef DEBUG_LEVEL2 | ||
897 | "-dbg" | ||
898 | @@ -1224,11 +1235,7 @@ void woal_clean_up(moal_handle *handle) | ||
899 | handle->cac_period = MFALSE; | ||
900 | priv = handle->priv[handle->cac_bss_index]; | ||
901 | if (priv) { | ||
902 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
903 | - cfg80211_cac_event(priv->netdev, &handle->dfs_channel, | ||
904 | - NL80211_RADAR_CAC_ABORTED, | ||
905 | - GFP_KERNEL, 0); | ||
906 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
907 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
908 | cfg80211_cac_event(priv->netdev, &handle->dfs_channel, | ||
909 | NL80211_RADAR_CAC_ABORTED, | ||
910 | GFP_KERNEL); | ||
911 | @@ -1259,8 +1266,8 @@ void woal_clean_up(moal_handle *handle) | ||
912 | #ifdef STA_CFG80211 | ||
913 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) | ||
914 | if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && | ||
915 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
916 | - IMX_ANDROID_12_BACKPORT) | ||
917 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
918 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
919 | priv->wdev->connected) { | ||
920 | #else | ||
921 | priv->wdev->current_bss) { | ||
922 | @@ -1305,6 +1312,92 @@ void woal_clean_up(moal_handle *handle) | ||
923 | return; | ||
924 | } | ||
925 | |||
926 | +/** | ||
927 | + * @brief This function send the auto recovery failure event to userspace using | ||
928 | + * netlink | ||
929 | + * | ||
930 | + * @param handle Pointer to structure moal_handle | ||
931 | + * | ||
932 | + * @return N/A | ||
933 | + */ | ||
934 | +void woal_send_auto_recovery_failure_event(moal_handle *handle) | ||
935 | +{ | ||
936 | + mlan_status ret = MLAN_STATUS_SUCCESS; | ||
937 | + struct sk_buff *skb = NULL; | ||
938 | + struct nlmsghdr *nlh = NULL; | ||
939 | + struct sock *sk = handle->nl_sk; | ||
940 | + int len = strlen(CUS_EVT_FW_RECOVER_FAIL); | ||
941 | + ENTER(); | ||
942 | + | ||
943 | + /* interface name to be prepended to event */ | ||
944 | + /* NL_MAX_PAYLOAD = 3 * 1024 */ | ||
945 | + if ((len + IFNAMSIZ) > NL_MAX_PAYLOAD) { | ||
946 | + PRINTM(MERROR, "event size is too big, len=%d\n", (int)len); | ||
947 | + ret = MLAN_STATUS_FAILURE; | ||
948 | + goto done; | ||
949 | + } | ||
950 | + if (sk) { | ||
951 | + /* Allocate skb */ | ||
952 | + skb = alloc_skb(NLMSG_SPACE(NL_MAX_PAYLOAD), GFP_ATOMIC); | ||
953 | + if (!skb) { | ||
954 | + PRINTM(MERROR, "Could not allocate skb for netlink\n"); | ||
955 | + ret = MLAN_STATUS_FAILURE; | ||
956 | + goto done; | ||
957 | + } | ||
958 | + memset(skb->data, 0, NLMSG_SPACE(NL_MAX_PAYLOAD)); | ||
959 | + | ||
960 | + nlh = (struct nlmsghdr *)skb->data; | ||
961 | + nlh->nlmsg_len = NLMSG_SPACE(len + IFNAMSIZ); | ||
962 | + | ||
963 | + /* From kernel */ | ||
964 | + nlh->nlmsg_pid = 0; | ||
965 | + nlh->nlmsg_flags = 0; | ||
966 | + | ||
967 | + /* Data */ | ||
968 | + skb_put(skb, nlh->nlmsg_len); | ||
969 | + moal_memcpy_ext(handle, NLMSG_DATA(nlh), "wlan", sizeof("wlan"), | ||
970 | + nlh->nlmsg_len - NLMSG_LENGTH(0)); | ||
971 | + | ||
972 | + moal_memcpy_ext(handle, ((t_u8 *)(NLMSG_DATA(nlh))) + IFNAMSIZ, | ||
973 | + CUS_EVT_FW_RECOVER_FAIL, len, | ||
974 | + nlh->nlmsg_len - NLMSG_LENGTH(IFNAMSIZ)); | ||
975 | + | ||
976 | + /* From Kernel */ | ||
977 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) | ||
978 | + NETLINK_CB(skb).pid = 0; | ||
979 | +#else | ||
980 | + NETLINK_CB(skb).portid = 0; | ||
981 | +#endif | ||
982 | + | ||
983 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) | ||
984 | + /* Multicast message */ | ||
985 | + NETLINK_CB(skb).dst_pid = 0; | ||
986 | +#endif | ||
987 | + | ||
988 | + /* Multicast group number */ | ||
989 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) | ||
990 | + NETLINK_CB(skb).dst_groups = NL_MULTICAST_GROUP; | ||
991 | +#else | ||
992 | + NETLINK_CB(skb).dst_group = NL_MULTICAST_GROUP; | ||
993 | +#endif | ||
994 | + | ||
995 | + /* Send message */ | ||
996 | + ret = netlink_broadcast(sk, skb, 0, NL_MULTICAST_GROUP, | ||
997 | + GFP_ATOMIC); | ||
998 | + if (ret) { | ||
999 | + PRINTM(MWARN, "netlink_broadcast failed: ret=%d\n", | ||
1000 | + ret); | ||
1001 | + goto done; | ||
1002 | + } | ||
1003 | + | ||
1004 | + } else { | ||
1005 | + PRINTM(MERROR, | ||
1006 | + "Could not send event through NETLINK. Link down.\n"); | ||
1007 | + } | ||
1008 | +done: | ||
1009 | + LEAVE(); | ||
1010 | +} | ||
1011 | + | ||
1012 | /** | ||
1013 | * @brief This function send the auto recovery complete event to kernel | ||
1014 | * | ||
1015 | @@ -1412,8 +1505,8 @@ static void woal_hang_work_queue(struct work_struct *work) | ||
1016 | #ifdef STA_CFG80211 | ||
1017 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) | ||
1018 | if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && | ||
1019 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1020 | - IMX_ANDROID_12_BACKPORT) | ||
1021 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1022 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1023 | priv->wdev->connected) { | ||
1024 | #else | ||
1025 | priv->wdev->current_bss) { | ||
1026 | @@ -2603,6 +2696,7 @@ mlan_status woal_init_sw(moal_handle *handle) | ||
1027 | handle->rtt_capa.responder_supported = MTRUE; | ||
1028 | handle->rtt_capa.mc_version = 60; | ||
1029 | handle->is_edmac_enabled = MFALSE; | ||
1030 | + handle->driver_init = MFALSE; | ||
1031 | |||
1032 | /* Register to MLAN */ | ||
1033 | memset(&device, 0, sizeof(mlan_device)); | ||
1034 | @@ -2716,6 +2810,7 @@ mlan_status woal_init_sw(moal_handle *handle) | ||
1035 | device.dmcs = handle->params.dmcs; | ||
1036 | device.pref_dbc = handle->params.pref_dbc; | ||
1037 | device.reject_addba_req = handle->params.reject_addba_req; | ||
1038 | + device.disable_11h_tpc = (t_u32)handle->params.disable_11h_tpc; | ||
1039 | |||
1040 | for (i = 0; i < handle->drv_mode.intf_num; i++) { | ||
1041 | device.bss_attr[i].bss_type = | ||
1042 | @@ -4274,6 +4369,15 @@ err: | ||
1043 | #ifdef CONFIG_PROC_FS | ||
1044 | woal_proc_exit(handle); | ||
1045 | #endif | ||
1046 | + | ||
1047 | +#if defined(STA_CFG80211) || defined(UAP_CFG80211) | ||
1048 | + if (handle->wiphy) { | ||
1049 | + wiphy_unregister(handle->wiphy); | ||
1050 | + woal_cfg80211_free_bands(handle->wiphy); | ||
1051 | + wiphy_free(handle->wiphy); | ||
1052 | + handle->wiphy = NULL; | ||
1053 | + } | ||
1054 | +#endif | ||
1055 | } | ||
1056 | LEAVE(); | ||
1057 | return ret; | ||
1058 | @@ -4770,6 +4874,7 @@ static mlan_status woal_request_fw_dpc(moal_handle *handle, | ||
1059 | if (ret) | ||
1060 | goto done; | ||
1061 | |||
1062 | + handle->driver_init = MTRUE; | ||
1063 | done: | ||
1064 | /* We should hold the semaphore until callback finishes execution */ | ||
1065 | MOAL_REL_SEMAPHORE(&AddRemoveCardSem); | ||
1066 | @@ -4910,6 +5015,9 @@ mlan_status woal_init_fw(moal_handle *handle) | ||
1067 | ret = woal_add_card_dpc(handle); | ||
1068 | if (ret) | ||
1069 | goto done; | ||
1070 | + | ||
1071 | + handle->driver_init = MTRUE; | ||
1072 | + | ||
1073 | /* Release semaphore if download is not required */ | ||
1074 | MOAL_REL_SEMAPHORE(&AddRemoveCardSem); | ||
1075 | done: | ||
1076 | @@ -6653,8 +6761,8 @@ int woal_close(struct net_device *dev) | ||
1077 | woal_cancel_scan(priv, MOAL_IOCTL_WAIT); | ||
1078 | |||
1079 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) | ||
1080 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1081 | - IMX_ANDROID_12_BACKPORT) | ||
1082 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1083 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1084 | if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev && | ||
1085 | priv->wdev->connected) { | ||
1086 | #else | ||
1087 | @@ -10391,8 +10499,8 @@ t_void woal_send_disconnect_to_system(moal_private *priv, | ||
1088 | if (IS_STA_CFG80211(cfg80211_wext)) { | ||
1089 | spin_lock_irqsave(&priv->connect_lock, flags); | ||
1090 | if (!priv->cfg_disconnect && !priv->cfg_connect && priv->wdev && | ||
1091 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1092 | - IMX_ANDROID_12_BACKPORT) | ||
1093 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1094 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1095 | priv->wdev->connected) { | ||
1096 | #else | ||
1097 | priv->wdev->current_bss) { | ||
1098 | @@ -12222,7 +12330,9 @@ t_void woal_scan_timeout_handler(struct work_struct *work) | ||
1099 | woal_inform_bss_from_scan_result(priv, NULL, | ||
1100 | MOAL_NO_WAIT); | ||
1101 | spin_lock_irqsave(&handle->scan_req_lock, flags); | ||
1102 | - woal_cfg80211_scan_done(handle->scan_request, MFALSE); | ||
1103 | + if (handle->scan_request) | ||
1104 | + woal_cfg80211_scan_done(handle->scan_request, | ||
1105 | + MFALSE); | ||
1106 | handle->scan_request = NULL; | ||
1107 | handle->fake_scan_complete = MFALSE; | ||
1108 | spin_unlock_irqrestore(&handle->scan_req_lock, flags); | ||
1109 | @@ -14035,6 +14145,13 @@ int woal_request_fw_reload(moal_handle *phandle, t_u8 mode) | ||
1110 | moal_handle *ref_handle = NULL; | ||
1111 | |||
1112 | ENTER(); | ||
1113 | + | ||
1114 | + if (!handle->driver_init) { | ||
1115 | + PRINTM(MMSG, "Ignore fw reload, driver not initialized\n"); | ||
1116 | + LEAVE(); | ||
1117 | + return -EFAULT; | ||
1118 | + } | ||
1119 | + | ||
1120 | wifi_status = WIFI_STATUS_FW_RELOAD; | ||
1121 | #ifdef PCIE | ||
1122 | if (mode == FW_RELOAD_PCIE_RESET) { | ||
1123 | @@ -14710,4 +14827,3 @@ MODULE_DESCRIPTION("M-WLAN Driver"); | ||
1124 | MODULE_AUTHOR("NXP"); | ||
1125 | MODULE_VERSION(MLAN_RELEASE_VERSION); | ||
1126 | MODULE_LICENSE("GPL"); | ||
1127 | -MODULE_LICENSE("GPL"); | ||
1128 | diff --git a/mlinux/moal_main.h b/mlinux/moal_main.h | ||
1129 | index 6d87dcf..f8941c7 100644 | ||
1130 | --- a/mlinux/moal_main.h | ||
1131 | +++ b/mlinux/moal_main.h | ||
1132 | @@ -3,7 +3,7 @@ | ||
1133 | * @brief This file contains wlan driver specific defines etc. | ||
1134 | * | ||
1135 | * | ||
1136 | - * Copyright 2008-2024 NXP | ||
1137 | + * Copyright 2008-2025 NXP | ||
1138 | * | ||
1139 | * This software file (the File) is distributed by NXP | ||
1140 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1141 | @@ -408,6 +408,7 @@ typedef enum _MOAL_HARDWARE_STATUS { | ||
1142 | #define WIFI_STATUS_SCAN_TIMEOUT 8 | ||
1143 | #define WIFI_STATUS_FW_DUMP 9 | ||
1144 | #define WIFI_STATUS_FW_RELOAD 10 | ||
1145 | +#define WIFI_STATUS_FW_RECOVERY_FAIL 11 | ||
1146 | |||
1147 | /** fw cap info 11p */ | ||
1148 | #define FW_CAPINFO_80211P MBIT(24) | ||
1149 | @@ -2124,6 +2125,7 @@ typedef struct _card_info { | ||
1150 | t_u8 func1_reg_end; | ||
1151 | t_u32 slew_rate_reg; | ||
1152 | t_u8 slew_rate_bit_offset; | ||
1153 | + t_u32 fw_winner_status_reg; | ||
1154 | #endif | ||
1155 | #if defined(SDIO) || defined(PCIE) | ||
1156 | t_u32 fw_stuck_code_reg; | ||
1157 | @@ -2724,6 +2726,8 @@ typedef struct _moal_mod_para { | ||
1158 | int dual_nb; | ||
1159 | /* reject addba req config for HS or FW Auto-reconnect */ | ||
1160 | t_u32 reject_addba_req; | ||
1161 | + /** disable_11h_tpc setting */ | ||
1162 | + int disable_11h_tpc; | ||
1163 | } moal_mod_para; | ||
1164 | |||
1165 | void woal_tp_acnt_timer_func(void *context); | ||
1166 | @@ -3265,6 +3269,7 @@ struct _moal_handle { | ||
1167 | #endif | ||
1168 | t_u32 ips_ctrl; | ||
1169 | BOOLEAN is_edmac_enabled; | ||
1170 | + bool driver_init; | ||
1171 | }; | ||
1172 | |||
1173 | /** | ||
1174 | @@ -4330,6 +4335,7 @@ moal_private *woal_add_interface(moal_handle *handle, t_u8 bss_num, | ||
1175 | t_u8 bss_type); | ||
1176 | void woal_clean_up(moal_handle *handle); | ||
1177 | void woal_send_auto_recovery_complete_event(moal_handle *handle); | ||
1178 | +void woal_send_auto_recovery_failure_event(moal_handle *handle); | ||
1179 | void woal_remove_interface(moal_handle *handle, t_u8 bss_index); | ||
1180 | void woal_set_multicast_list(struct net_device *dev); | ||
1181 | mlan_status woal_request_fw(moal_handle *handle); | ||
1182 | diff --git a/mlinux/moal_pcie.c b/mlinux/moal_pcie.c | ||
1183 | index 9034124..f3e8b8c 100644 | ||
1184 | --- a/mlinux/moal_pcie.c | ||
1185 | +++ b/mlinux/moal_pcie.c | ||
1186 | @@ -4,7 +4,7 @@ | ||
1187 | * related functions. | ||
1188 | * | ||
1189 | * | ||
1190 | - * Copyright 2008-2022, 2024 NXP | ||
1191 | + * Copyright 2008-2022, 2025 NXP | ||
1192 | * | ||
1193 | * This software file (the File) is distributed by NXP | ||
1194 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1195 | @@ -153,6 +153,8 @@ static const struct pci_device_id wlan_ids[] = { | ||
1196 | /* moal interface ops */ | ||
1197 | static moal_if_ops pcie_ops; | ||
1198 | |||
1199 | +MODULE_DEVICE_TABLE(pci, wlan_ids); | ||
1200 | + | ||
1201 | /******************************************************** | ||
1202 | Global Variables | ||
1203 | ********************************************************/ | ||
1204 | @@ -2547,8 +2549,10 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle) | ||
1205 | moal_private *priv = NULL; | ||
1206 | #ifdef DUMP_TO_PROC | ||
1207 | if (phandle->fw_dump_buf) { | ||
1208 | - PRINTM(MERROR, "FW dump already exist\n"); | ||
1209 | - return; | ||
1210 | + PRINTM(MMSG, "FW dump already exist, free existing dump\n"); | ||
1211 | + moal_vfree(phandle, phandle->fw_dump_buf); | ||
1212 | + phandle->fw_dump_buf = NULL; | ||
1213 | + phandle->fw_dump_len = 0; | ||
1214 | } | ||
1215 | #endif | ||
1216 | mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE); | ||
1217 | diff --git a/mlinux/moal_sdio_mmc.c b/mlinux/moal_sdio_mmc.c | ||
1218 | index 299829e..44a09f0 100644 | ||
1219 | --- a/mlinux/moal_sdio_mmc.c | ||
1220 | +++ b/mlinux/moal_sdio_mmc.c | ||
1221 | @@ -4,7 +4,7 @@ | ||
1222 | * related functions. | ||
1223 | * | ||
1224 | * | ||
1225 | - * Copyright 2008-2022, 2024 NXP | ||
1226 | + * Copyright 2008-2022, 2025 NXP | ||
1227 | * | ||
1228 | * This software file (the File) is distributed by NXP | ||
1229 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1230 | @@ -165,6 +165,8 @@ static const struct sdio_device_id wlan_ids[] = { | ||
1231 | {}, | ||
1232 | }; | ||
1233 | |||
1234 | +MODULE_DEVICE_TABLE(sdio, wlan_ids); | ||
1235 | + | ||
1236 | int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id); | ||
1237 | void woal_sdio_remove(struct sdio_func *func); | ||
1238 | static void woal_sdiommc_work(struct work_struct *work); | ||
1239 | @@ -281,7 +283,7 @@ static void woal_sdio_interrupt(struct sdio_func *func) | ||
1240 | moal_handle *handle; | ||
1241 | sdio_mmc_card *card; | ||
1242 | mlan_status status; | ||
1243 | - | ||
1244 | + t_u32 host_int_status_reg_val; | ||
1245 | ENTER(); | ||
1246 | |||
1247 | card = sdio_get_drvdata(func); | ||
1248 | @@ -301,6 +303,14 @@ static void woal_sdio_interrupt(struct sdio_func *func) | ||
1249 | PRINTM(MINFO, "*** IN SDIO IRQ ***\n"); | ||
1250 | PRINTM(MINTR, "*\n"); | ||
1251 | |||
1252 | + if (handle->fw_reseting == MTRUE && (!handle->pmlan_adapter)) { | ||
1253 | + handle->ops.read_reg(handle, 0x0c, &host_int_status_reg_val); | ||
1254 | + PRINTM(MERROR, | ||
1255 | + "*** Recv intr during fw reset, host int status reg value is %d, ignore it ***\n", | ||
1256 | + host_int_status_reg_val); | ||
1257 | + LEAVE(); | ||
1258 | + return; | ||
1259 | + } | ||
1260 | /* call mlan_interrupt to read int status */ | ||
1261 | status = mlan_interrupt(0, handle->pmlan_adapter); | ||
1262 | if (status == MLAN_STATUS_FAILURE) { | ||
1263 | @@ -3092,8 +3102,10 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle) | ||
1264 | } | ||
1265 | #ifdef DUMP_TO_PROC | ||
1266 | if (phandle->fw_dump_buf) { | ||
1267 | - PRINTM(MERROR, "FW dump already exist\n"); | ||
1268 | - return; | ||
1269 | + PRINTM(MMSG, "FW dump already exist, free existing dump\n"); | ||
1270 | + moal_vfree(phandle, phandle->fw_dump_buf); | ||
1271 | + phandle->fw_dump_buf = NULL; | ||
1272 | + phandle->fw_dump_len = 0; | ||
1273 | } | ||
1274 | #endif | ||
1275 | /** cancel all pending commands */ | ||
1276 | @@ -3298,6 +3310,30 @@ void woal_sdio_reset_hw(moal_handle *handle) | ||
1277 | return; | ||
1278 | } | ||
1279 | |||
1280 | +/** | ||
1281 | + * @brief This function check fw winner status | ||
1282 | + * | ||
1283 | + * @param handle A pointer to moal_handle structure | ||
1284 | + * | ||
1285 | + * @return 1--success, otherwise failure | ||
1286 | + */ | ||
1287 | +static BOOLEAN woal_sdiommc_check_winner_status(moal_handle *handle) | ||
1288 | +{ | ||
1289 | + t_u32 value = 1; | ||
1290 | + t_u32 winner_status_reg = handle->card_info->fw_winner_status_reg; | ||
1291 | + | ||
1292 | + ENTER(); | ||
1293 | +#ifdef SD8801 | ||
1294 | + if (IS_SD8801(handle->card_type)) { | ||
1295 | + LEAVE(); | ||
1296 | + return MTRUE; | ||
1297 | + } | ||
1298 | +#endif | ||
1299 | + handle->ops.read_reg(handle, winner_status_reg, &value); | ||
1300 | + LEAVE(); | ||
1301 | + return (value == 0); | ||
1302 | +} | ||
1303 | + | ||
1304 | /** | ||
1305 | * @brief This function reload fw | ||
1306 | * | ||
1307 | @@ -3322,8 +3358,7 @@ static int woal_sdiommc_reset_fw(moal_handle *handle) | ||
1308 | ret = -EFAULT; | ||
1309 | goto done; | ||
1310 | } | ||
1311 | - udelay(2000); | ||
1312 | - udelay(2000); | ||
1313 | + udelay(4000); | ||
1314 | /** wait SOC fully wake up */ | ||
1315 | for (tries = 0; tries < MAX_POLL_TRIES; ++tries) { | ||
1316 | ret = handle->ops.write_reg(handle, reset_reg, 0xba); | ||
1317 | @@ -3364,6 +3399,13 @@ static int woal_sdiommc_reset_fw(moal_handle *handle) | ||
1318 | reset_reg, value); | ||
1319 | ret = -EFAULT; | ||
1320 | goto done; | ||
1321 | + } else { | ||
1322 | + for (tries = 0; tries < 1000; ++tries) { | ||
1323 | + if (woal_sdiommc_check_winner_status(handle)) { | ||
1324 | + break; | ||
1325 | + } | ||
1326 | + udelay(1000); | ||
1327 | + } | ||
1328 | } | ||
1329 | PRINTM(MMSG, "SDIO Trigger FW In-band Reset success"); | ||
1330 | done: | ||
1331 | @@ -3609,13 +3651,19 @@ static void woal_sdiommc_work(struct work_struct *work) | ||
1332 | } | ||
1333 | if (woal_sdiommc_reset_fw(handle)) { | ||
1334 | PRINTM(MERROR, "SDIO In-band Reset Fail\n"); | ||
1335 | - goto done; | ||
1336 | + woal_send_auto_recovery_failure_event(handle); | ||
1337 | + wifi_status = WIFI_STATUS_FW_RECOVERY_FAIL; | ||
1338 | + return; | ||
1339 | } | ||
1340 | + | ||
1341 | handle->surprise_removed = MFALSE; | ||
1342 | if (MLAN_STATUS_SUCCESS == woal_do_sdiommc_flr(handle, false, true)) | ||
1343 | handle->fw_reseting = MFALSE; | ||
1344 | - else | ||
1345 | + else { | ||
1346 | handle = NULL; | ||
1347 | + wifi_status = WIFI_STATUS_FW_RECOVERY_FAIL; | ||
1348 | + return; | ||
1349 | + } | ||
1350 | |||
1351 | if (ref_handle) { | ||
1352 | ref_handle->surprise_removed = MFALSE; | ||
1353 | @@ -3624,7 +3672,6 @@ static void woal_sdiommc_work(struct work_struct *work) | ||
1354 | ref_handle->fw_reseting = MFALSE; | ||
1355 | } | ||
1356 | card->work_flags = MFALSE; | ||
1357 | -done: | ||
1358 | wifi_status = WIFI_STATUS_OK; | ||
1359 | if (handle) | ||
1360 | woal_send_auto_recovery_complete_event(handle); | ||
1361 | diff --git a/mlinux/moal_shim.c b/mlinux/moal_shim.c | ||
1362 | index 992e6ac..514aa95 100644 | ||
1363 | --- a/mlinux/moal_shim.c | ||
1364 | +++ b/mlinux/moal_shim.c | ||
1365 | @@ -3,7 +3,7 @@ | ||
1366 | * @brief This file contains the callback functions registered to MLAN | ||
1367 | * | ||
1368 | * | ||
1369 | - * Copyright 2008-2024 NXP | ||
1370 | + * Copyright 2008-2025 NXP | ||
1371 | * | ||
1372 | * This software file (the File) is distributed by NXP | ||
1373 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1374 | @@ -3734,12 +3734,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1375 | &priv->phandle->cac_timer); | ||
1376 | priv->phandle->is_cac_timer_set = MFALSE; | ||
1377 | if (radar_detected) { | ||
1378 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1379 | - cfg80211_cac_event(priv->netdev, | ||
1380 | - &priv->phandle->dfs_channel, | ||
1381 | - NL80211_RADAR_CAC_ABORTED, | ||
1382 | - GFP_KERNEL, 0); | ||
1383 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1384 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1385 | cfg80211_cac_event(priv->netdev, | ||
1386 | &priv->phandle->dfs_channel, | ||
1387 | NL80211_RADAR_CAC_ABORTED, | ||
1388 | @@ -3761,19 +3756,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1389 | // WARN_ON(!time_after_eq(jiffies, | ||
1390 | // timeout)); mdelay(100); Using | ||
1391 | // optimized delay | ||
1392 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1393 | - timeout = | ||
1394 | - (priv->wdev->links[0].cac_start_time + | ||
1395 | - msecs_to_jiffies( | ||
1396 | - priv->wdev | ||
1397 | - ->links[0].cac_time_ms)); | ||
1398 | -#else | ||
1399 | timeout = | ||
1400 | (priv->wdev->cac_start_time + | ||
1401 | msecs_to_jiffies( | ||
1402 | priv->wdev | ||
1403 | ->cac_time_ms)); | ||
1404 | -#endif | ||
1405 | if (!time_after_eq(jiffies, timeout)) { | ||
1406 | /* Exact time to make host and | ||
1407 | * device timer in sync */ | ||
1408 | @@ -3790,12 +3777,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1409 | } | ||
1410 | #endif | ||
1411 | |||
1412 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1413 | - cfg80211_cac_event(priv->netdev, | ||
1414 | - &priv->phandle->dfs_channel, | ||
1415 | - NL80211_RADAR_CAC_FINISHED, | ||
1416 | - GFP_KERNEL, 0); | ||
1417 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1418 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1419 | cfg80211_cac_event(priv->netdev, | ||
1420 | &priv->phandle->dfs_channel, | ||
1421 | NL80211_RADAR_CAC_FINISHED, | ||
1422 | @@ -3873,12 +3855,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1423 | woal_11h_cancel_chan_report_ioctl(priv, | ||
1424 | MOAL_NO_WAIT); | ||
1425 | /* upstream: inform cfg80211 */ | ||
1426 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1427 | - cfg80211_cac_event(priv->netdev, | ||
1428 | - &priv->phandle->dfs_channel, | ||
1429 | - NL80211_RADAR_CAC_ABORTED, | ||
1430 | - GFP_KERNEL, 0); | ||
1431 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1432 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1433 | cfg80211_cac_event(priv->netdev, | ||
1434 | &priv->phandle->dfs_channel, | ||
1435 | NL80211_RADAR_CAC_ABORTED, | ||
1436 | @@ -3980,8 +3957,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1437 | || priv->uap_host_based | ||
1438 | #endif | ||
1439 | #ifdef STA_CFG80211 | ||
1440 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1441 | - IMX_ANDROID_12_BACKPORT) | ||
1442 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1443 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1444 | || priv->wdev->connected | ||
1445 | #else | ||
1446 | || priv->wdev->current_bss | ||
1447 | @@ -4132,12 +4109,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1448 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, | ||
1449 | 0); | ||
1450 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && \ | ||
1451 | - IMX_ANDROID_13)) && \ | ||
1452 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33))) && \ | ||
1453 | CFG80211_VERSION_CODE < KERNEL_VERSION(6, 9, 0) | ||
1454 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, | ||
1455 | 0); | ||
1456 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1457 | - IMX_ANDROID_13 || IMX_ANDROID_12_BACKPORT) | ||
1458 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1459 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); | ||
1460 | #else | ||
1461 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan); | ||
1462 | @@ -4486,8 +4463,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1463 | PRINTM(MEVENT, | ||
1464 | "HostMlme %s: Receive deauth/disassociate\n", | ||
1465 | priv->netdev->name); | ||
1466 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1467 | - IMX_ANDROID_12_BACKPORT) | ||
1468 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1469 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1470 | if (!priv->wdev->connected) { | ||
1471 | #else | ||
1472 | if (!priv->wdev->current_bss) { | ||
1473 | @@ -4919,8 +4896,8 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) | ||
1474 | roam_info = | ||
1475 | kzalloc(sizeof(struct cfg80211_roam_info), GFP_ATOMIC); | ||
1476 | if (roam_info) { | ||
1477 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13 || \ | ||
1478 | - IMX_ANDROID_12_BACKPORT) | ||
1479 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1480 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1481 | roam_info->links[0].bssid = priv->cfg_bssid; | ||
1482 | #else | ||
1483 | roam_info->bssid = priv->cfg_bssid; | ||
1484 | diff --git a/mlinux/moal_sta_cfg80211.c b/mlinux/moal_sta_cfg80211.c | ||
1485 | index 3883433..f30134c 100644 | ||
1486 | --- a/mlinux/moal_sta_cfg80211.c | ||
1487 | +++ b/mlinux/moal_sta_cfg80211.c | ||
1488 | @@ -3,7 +3,7 @@ | ||
1489 | * @brief This file contains the functions for STA CFG80211. | ||
1490 | * | ||
1491 | * | ||
1492 | - * Copyright 2011-2024 NXP | ||
1493 | + * Copyright 2011-2025 NXP | ||
1494 | * | ||
1495 | * This software file (the File) is distributed by NXP | ||
1496 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1497 | @@ -135,8 +135,8 @@ static int woal_cfg80211_dump_survey(struct wiphy *wiphy, | ||
1498 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
1499 | static int woal_cfg80211_get_channel(struct wiphy *wiphy, | ||
1500 | struct wireless_dev *wdev, | ||
1501 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1502 | - IMX_ANDROID_12_BACKPORT) | ||
1503 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1504 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1505 | unsigned int link_id, | ||
1506 | #endif | ||
1507 | struct cfg80211_chan_def *chandef); | ||
1508 | @@ -2841,7 +2841,9 @@ void woal_host_mlme_process_assoc_timeout(moal_private *priv, | ||
1509 | struct cfg80211_bss *bss) | ||
1510 | { | ||
1511 | /* Send Assoc Failure with Timeout to CFG80211 */ | ||
1512 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) | ||
1513 | +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || \ | ||
1514 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33 && \ | ||
1515 | + CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 74))) | ||
1516 | struct cfg80211_assoc_failure data; | ||
1517 | memset(&data, 0, sizeof(struct cfg80211_assoc_failure)); | ||
1518 | data.timeout = 1; | ||
1519 | @@ -2877,7 +2879,8 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv, | ||
1520 | struct cfg80211_rx_assoc_resp_data resp = { | ||
1521 | .uapsd_queues = -1, | ||
1522 | }; | ||
1523 | -#elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1524 | +#elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1525 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1526 | struct cfg80211_rx_assoc_resp resp = { | ||
1527 | .uapsd_queues = -1, | ||
1528 | }; | ||
1529 | @@ -2950,7 +2953,8 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv, | ||
1530 | } | ||
1531 | } | ||
1532 | |||
1533 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1534 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1535 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1536 | resp.links[0].bss = bss; | ||
1537 | resp.buf = assoc_info->assoc_resp_buf; | ||
1538 | resp.len = assoc_info->assoc_resp_len; | ||
1539 | @@ -5021,7 +5025,9 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, | ||
1540 | if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) | ||
1541 | scan_req->chan_list[num_chans].scan_time = | ||
1542 | INIT_PASSIVE_SCAN_CHAN_TIME; | ||
1543 | - else if (priv->bss_type == MLAN_BSS_TYPE_STA) { | ||
1544 | + else if (priv->bss_type == MLAN_BSS_TYPE_STA && | ||
1545 | + scan_req->chan_list[num_chans].scan_type == | ||
1546 | + MLAN_SCAN_TYPE_PASSIVE) { | ||
1547 | /* | ||
1548 | * Set passive scan time to 110ms to discover | ||
1549 | * all nearby AP's, Current 40ms passive scan | ||
1550 | @@ -5034,20 +5040,17 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, | ||
1551 | * 1. STA is in connected state | ||
1552 | * 2. Scan type is passive | ||
1553 | */ | ||
1554 | - if (scan_req->chan_list[num_chans].scan_type == | ||
1555 | - MLAN_SCAN_TYPE_PASSIVE) | ||
1556 | - scan_req->chan_list[num_chans] | ||
1557 | - .scan_time = | ||
1558 | - PASSIVE_SCAN_CHAN_TIME; | ||
1559 | - } else | ||
1560 | + scan_req->chan_list[num_chans].scan_time = | ||
1561 | + PASSIVE_SCAN_CHAN_TIME; | ||
1562 | + } else { | ||
1563 | scan_req->chan_list[num_chans].scan_time = MIN( | ||
1564 | MIN_SPECIFIC_SCAN_CHAN_TIME, | ||
1565 | scan_cfg.scan_time.specific_scan_time); | ||
1566 | + } | ||
1567 | } | ||
1568 | #endif | ||
1569 | #ifdef UAP_CFG80211 | ||
1570 | if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) { | ||
1571 | - scan_req->scan_chan_gap = 0; | ||
1572 | if (!woal_is_uap_scan_result_expired(priv)) | ||
1573 | scan_req->chan_list[num_chans].scan_time = | ||
1574 | MIN_SPECIFIC_SCAN_CHAN_TIME; | ||
1575 | @@ -5850,8 +5853,8 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, | ||
1576 | if (priv->media_connected == MFALSE) { | ||
1577 | PRINTM(MMSG, " Already disconnected\n"); | ||
1578 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) | ||
1579 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1580 | - IMX_ANDROID_12_BACKPORT) | ||
1581 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1582 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1583 | if (priv->wdev->connected && | ||
1584 | #else | ||
1585 | if (priv->wdev->current_bss && | ||
1586 | @@ -6205,8 +6208,8 @@ done: | ||
1587 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) | ||
1588 | static int woal_cfg80211_get_channel(struct wiphy *wiphy, | ||
1589 | struct wireless_dev *wdev, | ||
1590 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1591 | - IMX_ANDROID_12_BACKPORT) | ||
1592 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1593 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1594 | unsigned int link_id, | ||
1595 | #endif | ||
1596 | struct cfg80211_chan_def *chandef) | ||
1597 | @@ -9277,8 +9280,8 @@ int woal_cfg80211_update_ft_ies(struct wiphy *wiphy, struct net_device *dev, | ||
1598 | passoc_rsp = (IEEEtypes_AssocRsp_t *) | ||
1599 | assoc_rsp->assoc_resp_buf; | ||
1600 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) | ||
1601 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13 || \ | ||
1602 | - IMX_ANDROID_14 || IMX_ANDROID_12_BACKPORT) | ||
1603 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1604 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1605 | roam_info.links[0].bssid = priv->cfg_bssid; | ||
1606 | #else | ||
1607 | roam_info.bssid = priv->cfg_bssid; | ||
1608 | @@ -9757,8 +9760,8 @@ void woal_start_roaming(moal_private *priv) | ||
1609 | } | ||
1610 | #endif | ||
1611 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) | ||
1612 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13 || \ | ||
1613 | - IMX_ANDROID_14 || IMX_ANDROID_12_BACKPORT) | ||
1614 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1615 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1616 | roam_info.links[0].bssid = priv->cfg_bssid; | ||
1617 | #else | ||
1618 | roam_info.bssid = priv->cfg_bssid; | ||
1619 | @@ -9839,7 +9842,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1620 | if (params->ext_capab_len) | ||
1621 | req_len += sizeof(MrvlIEtypesHeader_t) + params->ext_capab_len; | ||
1622 | #endif | ||
1623 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1624 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1625 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1626 | if (params->link_sta_params.supported_rates_len) | ||
1627 | req_len += sizeof(MrvlIEtypesHeader_t) + | ||
1628 | params->link_sta_params.supported_rates_len; | ||
1629 | @@ -9850,14 +9854,16 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1630 | #endif | ||
1631 | if (params->uapsd_queues || params->max_sp) | ||
1632 | req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(qosinfo); | ||
1633 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1634 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1635 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1636 | if (params->link_sta_params.ht_capa) | ||
1637 | #else | ||
1638 | if (params->ht_capa) | ||
1639 | #endif | ||
1640 | req_len += sizeof(MrvlIEtypesHeader_t) + | ||
1641 | sizeof(struct ieee80211_ht_cap); | ||
1642 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1643 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1644 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1645 | if (params->link_sta_params.vht_capa) | ||
1646 | #else | ||
1647 | if (params->vht_capa) | ||
1648 | @@ -9865,7 +9871,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1649 | req_len += sizeof(MrvlIEtypesHeader_t) + | ||
1650 | sizeof(struct ieee80211_vht_cap); | ||
1651 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1652 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1653 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1654 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1655 | if (params->link_sta_params.opmode_notif_used) | ||
1656 | req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(u8); | ||
1657 | #else | ||
1658 | @@ -9875,7 +9882,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1659 | #endif | ||
1660 | |||
1661 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) | ||
1662 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1663 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1664 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1665 | if (params->link_sta_params.he_capa_len) | ||
1666 | req_len += sizeof(MrvlExtIEtypesHeader_t) + | ||
1667 | params->link_sta_params.he_capa_len; | ||
1668 | @@ -9931,20 +9939,23 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1669 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1670 | } | ||
1671 | #endif | ||
1672 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1673 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1674 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1675 | if (params->link_sta_params.supported_rates_len) { | ||
1676 | #else | ||
1677 | if (params->supported_rates_len) { | ||
1678 | #endif | ||
1679 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1680 | tlv->header.type = SUPPORTED_RATES; | ||
1681 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1682 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1683 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1684 | tlv->header.len = params->link_sta_params.supported_rates_len; | ||
1685 | #else | ||
1686 | tlv->header.len = params->supported_rates_len; | ||
1687 | #endif | ||
1688 | moal_memcpy_ext(priv->phandle, tlv->data, | ||
1689 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1690 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1691 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1692 | params->link_sta_params.supported_rates, | ||
1693 | tlv->header.len, | ||
1694 | #else | ||
1695 | @@ -9968,7 +9979,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1696 | sizeof(MrvlIEtypesHeader_t) + tlv->header.len; | ||
1697 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1698 | } | ||
1699 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1700 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1701 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1702 | if (params->link_sta_params.ht_capa) { | ||
1703 | #else | ||
1704 | if (params->ht_capa) { | ||
1705 | @@ -9976,7 +9988,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1706 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1707 | tlv->header.type = HT_CAPABILITY; | ||
1708 | tlv->header.len = sizeof(struct ieee80211_ht_cap); | ||
1709 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1710 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1711 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1712 | moal_memcpy_ext(priv->phandle, tlv->data, | ||
1713 | params->link_sta_params.ht_capa, | ||
1714 | #else | ||
1715 | @@ -9988,7 +10001,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1716 | sizeof(MrvlIEtypesHeader_t) + tlv->header.len; | ||
1717 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1718 | } | ||
1719 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1720 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1721 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1722 | if (params->link_sta_params.vht_capa) { | ||
1723 | #else | ||
1724 | if (params->vht_capa) { | ||
1725 | @@ -9996,7 +10010,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1726 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1727 | tlv->header.type = VHT_CAPABILITY; | ||
1728 | tlv->header.len = sizeof(struct ieee80211_vht_cap); | ||
1729 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1730 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1731 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1732 | moal_memcpy_ext(priv->phandle, tlv->data, | ||
1733 | params->link_sta_params.vht_capa, | ||
1734 | #else | ||
1735 | @@ -10009,7 +10024,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1736 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1737 | } | ||
1738 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1739 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1740 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1741 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1742 | if (params->link_sta_params.opmode_notif_used) { | ||
1743 | #else | ||
1744 | if (params->opmode_notif_used) { | ||
1745 | @@ -10017,7 +10033,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1746 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1747 | tlv->header.type = OPER_MODE_NTF; | ||
1748 | tlv->header.len = sizeof(u8); | ||
1749 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1750 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1751 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1752 | moal_memcpy_ext(priv->phandle, tlv->data, | ||
1753 | ¶ms->link_sta_params.opmode_notif, | ||
1754 | #else | ||
1755 | @@ -10030,7 +10047,8 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev, | ||
1756 | tlv = (MrvlIEtypes_Data_t *)pos; | ||
1757 | } | ||
1758 | #endif | ||
1759 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_14) | ||
1760 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || \ | ||
1761 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 34)) | ||
1762 | if (params->link_sta_params.he_capa_len) { | ||
1763 | ext_tlv = (MrvlExtIEtypes_Data_t *)pos; | ||
1764 | ext_tlv->header.type = EXTENSION; | ||
1765 | diff --git a/mlinux/moal_uap_cfg80211.c b/mlinux/moal_uap_cfg80211.c | ||
1766 | index 6c40a10..95aaaad 100644 | ||
1767 | --- a/mlinux/moal_uap_cfg80211.c | ||
1768 | +++ b/mlinux/moal_uap_cfg80211.c | ||
1769 | @@ -3,7 +3,7 @@ | ||
1770 | * @brief This file contains the functions for uAP CFG80211. | ||
1771 | * | ||
1772 | * | ||
1773 | - * Copyright 2011-2024 NXP | ||
1774 | + * Copyright 2011-2025 NXP | ||
1775 | * | ||
1776 | * This software file (the File) is distributed by NXP | ||
1777 | * under the terms of the GNU General Public License Version 2, June 1991 | ||
1778 | @@ -2780,8 +2780,8 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, | ||
1779 | } | ||
1780 | } | ||
1781 | if (vir_priv && vir_priv->bss_type == MLAN_BSS_TYPE_UAP) { | ||
1782 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1783 | - IMX_ANDROID_12_BACKPORT) | ||
1784 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1785 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1786 | if (woal_cfg80211_del_beacon(wiphy, dev, 0)) | ||
1787 | #else | ||
1788 | if (woal_cfg80211_del_beacon(wiphy, dev)) | ||
1789 | @@ -2789,15 +2789,15 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, | ||
1790 | PRINTM(MERROR, "%s: del_beacon failed\n", | ||
1791 | __func__); | ||
1792 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) | ||
1793 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1794 | - IMX_ANDROID_12_BACKPORT) | ||
1795 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1796 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1797 | vir_priv->wdev->links[0].ap.beacon_interval = 0; | ||
1798 | #else | ||
1799 | vir_priv->wdev->beacon_interval = 0; | ||
1800 | #endif | ||
1801 | #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) | ||
1802 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1803 | - IMX_ANDROID_12_BACKPORT) | ||
1804 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1805 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1806 | memset(&vir_priv->wdev->links[0].ap.chandef, 0, | ||
1807 | sizeof(vir_priv->wdev->links[0].ap.chandef)); | ||
1808 | #else | ||
1809 | @@ -2806,8 +2806,8 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy, | ||
1810 | #endif | ||
1811 | #endif | ||
1812 | #endif | ||
1813 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1814 | - IMX_ANDROID_12_BACKPORT) | ||
1815 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1816 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1817 | vir_priv->wdev->u.ap.ssid_len = 0; | ||
1818 | #else | ||
1819 | vir_priv->wdev->ssid_len = 0; | ||
1820 | @@ -3101,8 +3101,8 @@ done: | ||
1821 | * | ||
1822 | * @return 0 -- success, otherwise fail | ||
1823 | */ | ||
1824 | -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13 || \ | ||
1825 | - IMX_ANDROID_12_BACKPORT) | ||
1826 | +#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1827 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1828 | int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, | ||
1829 | unsigned int link_id) | ||
1830 | #else | ||
1831 | @@ -3168,10 +3168,7 @@ int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | ||
1832 | if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) | ||
1833 | PRINTM(MERROR, "%s: cancel chan report failed \n", | ||
1834 | __func__); | ||
1835 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1836 | - cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
1837 | - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); | ||
1838 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1839 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1840 | cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
1841 | NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); | ||
1842 | #else | ||
1843 | @@ -3851,10 +3848,7 @@ void woal_cac_timer_func(void *context) | ||
1844 | moal_private *priv = handle->priv[handle->cac_bss_index]; | ||
1845 | |||
1846 | PRINTM(MEVENT, "cac_timer fired.\n"); | ||
1847 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1848 | - cfg80211_cac_event(priv->netdev, &handle->dfs_channel, | ||
1849 | - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); | ||
1850 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1851 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1852 | cfg80211_cac_event(priv->netdev, &handle->dfs_channel, | ||
1853 | NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); | ||
1854 | #else | ||
1855 | @@ -3957,11 +3951,11 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option) | ||
1856 | CFG80211_VERSION_CODE < KERNEL_VERSION(6, 9, 0) | ||
1857 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); | ||
1858 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && \ | ||
1859 | - IMX_ANDROID_13)) && \ | ||
1860 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 33))) && \ | ||
1861 | CFG80211_VERSION_CODE < KERNEL_VERSION(6, 9, 0) | ||
1862 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); | ||
1863 | #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || \ | ||
1864 | - IMX_ANDROID_13 || IMX_ANDROID_12_BACKPORT) | ||
1865 | + (defined(ANDROID_SDK_VERSION) && ANDROID_SDK_VERSION >= 31)) | ||
1866 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); | ||
1867 | #else | ||
1868 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan); | ||
1869 | @@ -4013,10 +4007,7 @@ void woal_process_cancel_chanrpt_event(moal_private *priv) | ||
1870 | if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) | ||
1871 | PRINTM(MERROR, "%s: cancel chan report failed \n", | ||
1872 | __func__); | ||
1873 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1874 | - cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
1875 | - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); | ||
1876 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1877 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) | ||
1878 | cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, | ||
1879 | NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); | ||
1880 | #else | ||
1881 | @@ -4030,22 +4021,7 @@ void woal_process_cancel_chanrpt_event(moal_private *priv) | ||
1882 | } | ||
1883 | #endif | ||
1884 | |||
1885 | -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
1886 | -/** | ||
1887 | - * @brief start radar detection | ||
1888 | - * | ||
1889 | - * @param wiphy A pointer to wiphy structure | ||
1890 | - * @param dev A pointer to net_device structure | ||
1891 | - * @param chandef A pointer to cfg80211_chan_def structure | ||
1892 | - * @param cac_time_ms A cac dwell time | ||
1893 | - * @param link_id valid link_id for MLO operation or 0 otherwise. | ||
1894 | - * @return 0 -- success, otherwise fail | ||
1895 | - */ | ||
1896 | -int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, | ||
1897 | - struct net_device *dev, | ||
1898 | - struct cfg80211_chan_def *chandef, | ||
1899 | - u32 cac_time_ms, int link_id) | ||
1900 | -#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) | ||
1901 | +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) | ||
1902 | /** | ||
1903 | * @brief start radar detection | ||
1904 | * | ||
diff --git a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb index 5b8aaa09..235fa93e 100644 --- a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb +++ b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb | |||
@@ -10,7 +10,10 @@ RCONFLICTS:${PN} = "kernel-module-nxp89xx" | |||
10 | 10 | ||
11 | SRCBRANCH = "lf-6.6.52_2.2.0" | 11 | SRCBRANCH = "lf-6.6.52_2.2.0" |
12 | MRVL_SRC ?= "git://github.com/nxp-imx/mwifiex.git;protocol=https" | 12 | MRVL_SRC ?= "git://github.com/nxp-imx/mwifiex.git;protocol=https" |
13 | SRC_URI = "${MRVL_SRC};branch=${SRCBRANCH}" | 13 | SRC_URI = " \ |
14 | ${MRVL_SRC};branch=${SRCBRANCH} \ | ||
15 | file://wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch \ | ||
16 | " | ||
14 | SRCREV = "5ad19e194f49ed9447bee7864eb562618ccaf9b1" | 17 | SRCREV = "5ad19e194f49ed9447bee7864eb562618ccaf9b1" |
15 | 18 | ||
16 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |