Просмотр исходного кода

qcacld-3.0: Add INI items to enable NAN datapath feature

Propagation from qcacld-2.0 to qcacld-3.0.

Add .ini items to enable NAN datapath feature. It will be disabled
by default.

Name: genable_nan_datapath
Minimum: 0 (disable)
Maximum: 1 (enable)
Default: 0 (disable)

CRs-Fixed: 962367
Change-Id: I304fcc70c0e83d890ae95d2d4ff1b7ce691374e2
Deepak Dhamdhere 9 лет назад
Родитель
Сommit
3385d7595e

+ 24 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -3157,6 +3157,26 @@ enum dot11p_mode {
 #define CFG_IGNORE_PEER_HT_MODE_MAX        (1)
 #define CFG_IGNORE_PEER_HT_MODE_DEFAULT    (0)
 
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+/*
+ * Enable NaN data path feature. NaN data path enables
+ * NaN supported devices to exchange data over traditional
+ * TCP/UDP network stack.
+ */
+#define CFG_ENABLE_NAN_DATAPATH_NAME    "genable_nan_datapath"
+#define CFG_ENABLE_NAN_DATAPATH_MIN     (0)
+#define CFG_ENABLE_NAN_DATAPATH_MAX     (1)
+#define CFG_ENABLE_NAN_DATAPATH_DEFAULT (0)
+
+/*
+ * NAN channel on which NAN data interface to start
+ */
+#define CFG_ENABLE_NAN_NDI_CHANNEL_NAME    "gnan_datapath_ndi_channel"
+#define CFG_ENABLE_NAN_NDI_CHANNEL_MIN     (6)
+#define CFG_ENABLE_NAN_NDI_CHANNEL_MAX     (149)
+#define CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT (6)
+#endif
+
 /*
  * Dense Roam Min APs
  * minimum number of AP required for dense roam
@@ -4045,6 +4065,10 @@ struct hdd_config {
 	uint8_t adapt_dwell_lpf_weight;
 	uint8_t adapt_dwell_passive_mon_intval;
 	uint8_t adapt_dwell_wifi_act_threshold;
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+	bool enable_nan_datapath;
+	uint8_t nan_datapath_ndi_channel;
+#endif
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 17 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -45,6 +45,7 @@
 #include <wlan_hdd_misc.h>
 #include <wlan_hdd_napi.h>
 #include <cds_concurrency.h>
+#include "wlan_hdd_nan_datapath.h"
 
 static void
 cb_notify_set_roam_prefer5_g_hz(hdd_context_t *pHddCtx, unsigned long notifyId)
@@ -3919,6 +3920,21 @@ REG_TABLE_ENTRY g_registry_table[] = {
 			CFG_EDCA_BE_AIFS_VALUE_DEFAULT,
 			CFG_EDCA_BE_AIFS_VALUE_MIN,
 			CFG_EDCA_BE_AIFS_VALUE_MAX),
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+	REG_VARIABLE(CFG_ENABLE_NAN_DATAPATH_NAME, WLAN_PARAM_Integer,
+		struct hdd_config, enable_nan_datapath,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ENABLE_NAN_DATAPATH_DEFAULT,
+		CFG_ENABLE_NAN_DATAPATH_MIN,
+		CFG_ENABLE_NAN_DATAPATH_MAX),
+
+	REG_VARIABLE(CFG_ENABLE_NAN_NDI_CHANNEL_NAME, WLAN_PARAM_Integer,
+		struct hdd_config, nan_datapath_ndi_channel,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT,
+		CFG_ENABLE_NAN_NDI_CHANNEL_MIN,
+		CFG_ENABLE_NAN_NDI_CHANNEL_MAX),
+#endif
 
 	REG_VARIABLE(CFG_ENABLE_DP_TRACE, WLAN_PARAM_Integer,
 		struct hdd_config, enable_dp_trace,
@@ -5657,6 +5673,7 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 	hdd_info("Name = [%s] Value = [%u]",
 		CFG_ADAPT_DWELL_WIFI_THRESH_NAME,
 		pHddCtx->config->adapt_dwell_wifi_act_threshold);
+	hdd_ndp_print_ini_config(pHddCtx);
 }
 
 

+ 17 - 0
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -23,4 +23,21 @@
  *
  * WLAN Host Device Driver nan datapath API implementation
  */
+#include "wlan_hdd_includes.h"
 #include "wlan_hdd_nan_datapath.h"
+
+/**
+ * hdd_ndp_print_ini_config()- Print nan datapath specific INI configuration
+ * @hdd_ctx: handle to hdd context
+ *
+ * Return: None
+ */
+void hdd_ndp_print_ini_config(hdd_context_t *hdd_ctx)
+{
+	hddLog(LOG2, "Name = [%s] Value = [%u]",
+		CFG_ENABLE_NAN_DATAPATH_NAME,
+		hdd_ctx->config->enable_nan_datapath);
+	hddLog(LOG2, "Name = [%s] Value = [%u]",
+		CFG_ENABLE_NAN_NDI_CHANNEL_NAME,
+		hdd_ctx->config->nan_datapath_ndi_channel);
+}

+ 10 - 0
core/hdd/src/wlan_hdd_nan_datapath.h

@@ -27,5 +27,15 @@
 #ifndef __WLAN_HDD_NAN_DATAPATH_H
 #define __WLAN_HDD_NAN_DATAPATH_H
 
+struct hdd_context_s;
+
+#ifdef WLAN_FEATURE_NAN_DATAPATH
+void hdd_ndp_print_ini_config(struct hdd_context_s *hdd_ctx);
+#else
+static inline void hdd_ndp_print_ini_config(struct hdd_context_s *hdd_ctx)
+{
+}
+#endif /* WLAN_FEATURE_NAN_DATAPATH */
+
 #endif /* __WLAN_HDD_NAN_DATAPATH_H */