浏览代码

qcacld-3.0: Increase max ndp instances per peer to 2

To allow multiple instances of NDP on single peer, limit of max ndp
instances per peer set to 2.

Thus termination of first NDP instance will not affect second NDP
connection.

Change-Id: I421b185bd344688630dbe02e97f0b047d8823abe
CRs-Fixed: 2654713
Abhishek Ambure 5 年之前
父节点
当前提交
79c5436094
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 10 2
      components/nan/core/src/nan_main.c
  2. 1 1
      components/nan/core/src/nan_main_i.h

+ 10 - 2
components/nan/core/src/nan_main.c

@@ -354,9 +354,14 @@ nan_increment_ndp_sessions(struct wlan_objmgr_psoc *psoc,
 	 * Store the first channel info in NDP Confirm as the home channel info
 	 * and store it in the peer private object.
 	 */
-	qdf_mem_copy(&peer_nan_obj->home_chan_info, ndp_chan_info,
-		     sizeof(struct nan_datapath_channel_info));
+	if (!peer_nan_obj->active_ndp_sessions)
+		qdf_mem_copy(&peer_nan_obj->home_chan_info, ndp_chan_info,
+			     sizeof(struct nan_datapath_channel_info));
+
 	peer_nan_obj->active_ndp_sessions++;
+	nan_debug("Number of active session = %d for peer:"QDF_MAC_ADDR_STR"",
+		  peer_nan_obj->active_ndp_sessions,
+		  QDF_MAC_ADDR_ARRAY(peer_ndi_mac->bytes));
 	qdf_spin_unlock_bh(&peer_nan_obj->lock);
 	wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);
 
@@ -393,6 +398,9 @@ static QDF_STATUS nan_decrement_ndp_sessions(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_FAILURE;
 	}
 	peer_nan_obj->active_ndp_sessions--;
+	nan_debug("Number of active session = %d for peer:"QDF_MAC_ADDR_STR"",
+		  peer_nan_obj->active_ndp_sessions,
+		  QDF_MAC_ADDR_ARRAY(peer_ndi_mac->bytes));
 	qdf_spin_unlock_bh(&peer_nan_obj->lock);
 	wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);
 

+ 1 - 1
components/nan/core/src/nan_main_i.h

@@ -59,7 +59,7 @@ struct scheduler_msg;
 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_NAN, params)
 
 /* Maximum number of NDP instances supported on each NAN Peer */
-#define MAX_NDP_INSTANCES_PER_PEER 1
+#define MAX_NDP_INSTANCES_PER_PEER 2
 
 /**
  * enum nan_disc_state - NAN Discovery states