Răsfoiți Sursa

qcacld-3.0: Combine all NAN related flags with WLAN_FEATURE_NAN

Flag WLAN_FEATURE_NAN_DATAPATH was added to protect NAN Datapath
related code, while WLAN_FEATURE_NAN_CONVERGENCE was added to
protect the converged code inside NAN Component. Since the
original NAN Discovery related code has now been moved inside
NAN component and NAN Datapath cannot exist without NAN Discovery,
keeping these flags separate doesn't make sense. Combine these
two flags with WLAN_FEATURE_NAN flag which is the original NAN
feature flag.

As a cleanup of NAN code, combine all NAN related flags with
WLAN_FEATURE_NAN flag.

Change-Id: If98ecaace17f8724e9c28325ef61e721f42e1d8f
CRs-Fixed: 2377375
Nachiket Kukade 6 ani în urmă
părinte
comite
6651a41e17

+ 2 - 2
cfg/cfg_all.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -35,7 +35,7 @@
 #define CFG_TDLS_ALL
 #endif
 
-#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#ifdef WLAN_FEATURE_NAN
 #include "cfg_nan.h"
 #else
 #define CFG_NAN_ALL

+ 4 - 4
nan/core/inc/wlan_nan_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -28,7 +28,7 @@
 #include "wlan_policy_mgr_public_struct.h"
 #include "qdf_status.h"
 
-#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#ifdef WLAN_FEATURE_NAN
 
 #include "../src/nan_main_i.h"
 
@@ -164,7 +164,7 @@ struct wlan_nan_rx_ops *nan_psoc_get_rx_ops(struct wlan_objmgr_psoc *psoc)
 QDF_STATUS
 wlan_nan_get_connection_info(struct wlan_objmgr_psoc *psoc,
 			     struct policy_mgr_vdev_entry_info *conn_info);
-#else /* WLAN_FEATURE_NAN_CONVERGENCE */
+#else /* WLAN_FEATURE_NAN */
 static inline QDF_STATUS nan_init(void)
 {
 	return QDF_STATUS_SUCCESS;
@@ -191,5 +191,5 @@ wlan_nan_get_connection_info(struct wlan_objmgr_psoc *psoc,
 {
 	return QDF_STATUS_SUCCESS;
 }
-#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
+#endif /* WLAN_FEATURE_NAN */
 #endif /* _WLAN_NAN_API_H_ */

+ 7 - 9
nan/core/src/nan_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -32,6 +32,7 @@
 #include "cfg_nan.h"
 #include "cfg_ucfg_api.h"
 
+#ifdef WLAN_FEATURE_NAN
 /**
  * nan_cfg_init() - Initialize NAN config params
  * @psoc: Pointer to PSOC Object
@@ -39,7 +40,6 @@
  *
  * This function initialize NAN config params
  */
-#ifdef WLAN_FEATURE_NAN
 static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
 			 struct nan_psoc_priv_obj *nan_obj)
 {
@@ -48,12 +48,6 @@ static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
 
 	nan_obj->cfg_param.enable = cfg_get(psoc, CFG_NAN_ENABLE);
 }
-#else
-static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
-			 struct nan_psoc_priv_obj *nan_obj)
-{
-}
-#endif
 
 /**
  * nan_cfg_dp_init() - Initialize NAN Datapath config params
@@ -62,7 +56,6 @@ static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
  *
  * This function initialize NAN config params
  */
-#ifdef WLAN_FEATURE_NAN_DATAPATH
 static void nan_cfg_dp_init(struct wlan_objmgr_psoc *psoc,
 			    struct nan_psoc_priv_obj *nan_obj)
 {
@@ -74,6 +67,11 @@ static void nan_cfg_dp_init(struct wlan_objmgr_psoc *psoc,
 				cfg_get(psoc, CFG_NAN_RANDOMIZE_NDI_MAC);
 }
 #else
+static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
+			 struct nan_psoc_priv_obj *nan_obj)
+{
+}
+
 static void nan_cfg_dp_init(struct wlan_objmgr_psoc *psoc,
 			    struct nan_psoc_priv_obj *nan_obj)
 {

+ 3 - 7
nan/core/src/nan_main_i.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -21,7 +21,7 @@
  * used in NAN modules
  */
 
-#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#ifdef WLAN_FEATURE_NAN
 #ifndef _WLAN_NAN_MAIN_I_H_
 #define _WLAN_NAN_MAIN_I_H_
 
@@ -83,13 +83,9 @@ enum nan_disc_state {
  * @ndi_mac_randomize: Randomize NAN datapath interface MAC
  */
 struct nan_cfg_params {
-#ifdef WLAN_FEATURE_NAN
 	bool enable;
-#endif
-#ifdef WLAN_FEATURE_NAN_DATAPATH
 	bool dp_enable;
 	bool ndi_mac_randomize;
-#endif
 };
 
 /**
@@ -245,4 +241,4 @@ nan_get_connection_info(struct wlan_objmgr_psoc *psoc, uint8_t *chan,
 			uint8_t *mac_id);
 
 #endif /* _WLAN_NAN_MAIN_I_H_ */
-#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
+#endif /* WLAN_FEATURE_NAN */

+ 2 - 6
nan/dispatcher/inc/cfg_nan.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -95,14 +95,10 @@
 
 #ifdef WLAN_FEATURE_NAN
 #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE)
-#else
-#define CFG_NAN_DISC
-#endif
-
-#ifdef WLAN_FEATURE_NAN_DATAPATH
 #define CFG_NAN_DP      CFG(CFG_NAN_DATAPATH_ENABLE) \
 			CFG(CFG_NAN_RANDOMIZE_NDI_MAC)
 #else
+#define CFG_NAN_DISC
 #define CFG_NAN_DP
 #endif
 

+ 7 - 8
nan/dispatcher/inc/cfg_nan_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -37,14 +37,7 @@ struct wlan_objmgr_psoc;
  * This function returns NAN enable status
  */
 bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc);
-#else
-static inline bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc)
-{
-	return false;
-}
-#endif
 
-#ifdef WLAN_FEATURE_NAN_DATAPATH
 /**
  * cfg_nan_get_datapath_enable() - get NAN Datapath support enable status
  * @psoc: pointer to psoc object
@@ -61,6 +54,11 @@ bool cfg_nan_get_datapath_enable(struct wlan_objmgr_psoc *psoc);
  */
 bool cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc *psoc);
 #else
+static inline bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
+
 static inline bool cfg_nan_get_datapath_enable(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
@@ -71,5 +69,6 @@ static inline bool cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc *psoc)
 	return false;
 }
 #endif
+
 #endif