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
This commit is contained in:
Sajini R
2021-05-05 17:54:39 +05:30
committed by Madan Koyyalamudi
parent dcd62f697c
commit ffc4a9de53
4 changed files with 16 additions and 7 deletions

View File

@@ -363,6 +363,14 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
target->osdev = osdev; target->osdev = osdev;
target->con_mode = con_mode; 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); reset_endpoint_states(target);
INIT_HTC_PACKET_QUEUE(&target->ControlBufferTXFreeList); INIT_HTC_PACKET_QUEUE(&target->ControlBufferTXFreeList);

View File

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

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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 #define DEBUG_BUNDLE 0
#endif #endif
/* HTC Control message receive timeout msec */
#define HTC_CONTROL_RX_TIMEOUT 6000
#if defined(HIF_SDIO) || defined(HIF_USB) #if defined(HIF_SDIO) || defined(HIF_USB)
#ifndef ENABLE_BUNDLE_TX #ifndef ENABLE_BUNDLE_TX
#define ENABLE_BUNDLE_TX 1 #define ENABLE_BUNDLE_TX 1

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -21,9 +21,6 @@
#include "htc_credit_history.h" #include "htc_credit_history.h"
#include <qdf_nbuf.h> /* qdf_nbuf_t */ #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) #if defined(WLAN_DEBUG) || defined(DEBUG)
void debug_dump_bytes(uint8_t *buffer, uint16_t length, char *pDescription) 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 */ /* Requester will clear this flag */
target->CtrlResponseProcessing = true; target->CtrlResponseProcessing = true;
UNLOCK_HTC_RX(target); UNLOCK_HTC_RX(target);
qdf_event_set(&target->ctrl_response_valid); qdf_event_set(&target->ctrl_response_valid);
break; break;
#ifdef HTC_MSG_WAKEUP_FROM_SUSPEND_ID #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 */ /* Wait for BMI request/response transaction to complete */
if (qdf_wait_single_event(&target->ctrl_response_valid, 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, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("Failed to receive control message\n")); ("Failed to receive control message\n"));
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;