qcacld-3.0: Route NDP commands to UMAC's NAN component
Add framework to route NDP commands to UMAC's NAN component.
Change-Id: I0af1d537133eff8b9a78405b39d6ccaede60f341
CRs-Fixed: 2014795
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 9f69656..50d4ae2 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -35,6 +35,7 @@
#include "sme_nan_datapath.h"
#include "wlan_hdd_object_manager.h"
#include <qca_vendor.h>
+#include "os_if_nan.h"
#ifndef WLAN_FEATURE_NAN_CONVERGENCE
/* NLA policy */
@@ -1833,6 +1834,44 @@
*
* Return: 0 on success, negative errno on failure
*/
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+static int __wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
+ struct wireless_dev *wdev, const void *data, int data_len)
+{
+ int ret_val;
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
+
+ ENTER();
+
+ ret_val = wlan_hdd_validate_context(hdd_ctx);
+ if (ret_val)
+ return ret_val;
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+ hdd_err("Command not allowed in FTM mode");
+ return -EPERM;
+ }
+
+ if (!WLAN_HDD_IS_NDP_ENABLED(hdd_ctx)) {
+ hdd_err("NAN datapath is not enabled");
+ return -EPERM;
+ }
+ /* NAN data path coexists only with STA interface */
+ if (false == hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return -EPERM;
+ }
+
+ /* NAN data path coexists only with STA interface */
+ if (false == hdd_is_ndp_allowed(hdd_ctx)) {
+ hdd_err("Unsupported concurrency for NAN datapath");
+ return -EPERM;
+ }
+
+ return os_if_nan_process_ndp_cmd(hdd_ctx->hdd_psoc,
+ data, data_len);
+}
+#else
static int __wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
struct wireless_dev *wdev, const void *data, int data_len)
{
@@ -1911,6 +1950,7 @@
return ret_val;
}
+#endif
/**
* wlan_hdd_cfg80211_process_ndp_cmd() - handle NDP request