From 3be9e052707aa19677999c089307db72e8dbaf5e Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Wed, 21 Sep 2016 10:19:31 +0530 Subject: [PATCH] qcacmn: Fix key installation issue for BE offload radios For big endian based offload radios, key installed using WMI_VDEV_INSTALL_KEY_CMDID requires to be code swapped as the copy engine for big endian platform does byte swap operation on the received key before sending it down to FW. It is observed that the big endian conversion is carried out in WIN Wi-Fi driver for big endian platform specific radios in the driver, that takes care of converting the key data to the byte swapped form. However, it is observed that an additional copy is carried out in the WMI layer that is overwriting the converted key with old key, in the non-swapped form. We move the byte swapping operation to the converged component and do a single memory copy using the macro that carries out its operation based on big or little endian platform. Change-Id: Ic6b7cc667d0f505d1d1daeacec72f54d41554038 CRs-Fixed: 1067206 --- wmi_unified_non_tlv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wmi_unified_non_tlv.c b/wmi_unified_non_tlv.c index 79a8bd41d9..49e4d3bf9a 100644 --- a/wmi_unified_non_tlv.c +++ b/wmi_unified_non_tlv.c @@ -446,7 +446,14 @@ QDF_STATUS send_vdev_install_key_cmd_non_tlv(wmi_unified_t wmi_handle, } #endif - qdf_mem_copy(cmd->key_data, param->key_data, cmd->key_len); + /* for big endian host, copy engine byte_swap is enabled + * But the key data content is in network byte order + * Need to byte swap the key data content - so when copy engine + * does byte_swap - target gets key_data content in the correct order + */ + WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(cmd->key_data, param->key_data, + cmd->key_len); + return wmi_unified_cmd_send(wmi_handle, buf, len, WMI_VDEV_INSTALL_KEY_CMDID);