From 44ed1ebb6a15d3d357e227cd209c0b7efe125428 Mon Sep 17 00:00:00 2001
From: Sherry Sun <sherry.sun@nxp.com>
Date: Mon, 2 Oct 2023 12:38:24 +0800
Subject: [PATCH] mxm_wifiex: fix L6.1.55 kernel build break

When build wifi driver based on L6.1.55 kernel, will observe the
following build error.

| mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:10345:36: error: 'REGULATORY_IGNORE_STALE_KICKOFF' undeclared (first use in this function)
| 10345 |         wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
|       |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This error caused by kernel patch e8c2af660ba0("wifi: cfg80211: fix
regulatory disconnect with OCB/NAN") remove the
REGULATORY_IGNORE_STALE_KICKOFF flag.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
---
 mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c
index fd08276..49f9620 100644
--- a/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c
+++ b/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c
@@ -10422,7 +10422,7 @@ mlan_status woal_register_cfg80211(moal_private *priv)
 		PRINTM(MIOCTL, "Follow countryIE provided by AP.\n");
 	}
 #endif
-#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) && CFG80211_VERSION_CODE < KERNEL_VERSION(6, 1, 39)
 	/*REGULATORY_IGNORE_STALE_KICKOFF: the regulatory core will _not_ make
 	 * sure all interfaces on this wiphy reside on allowed channels. If this
 	 * flag is not set, upon a regdomain change, the interfaces are given a