From 0159f81bcab77ae3f9d3b1908f77ee6bd3627e17 Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Wed, 27 Mar 2019 15:23:38 -0700 Subject: [PATCH] qcacmn: Use INI configured WMI credit count Use INI configured WMI credit for exchanging WMI messages. Make sure INI configured value is less than FW advertised capability. This credit configuration should be non zero. Change-Id: I26b2dfbee0fc095aca3d37f21cd22c974189bb49 CRs-Fixed: 2411028 --- htc/htc.c | 15 +++++++++++++-- htc/htc_api.h | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) 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*/