Prechádzať zdrojové kódy

qcacmn: Add option to configure H-T-C pipe ready message timeout

Add INI option to configure Host-Target communication pipe ready
message timeout for debug.

Change-Id: I0b29ced69b67debcc4059b3ffb6578f3e808bf5c
Sajini R 4 rokov pred
rodič
commit
ffc4a9de53
4 zmenil súbory, kde vykonal 16 pridanie a 7 odobranie
  1. 8 0
      htc/htc.c
  2. 2 0
      htc/htc_api.h
  3. 4 1
      htc/htc_internal.h
  4. 2 6
      htc/htc_recv.c

+ 8 - 0
htc/htc.c

@@ -363,6 +363,14 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
 		target->osdev = osdev;
 		target->con_mode = con_mode;
 
+		/* If htc_ready_timeout_ms is not configured from CFG,
+		 * assign the default timeout value here.
+		 */
+
+		if (!target->HTCInitInfo.htc_ready_timeout_ms)
+			target->HTCInitInfo.htc_ready_timeout_ms =
+							HTC_CONTROL_RX_TIMEOUT;
+
 		reset_endpoint_states(target);
 
 		INIT_HTC_PACKET_QUEUE(&target->ControlBufferTXFreeList);

+ 2 - 0
htc/htc_api.h

@@ -57,6 +57,8 @@ struct htc_init_info {
 	void (*target_initial_wakeup_cb)(void *cb_ctx);
 	void *target_psoc;
 	uint32_t cfg_wmi_credit_cnt;
+	/* HTC Pipe Ready Timeout in msecs */
+	uint32_t htc_ready_timeout_ms;
 };
 
 /* Struct for HTC layer packet stats*/

+ 4 - 1
htc/htc_internal.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2021 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
@@ -400,6 +400,9 @@ htc_send_complete_check(HTC_ENDPOINT *pEndpoint, int force) {
 #define DEBUG_BUNDLE 0
 #endif
 
+/* HTC Control message receive timeout msec */
+#define HTC_CONTROL_RX_TIMEOUT     6000
+
 #if defined(HIF_SDIO) || defined(HIF_USB)
 #ifndef ENABLE_BUNDLE_TX
 #define ENABLE_BUNDLE_TX 1

+ 2 - 6
htc/htc_recv.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2021 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
@@ -21,9 +21,6 @@
 #include "htc_credit_history.h"
 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
 
-/* HTC Control message receive timeout msec */
-#define HTC_CONTROL_RX_TIMEOUT     6000
-
 #if defined(WLAN_DEBUG) || defined(DEBUG)
 void debug_dump_bytes(uint8_t *buffer, uint16_t length, char *pDescription)
 {
@@ -433,7 +430,6 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 				/* Requester will clear this flag */
 				target->CtrlResponseProcessing = true;
 				UNLOCK_HTC_RX(target);
-
 				qdf_event_set(&target->ctrl_response_valid);
 				break;
 #ifdef HTC_MSG_WAKEUP_FROM_SUSPEND_ID
@@ -619,7 +615,7 @@ QDF_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target)
 
 	/* Wait for BMI request/response transaction to complete */
 	if (qdf_wait_single_event(&target->ctrl_response_valid,
-				  HTC_CONTROL_RX_TIMEOUT)) {
+				  (target->HTCInitInfo.htc_ready_timeout_ms))) {
 		AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
 			("Failed to receive control message\n"));
 		return QDF_STATUS_E_FAILURE;