Browse Source

qcacld-3.0: Properly advertise NAN iface_combinations to wiphy

With WLAN_FEATURE_NAN=n and kernel version > 4.9.0 , wiphy_register()
returns failure and throws below warning:

WARNING: CPU: 1 PID: 8 at net/wireless/core.c:641
wiphy_register+0x5ac/0x944

With above config, NL80211_IFTYPE_NAN is not advertised to
wiphy->interface_modes. But NL80211_IFTYPE_NAN is advertised
to wiphy->iface_combinations. Hence the failure and warning are seen.

Fix is to advertise NAN iface_combinations only when NAN feature
flag and kernel version are met.

Change-Id: Iaceea699939df919c17dc81a1195f7dea1543982
CRs-Fixed: 3329527
Jia Ding 2 years ago
parent
commit
1a97addf36
1 changed files with 8 additions and 2 deletions
  1. 8 2
      core/hdd/src/wlan_hdd_cfg80211.c

+ 8 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -738,6 +738,8 @@ static const struct ieee80211_iface_limit
 	},
 };
 
+#if defined(WLAN_FEATURE_NAN) && \
+	   (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
 /* STA + NAN disc combination */
 static const struct ieee80211_iface_limit
 	wlan_hdd_sta_nan_iface_limit[] = {
@@ -768,7 +770,8 @@ static const struct ieee80211_iface_limit
 		.types = BIT(NL80211_IFTYPE_NAN),
 	},
 };
-#endif
+#endif /* !WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY */
+#endif /* WLAN_FEATURE_NAN */
 
 static struct ieee80211_iface_combination
 	wlan_hdd_iface_combination[] = {
@@ -859,6 +862,8 @@ static struct ieee80211_iface_combination
 		.num_different_channels = 2,
 		.n_limits = ARRAY_SIZE(wlan_hdd_mon_iface_limit),
 	},
+#if defined(WLAN_FEATURE_NAN) && \
+	   (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
 	/* NAN + STA */
 	{
 		.limits = wlan_hdd_sta_nan_iface_limit,
@@ -875,7 +880,8 @@ static struct ieee80211_iface_combination
 		.n_limits = ARRAY_SIZE(wlan_hdd_sap_nan_iface_limit),
 		.beacon_int_infra_match = true,
 	},
-#endif
+#endif /* !WLAN_FEATURE_NO_SAP_NAN_CONCURRENCY */
+#endif /* WLAN_FEATURE_NAN */
 };
 
 static struct cfg80211_ops wlan_hdd_cfg80211_ops;