From 61277b67f523cfe72541a0de38275e21f7a1cde4 Mon Sep 17 00:00:00 2001 From: yunjie Date: Tue, 15 Nov 2022 20:52:03 +0000 Subject: [PATCH] MA-20890 WCS MM5X17366 - Q4-2022 RC2 patch integrate Reason: integrate WCS MM5X17366p5 wlan driver code Test: i.MX8M mini Change-Id: Ib3f9562a0eb4adddf8939a014d85c85feae2b9ab Signed-off-by: yunjie --- mxm_wifiex/wlan_src/mlan/mlan_11ax.c | 25 ++++++++- mxm_wifiex/wlan_src/mlan/mlan_11h.c | 2 - mxm_wifiex/wlan_src/mlan/mlan_decl.h | 2 +- mxm_wifiex/wlan_src/mlan/mlan_init.c | 23 ++++++++ mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c | 2 +- mxm_wifiex/wlan_src/mlinux/mlan_decl.h | 2 +- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 53 +++++++++++++++++-- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h | 15 ++++-- mxm_wifiex/wlan_src/mlinux/moal_main.c | 8 +++ mxm_wifiex/wlan_src/mlinux/moal_main.h | 4 +- mxm_wifiex/wlan_src/mlinux/moal_pcie.c | 2 - mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c | 2 - mxm_wifiex/wlan_src/mlinux/moal_shim.c | 30 ++++++----- .../wlan_src/mlinux/moal_sta_cfg80211.c | 4 ++ mxm_wifiex/wlan_src/mlinux/moal_uap.c | 4 ++ .../wlan_src/mlinux/moal_uap_cfg80211.c | 11 +++- 16 files changed, 153 insertions(+), 36 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11ax.c b/mxm_wifiex/wlan_src/mlan/mlan_11ax.c index d529a21..cc94b28 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11ax.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11ax.c @@ -76,7 +76,7 @@ static t_u8 wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc) { if (!pbss_desc->phe_cap) return MFALSE; - if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT)) + if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_RESP_SUPPORT)) return MFALSE; if (!pbss_desc->pext_cap) return MFALSE; @@ -526,6 +526,7 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter, MrvlIEtypes_He_cap_t *phe_cap = MNULL; t_u8 i = 0; t_u8 he_cap_2g = 0; + MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL; ENTER(); if ((hw_he_cap->len + sizeof(MrvlIEtypesHeader_t)) > @@ -584,6 +585,28 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter, pmadapter->hw_hecap_len, sizeof(pmadapter->priv[i]->user_he_cap)); } + /** + * Clear TWT bits in he_mac_cap by bss role + * STA mode should clear TWT responder bit + * UAP mode should clear TWT request bit + */ + if (he_cap_2g) + user_he_cap_tlv = + (MrvlIEtypes_He_cap_t *)&pmadapter + ->priv[i] + ->user_2g_he_cap; + else + user_he_cap_tlv = + (MrvlIEtypes_He_cap_t *)&pmadapter + ->priv[i] + ->user_he_cap; + + if (pmadapter->priv[i]->bss_role == MLAN_BSS_ROLE_STA) + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_RESP_SUPPORT; + else + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_REQ_SUPPORT; } } LEAVE(); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_11h.c b/mxm_wifiex/wlan_src/mlan/mlan_11h.c index c37ccce..73fc5ba 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_11h.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_11h.c @@ -771,11 +771,9 @@ static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv, PRINTM(MCMND, "DFS: STOP\n"); } pcmd_ptr->size += sizeof(MrvlIEtypes_ZeroDfsOperation_t); - pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size); LEAVE(); return MLAN_STATUS_SUCCESS; } - pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size); /* update dfs sturcture. * dfs_check_pending is set when we receive CMD_RESP == SUCCESS */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index e9c41a6..70e970a 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlan/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "366" +#define MLAN_RELEASE_VERSION "366.p5" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlan/mlan_init.c b/mxm_wifiex/wlan_src/mlan/mlan_init.c index e398959..8213c41 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_init.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_init.c @@ -1470,6 +1470,7 @@ done: static void wlan_update_hw_spec(pmlan_adapter pmadapter) { t_u32 i; + MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL; ENTER(); @@ -1582,6 +1583,28 @@ static void wlan_update_hw_spec(pmlan_adapter pmadapter) pmadapter->hw_he_cap, pmadapter->hw_hecap_len, sizeof(pmadapter->priv[i]->user_he_cap)); + user_he_cap_tlv = + (MrvlIEtypes_He_cap_t *)&pmadapter + ->priv[i] + ->user_2g_he_cap; + if (pmadapter->priv[i]->bss_role == + MLAN_BSS_ROLE_STA) + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_RESP_SUPPORT; + else + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_REQ_SUPPORT; + user_he_cap_tlv = + (MrvlIEtypes_He_cap_t *)&pmadapter + ->priv[i] + ->user_he_cap; + if (pmadapter->priv[i]->bss_role == + MLAN_BSS_ROLE_STA) + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_RESP_SUPPORT; + else + user_he_cap_tlv->he_mac_cap[0] &= + ~HE_MAC_CAP_TWT_REQ_SUPPORT; } } } diff --git a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c index b8df239..982b7e6 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_uap_cmdevent.c @@ -199,7 +199,7 @@ static mlan_status uap_process_cmdresp_error(mlan_private *pmpriv, mlan_status ret = MLAN_STATUS_FAILURE; ENTER(); - if (resp->command != HostCmd_CMD_WMM_PARAM_CONFIG || + if (resp->command != HostCmd_CMD_WMM_PARAM_CONFIG && resp->command != HostCmd_CMD_CHAN_REGION_CFG) PRINTM(MERROR, "CMD_RESP: cmd %#x error, result=%#x\n", resp->command, resp->result); diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index e9c41a6..70e970a 100644 --- a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h +++ b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h @@ -24,7 +24,7 @@ #define _MLAN_DECL_H_ /** MLAN release version */ -#define MLAN_RELEASE_VERSION "366" +#define MLAN_RELEASE_VERSION "366.p5" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 217ed98..3d26746 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -1042,6 +1042,44 @@ done: #endif /* KERNEL_VERSION */ #endif /* WIFI_DIRECT_SUPPORT */ +#ifdef UAP_SUPPORT +/** + * @brief Request to cancel CAC + * + * @param priv A pointer to moal_private structure + * + * @return N/A */ +void woal_cancel_cac(moal_private *priv) +{ +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) + if (priv->phandle->is_cac_timer_set && + priv->bss_index == priv->phandle->cac_bss_index) { + woal_cancel_timer(&priv->phandle->cac_timer); + priv->phandle->is_cac_timer_set = MFALSE; + /* Make sure Chan Report is cancelled */ + if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) + PRINTM(MERROR, "%s: cancel chan report failed \n", + __func__); +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); +#else + cfg80211_cac_event(priv->netdev, NL80211_RADAR_CAC_ABORTED, + GFP_KERNEL); +#endif + memset(&priv->phandle->dfs_channel, 0, + sizeof(struct cfg80211_chan_def)); + priv->phandle->cac_bss_index = 0xff; + } +#endif +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD)) + woal_cancel_cac_block(priv); +#endif + return; +} +#endif + /** * @brief Request the driver to change the interface type * @@ -1445,7 +1483,7 @@ fail: */ #endif int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -1504,7 +1542,7 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, */ #endif int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -1563,7 +1601,7 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, #endif int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index @@ -1598,7 +1636,7 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index) @@ -1612,7 +1650,7 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index) @@ -2760,6 +2798,7 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, if (!priv->bss_started) { PRINTM(MCMND, "Drop deauth packet before AP started\n"); + woal_cancel_cac(priv); goto done; } #endif @@ -2907,7 +2946,11 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy, #if KERNEL_VERSION(3, 8, 0) > LINUX_VERSION_CODE *cookie = random32() | 1; #else +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE *cookie = prandom_u32() | 1; +#else + *cookie = get_random_u32() | 1; +#endif #endif pmbuf->data_offset = MLAN_MIN_DATA_HEADER_LEN; pkt_type = MRVL_PKT_TYPE_MGMT_FRAME; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index fadf07b..6e7eaf0 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -128,7 +128,7 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed); int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -138,7 +138,7 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, const t_u8 *mac_addr, struct key_params *params); int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, @@ -213,7 +213,7 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index, bool ucast, bool mcast); @@ -225,7 +225,7 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index); @@ -234,7 +234,7 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || IMX_ANDROID_13) +#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13) int link_id, #endif t_u8 key_index); @@ -293,6 +293,11 @@ extern struct ieee80211_supported_band mac1_cfg80211_band_5ghz; int woal_cfg80211_bss_role_cfg(moal_private *priv, t_u16 action, t_u8 *bss_role); #endif + +#ifdef UAP_SUPPORT +void woal_cancel_cac(moal_private *priv); +#endif + #if KERNEL_VERSION(4, 1, 0) <= CFG80211_VERSION_CODE struct wireless_dev * woal_cfg80211_add_virtual_intf(struct wiphy *wiphy, const char *name, diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index 499719b..7dcdef6 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -10736,7 +10736,11 @@ moal_handle *woal_add_card(void *card, struct device *dev, moal_if_ops *if_ops, if (moal_extflg_isset(handle, EXT_NAPI)) { init_dummy_netdev(&handle->napi_dev); netif_napi_add(&handle->napi_dev, &handle->napi_rx, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + woal_netdev_poll_rx); +#else woal_netdev_poll_rx, NAPI_BUDGET); +#endif napi_enable(&handle->napi_rx); } @@ -11397,6 +11401,7 @@ static void woal_post_reset(moal_handle *handle) #endif if (!handle->wifi_hal_flag) { PRINTM(MMSG, "wlan: post_reset remove/add interface\n"); + handle->surprise_removed = MTRUE; for (intf_num = 0; intf_num < MIN(MLAN_MAX_BSS_NUM, handle->priv_num); intf_num++) @@ -11411,6 +11416,8 @@ static void woal_post_reset(moal_handle *handle) handle->wiphy = NULL; } #endif + handle->surprise_removed = MFALSE; + for (intf_num = 0; intf_num < handle->drv_mode.intf_num; intf_num++) { if (handle->drv_mode.bss_attr[intf_num].bss_virtual) @@ -11424,6 +11431,7 @@ static void woal_post_reset(moal_handle *handle) goto done; } } + PRINTM(MMSG, "wlan: post_reset remove/add interface done\n"); goto done; } /* Reset all interfaces */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.h b/mxm_wifiex/wlan_src/mlinux/moal_main.h index 6559743..a5e2b30 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.h @@ -158,8 +158,8 @@ Change log: #define IMX_ANDROID_13 0 -#ifdef IMX_SUPPORT -#ifdef IMX_ANDROID +#if defined(IMX_SUPPORT) +#if defined(IMX_ANDROID) #if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 41) #undef IMX_ANDROID_13 #define IMX_ANDROID_13 1 diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index 27f495f..c0bfbc9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -132,8 +132,6 @@ static const struct pci_device_id wlan_ids[] = { /* moal interface ops */ static moal_if_ops pcie_ops; -MODULE_DEVICE_TABLE(pci, wlan_ids); - /******************************************************** Global Variables ********************************************************/ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c index 67419c0..373904a 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c @@ -129,8 +129,6 @@ static const struct sdio_device_id wlan_ids[] = { {}, }; -MODULE_DEVICE_TABLE(sdio, wlan_ids); - int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id); void woal_sdio_remove(struct sdio_func *func); #ifdef SDIO diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 98094a9..afc8e93 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -3281,11 +3281,23 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) case MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE: #if defined(UAP_CFG80211) || defined(STA_CFG80211) pchan_info = (chan_band_info *)pmevent->event_buf; +#ifdef UAP_SUPPORT + if (priv->bss_role == MLAN_BSS_ROLE_UAP) { + if (priv->uap_tx_blocked) { + if (!netif_carrier_ok(priv->netdev)) + netif_carrier_on(priv->netdev); + woal_start_queue(priv->netdev); + priv->uap_tx_blocked = MFALSE; + } + priv->phandle->chsw_wait_q_woken = MTRUE; + wake_up_interruptible(&priv->phandle->chsw_wait_q); + } +#endif + if (IS_STA_OR_UAP_CFG80211(cfg80211_wext)) { PRINTM(MMSG, "CSA/ECSA: Switch to new channel %d complete!\n", pchan_info->channel); - priv->channel = pchan_info->channel; #ifdef UAP_CFG80211 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) if (priv->csa_chan.chan && @@ -3299,6 +3311,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) } #endif #endif + if (priv->channel == pchan_info->channel) + break; + priv->channel = pchan_info->channel; + #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) if (MFALSE #ifdef UAP_CFG80211 @@ -3320,18 +3336,6 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) } #endif } -#endif -#ifdef UAP_SUPPORT - if (priv->bss_role == MLAN_BSS_ROLE_UAP) { - if (priv->uap_tx_blocked) { - if (!netif_carrier_ok(priv->netdev)) - netif_carrier_on(priv->netdev); - woal_start_queue(priv->netdev); - priv->uap_tx_blocked = MFALSE; - } - priv->phandle->chsw_wait_q_woken = MTRUE; - wake_up_interruptible(&priv->phandle->chsw_wait_q); - } #endif break; case MLAN_EVENT_ID_FW_STOP_TX: diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c index 92cb039..f13f641 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c @@ -6229,7 +6229,11 @@ woal_cfg80211_remain_on_channel(struct wiphy *wiphy, struct net_device *dev, #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) *cookie = (u64)random32() | 1; #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) *cookie = (u64)prandom_u32() | 1; +#else + *cookie = (u64)get_random_u32() | 1; +#endif #endif priv->phandle->remain_on_channel = MTRUE; priv->phandle->remain_bss_index = priv->bss_index; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap.c b/mxm_wifiex/wlan_src/mlinux/moal_uap.c index 16808fe..6075bdc 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap.c @@ -3777,6 +3777,10 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band, &hecap_ie->ext_id, he_cfg.he_cap.len, he_cfg.he_cap.len); } +#define HE_MAC_CAP_TWT_REQ_SUPPORT MBIT(1) + /* uap mode clear TWT request bit */ + he_cfg.he_cap.he_mac_cap[0] &= ~HE_MAC_CAP_TWT_REQ_SUPPORT; + if (action == MLAN_ACT_DISABLE) { if (he_cfg.he_cap.len && (he_cfg.he_cap.ext_id == HE_CAPABILITY)) { diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index f4316f5..90841a2 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -2869,6 +2869,14 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, moal_private *priv = (moal_private *)woal_get_netdev_priv(dev); ENTER(); +#ifdef UAP_SUPPORT + if ((priv->bss_type == MLAN_BSS_TYPE_UAP) && !priv->bss_started) { + woal_cancel_cac(priv); + LEAVE(); + return 0; + } +#endif + if (priv->media_connected == MFALSE) { PRINTM(MINFO, "cfg80211: Media not connected!\n"); LEAVE(); @@ -3737,7 +3745,8 @@ mlan_status woal_register_uap_cfg80211(struct net_device *dev, t_u8 bss_type) return MLAN_STATUS_FAILURE; } - wdev->iftype = NL80211_IFTYPE_STATION; + if (bss_type == MLAN_BSS_TYPE_UAP) + wdev->iftype = NL80211_IFTYPE_AP; dev_net_set(dev, wiphy_net(wdev->wiphy)); dev->ieee80211_ptr = wdev;