From cbe4c342b6a24d0cf2a472bcc62c201a06e025a5 Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Mon, 12 Jun 2017 20:06:35 -0700 Subject: [PATCH] qcacmn: Fix the issue on setup monitor mode ring The pdev id in host is not the same as firmware MAC id Add host pdevid to firmware MAC id mapping code in set pdev id for htt sring setup and set pdev id for htt rx ring selection cfg The mon_ppdu_status is not synchronized Fix the issue on pdev mon_ppdu_status by reset mon_ppdu_status to DP_PPDU_STATUS_START after monitor destination ring is processed Add code for mpdu fcs error for later use Change-Id: Ia6245cc9441e3339bcd01ed18fdce2f33f3f7699 --- dp/wifi3.0/dp_htt.c | 6 ++++-- dp/wifi3.0/dp_rx_mon_dest.c | 12 +++++++++++- dp/wifi3.0/dp_rx_mon_status.c | 2 +- hal/wifi3.0/hal_api_mon.h | 18 +++++++++++++++++- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 0ee09d90a3..ea90879a95 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -345,7 +345,8 @@ int htt_srng_setup(void *htt_soc, int mac_id, void *hal_srng, *msg_word = 0; HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP); - if (htt_ring_type == HTT_SW_TO_HW_RING) + if ((htt_ring_type == HTT_SW_TO_HW_RING) || + (htt_ring_type == HTT_HW_TO_SW_RING)) HTT_SRING_SETUP_PDEV_ID_SET(*msg_word, DP_SW2HW_MACID(mac_id)); else @@ -571,7 +572,8 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng, /* word 0 */ *msg_word = 0; HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG); - HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(*msg_word, pdev_id); + HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(*msg_word, + DP_SW2HW_MACID(pdev_id)); /* TODO: Discuss with FW on changing this to unique ID and using * htt_ring_type to send the type of ring */ diff --git a/dp/wifi3.0/dp_rx_mon_dest.c b/dp/wifi3.0/dp_rx_mon_dest.c index 003ea4fc05..4a1226d7e0 100644 --- a/dp/wifi3.0/dp_rx_mon_dest.c +++ b/dp/wifi3.0/dp_rx_mon_dest.c @@ -121,13 +121,14 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, uint32_t msdu_ppdu_id, msdu_cnt; uint8_t *data; uint32_t i; + bool mpdu_fcs_err; msdu = 0; last = NULL; hal_rx_reo_ent_buf_paddr_get(rxdma_dst_ring_desc, &buf_info, - &p_last_buf_addr_info, &msdu_cnt); + &p_last_buf_addr_info, &msdu_cnt, &mpdu_fcs_err); do { rx_msdu_link_desc = @@ -168,6 +169,15 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, QDF_TRACE_LEVEL_DEBUG, "[%s][%d] i=%d, ppdu_id=%x, msdu_ppdu_id=%x\n", __func__, __LINE__, i, *ppdu_id, msdu_ppdu_id); + + if (*ppdu_id > msdu_ppdu_id) + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_WARN, + "[%s][%d] ppdu_id=%id \ + msdu_ppdu_id=%d\n", + __func__, __LINE__, *ppdu_id, + msdu_ppdu_id); + if (*ppdu_id != msdu_ppdu_id) { *ppdu_id = msdu_ppdu_id; return rx_bufs_used; diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index ef0eabcb0e..a56b4808c8 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -28,7 +28,6 @@ #include "dp_internal.h" #include "qdf_mem.h" /* qdf_mem_malloc,free */ - /** * dp_rx_mon_status_process_tlv() - Process status TLV in status * buffer on Rx status Queue posted by status SRNG processing. @@ -87,6 +86,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) { pdev->mon_ppdu_status = DP_PPDU_STATUS_DONE; dp_rx_mon_dest_process(soc, mac_id, quota); + pdev->mon_ppdu_status = DP_PPDU_STATUS_START; } } return; diff --git a/hal/wifi3.0/hal_api_mon.h b/hal/wifi3.0/hal_api_mon.h index b78854563f..8c47ab5a46 100644 --- a/hal/wifi3.0/hal_api_mon.h +++ b/hal/wifi3.0/hal_api_mon.h @@ -205,13 +205,15 @@ uint32_t hal_rx_desc_is_first_msdu(void *hw_desc_addr) * the current descriptor * @ buf_info: structure to return the buffer information * @ msdu_cnt: pointer to msdu count in MPDU + * @ mpdu_fcs_err: pointer to valuable of mpdu fcs error * Return: void */ static inline void hal_rx_reo_ent_buf_paddr_get(void *rx_desc, struct hal_buf_info *buf_info, void **pp_buf_addr_info, - uint32_t *msdu_cnt + uint32_t *msdu_cnt, + bool *mpdu_fcs_err ) { struct reo_entrance_ring *reo_ent_ring = @@ -219,10 +221,24 @@ void hal_rx_reo_ent_buf_paddr_get(void *rx_desc, struct buffer_addr_info *buf_addr_info; struct rx_mpdu_desc_info *rx_mpdu_desc_info_details; uint32_t loop_cnt; + uint32_t rxdma_push_reason; + uint32_t rxdma_error_code; rx_mpdu_desc_info_details = &reo_ent_ring->reo_level_mpdu_frame_info.rx_mpdu_desc_info_details; + rxdma_push_reason = HAL_RX_GET(reo_ent_ring, REO_ENTRANCE_RING_6, + RXDMA_PUSH_REASON); + + *mpdu_fcs_err = false; + + if (rxdma_push_reason == HAL_RX_WBM_RXDMA_PSH_RSN_ERROR) { + rxdma_error_code = HAL_RX_GET(reo_ent_ring, + REO_ENTRANCE_RING_6, RXDMA_ERROR_CODE); + if (rxdma_error_code == HAL_RXDMA_ERR_FCS) + *mpdu_fcs_err = true; + } + *msdu_cnt = HAL_RX_GET(rx_mpdu_desc_info_details, RX_MPDU_DESC_INFO_0, MSDU_COUNT);