qcacmn: DP changes to create li/be TX files

Move DP TX target specific functionality to dp/wifi3.0/be
and dp/wifi3.0/li folders. DP Functionality common to both lithium and
beryllium targets stays in dp/wifi3.0.

Change-Id: I3497284153e2ea30a9cb1faf05bd41422329b804
CRs-Fixed: 2891038
This commit is contained in:
Mohit Khanna
2021-02-17 01:06:06 -08:00
committed by Rakesh Pillai
parent ca2db4bfa8
commit e135b3e106
15 changed files with 1496 additions and 303 deletions

View File

@@ -25,6 +25,7 @@
#include "if_meta_hdr.h"
#endif
#include "dp_internal.h"
#include "hal_tx.h"
#define DP_INVALID_VDEV_ID 0xFF
@@ -457,11 +458,11 @@ static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
*
* Return - HAL ring handle
*/
static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *doc,
static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *soc,
uint8_t ring_id)
{
return (ring_id ? HAL_WBM_SW0_BM_ID + (ring_id - 1) :
HAL_WBM_SW2_BM_ID);
return (ring_id ? soc->wbm_sw0_bm_id + (ring_id - 1) :
HAL_WBM_SW2_BM_ID(soc->wbm_sw0_bm_id));
}
#else /* QCA_OL_TX_MULTIQ_SUPPORT */
@@ -485,7 +486,7 @@ static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *soc,
uint8_t ring_id)
{
return (ring_id + HAL_WBM_SW0_BM_ID);
return (ring_id + soc->wbm_sw0_bm_id);
}
#endif
@@ -676,4 +677,113 @@ dp_send_completion_to_pkt_capture(struct dp_soc *soc,
{
}
#endif
#ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
/**
* dp_tx_update_stats() - Update soc level tx stats
* @soc: DP soc handle
* @nbuf: packet being transmitted
*
* Returns: none
*/
void dp_tx_update_stats(struct dp_soc *soc,
qdf_nbuf_t nbuf);
/**
* dp_tx_attempt_coalescing() - Check and attempt TCL register write coalescing
* @soc: Datapath soc handle
* @tx_desc: tx packet descriptor
* @tid: TID for pkt transmission
*
* Returns: 1, if coalescing is to be done
* 0, if coalescing is not to be done
*/
int
dp_tx_attempt_coalescing(struct dp_soc *soc, struct dp_vdev *vdev,
struct dp_tx_desc_s *tx_desc,
uint8_t tid);
/**
* dp_tx_ring_access_end() - HAL ring access end for data transmission
* @soc: Datapath soc handle
* @hal_ring_hdl: HAL ring handle
* @coalesce: Coalesce the current write or not
*
* Returns: none
*/
void
dp_tx_ring_access_end(struct dp_soc *soc, hal_ring_handle_t hal_ring_hdl,
int coalesce);
#else
/**
* dp_tx_update_stats() - Update soc level tx stats
* @soc: DP soc handle
* @nbuf: packet being transmitted
*
* Returns: none
*/
static inline void dp_tx_update_stats(struct dp_soc *soc,
qdf_nbuf_t nbuf) { }
static inline void
dp_tx_ring_access_end(struct dp_soc *soc, hal_ring_handle_t hal_ring_hdl,
int coalesce)
{
dp_tx_hal_ring_access_end(soc, hal_ring_hdl);
}
static inline int
dp_tx_attempt_coalescing(struct dp_soc *soc, struct dp_vdev *vdev,
struct dp_tx_desc_s *tx_desc,
uint8_t tid)
{
return 0;
}
#endif /* WLAN_DP_FEATURE_SW_LATENCY_MGR */
#ifdef FEATURE_RUNTIME_PM
void
dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl,
int coalesce);
#else
static inline void
dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl,
int coalesce)
{
dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
}
#endif
#ifdef DP_TX_HW_DESC_HISTORY
static inline void
dp_tx_hw_desc_update_evt(uint8_t *hal_tx_desc_cached,
hal_ring_handle_t hal_ring_hdl,
struct dp_soc *soc)
{
struct dp_tx_hw_desc_evt *evt;
uint64_t idx = 0;
if (!soc->tx_hw_desc_history)
return;
idx = ++soc->tx_hw_desc_history->index;
if (idx == DP_TX_HW_DESC_HIST_MAX)
soc->tx_hw_desc_history->index = 0;
idx = qdf_do_div_rem(idx, DP_TX_HW_DESC_HIST_MAX);
evt = &soc->tx_hw_desc_history->entry[idx];
qdf_mem_copy(evt->tcl_desc, hal_tx_desc_cached, HAL_TX_DESC_LEN_BYTES);
evt->posted = qdf_get_log_timestamp();
hal_get_sw_hptp(soc->hal_soc, hal_ring_hdl, &evt->tp, &evt->hp);
}
#else
static inline void
dp_tx_hw_desc_update_evt(uint8_t *hal_tx_desc_cached,
hal_ring_handle_t hal_ring_hdl,
struct dp_soc *soc)
{
}
#endif
#endif