Преглед на файлове

qcacmn: Extending TDLS Peer ops and pause/unpause APIs

Changes are done to extend vdev based pause/unpause to
peer based pauses/unpause. Added changes to mark peer
as tdls peer and supports TDLS offchan operations which
will be used to pause/unpause the peer queues based on
pause type coming with pause event from FW.

Change-Id: I3976501c318ae5a295e71ed2265db04496974c7a
CRs-Fixed: 2508209
nakul kachhwaha преди 5 години
родител
ревизия
f9ae9360f9
променени са 3 файла, в които са добавени 55 реда и са изтрити 6 реда
  1. 4 4
      dp/inc/cdp_txrx_flow_ctrl_legacy.h
  2. 6 2
      dp/inc/cdp_txrx_ops.h
  3. 45 0
      dp/inc/cdp_txrx_peer_ops.h

+ 4 - 4
dp/inc/cdp_txrx_flow_ctrl_legacy.h

@@ -265,7 +265,7 @@ cdp_fc_vdev_flush(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
  */
 static inline void
 cdp_fc_vdev_pause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
-		uint32_t reason)
+		uint32_t reason, uint32_t pause_type)
 {
 	if (!soc || !soc->ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -278,7 +278,7 @@ cdp_fc_vdev_pause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	    !soc->ops->l_flowctl_ops->vdev_pause)
 		return;
 
-	soc->ops->l_flowctl_ops->vdev_pause(vdev, reason);
+	soc->ops->l_flowctl_ops->vdev_pause(vdev, reason, pause_type);
 }
 
 /**
@@ -293,7 +293,7 @@ cdp_fc_vdev_pause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
  */
 static inline void
 cdp_fc_vdev_unpause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
-		uint32_t reason)
+		uint32_t reason, uint32_t pause_type)
 {
 	if (!soc || !soc->ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -305,6 +305,6 @@ cdp_fc_vdev_unpause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	    !soc->ops->l_flowctl_ops->vdev_unpause)
 		return;
 
-	soc->ops->l_flowctl_ops->vdev_unpause(vdev, reason);
+	soc->ops->l_flowctl_ops->vdev_unpause(vdev, reason, pause_type);
 }
 #endif /* _CDP_TXRX_FC_LEG_H_ */

+ 6 - 2
dp/inc/cdp_txrx_ops.h

@@ -1157,6 +1157,8 @@ struct cdp_peer_ops {
 	void (*update_last_real_peer)(struct cdp_pdev *pdev, void *vdev,
 			uint8_t *peer_id, bool restore_last_peer);
 	void (*peer_detach_force_delete)(void *peer);
+	void (*set_tdls_offchan_enabled)(void *peer, bool val);
+	void (*set_peer_as_tdls_peer)(void *peer, bool val);
 };
 
 /**
@@ -1281,8 +1283,10 @@ struct cdp_lflowctl_ops {
 			 unsigned int high_watermark_offset);
 	int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth);
 	void (*vdev_flush)(struct cdp_vdev *vdev);
-	void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason);
-	void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
+	void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason,
+			   uint32_t pause_type);
+	void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason,
+			     uint32_t pause_type);
 };
 
 /**

+ 45 - 0
dp/inc/cdp_txrx_peer_ops.h

@@ -675,4 +675,49 @@ is_cdp_peer_detach_force_delete_supported(ol_txrx_soc_handle soc)
 
 	return false;
 }
+
+/*
+ * cdp_peer_set_peer_as_tdls() - To set peer as tdls peer
+ * @soc: pointer to SOC handle
+ * @peer: dp peer
+ * @var: true or false
+ *
+ * Return: void
+ */
+static inline void
+cdp_peer_set_peer_as_tdls(ol_txrx_soc_handle soc, void *peer, bool val)
+{
+	if (!soc || !soc->ops || !soc->ops->peer_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			  "%s invalid instance", __func__);
+		return;
+	}
+
+	if (soc->ops->peer_ops->set_peer_as_tdls_peer)
+		soc->ops->peer_ops->set_peer_as_tdls_peer(peer, val);
+}
+
+/**
+ * cdp_peer_set_tdls_offchan_enabled() - Set tdls offchan operation as enabled
+ * @soc - data path soc handle
+ * @peer - peer instance pointer
+ * @val - true or false
+ *
+ * update tdls_offchan_enabled
+ *
+ * Return: none
+ */
+static inline void
+cdp_peer_set_tdls_offchan_enabled(ol_txrx_soc_handle soc, void *peer, bool val)
+{
+	if (!soc || !soc->ops || !soc->ops->peer_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			  "%s invalid instance", __func__);
+		return;
+	}
+
+	if (soc->ops->peer_ops->set_tdls_offchan_enabled)
+		soc->ops->peer_ops->set_tdls_offchan_enabled(peer, val);
+}
+
 #endif /* _CDP_TXRX_PEER_H_ */