From f65a0102257b53932afe55c86f7d3a880b83abd4 Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Fri, 7 May 2021 12:38:32 +0800 Subject: [PATCH] mxm_wifiex: update to mxm5x17247.p1 release changes: 1. Fixed compilation errors for 5.12 kernel. 2. Fixed an issue with suspend/resume for PCIE9098 with 5.10.9 kernel. Signed-off-by: Sherry Sun Reviewed-by: yang.tian --- mxm_wifiex/wlan_src/mlan/mlan_decl.h | 2 +- mxm_wifiex/wlan_src/mlinux/mlan_decl.h | 2 +- mxm_wifiex/wlan_src/mlinux/moal_main.c | 12 ++++++++---- mxm_wifiex/wlan_src/mlinux/moal_pcie.c | 8 +++++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlan/mlan_decl.h b/mxm_wifiex/wlan_src/mlan/mlan_decl.h index 34c114f..20acd74 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" +#define MLAN_RELEASE_VERSION "247.p1" /** 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 34c114f..20acd74 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" +#define MLAN_RELEASE_VERSION "247.p1" /** Re-define generic data types for MLAN/MOAL */ /** Signed char (1-byte) */ diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index bb65246..2faeaf9 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -8766,7 +8766,7 @@ void woal_regist_oob_wakeup_irq(moal_handle *handle) ENTER(); - node = of_find_compatible_node(NULL, NULL, "nxp,host-wake"); + node = of_find_compatible_node(NULL, NULL, "nxp,wifi-wake-host"); if (!node) goto err_exit; @@ -8777,7 +8777,8 @@ void woal_regist_oob_wakeup_irq(moal_handle *handle) } ret = devm_request_irq(dev, handle->irq_oob_wakeup, - woal_oob_wakeup_irq_handler, IRQF_TRIGGER_LOW, + woal_oob_wakeup_irq_handler, + IRQF_TRIGGER_LOW | IRQF_SHARED, "wifi_oob_wakeup", handle); if (ret) { dev_err(dev, "Failed to request irq_oob_wakeup %d (%d)\n", @@ -8810,7 +8811,10 @@ void woal_unregist_oob_wakeup_irq(moal_handle *handle) struct device *dev = handle->hotplug_device; ENTER(); - devm_free_irq(dev, handle->irq_oob_wakeup, handle); + if (handle->irq_oob_wakeup >= 0) { + device_init_wakeup(dev, false); + devm_free_irq(dev, handle->irq_oob_wakeup, handle); + } LEAVE(); } @@ -8827,7 +8831,7 @@ void woal_disable_oob_wakeup_irq(moal_handle *handle) if (handle->irq_oob_wakeup >= 0) { if (handle->wake_by_wifi) - return; + disable_irq_wake(handle->irq_oob_wakeup); else { disable_irq_wake(handle->irq_oob_wakeup); disable_irq(handle->irq_oob_wakeup); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c index 8cb7bea..407c08f 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_pcie.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_pcie.c @@ -642,12 +642,12 @@ static int woal_pcie_suspend(struct pci_dev *pdev, pm_message_t state) handle->surprise_removed = MTRUE; handle->is_suspended = MTRUE; } - pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); - pci_save_state(pdev); - pci_set_power_state(pdev, pci_choose_state(pdev, state)); #ifdef IMX_SUPPORT woal_enable_oob_wakeup_irq(handle); #endif /* IMX_SUPPORT */ + pci_enable_wake(pdev, pci_choose_state(pdev, state), 1); + pci_save_state(pdev); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); done: PRINTM(MCMND, "<--- Leave woal_pcie_suspend --->\n"); LEAVE(); @@ -1114,8 +1114,10 @@ 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);