|
@@ -21,6 +21,7 @@
|
|
|
|
|
|
#include "qdf_types.h"
|
|
|
#include "qdf_util.h"
|
|
|
+#include "qdf_atomic.h"
|
|
|
#include "hal_internal.h"
|
|
|
#define MAX_UNWINDOWED_ADDRESS 0x80000
|
|
|
#ifdef QCA_WIFI_QCA6390
|
|
@@ -1582,4 +1583,74 @@ hal_ring_desc_t hal_rxdma_desc_to_hal_ring_desc(hal_rxdma_desc_t ring_desc)
|
|
|
{
|
|
|
return (hal_ring_desc_t)ring_desc;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_srng_set_event() - Set hal_srng event
|
|
|
+ * @hal_ring_hdl: Source ring pointer
|
|
|
+ * @event: SRNG ring event
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static inline void hal_srng_set_event(hal_ring_handle_t hal_ring_hdl, int event)
|
|
|
+{
|
|
|
+ struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
|
|
+
|
|
|
+ qdf_atomic_set_bit(event, &srng->srng_event);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_srng_clear_event() - Clear hal_srng event
|
|
|
+ * @hal_ring_hdl: Source ring pointer
|
|
|
+ * @event: SRNG ring event
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static inline
|
|
|
+void hal_srng_clear_event(hal_ring_handle_t hal_ring_hdl, int event)
|
|
|
+{
|
|
|
+ struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
|
|
+
|
|
|
+ qdf_atomic_clear_bit(event, &srng->srng_event);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_srng_get_clear_event() - Clear srng event and return old value
|
|
|
+ * @hal_ring_hdl: Source ring pointer
|
|
|
+ * @event: SRNG ring event
|
|
|
+ *
|
|
|
+ * Return: Return old event value
|
|
|
+ */
|
|
|
+static inline
|
|
|
+int hal_srng_get_clear_event(hal_ring_handle_t hal_ring_hdl, int event)
|
|
|
+{
|
|
|
+ struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
|
|
+
|
|
|
+ return qdf_atomic_test_and_clear_bit(event, &srng->srng_event);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_srng_set_flush_last_ts() - Record last flush time stamp
|
|
|
+ * @hal_ring_hdl: Source ring pointer
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static inline void hal_srng_set_flush_last_ts(hal_ring_handle_t hal_ring_hdl)
|
|
|
+{
|
|
|
+ struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
|
|
+
|
|
|
+ srng->last_flush_ts = qdf_get_log_timestamp();
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hal_srng_inc_flush_cnt() - Increment flush counter
|
|
|
+ * @hal_ring_hdl: Source ring pointer
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static inline void hal_srng_inc_flush_cnt(hal_ring_handle_t hal_ring_hdl)
|
|
|
+{
|
|
|
+ struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
|
|
+
|
|
|
+ srng->flush_count++;
|
|
|
+}
|
|
|
#endif /* _HAL_APIH_ */
|