From 2c73be828a71fd94ecc1cb2aee37917269a6bf98 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Thu, 29 Sep 2016 03:35:59 -0400 Subject: [PATCH] qcacmn: Fix WMI command tx failure qcacld-2.0 to qcacmn propagation In USB solution, one WMI command will consume one "resource". So, for WMI endpoint, the "resource" number of one bundle is HTC_MAX_MSG_PER_BUNDLE_TX rather than 2 * HTC_MAX_MSG_PER_BUNDLE_TX. Change-Id: Ia60e49a403a0d689d1ba8397f7c796cd911ab918 CRs-Fixed: 1013006 --- htc/htc_send.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/htc/htc_send.c b/htc/htc_send.c index 38938ddd8bf6..348233fff93b 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -1187,13 +1187,20 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target, /* * Header and payload belongs to the different fragments and * consume 2 resource for one HTC package but USB combine into - * one transfer. + * one transfer.And one WMI message only consumes one single + * resource. */ - if (HTC_TX_BUNDLE_ENABLED(target) && tx_resources && - hif_get_bus_type(target->hif_dev) == - QDF_BUS_TYPE_USB) - tx_resources = (HTC_MAX_MSG_PER_BUNDLE_TX * 2); - + if (HTC_TX_BUNDLE_ENABLED(target) && tx_resources && + hif_get_bus_type(target->hif_dev) == + QDF_BUS_TYPE_USB) { + if (pEndpoint->service_id == + WMI_CONTROL_SVC) + tx_resources = + HTC_MAX_MSG_PER_BUNDLE_TX; + else + tx_resources = + (HTC_MAX_MSG_PER_BUNDLE_TX * 2); + } /* get all the packets for this endpoint that we can for this pass */ get_htc_send_packets(target, pEndpoint, &sendQueue, tx_resources);