qcacmn: Remove void pointer usage for ring desc's
Make change to remove usage of void pointers for ring descriptors and instead use a opaque pointer dp_ring_desc_t. Change-Id: Ia1e9a3da9eaa3cccf297b2135b52a72f2fe21431 CRs-Fixed: 2484409
This commit is contained in:
@@ -56,7 +56,8 @@ void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring,
|
||||
}
|
||||
#else
|
||||
void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring,
|
||||
void *ring_desc, struct dp_rx_desc *rx_desc)
|
||||
hal_ring_desc_t ring_desc,
|
||||
struct dp_rx_desc *rx_desc)
|
||||
{
|
||||
void *hal_soc = soc->hal_soc;
|
||||
|
||||
@@ -1460,7 +1461,8 @@ int dp_wds_rx_policy_check(uint8_t *rx_tlv_hdr,
|
||||
*
|
||||
* Return: NONE
|
||||
*/
|
||||
static inline void dp_rx_desc_nbuf_sanity_check(void *ring_desc,
|
||||
static inline
|
||||
void dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,
|
||||
struct dp_rx_desc *rx_desc)
|
||||
{
|
||||
struct hal_buf_info hbi;
|
||||
@@ -1471,7 +1473,8 @@ static inline void dp_rx_desc_nbuf_sanity_check(void *ring_desc,
|
||||
qdf_nbuf_get_frag_paddr(rx_desc->nbuf, 0));
|
||||
}
|
||||
#else
|
||||
static inline void dp_rx_desc_nbuf_sanity_check(void *ring_desc,
|
||||
static inline
|
||||
void dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,
|
||||
struct dp_rx_desc *rx_desc)
|
||||
{
|
||||
}
|
||||
@@ -1619,7 +1622,7 @@ uint32_t dp_rx_process(struct dp_intr *int_ctx, void *hal_ring,
|
||||
uint8_t reo_ring_num, uint32_t quota)
|
||||
{
|
||||
void *hal_soc;
|
||||
void *ring_desc;
|
||||
hal_ring_desc_t ring_desc;
|
||||
struct dp_rx_desc *rx_desc = NULL;
|
||||
qdf_nbuf_t nbuf, next;
|
||||
union dp_rx_desc_list_elem_t *head[MAX_PDEV_CNT];
|
||||
|
@@ -1129,10 +1129,12 @@ dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id,
|
||||
* @buf_addr_info: opaque pointer to the REO error ring descriptor
|
||||
* @buf_addr_info: void pointer to the buffer_addr_info
|
||||
* @bm_action: put to idle_list or release to msdu_list
|
||||
* Return: QDF_STATUS
|
||||
*
|
||||
* Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action);
|
||||
dp_rx_link_desc_return(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
uint8_t bm_action);
|
||||
|
||||
/**
|
||||
* dp_rx_link_desc_return_by_addr - Return a MPDU link descriptor to
|
||||
@@ -1141,10 +1143,11 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action);
|
||||
* @soc: core DP main context
|
||||
* @link_desc_addr: link descriptor addr
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
* Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_link_desc_return_by_addr(struct dp_soc *soc, void *link_desc_addr,
|
||||
dp_rx_link_desc_return_by_addr(struct dp_soc *soc,
|
||||
hal_ring_desc_t link_desc_addr,
|
||||
uint8_t bm_action);
|
||||
|
||||
/**
|
||||
@@ -1182,7 +1185,8 @@ dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev);
|
||||
* Return: void
|
||||
*/
|
||||
void dp_rx_dump_info_and_assert(struct dp_soc *soc, void *hal_ring,
|
||||
void *ring_desc, struct dp_rx_desc *rx_desc);
|
||||
hal_ring_desc_t ring_desc,
|
||||
struct dp_rx_desc *rx_desc);
|
||||
|
||||
void dp_rx_compute_delay(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
|
||||
#ifdef RX_DESC_DEBUG_CHECK
|
||||
|
@@ -1015,7 +1015,7 @@ dp_rx_defrag_nwifi_to_8023(qdf_nbuf_t nbuf, uint16_t hdrsize)
|
||||
uint32_t *mpdu_wrd;
|
||||
uint32_t ret, cookie;
|
||||
|
||||
void *dst_ring_desc =
|
||||
hal_ring_desc_t dst_ring_desc =
|
||||
peer->rx_tid[tid].dst_ring_desc;
|
||||
void *hal_srng = soc->reo_reinject_ring.hal_srng;
|
||||
|
||||
@@ -1352,8 +1352,11 @@ void dp_rx_defrag_cleanup(struct dp_peer *peer, unsigned tid)
|
||||
*
|
||||
* Returns: None
|
||||
*/
|
||||
static QDF_STATUS dp_rx_defrag_save_info_from_ring_desc(void *ring_desc,
|
||||
struct dp_rx_desc *rx_desc, struct dp_peer *peer, unsigned tid)
|
||||
static QDF_STATUS
|
||||
dp_rx_defrag_save_info_from_ring_desc(hal_ring_desc_t ring_desc,
|
||||
struct dp_rx_desc *rx_desc,
|
||||
struct dp_peer *peer,
|
||||
unsigned int tid)
|
||||
{
|
||||
void *dst_ring_desc = qdf_mem_malloc(
|
||||
sizeof(struct reo_destination_ring));
|
||||
@@ -1385,12 +1388,13 @@ static QDF_STATUS dp_rx_defrag_save_info_from_ring_desc(void *ring_desc,
|
||||
*
|
||||
* Returns: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS dp_rx_defrag_store_fragment(struct dp_soc *soc,
|
||||
void *ring_desc,
|
||||
static QDF_STATUS
|
||||
dp_rx_defrag_store_fragment(struct dp_soc *soc,
|
||||
hal_ring_desc_t ring_desc,
|
||||
union dp_rx_desc_list_elem_t **head,
|
||||
union dp_rx_desc_list_elem_t **tail,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
unsigned tid, struct dp_rx_desc *rx_desc,
|
||||
unsigned int tid, struct dp_rx_desc *rx_desc,
|
||||
uint32_t *rx_bfs)
|
||||
{
|
||||
struct dp_rx_reorder_array_elem *rx_reorder_array_elem;
|
||||
@@ -1648,7 +1652,7 @@ end:
|
||||
*
|
||||
* Return: uint32_t: No. of elements processed
|
||||
*/
|
||||
uint32_t dp_rx_frag_handle(struct dp_soc *soc, void *ring_desc,
|
||||
uint32_t dp_rx_frag_handle(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
struct dp_rx_desc *rx_desc,
|
||||
uint8_t *mac_id,
|
||||
|
@@ -48,7 +48,7 @@ struct dp_rx_defrag_cipher {
|
||||
uint8_t ic_miclen;
|
||||
};
|
||||
|
||||
uint32_t dp_rx_frag_handle(struct dp_soc *soc, void *ring_desc,
|
||||
uint32_t dp_rx_frag_handle(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
struct dp_rx_desc *rx_desc,
|
||||
uint8_t *mac_id,
|
||||
|
@@ -161,7 +161,8 @@ static inline bool dp_rx_mcast_echo_check(struct dp_soc *soc,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_link_desc_return_by_addr(struct dp_soc *soc, void *link_desc_addr,
|
||||
dp_rx_link_desc_return_by_addr(struct dp_soc *soc,
|
||||
hal_ring_desc_t link_desc_addr,
|
||||
uint8_t bm_action)
|
||||
{
|
||||
struct dp_srng *wbm_desc_rel_ring = &soc->wbm_desc_rel_ring;
|
||||
@@ -220,10 +221,10 @@ done:
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
|
||||
dp_rx_link_desc_return(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
uint8_t bm_action)
|
||||
{
|
||||
void *buf_addr_info = HAL_RX_REO_BUF_ADDR_INFO_GET(ring_desc);
|
||||
return dp_rx_link_desc_return_by_addr(soc, buf_addr_info, bm_action);
|
||||
return dp_rx_link_desc_return_by_addr(soc, ring_desc, bm_action);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +241,8 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
|
||||
*
|
||||
* Return: uint32_t: No. of elements processed
|
||||
*/
|
||||
static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
||||
static uint32_t
|
||||
dp_rx_msdus_drop(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
uint8_t *mac_id,
|
||||
uint32_t quota)
|
||||
@@ -327,7 +329,7 @@ static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
||||
* Return: uint32_t: No. of elements processed
|
||||
*/
|
||||
static uint32_t
|
||||
dp_rx_pn_error_handle(struct dp_soc *soc, void *ring_desc,
|
||||
dp_rx_pn_error_handle(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
uint8_t *mac_id,
|
||||
uint32_t quota)
|
||||
@@ -390,7 +392,7 @@ dp_rx_pn_error_handle(struct dp_soc *soc, void *ring_desc,
|
||||
* Return: uint32_t: No. of elements processed
|
||||
*/
|
||||
static uint32_t
|
||||
dp_rx_2k_jump_handle(struct dp_soc *soc, void *ring_desc,
|
||||
dp_rx_2k_jump_handle(struct dp_soc *soc, hal_ring_desc_t ring_desc,
|
||||
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
||||
uint8_t *mac_id, uint32_t quota)
|
||||
{
|
||||
@@ -1090,7 +1092,7 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
||||
void *hal_ring, uint32_t quota)
|
||||
{
|
||||
void *hal_soc;
|
||||
void *ring_desc;
|
||||
hal_ring_desc_t ring_desc;
|
||||
uint32_t count = 0;
|
||||
uint32_t rx_bufs_used = 0;
|
||||
uint32_t rx_bufs_reaped[MAX_PDEV_CNT] = { 0 };
|
||||
@@ -1277,7 +1279,7 @@ dp_rx_wbm_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
||||
void *hal_ring, uint32_t quota)
|
||||
{
|
||||
void *hal_soc;
|
||||
void *ring_desc;
|
||||
hal_ring_desc_t ring_desc;
|
||||
struct dp_rx_desc *rx_desc;
|
||||
union dp_rx_desc_list_elem_t *head[MAX_PDEV_CNT] = { NULL };
|
||||
union dp_rx_desc_list_elem_t *tail[MAX_PDEV_CNT] = { NULL };
|
||||
@@ -1567,7 +1569,7 @@ done:
|
||||
* Return: void
|
||||
*/
|
||||
static void dup_desc_dbg(struct dp_soc *soc,
|
||||
void *rxdma_dst_ring_desc,
|
||||
hal_ring_desc_t rxdma_dst_ring_desc,
|
||||
void *rx_desc)
|
||||
{
|
||||
DP_STATS_INC(soc, rx.err.hal_rxdma_err_dup, 1);
|
||||
@@ -1590,7 +1592,7 @@ static void dup_desc_dbg(struct dp_soc *soc,
|
||||
*/
|
||||
static inline uint32_t
|
||||
dp_rx_err_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
||||
void *rxdma_dst_ring_desc,
|
||||
hal_ring_desc_t rxdma_dst_ring_desc,
|
||||
union dp_rx_desc_list_elem_t **head,
|
||||
union dp_rx_desc_list_elem_t **tail)
|
||||
{
|
||||
@@ -1609,7 +1611,7 @@ dp_rx_err_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
||||
uint8_t rxdma_error_code = 0;
|
||||
uint8_t bm_action = HAL_BM_ACTION_PUT_IN_IDLE_LIST;
|
||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
||||
void *ring_desc;
|
||||
hal_ring_desc_t ring_desc;
|
||||
|
||||
msdu = 0;
|
||||
|
||||
@@ -1717,7 +1719,7 @@ dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
|
||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
||||
int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
|
||||
void *hal_soc;
|
||||
void *rxdma_dst_ring_desc;
|
||||
hal_ring_desc_t rxdma_dst_ring_desc;
|
||||
void *err_dst_srng;
|
||||
union dp_rx_desc_list_elem_t *head = NULL;
|
||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||
|
@@ -255,7 +255,7 @@ struct dp_rx_desc *dp_rx_get_mon_desc(struct dp_soc *soc,
|
||||
*/
|
||||
static inline uint32_t
|
||||
dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
||||
void *rxdma_dst_ring_desc, qdf_nbuf_t *head_msdu,
|
||||
hal_ring_desc_t rxdma_dst_ring_desc, qdf_nbuf_t *head_msdu,
|
||||
qdf_nbuf_t *tail_msdu, uint32_t *npackets, uint32_t *ppdu_id,
|
||||
union dp_rx_desc_list_elem_t **head,
|
||||
union dp_rx_desc_list_elem_t **tail)
|
||||
@@ -1077,7 +1077,7 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
|
||||
struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
|
||||
uint8_t pdev_id;
|
||||
void *hal_soc;
|
||||
void *rxdma_dst_ring_desc;
|
||||
hal_ring_desc_t rxdma_dst_ring_desc;
|
||||
void *mon_dst_srng;
|
||||
union dp_rx_desc_list_elem_t *head = NULL;
|
||||
union dp_rx_desc_list_elem_t *tail = NULL;
|
||||
|
@@ -545,7 +545,7 @@ struct dp_rx_tid {
|
||||
TAILQ_ENTRY(dp_rx_tid) defrag_waitlist_elem;
|
||||
|
||||
/* Store dst desc for reinjection */
|
||||
void *dst_ring_desc;
|
||||
hal_ring_desc_t dst_ring_desc;
|
||||
struct dp_rx_desc *head_frag_desc;
|
||||
|
||||
/* rx_tid lock */
|
||||
|
@@ -1474,7 +1474,7 @@ static inline void hal_setup_link_idle_list(void *halsoc,
|
||||
* @ring_desc: Opaque ring descriptor handle
|
||||
*/
|
||||
static inline void hal_srng_dump_ring_desc(struct hal_soc *hal, void *hal_ring,
|
||||
void *ring_desc)
|
||||
hal_ring_desc_t ring_desc)
|
||||
{
|
||||
struct hal_srng *srng = (struct hal_srng *)hal_ring;
|
||||
|
||||
|
@@ -277,7 +277,7 @@ uint32_t HAL_RX_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
|
||||
* Return: void
|
||||
*/
|
||||
static inline
|
||||
void hal_rx_reo_ent_buf_paddr_get(void *rx_desc,
|
||||
void hal_rx_reo_ent_buf_paddr_get(hal_ring_desc_t rx_desc,
|
||||
struct hal_buf_info *buf_info,
|
||||
void **pp_buf_addr_info,
|
||||
uint32_t *msdu_cnt
|
||||
|
@@ -172,6 +172,13 @@ enum hal_srng_dir {
|
||||
#define SRNG_LOCK_DESTROY(_lock) qdf_spinlock_destroy(_lock)
|
||||
|
||||
struct hal_soc;
|
||||
|
||||
/**
|
||||
* hal_ring_desc - opaque handle for DP ring descriptor
|
||||
*/
|
||||
struct hal_ring_desc;
|
||||
typedef struct hal_ring_desc *hal_ring_desc_t;
|
||||
|
||||
#define MAX_SRNG_REG_GROUPS 2
|
||||
|
||||
/* Common SRNG ring structure for source and destination rings */
|
||||
|
@@ -2163,7 +2163,8 @@ hal_rx_msdu_reo_dst_ind_get(hal_soc_handle_t hal_soc_hdl, void *msdu_link_desc)
|
||||
* @ buf_info: structure to return the buffer information
|
||||
* Return: void
|
||||
*/
|
||||
static inline void hal_rx_reo_buf_paddr_get(void *rx_desc,
|
||||
static inline
|
||||
void hal_rx_reo_buf_paddr_get(hal_ring_desc_t rx_desc,
|
||||
struct hal_buf_info *buf_info)
|
||||
{
|
||||
struct reo_destination_ring *reo_ring =
|
||||
@@ -2345,7 +2346,7 @@ enum hal_rx_wbm_buf_type {
|
||||
*
|
||||
* Return: true: error caused by PN check, false: other error
|
||||
*/
|
||||
static inline bool hal_rx_reo_is_pn_error(void *rx_desc)
|
||||
static inline bool hal_rx_reo_is_pn_error(hal_ring_desc_t rx_desc)
|
||||
{
|
||||
struct reo_destination_ring *reo_desc =
|
||||
(struct reo_destination_ring *)rx_desc;
|
||||
@@ -2365,7 +2366,7 @@ static inline bool hal_rx_reo_is_pn_error(void *rx_desc)
|
||||
*
|
||||
* Return: true: error caused by 2K jump, false: other error
|
||||
*/
|
||||
static inline bool hal_rx_reo_is_2k_jump(void *rx_desc)
|
||||
static inline bool hal_rx_reo_is_2k_jump(hal_ring_desc_t rx_desc)
|
||||
{
|
||||
struct reo_destination_ring *reo_desc =
|
||||
(struct reo_destination_ring *)rx_desc;
|
||||
@@ -2388,8 +2389,10 @@ static inline bool hal_rx_reo_is_2k_jump(void *rx_desc)
|
||||
* Return: void
|
||||
*/
|
||||
/* look at implementation at dp_hw_link_desc_pool_setup()*/
|
||||
static inline void hal_rx_msdu_link_desc_set(struct hal_soc *soc,
|
||||
void *src_srng_desc, void *buf_addr_info,
|
||||
static inline
|
||||
void hal_rx_msdu_link_desc_set(struct hal_soc *soc,
|
||||
void *src_srng_desc,
|
||||
hal_ring_desc_t buf_addr_info,
|
||||
uint8_t bm_action)
|
||||
{
|
||||
struct wbm_release_ring *wbm_rel_srng =
|
||||
@@ -2430,7 +2433,8 @@ static inline void hal_rx_msdu_link_desc_reinject(struct hal_soc *soc,
|
||||
* (Assumption -- BUFFER_ADDR_INFO is the
|
||||
* first field in the descriptor structure)
|
||||
*/
|
||||
#define HAL_RX_BUF_ADDR_INFO_GET(ring_desc) ((void *)(ring_desc))
|
||||
#define HAL_RX_BUF_ADDR_INFO_GET(ring_desc) \
|
||||
((hal_ring_desc_t)(ring_desc))
|
||||
|
||||
#define HAL_RX_REO_BUF_ADDR_INFO_GET HAL_RX_BUF_ADDR_INFO_GET
|
||||
|
||||
@@ -2445,7 +2449,7 @@ static inline void hal_rx_msdu_link_desc_reinject(struct hal_soc *soc,
|
||||
* Return: uint8_t (value of the return_buffer_manager)
|
||||
*/
|
||||
static inline
|
||||
uint8_t hal_rx_ret_buf_manager_get(void *ring_desc)
|
||||
uint8_t hal_rx_ret_buf_manager_get(hal_ring_desc_t ring_desc)
|
||||
{
|
||||
/*
|
||||
* The following macro takes buf_addr_info as argument,
|
||||
@@ -3082,7 +3086,8 @@ int hal_rx_chain_msdu_links(struct hal_soc *hal_soc, qdf_nbuf_t msdu,
|
||||
* Returns: None
|
||||
*/
|
||||
static inline
|
||||
void hal_rx_defrag_update_src_ring_desc(void *ring_desc,
|
||||
void hal_rx_defrag_update_src_ring_desc(
|
||||
hal_ring_desc_t ring_desc,
|
||||
void *saved_mpdu_desc_info,
|
||||
struct hal_rx_msdu_link_ptr_info *saved_msdu_link_ptr)
|
||||
{
|
||||
@@ -3157,7 +3162,7 @@ uint16_t hal_rx_get_desc_len(void)
|
||||
* Returns: value of rxdma_push_reason
|
||||
*/
|
||||
static inline
|
||||
uint8_t hal_rx_reo_ent_rxdma_push_reason_get(void *reo_ent_desc)
|
||||
uint8_t hal_rx_reo_ent_rxdma_push_reason_get(hal_ring_desc_t reo_ent_desc)
|
||||
{
|
||||
return _HAL_MS((*_OFFSET_TO_WORD_PTR(reo_ent_desc,
|
||||
REO_ENTRANCE_RING_6_RXDMA_PUSH_REASON_OFFSET)),
|
||||
@@ -3172,7 +3177,7 @@ uint8_t hal_rx_reo_ent_rxdma_push_reason_get(void *reo_ent_desc)
|
||||
* Return: value of rxdma_error_code
|
||||
*/
|
||||
static inline
|
||||
uint8_t hal_rx_reo_ent_rxdma_error_code_get(void *reo_ent_desc)
|
||||
uint8_t hal_rx_reo_ent_rxdma_error_code_get(hal_ring_desc_t reo_ent_desc)
|
||||
{
|
||||
return _HAL_MS((*_OFFSET_TO_WORD_PTR(reo_ent_desc,
|
||||
REO_ENTRANCE_RING_6_RXDMA_ERROR_CODE_OFFSET)),
|
||||
|
Reference in New Issue
Block a user