diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index dcc91e4741ad..dc4e143768e1 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -41,6 +41,8 @@ #include /* HTT host->target WDI IPA msg defs */ #include /* ol_tx_completion_handler, htt_tx_status */ #include +#include +#include #include #include @@ -72,6 +74,30 @@ htt_h2t_send_complete_free_netbuf(void *pdev, QDF_STATUS status, qdf_nbuf_free(netbuf); } +#ifndef QCN7605_SUPPORT +static void htt_t2h_adjust_bus_target_delta(struct htt_pdev_t *pdev) +{ + int32_t credit_delta; + + if (pdev->cfg.is_high_latency && !pdev->cfg.default_tx_comp_req) { + HTT_TX_MUTEX_ACQUIRE(&pdev->credit_mutex); + qdf_atomic_add(1, &pdev->htt_tx_credit.bus_delta); + credit_delta = htt_tx_credit_update(pdev); + HTT_TX_MUTEX_RELEASE(&pdev->credit_mutex); + + if (credit_delta) + ol_tx_credit_completion_handler(pdev->txrx_pdev, + credit_delta); + } +} +#else +static void htt_t2h_adjust_bus_target_delta(struct htt_pdev_t *pdev) +{ + /* UNPAUSE OS Q */ + ol_tx_flow_ct_unpause_os_q(pdev->txrx_pdev); +} +#endif + void htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt) { void (*send_complete_part2)(void *pdev, QDF_STATUS status, @@ -91,19 +117,7 @@ void htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt) htt_pkt->msdu_id); } - if (pdev->cfg.is_high_latency && !pdev->cfg.default_tx_comp_req) { - int32_t credit_delta; - - HTT_TX_MUTEX_ACQUIRE(&pdev->credit_mutex); - qdf_atomic_add(1, &pdev->htt_tx_credit.bus_delta); - credit_delta = htt_tx_credit_update(pdev); - HTT_TX_MUTEX_RELEASE(&pdev->credit_mutex); - - if (credit_delta) - ol_tx_credit_completion_handler(pdev->txrx_pdev, - credit_delta); - } - + htt_t2h_adjust_bus_target_delta(pdev); /* free the htt_htc_pkt / HTC_PACKET object */ htt_htc_pkt_free(pdev, htt_pkt); } diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index a53dea7063d6..240fb2d420d4 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -185,6 +185,27 @@ static void htt_ipa_op_response(struct htt_pdev_t *pdev, uint32_t *msg_word) } #endif +#ifndef QCN7605_SUPPORT +static int htt_t2h_adjust_bus_target_delta(struct htt_pdev_t *pdev, + int32_t htt_credit_delta) +{ + if (pdev->cfg.is_high_latency && !pdev->cfg.default_tx_comp_req) { + HTT_TX_MUTEX_ACQUIRE(&pdev->credit_mutex); + qdf_atomic_add(htt_credit_delta, + &pdev->htt_tx_credit.target_delta); + htt_credit_delta = htt_tx_credit_update(pdev); + HTT_TX_MUTEX_RELEASE(&pdev->credit_mutex); + } + return htt_credit_delta; +} +#else +static int htt_t2h_adjust_bus_target_delta(struct htt_pdev_t *pdev, + int32_t htt_credit_delta) +{ + return htt_credit_delta; +} +#endif + #define MAX_TARGET_TX_CREDIT 204800 /* Target to host Msg/event handler for low priority messages*/ @@ -471,16 +492,8 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, old_credit, htt_credit_delta); break; } - - if (pdev->cfg.is_high_latency && - !pdev->cfg.default_tx_comp_req) { - HTT_TX_MUTEX_ACQUIRE(&pdev->credit_mutex); - qdf_atomic_add(htt_credit_delta, - &pdev->htt_tx_credit.target_delta); - htt_credit_delta = htt_tx_credit_update(pdev); - HTT_TX_MUTEX_RELEASE(&pdev->credit_mutex); - } - + htt_credit_delta = + htt_t2h_adjust_bus_target_delta(pdev, htt_credit_delta); htt_tx_group_credit_process(pdev, msg_word); ol_tx_credit_completion_handler(pdev->txrx_pdev, htt_credit_delta);