From aab0f07fa18810ec45cdf1bc7dd33326400de2a4 Mon Sep 17 00:00:00 2001 From: yunjie Date: Thu, 14 Nov 2024 15:18:06 +0000 Subject: [PATCH] MA-22959-1 [Android-15.0] WCS Q4 release patch integrate Reason: integrate WCS Q4 RC2 patch, WiFi driver MM6X18505.p5 Tested: 8MQ related FW version: PCIE_UART_8997_16.92.21.p137.4 PCIE_UART_9098_17.92.1.p149.53 SDIO_UART_8987_16.92.21.p142.3 SDIO_UART_8997_16.92.21.p137.4 SDIO_UART_9098_17.92.1.p149.53 SDIO_UART_IW416_16.92.21.p142.3 SDIO_UART_IW610_18.99.5.p39 SDIO_UART_IW612_18.99.3.p21.10 SDIO_WLAN_8801_14.92.36.p195 Change-Id: I0178c7d1640d4668937c987344abe42d9c66180d Signed-off-by: yunjie --- Makefile | 2 +- mlan/mlan_11ax.c | 10 +++++++++ mlan/mlan_ioctl.h | 10 +++++++++ mlinux/mlan_ioctl.h | 10 +++++++++ mlinux/moal_eth_ioctl.c | 4 ++++ mlinux/moal_main.c | 4 ++++ mlinux/moal_main.h | 11 +++++----- mlinux/moal_shim.c | 42 ++++++++++++++++++++++++++++++-------- mlinux/moal_sta_cfg80211.c | 34 +++++++++++++++++------------- 9 files changed, 98 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 92dda33..1b516f3 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ APPDIR= $(shell if test -d "mapp"; then echo mapp; fi) ############################################################################# ccflags-y += -I$(KERNELDIR)/include - ccflags-y += -DMLAN_RELEASE_VERSION='"505.p1"' + ccflags-y += -DMLAN_RELEASE_VERSION='"505.p4"' ccflags-y += -DFPNUM='"92"' diff --git a/mlan/mlan_11ax.c b/mlan/mlan_11ax.c index 44732b7..a1feaf2 100644 --- a/mlan/mlan_11ax.c +++ b/mlan/mlan_11ax.c @@ -998,6 +998,8 @@ mlan_status wlan_cmd_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, (mlan_ds_11ax_llde_cmd *)&ds_11ax_cmd->param; mlan_ds_11ax_rutxpwr_cmd *rutxpwr_cmd = (mlan_ds_11ax_rutxpwr_cmd *)&ds_11ax_cmd->param; + mlan_ds_11ax_HeSuER_cmd *HeSuER_cmd = + (mlan_ds_11ax_HeSuER_cmd *)&ds_11ax_cmd->param; MrvlIEtypes_Data_t *tlv = MNULL; ENTER(); @@ -1055,6 +1057,10 @@ mlan_status wlan_cmd_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd, sizeof(t_u8), sizeof(t_u8)); cmd->size += sizeof(t_u8); break; + case MLAN_11AXCMD_HESUER_SUBID: + axcmd->val[0] = HeSuER_cmd->value; + cmd->size += sizeof(t_u8); + break; default: PRINTM(MERROR, "Unknown subcmd %x\n", ds_11ax_cmd->sub_id); @@ -1147,6 +1153,10 @@ mlan_status wlan_ret_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp, sizeof(mlan_ds_11ax_rutxpwr_cmd), sizeof(mlan_ds_11ax_rutxpwr_cmd)); break; + case MLAN_11AXCMD_HESUER_SUBID: + cfg->param.HeSuER_cfg.value = *axcmd->val; + break; + default: PRINTM(MERROR, "Unknown subcmd %x\n", axcmd->sub_id); break; diff --git a/mlan/mlan_ioctl.h b/mlan/mlan_ioctl.h index 38518c6..f2cb525 100644 --- a/mlan/mlan_ioctl.h +++ b/mlan/mlan_ioctl.h @@ -4068,6 +4068,7 @@ typedef struct _mlan_ds_11ax_cfg { #define MLAN_11AXCMD_CFG_ID_SET_BSRP 8 #define MLAN_11AXCMD_CFG_ID_LLDE 9 #define MLAN_11AXCMD_CFG_ID_RUTXPWR 10 +#define MLAN_11AXCMD_CFG_ID_HESUER 11 #define MLAN_11AXCMD_SR_SUBID 0x102 #define MLAN_11AXCMD_BEAM_SUBID 0x103 @@ -4078,6 +4079,7 @@ typedef struct _mlan_ds_11ax_cfg { #define MLAN_11AXCMD_SET_BSRP_SUBID 0x109 #define MLAN_11AXCMD_LLDE_SUBID 0x110 #define MLAN_11AXCMD_RUTXSUBPWR_SUBID 0x118 +#define MLAN_11AXCMD_HESUER_SUBID 0x121 #define MLAN_11AX_TWT_SETUP_SUBID 0x114 #define MLAN_11AX_TWT_TEARDOWN_SUBID 0x115 @@ -4201,6 +4203,12 @@ typedef struct _mlan_ds_11ax_rutxpwr_cmd { t_s8 rutxSubPwr[89]; } mlan_ds_11ax_rutxpwr_cmd, *pmlan_ds_11ax_rutxpwr_cmd; +/** Type definition of mlan_ds_11ax_HeSuER_cmd for MLAN_11AXCMD_HESUER_SUBID */ +typedef struct _mlan_ds_11ax_HeSuER_cmd { + /** command value: 1 is enable, 0 is disable*/ + t_u8 value; +} mlan_ds_11ax_HeSuER_cmd, *pmlan_ds_11ax_HeSuER_cmd; + /** Type definition of mlan_ds_11ax_cmd_cfg for MLAN_OID_11AX_CMD_CFG */ typedef struct _mlan_ds_11ax_cmd_cfg { /** Sub-command */ @@ -4228,6 +4236,8 @@ typedef struct _mlan_ds_11ax_cmd_cfg { mlan_ds_11ax_llde_cmd llde_cfg; /* MLAN_11AXCMD_RUTXPWR_SUBID */ mlan_ds_11ax_rutxpwr_cmd rutxpwr_cfg; + /** HeSuER configuration for MLAN_11AXCMD_HESUER_SUBID */ + mlan_ds_11ax_HeSuER_cmd HeSuER_cfg; } param; } mlan_ds_11ax_cmd_cfg, *pmlan_ds_11ax_cmd_cfg; diff --git a/mlinux/mlan_ioctl.h b/mlinux/mlan_ioctl.h index 38518c6..f2cb525 100644 --- a/mlinux/mlan_ioctl.h +++ b/mlinux/mlan_ioctl.h @@ -4068,6 +4068,7 @@ typedef struct _mlan_ds_11ax_cfg { #define MLAN_11AXCMD_CFG_ID_SET_BSRP 8 #define MLAN_11AXCMD_CFG_ID_LLDE 9 #define MLAN_11AXCMD_CFG_ID_RUTXPWR 10 +#define MLAN_11AXCMD_CFG_ID_HESUER 11 #define MLAN_11AXCMD_SR_SUBID 0x102 #define MLAN_11AXCMD_BEAM_SUBID 0x103 @@ -4078,6 +4079,7 @@ typedef struct _mlan_ds_11ax_cfg { #define MLAN_11AXCMD_SET_BSRP_SUBID 0x109 #define MLAN_11AXCMD_LLDE_SUBID 0x110 #define MLAN_11AXCMD_RUTXSUBPWR_SUBID 0x118 +#define MLAN_11AXCMD_HESUER_SUBID 0x121 #define MLAN_11AX_TWT_SETUP_SUBID 0x114 #define MLAN_11AX_TWT_TEARDOWN_SUBID 0x115 @@ -4201,6 +4203,12 @@ typedef struct _mlan_ds_11ax_rutxpwr_cmd { t_s8 rutxSubPwr[89]; } mlan_ds_11ax_rutxpwr_cmd, *pmlan_ds_11ax_rutxpwr_cmd; +/** Type definition of mlan_ds_11ax_HeSuER_cmd for MLAN_11AXCMD_HESUER_SUBID */ +typedef struct _mlan_ds_11ax_HeSuER_cmd { + /** command value: 1 is enable, 0 is disable*/ + t_u8 value; +} mlan_ds_11ax_HeSuER_cmd, *pmlan_ds_11ax_HeSuER_cmd; + /** Type definition of mlan_ds_11ax_cmd_cfg for MLAN_OID_11AX_CMD_CFG */ typedef struct _mlan_ds_11ax_cmd_cfg { /** Sub-command */ @@ -4228,6 +4236,8 @@ typedef struct _mlan_ds_11ax_cmd_cfg { mlan_ds_11ax_llde_cmd llde_cfg; /* MLAN_11AXCMD_RUTXPWR_SUBID */ mlan_ds_11ax_rutxpwr_cmd rutxpwr_cfg; + /** HeSuER configuration for MLAN_11AXCMD_HESUER_SUBID */ + mlan_ds_11ax_HeSuER_cmd HeSuER_cfg; } param; } mlan_ds_11ax_cmd_cfg, *pmlan_ds_11ax_cmd_cfg; diff --git a/mlinux/moal_eth_ioctl.c b/mlinux/moal_eth_ioctl.c index dddad2a..4997e17 100644 --- a/mlinux/moal_eth_ioctl.c +++ b/mlinux/moal_eth_ioctl.c @@ -660,6 +660,10 @@ static int woal_setget_priv_11axcmdcfg(moal_private *priv, t_u8 *respbuf, case MLAN_11AXCMD_CFG_ID_RUTXPWR: cfg->sub_id = MLAN_11AXCMD_RUTXSUBPWR_SUBID; break; + case MLAN_11AXCMD_CFG_ID_HESUER: + cfg->sub_id = MLAN_11AXCMD_HESUER_SUBID; + cfg->param.HeSuER_cfg.value = data[1]; + break; default: PRINTM(MERROR, "unknown 11axcmd\n"); diff --git a/mlinux/moal_main.c b/mlinux/moal_main.c index 07ee1d6..d6763cc 100644 --- a/mlinux/moal_main.c +++ b/mlinux/moal_main.c @@ -12329,6 +12329,10 @@ t_void woal_evt_work_queue(struct work_struct *work) woal_host_mlme_process_assoc_timeout( (moal_private *)evt->priv, evt->assoc_bss); break; + case WOAL_EVENT_RESET_WIFI: + woal_reset_wifi(handle, evt->deauth_evt_cnt, + "EAPOL timeout"); + break; #endif #endif #ifdef UAP_SUPPORT diff --git a/mlinux/moal_main.h b/mlinux/moal_main.h index 50f36bb..6d87dcf 100644 --- a/mlinux/moal_main.h +++ b/mlinux/moal_main.h @@ -174,10 +174,7 @@ Change log: #define IMX_ANDROID_14 0 #define IMX_ANDROID_12_BACKPORT 0 -#if defined(IMX_SUPPORT) - -#if defined(IMX_ANDROID) - +#ifdef ANDROID_SDK_VERSION #if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 52) #undef IMX_ANDROID_13 #define IMX_ANDROID_13 1 @@ -190,7 +187,7 @@ Change log: #undef IMX_ANDROID_12_BACKPORT #define IMX_ANDROID_12_BACKPORT 1 #endif -#endif +#else #endif /** @@ -1043,7 +1040,7 @@ typedef struct _wait_queue { /** flag for wait_timeout */ t_u8 wait_timeout; /** retry count */ - t_u8 retry; + t_u16 retry; } wait_queue, *pwait_queue; /** Auto Rate */ @@ -1258,6 +1255,7 @@ enum woal_event_type { #endif #endif WOAL_EVENT_RGPWR_KEY_MISMATCH, + WOAL_EVENT_RESET_WIFI, }; /** chan_rpt_info */ @@ -1290,6 +1288,7 @@ struct woal_event { mlan_ds_assoc_info assoc_info; mlan_deauth_param deauth_info; chan_radar_info radar_info; + t_u8 deauth_evt_cnt; }; }; diff --git a/mlinux/moal_shim.c b/mlinux/moal_shim.c index be555ef..2380752 100644 --- a/mlinux/moal_shim.c +++ b/mlinux/moal_shim.c @@ -2699,6 +2699,35 @@ static void woal_rgpower_key_mismatch_event(moal_private *priv) } } +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) +/** + * @brief This function prepare wifi reset event + * + * @param priv pointer to the moal_private structure. + * + * @return N/A + */ +static void woal_wifi_reset_event(moal_private *priv, t_u8 deauth_evt_cnt) +{ + struct woal_event *evt; + unsigned long flags; + moal_handle *handle = priv->phandle; + + evt = kzalloc(sizeof(struct woal_event), GFP_ATOMIC); + if (evt) { + evt->priv = priv; + evt->type = WOAL_EVENT_RESET_WIFI; + evt->deauth_evt_cnt = deauth_evt_cnt; + INIT_LIST_HEAD(&evt->link); + spin_lock_irqsave(&handle->evt_lock, flags); + list_add_tail(&evt->link, &handle->evt_queue); + spin_unlock_irqrestore(&handle->evt_lock, flags); + queue_work(handle->evt_workqueue, &handle->evt_work); + } + // coverity[leaked_storage]: SUPPRESS +} +#endif + /** * @brief This function handles defer event receive * @@ -4455,14 +4484,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) #define MAX_DEAUTH_COUNTER 5 if (priv->deauth_evt_cnt >= MAX_DEAUTH_COUNTER) { - if (woal_reset_wifi( - priv->phandle, - priv->deauth_evt_cnt, - "EAPOL timeout") == - MLAN_STATUS_SUCCESS) { - priv->deauth_evt_cnt = - 0; - } + woal_wifi_reset_event( + priv, + priv->deauth_evt_cnt); + priv->deauth_evt_cnt = + 0; } } priv->cfg_disconnect = MTRUE; diff --git a/mlinux/moal_sta_cfg80211.c b/mlinux/moal_sta_cfg80211.c index 225e5a3..3883433 100644 --- a/mlinux/moal_sta_cfg80211.c +++ b/mlinux/moal_sta_cfg80211.c @@ -1661,7 +1661,18 @@ mlan_status woal_reset_wifi(moal_handle *handle, t_u8 cnt, char *reason) static wifi_timeval reset_time; wifi_timeval ts; t_u64 diff; + t_u8 intf_num; + /* Disconnect all interfaces */ + for (intf_num = 0; intf_num < handle->priv_num; intf_num++) { + if (handle->priv[intf_num] && + handle->priv[intf_num]->media_connected == MTRUE) { + if (woal_disconnect(handle->priv[intf_num], + MOAL_IOCTL_WAIT, NULL, + DEF_DEAUTH_REASON_CODE)) + PRINTM(MERROR, "woal_disconnect failed\n"); + } + } #define MAX_WIFI_RESET_INTERVAL 15 * 60 * 1000000 // 15 minute woal_get_monotonic_time(&ts); diff = (t_u64)(timeval_to_usec(ts) - timeval_to_usec(reset_time)); @@ -5010,23 +5021,18 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev, if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) scan_req->chan_list[num_chans].scan_time = INIT_PASSIVE_SCAN_CHAN_TIME; - else if ((priv->bss_type == MLAN_BSS_TYPE_STA) && - (1 == - priv->phandle->scan_request->n_channels)) { + else if (priv->bss_type == MLAN_BSS_TYPE_STA) { /* * Set passive scan time to 110ms to discover * all nearby AP's, Current 40ms passive scan - * time does not scan all AP's. There are issues - * with 40ms scan time: - * 1. Regular user passive scan does list - * limited nearby AP's. - * 2. Radio Measurement RPT with beacon report - * for passive scan mode does not list all - * required AP's and hence cert fails. This - * change is limited to below scenario only: - * 1. Single channel user scan is requested - * 2. STA is in connected state - * 3. Scan type is passive + * time does not scan all AP's. As beacon + * interval is 100ms and dwell time on channel + * is 40ms There are issues with 40ms scan time: + * 1. Passive scan does list limited nearby + * AP's. This change is limited to below + * scenario only: + * 1. STA is in connected state + * 2. Scan type is passive */ if (scan_req->chan_list[num_chans].scan_type == MLAN_SCAN_TYPE_PASSIVE)