qcacmn: Dont add the wmi header size while allocating the wmi buff
Currently whenever the wmi message is allocated the wmi header length is also added to check with against the max size supported by the firmware, there is no need to add the extra wmi header size as the max length shared by firmware has the wmi header size included. Below is the breakdown: Max CE2 transfer size is 2048 bytes HTC header is 8 bytes WMI header is 4 bytes Max payload can be (MAX CE2 Transfer size - (HTC header+ WMI header) (2048 - (8 +4)) = 2036 During the htc handshake this max wmi length is recevied by the host as 2040 bytes which is including the wmi header so host adding the extra 4 bytes is redundant and can be removed. HTC buffer->actual_length = 2036 + WMI(4) = 2040 bytes Change-Id: Ib958a938506c5c96347dec5304ca30aa8690d459 CRs-Fixed: 3130493
This commit is contained in:

committed by
Madan Koyyalamudi

parent
edf9fd0441
commit
d4239b89f6
@@ -1677,7 +1677,10 @@ wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint32_t len,
|
||||
{
|
||||
wmi_buf_t wmi_buf;
|
||||
|
||||
if (roundup(len + sizeof(WMI_CMD_HDR), 4) > wmi_handle->max_msg_len) {
|
||||
if (roundup(len, 4) > wmi_handle->max_msg_len) {
|
||||
wmi_err("Invalid length %u (via %s:%u) max size: %u",
|
||||
len, func_name, line_num,
|
||||
wmi_handle->max_msg_len);
|
||||
QDF_ASSERT(0);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1718,9 +1721,9 @@ wmi_buf_t wmi_buf_alloc_fl(wmi_unified_t wmi_handle, uint32_t len,
|
||||
{
|
||||
wmi_buf_t wmi_buf;
|
||||
|
||||
if (roundup(len + sizeof(WMI_CMD_HDR), 4) > wmi_handle->max_msg_len) {
|
||||
QDF_DEBUG_PANIC("Invalid length %u (via %s:%u)",
|
||||
len, func, line);
|
||||
if (roundup(len, 4) > wmi_handle->max_msg_len) {
|
||||
QDF_DEBUG_PANIC("Invalid length %u (via %s:%u) max size: %u",
|
||||
len, func, line, wmi_handle->max_msg_len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user