Browse Source

qcacmn: WMI changes for big endian platform

Swap each word of beacon and mgmt frame for big endian platform.
This is needed since copy engine swap is enabled but beacon and mgmt frame
needs to be given in same order to FW in order to get transmitted in the
intended network byte order.

Change-Id: I09290f3beef5f0cde33a5543c2778473b35d232c
Nandha Kishore Easwaran 4 years ago
parent
commit
12104fad28
1 changed files with 15 additions and 2 deletions
  1. 15 2
      wmi/src/wmi_unified_tlv.c

+ 15 - 2
wmi/src/wmi_unified_tlv.c

@@ -2419,7 +2419,14 @@ static QDF_STATUS send_beacon_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle,
 
 	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, param->tmpl_len_aligned);
 	buf_ptr += WMI_TLV_HDR_SIZE;
-	qdf_mem_copy(buf_ptr, param->frm, param->tmpl_len);
+
+	/* for big endian host, copy engine byte_swap is enabled
+	 * But the frame content is in network byte order
+	 * Need to byte swap the frame content - so when copy engine
+	 * does byte_swap - target gets frame content in the correct order
+	 */
+	WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(buf_ptr, param->frm,
+					param->tmpl_len);
 
 	wmi_mtrace(WMI_BCN_TMPL_CMDID, cmd->vdev_id, 0);
 	ret = wmi_unified_cmd_send(wmi_handle,
@@ -3514,7 +3521,13 @@ static QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle,
 	WMITLV_SET_HDR(bufp, WMITLV_TAG_ARRAY_BYTE, roundup(bufp_len,
 							    sizeof(uint32_t)));
 	bufp += WMI_TLV_HDR_SIZE;
-	qdf_mem_copy(bufp, param->pdata, bufp_len);
+
+	/* for big endian host, copy engine byte_swap is enabled
+	 * But the frame content is in network byte order
+	 * Need to byte swap the frame content - so when copy engine
+	 * does byte_swap - target gets frame content in the correct order
+	 */
+	WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(bufp, param->pdata, bufp_len);
 
 	status = qdf_nbuf_map_single(qdf_ctx, param->tx_frame,
 				     QDF_DMA_TO_DEVICE);