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
diff --git a/dp/inc/cdp_txrx_flow_ctrl_legacy.h b/dp/inc/cdp_txrx_flow_ctrl_legacy.h
index 4672ac6..d919d50 100644
--- a/dp/inc/cdp_txrx_flow_ctrl_legacy.h
+++ b/dp/inc/cdp_txrx_flow_ctrl_legacy.h
@@ -265,7 +265,7 @@
*/
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 @@
!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 @@
*/
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 @@
!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_ */
diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h
index bfa2839..c6a291a 100644
--- a/dp/inc/cdp_txrx_ops.h
+++ b/dp/inc/cdp_txrx_ops.h
@@ -1157,6 +1157,8 @@
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 @@
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);
};
/**
diff --git a/dp/inc/cdp_txrx_peer_ops.h b/dp/inc/cdp_txrx_peer_ops.h
index c21ba91..41d3f60 100644
--- a/dp/inc/cdp_txrx_peer_ops.h
+++ b/dp/inc/cdp_txrx_peer_ops.h
@@ -675,4 +675,49 @@
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_ */