Browse Source

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
Manjunathappa Prakash 6 years ago
parent
commit
0159f81bca
2 changed files with 15 additions and 3 deletions
  1. 13 2
      htc/htc.c
  2. 2 1
      htc/htc_api.h

+ 13 - 2
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 =

+ 2 - 1
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*/