Browse Source

qcacmn: Add interface to WDI-stats and quota limit

Add structure changes for querying WDI-stats, register the callback
functions for IPA to query WDI stats and sets the quota limit

Change-Id: I05d9d50fad735fa0a57c4de23c81461f6e12b648
CRs-Fixed: 1095710
Yun Park 8 years ago
parent
commit
6716dfffcd
2 changed files with 55 additions and 5 deletions
  1. 46 0
      dp/inc/cdp_txrx_ipa.h
  2. 9 5
      dp/inc/cdp_txrx_ops.h

+ 46 - 0
dp/inc/cdp_txrx_ipa.h

@@ -237,5 +237,51 @@ static inline void cdp_ipa_set_uc_tx_partition_base(ol_txrx_soc_handle soc,
 
 	return;
 }
+
+/**
+ * cdp_ipa_uc_get_share_stats() - get Tx/Rx byte stats from FW
+ * @pdev: physical device instance
+ * @value: reset stats
+ *
+ * Return: none
+ */
+static inline void cdp_ipa_uc_get_share_stats(ol_txrx_soc_handle soc,
+				struct cdp_pdev *pdev, uint8_t value)
+{
+	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			"%s invalid instance", __func__);
+		return;
+	}
+
+	if (soc->ops->ipa_ops->ipa_uc_get_share_stats)
+		return soc->ops->ipa_ops->ipa_uc_get_share_stats(pdev,
+								 value);
+
+	return;
+}
+
+/**
+ * cdp_ipa_uc_set_quota() - set quota limit to FW
+ * @pdev: physical device instance
+ * @value: quota limit bytes
+ *
+ * Return: none
+ */
+static inline void cdp_ipa_uc_set_quota(ol_txrx_soc_handle soc,
+				struct cdp_pdev *pdev, uint64_t value)
+{
+	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			"%s invalid instance", __func__);
+		return;
+	}
+
+	if (soc->ops->ipa_ops->ipa_uc_get_share_stats)
+		return soc->ops->ipa_ops->ipa_uc_set_quota(pdev,
+							   value);
+
+	return;
+}
 #endif /* _CDP_TXRX_IPA_H_ */
 

+ 9 - 5
dp/inc/cdp_txrx_ops.h

@@ -704,20 +704,24 @@ struct cdp_lflowctl_ops {
  */
 struct cdp_ipa_ops {
 	void (*ipa_get_resource)(struct cdp_pdev *pdev,
-			struct ol_txrx_ipa_resources *ipa_res);
+		struct ol_txrx_ipa_resources *ipa_res);
 	void (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev,
-		 qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
-		 qdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
+		qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
+		qdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
 	void (*ipa_set_active)(struct cdp_pdev *pdev,
 		bool uc_active, bool is_tx);
 	void (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg);
 	void (*ipa_register_op_cb)(struct cdp_pdev *pdev,
-		 void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
-		 void *osif_dev);
+		void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
+		void *osif_dev);
 	void (*ipa_get_stat)(struct cdp_pdev *pdev);
 	qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb);
 	void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *cfg_pdev,
 		uint32_t value);
+	void (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev,
+		uint8_t reset_stats);
+	void (*ipa_uc_set_quota)(struct cdp_pdev *pdev,
+		uint64_t quota_bytes);
 };
 
 /**