diff --git a/htc/htc.c b/htc/htc.c index 5ccd803b20..86d0a365a9 100644 --- a/htc/htc.c +++ b/htc/htc.c @@ -575,8 +575,19 @@ QDF_STATUS htc_wait_target(HTC_HANDLE HTCHandle) break; } - target->TotalTransmitCredits = - HTC_GET_FIELD(rdy_msg, HTC_READY_MSG, CREDITCOUNT); + target->TotalTransmitCredits = HTC_GET_FIELD(rdy_msg, + HTC_READY_MSG, CREDITCOUNT); + if (target->HTCInitInfo.cfg_wmi_credit_cnt && + (target->HTCInitInfo.cfg_wmi_credit_cnt < + target->TotalTransmitCredits)) + /* + * If INI configured value is less than FW advertised, + * then use INI configured value, otherwise use FW + * advertised. + */ + target->TotalTransmitCredits = + target->HTCInitInfo.cfg_wmi_credit_cnt; + target->TargetCreditSize = (int)HTC_GET_FIELD(rdy_msg, HTC_READY_MSG, CREDITSIZE); target->MaxMsgsPerHTCBundle = diff --git a/htc/htc_api.h b/htc/htc_api.h index 0950ba5d30..f871c33ed2 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, 2016-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -50,6 +50,7 @@ struct htc_init_info { void (*TargetSendSuspendComplete)(void *ctx, bool is_nack); void (*target_initial_wakeup_cb)(void *cb_ctx); void *target_psoc; + uint32_t cfg_wmi_credit_cnt; }; /* Struct for HTC layer packet stats*/