diff --git a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c index 05f9b8f..156027e 100644 --- a/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c +++ b/mxm_wifiex/wlan_src/mapp/mlanutl/mlanutl.c @@ -923,7 +923,7 @@ static int prepare_host_cmd_buffer(FILE *fp, char *cmd_name, t_u8 *buf) } #define SUBID_OFFSET 2 -static t_u16 supported_subcmd[] = {0x111, 0x11b, 0x11e}; +static t_u16 supported_subcmd[] = {0x104, 0x111, 0x11b, 0x11e}; static int check_if_hostcmd_subcmd_allowed(t_u8 *buf) { diff --git a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c index fd394be..75440b0 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_cmdevt.c @@ -974,7 +974,7 @@ static t_u16 wlan_get_cmd_timeout(t_u16 cmd_id) timeout = MRVDRV_TIMER_5S; break; default: - timeout = MRVDRV_TIMER_1S * 2; + timeout = MRVDRV_TIMER_1S * 5; break; } LEAVE(); diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 20acd74..42884ba 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 "247.p1" +#define MLAN_RELEASE_VERSION "247.p5" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlinux/mlan_decl.h b/mxm_wifiex/wlan_src/mlinux/mlan_decl.h index 20acd74..42884ba 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 "247.p1" +#define MLAN_RELEASE_VERSION "247.p5" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index 407c08f..ef7e53d 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -30,10 +30,6 @@ Change log: #include "moal_pcie.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) -#include -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) #ifdef IMX_SUPPORT #include @@ -44,11 +40,6 @@ Change log: Local Variables ********************************************************/ #define DRV_NAME "NXP mdriver PCIe" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) -#ifdef IMX_SUPPORT -static struct pm_qos_request woal_pcie_pm_qos_req; -#endif -#endif /* PCIE resume handler */ static int woal_pcie_resume(struct pci_dev *pdev); @@ -128,50 +119,6 @@ static moal_if_ops pcie_ops; Local Functions ********************************************************/ -void woal_request_pmqos_busfreq_high(void) -{ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) -#ifdef IMX_SUPPORT - pm_qos_add_request(&woal_pcie_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); -#endif -#endif -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) -#ifdef IMX_SUPPORT - cpu_latency_qos_add_request(&woal_pcie_pm_qos_req, 0); -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) -#ifdef IMX_SUPPORT - request_bus_freq(BUS_FREQ_HIGH); -#endif -#endif - return; -} - -void woal_release_pmqos_busfreq_high(void) -{ -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) -#ifdef IMX_SUPPORT - release_bus_freq(BUS_FREQ_HIGH); -#endif -#endif - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) -#ifdef IMX_SUPPORT - pm_qos_remove_request(&woal_pcie_pm_qos_req); -#endif -#endif -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) -#ifdef IMX_SUPPORT - cpu_latency_qos_remove_request(&woal_pcie_pm_qos_req); -#endif -#endif - return; -} - static mlan_status woal_pcie_preinit(struct pci_dev *pdev); /** @brief This function updates the card types @@ -586,6 +533,23 @@ static int woal_pcie_suspend(struct pci_dev *pdev, pm_message_t state) if (handle->priv[i] && (GET_BSS_ROLE(handle->priv[i]) == MLAN_BSS_ROLE_STA)) woal_cancel_scan(handle->priv[i], MOAL_IOCTL_WAIT); + +#ifdef PCIE9098 + if (IS_PCIE9098(handle->card_type)) { + if ((cardp->dev->device == + PCIE_DEVICE_ID_NXP_88W9098P_FN0) || + (cardp->dev->device == + PCIE_DEVICE_ID_NXP_88W9098P_FN1)) { + if (handle->priv[i] && + handle->priv[i]->media_connected) { + PRINTM(MMSG, + "Suspend not allowed while connected\n"); + ret = -EBUSY; + goto done; + } + } + } +#endif } handle->suspend_fail = MFALSE; memset(&pm_info, 0, sizeof(pm_info)); @@ -1114,10 +1078,8 @@ static mlan_status woal_pcie_preinit(struct pci_dev *pdev) { int ret; -#ifndef IMX_SUPPORT if (pdev->multifunction) device_disable_async_suspend(&pdev->dev); -#endif ret = pci_enable_device(pdev); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.h b/mxm_wifiex/wlan_src/mlinux/moal_pcie.h index 1f3fd71..9f6011c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.h @@ -140,9 +140,4 @@ mlan_status woal_pcie_bus_register(void); /** Unregister from bus driver function */ void woal_pcie_bus_unregister(void); -/* pmqos busfreq request handler*/ -void woal_request_pmqos_busfreq_high(void); -/* pmqos busfreq release handler*/ -void woal_release_pmqos_busfreq_high(void); - #endif /* _MOAL_PCIE_H_ */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 0892104..003830f 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -44,6 +44,24 @@ Change log: #endif #include +#if defined(PCIE) || defined(SDIO) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) +#ifdef IMX_SUPPORT +#include +#endif +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#include +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#ifdef IMX_SUPPORT +static struct pm_qos_request woal_pm_qos_req; +#endif +#endif +#endif /*defined(PCIE) || defined(SDIO)*/ + /******************************************************** Local Variables ********************************************************/ @@ -1525,6 +1543,57 @@ done: return status; } +#if defined(PCIE) || defined(SDIO) +void woal_request_busfreq_pmqos_add(t_u16 card_type) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) +#ifdef IMX_SUPPORT + if (IS_PCIE(card_type)) { + request_bus_freq(BUS_FREQ_HIGH); + } +#endif +#endif + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#ifdef IMX_SUPPORT + pm_qos_add_request(&woal_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); +#endif +#endif +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) +#ifdef IMX_SUPPORT + cpu_latency_qos_add_request(&woal_pm_qos_req, 0); +#endif +#endif + + return; +} + +void woal_release_busfreq_pmqos_remove(t_u16 card_type) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70) +#ifdef IMX_SUPPORT + if (IS_PCIE(card_type)) { + release_bus_freq(BUS_FREQ_HIGH); + } +#endif +#endif + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) +#ifdef IMX_SUPPORT + pm_qos_remove_request(&woal_pm_qos_req); +#endif +#endif +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) +#ifdef IMX_SUPPORT + cpu_latency_qos_remove_request(&woal_pm_qos_req); +#endif +#endif + return; +} +#endif /*defined(PCIE) || defined(SDIO)*/ + /** * @brief This function checks media_connected state for * BSS types UAP/STA/P2P_GO/GC @@ -1561,17 +1630,15 @@ static void moal_connection_status_check_pmqos(t_void *pmoal) if ((woal_check_media_connected(pmoal) == MTRUE)) { if ((pmhandle->request_pm == MFALSE)) { pmhandle->request_pm = MTRUE; -#ifdef PCIE - if (IS_PCIE(pmhandle->card_type)) - woal_request_pmqos_busfreq_high(); +#if defined(PCIE) || defined(SDIO) + woal_request_busfreq_pmqos_add(pmhandle->card_type); #endif } } else { if (pmhandle->request_pm == MTRUE) { pmhandle->request_pm = MFALSE; -#ifdef PCIE - if (IS_PCIE(pmhandle->card_type)) - woal_release_pmqos_busfreq_high(); +#if defined(PCIE) || defined(SDIO) + woal_release_busfreq_pmqos_remove(pmhandle->card_type); #endif } } diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.h b/mxm_wifiex/wlan_src/mlinux/moal_shim.h index 4eb85b5..3d768bd 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.h @@ -118,4 +118,12 @@ mlan_status moal_stop_timer(t_void *pmoal, t_void *ptimer); void moal_tp_accounting(t_void *pmoal, void *buf, t_u32 drop_point); void moal_tp_accounting_rx_param(t_void *pmoal, unsigned int type, unsigned int rsvd1); + +#if defined(PCIE) || defined(SDIO) +/* pmqos busfreq add request handler*/ +void woal_request_busfreq_pmqos_add(t_u16 card_type); +/* pmqos busfreq remove handler*/ +void woal_release_busfreq_pmqos_remove(t_u16 card_type); +#endif + #endif /*_MOAL_H */