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