diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index c956dfee691a..f71788158213 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -830,19 +830,19 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng, *msg_word = 0; if (htt_tlv_filter->enable_fp) { - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0000, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0001, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0010, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0011, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0100, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0101, 1); - htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, MO, + htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0110, 1); htt_rx_ring_pkt_enable_subtype_set(*msg_word, FLAG2, FP, CTRL, 0111, 1); @@ -1326,21 +1326,17 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) } #if defined(CONFIG_WIN) && WDI_EVENT_ENABLE #ifndef REMOVE_PKT_LOG - case HTT_T2H_MSG_TYPE_PKTLOG: - { - u_int32_t *pl_hdr; - pl_hdr = (msg_word + 1); - dp_wdi_event_handler(WDI_EVENT_OFFLOAD_ALL, soc->dp_soc, - (void *)pl_hdr, HTT_INVALID_PEER, WDI_NO_VAL, 0); - break; - } case HTT_T2H_MSG_TYPE_PPDU_STATS_IND: { + u_int8_t pdev_id; qdf_nbuf_set_pktlen(htt_t2h_msg, HTT_T2H_MAX_MSG_SIZE); QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, "received HTT_T2H_MSG_TYPE_PPDU_STATS_IND\n"); + pdev_id = HTT_T2H_PPDU_STATS_MAC_ID_GET(*msg_word); + pdev_id = DP_HW2SW_MACID(pdev_id); dp_wdi_event_handler(WDI_EVENT_LITE_T2H, soc->dp_soc, - htt_t2h_msg, HTT_INVALID_PEER, WDI_NO_VAL, 0); + htt_t2h_msg, HTT_INVALID_PEER, WDI_NO_VAL, + pdev_id); break; } #endif @@ -1660,3 +1656,88 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev, DP_HTT_SEND_HTC_PKT(soc, pkt); return 0; } + +/* This macro will revert once proper HTT header will define for + * HTT_H2T_MSG_TYPE_PPDU_STATS_CFG in htt.h file + * */ +#if defined(CONFIG_WIN) && WDI_EVENT_ENABLE +/** + * dp_h2t_cfg_stats_msg_send(): function to construct HTT message to pass to FW + * @pdev: DP PDEV handle + * @stats_type_upload_mask: stats type requested by user + * + * return: QDF STATUS + */ +QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev, + uint32_t stats_type_upload_mask) +{ + struct htt_soc *soc = pdev->soc->htt_handle; + struct dp_htt_htc_pkt *pkt; + qdf_nbuf_t msg; + uint32_t *msg_word; + uint8_t pdev_mask; + + msg = qdf_nbuf_alloc( + soc->osdev, + HTT_MSG_BUF_SIZE(HTT_H2T_PPDU_STATS_CFG_MSG_SZ), + HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, true); + + if (!msg) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + "Fail to allocate HTT_H2T_PPDU_STATS_CFG_MSG_SZ msg buffer\n"); + qdf_assert(0); + return QDF_STATUS_E_NOMEM; + } + + /*TODO:Add support for SOC stats + * Bit 0: SOC Stats + * Bit 1: Pdev stats for pdev id 0 + * Bit 2: Pdev stats for pdev id 1 + * Bit 3: Pdev stats for pdev id 2 + */ + pdev_mask = 1 << DP_SW2HW_MACID(pdev->pdev_id); + + /* + * Set the length of the message. + * The contribution from the HTC_HDR_ALIGNMENT_PADDING is added + * separately during the below call to qdf_nbuf_push_head. + * The contribution from the HTC header is added separately inside HTC. + */ + if (qdf_nbuf_put_tail(msg, HTT_H2T_PPDU_STATS_CFG_MSG_SZ) == NULL) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + "Failed to expand head for HTT_CFG_STATS\n"); + qdf_nbuf_free(msg); + return QDF_STATUS_E_FAILURE; + } + + msg_word = (uint32_t *) qdf_nbuf_data(msg); + + qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); + *msg_word = 0; + HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_PPDU_STATS_CFG); + HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(*msg_word, pdev_mask); + HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(*msg_word, + stats_type_upload_mask); + + pkt = htt_htc_pkt_alloc(soc); + if (!pkt) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + "Fail to allocate dp_htt_htc_pkt buffer\n"); + qdf_assert(0); + qdf_nbuf_free(msg); + return QDF_STATUS_E_NOMEM; + } + + pkt->soc_ctxt = NULL; /* not used during send-done callback */ + + SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, + dp_htt_h2t_send_complete_free_netbuf, + qdf_nbuf_data(msg), qdf_nbuf_len(msg), + soc->htc_endpoint, + 1); /* tag - not relevant here */ + + SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); + DP_HTT_SEND_HTC_PKT(soc, pkt); + return 0; +} +#endif diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index 4cac8a417e29..c553b7a50eea 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -296,6 +296,9 @@ void dp_set_pn_check_wifi3(struct cdp_vdev *vdev_handle, uint32_t *rx_pn); #if defined(CONFIG_WIN) && WDI_EVENT_ENABLE +QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev, + uint32_t stats_type_upload_mask); + int dp_wdi_event_unsub(struct cdp_pdev *txrx_pdev_handle, void *event_cb_sub_handle, uint32_t event); @@ -348,6 +351,11 @@ static inline int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event, { return 0; } +static inline QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev, + uint32_t stats_type_upload_mask) +{ + return 0; +} #endif /* CONFIG_WIN */ #ifdef QCA_LL_TX_FLOW_CONTROL_V2 void dp_tx_dump_flow_pool_info(void *soc); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index a4888cafa01d..0fda593c2b65 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -4430,6 +4430,19 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event, &htt_tlv_filter); } break; + case WDI_EVENT_LITE_T2H: + if (pdev->monitor_vdev) { + /* Nothing needs to be done if monitor mode is + * enabled + */ + return 0; + } + /* To enable HTT_H2T_MSG_TYPE_PPDU_STATS_CFG in FW + * passing value 0xffff. Once these macros will define in htt + * header file will use proper macros + */ + dp_h2t_cfg_stats_msg_send(pdev, 0xffff); + break; default: /* Nothing needs to be done for other pktlog types */ break; @@ -4454,6 +4467,19 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event, &htt_tlv_filter); } break; + case WDI_EVENT_LITE_T2H: + if (pdev->monitor_vdev) { + /* Nothing needs to be done if monitor mode is + * enabled + */ + return 0; + } + /* To disable HTT_H2T_MSG_TYPE_PPDU_STATS_CFG in FW + * passing value 0. Once these macros will define in htt + * header file will use proper macros + */ + dp_h2t_cfg_stats_msg_send(pdev, 0); + break; default: /* Nothing needs to be done for other pktlog types */ break; diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index d11fb22b24ad..3fce4df4fb1c 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -66,7 +66,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, #if defined(CONFIG_WIN) && WDI_EVENT_ENABLE #ifndef REMOVE_PKT_LOG dp_wdi_event_handler(WDI_EVENT_RX_DESC, soc, - status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, 0); + status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, mac_id); #endif #endif if (pdev->monitor_vdev != NULL) { diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index 18b3a832579f..39c88f7813dd 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -597,8 +597,8 @@ static struct CE_pipe_config target_ce_config_wlan_qca8074[] = { { /* CE4 */ 4, PIPEDIR_OUT, 256, 256, (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,}, /* NB: 50% of src nentries, since tx has 2 frags */ - /* ipa_uc->target */ - { /* CE5 */ 5, PIPEDIR_INOUT_H2H, 0, 0, 0, 0,}, + /* Target -> host PKTLOG */ + { /* CE5 */ 5, PIPEDIR_IN, 32, 2048, 0, 0,}, /* Reserved for target autonomous HIF_memcpy */ { /* CE6 */ 6, PIPEDIR_INOUT, 32, 65535, 64, 0,}, /* CE7 used only by Host */ @@ -610,8 +610,6 @@ static struct CE_pipe_config target_ce_config_wlan_qca8074[] = { { /* CE9 */ 9, PIPEDIR_OUT, 32, 2048, 8192, 0,}, /* CE10 target->host HTT */ { /* CE10 */ 10, PIPEDIR_INOUT_H2H, 0, 0, 0, 0,}, - /* Target -> host PKTLOG */ - { /* CE11 */ 11, PIPEDIR_IN, 32, 2048, 48, 0,}, }; static struct CE_attr host_ce_config_wlan_qca8074_pci[] = {