Ver Fonte

qcacmn: Add API to get dp peer authorize state

Add API to get dp peer authorize state.
Also modify dp_tx_get_rbm_id_li to update rbm for IPA offload
scenario

Change-Id: I0f8cca4623a1c3b840f336aa6d67740951cb6700
Himanshu Batra há 3 anos atrás
pai
commit
ff8ee42eac

+ 27 - 0
dp/inc/cdp_txrx_ctrl.h

@@ -283,6 +283,33 @@ cdp_peer_authorize(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
 			(soc, vdev_id, peer_mac, authorize);
 }
 
+/**
+ * cdp_peer_get_authorize Get per authorize status
+ *
+ * @soc - pointer to the soc
+ * @vdev_id - id of the pointer to vdev
+ * @peer_mac - mac address of the node's object
+ *
+ * Return: true is peer is authorized, false otherwise
+ */
+static inline bool
+cdp_peer_get_authorize(ol_txrx_soc_handle soc, uint8_t vdev_id,
+		       uint8_t *peer_mac)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance:");
+		QDF_BUG(0);
+		return false;
+	}
+
+	if (!soc->ops->ctrl_ops ||
+	    !soc->ops->ctrl_ops->txrx_peer_get_authorize)
+		return false;
+
+	return soc->ops->ctrl_ops->txrx_peer_get_authorize
+			(soc, vdev_id, peer_mac);
+}
+
 static inline void cdp_tx_flush_buffers
 (ol_txrx_soc_handle soc, uint8_t vdev_id)
 {

+ 4 - 0
dp/inc/cdp_txrx_ops.h

@@ -621,6 +621,10 @@ struct cdp_ctrl_ops {
 				       uint8_t vdev_id,
 				       uint8_t *peer_mac,
 				       u_int32_t authorize);
+	bool
+		(*txrx_peer_get_authorize)(struct cdp_soc_t *soc_hdl,
+					   uint8_t vdev_id,
+					   uint8_t *peer_mac);
 
 	void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id);
 

+ 30 - 1
dp/wifi3.0/dp_main.c

@@ -7309,6 +7309,35 @@ dp_peer_authorize(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 	return status;
 }
 
+/*
+ * dp_peer_get_authorize() - get peer authorize status
+ * @soc: soc handle
+ * @vdev_id: id of dp handle
+ * @peer_mac: mac of datapath PEER handle
+ *
+ * Retusn: true is peer is authorized, false otherwise
+ */
+static bool
+dp_peer_get_authorize(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
+		      uint8_t *peer_mac)
+{
+	struct dp_soc *soc = (struct dp_soc *)soc_hdl;
+	bool authorize = false;
+	struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac,
+						      0, vdev_id,
+						      DP_MOD_ID_CDP);
+
+	if (!peer) {
+		dp_cdp_debug("%pK: Peer is NULL!\n", soc);
+		return authorize;
+	}
+
+	authorize = peer->authorize;
+	dp_peer_unref_delete(peer, DP_MOD_ID_CDP);
+
+	return authorize;
+}
+
 /**
  * dp_vdev_unref_delete() - check and process vdev delete
  * @soc : DP specific soc pointer
@@ -11272,6 +11301,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
 
 static struct cdp_ctrl_ops dp_ops_ctrl = {
 	.txrx_peer_authorize = dp_peer_authorize,
+	.txrx_peer_get_authorize = dp_peer_get_authorize,
 #ifdef VDEV_PEER_PROTOCOL_COUNT
 	.txrx_enable_peer_protocol_count = dp_enable_vdev_peer_protocol_count,
 	.txrx_set_peer_protocol_drop_mask =
@@ -12219,7 +12249,6 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
 		dp_err("wlan_cfg_ctx failed\n");
 		goto fail1;
 	}
-
 	dp_soc_cfg_attach(soc);
 
 	if (dp_hw_link_desc_pool_banks_alloc(soc, WLAN_INVALID_PDEV_ID)) {

+ 8 - 1
dp/wifi3.0/li/dp_li_tx.c

@@ -63,13 +63,20 @@ void dp_tx_comp_get_params_from_hal_desc_li(struct dp_soc *soc,
  *
  * Return - HAL ring handle
  */
+#ifdef IPA_OFFLOAD
+static inline uint8_t dp_tx_get_rbm_id_li(struct dp_soc *soc,
+					  uint8_t ring_id)
+{
+	return (ring_id + soc->wbm_sw0_bm_id);
+}
+#else
 static inline uint8_t dp_tx_get_rbm_id_li(struct dp_soc *soc,
 					  uint8_t ring_id)
 {
 	return (ring_id ? soc->wbm_sw0_bm_id + (ring_id - 1) :
 			  HAL_WBM_SW2_BM_ID(soc->wbm_sw0_bm_id));
 }
-
+#endif
 #else
 static inline uint8_t dp_tx_get_rbm_id_li(struct dp_soc *soc,
 					  uint8_t ring_id)

+ 6 - 1
hal/wifi3.0/hal_srng.c

@@ -1275,6 +1275,8 @@ void hal_reo_read_write_ctrl_ix(hal_soc_handle_t hal_soc_hdl, bool read,
 	}
 }
 
+qdf_export_symbol(hal_reo_read_write_ctrl_ix);
+
 /**
  * hal_srng_dst_set_hp_paddr_confirm() - Set physical address to dest ring head
  *  pointer and confirm that write went through by reading back the value
@@ -1289,6 +1291,8 @@ void hal_srng_dst_set_hp_paddr_confirm(struct hal_srng *srng, uint64_t paddr)
 	SRNG_DST_REG_WRITE_CONFIRM(srng, HP_ADDR_MSB, paddr >> 32);
 }
 
+qdf_export_symbol(hal_srng_dst_set_hp_paddr_confirm);
+
 /**
  * hal_srng_dst_init_hp() - Initialize destination ring head
  * pointer
@@ -1321,6 +1325,8 @@ void hal_srng_dst_init_hp(struct hal_soc_handle *hal_soc,
 	}
 }
 
+qdf_export_symbol(hal_srng_dst_init_hp);
+
 /**
  * hal_srng_hw_init - Private function to initialize SRNG HW
  * @hal_soc: HAL SOC handle
@@ -1742,7 +1748,6 @@ void hal_set_low_threshold(hal_ring_handle_t hal_ring_hdl,
 }
 qdf_export_symbol(hal_set_low_threshold);
 
-
 #ifdef FORCE_WAKE
 void hal_set_init_phase(hal_soc_handle_t soc, bool init_phase)
 {