瀏覽代碼

qcacmn: Read the Direct Buf Rx tail pointer in the Host order

Direct Buf Rx has a source ring to communicate with the target.
The target updates its tail pointer in little-endian format and this update
doesn't go through any byte-order conversion at the target. On a big-endian
Host platform, this tail pointer will be read in reverse order of bytes.
To fix this, convert the tail pointer to the Host order before using it.

Change-Id: Ibcaf3d7507910ea81eeb895772241ab9861ee45a
CRs-Fixed: 2843259
Shiva Krishna Pittala 4 年之前
父節點
當前提交
ee5f45a176
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c

+ 2 - 0
target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c

@@ -1744,6 +1744,7 @@ static void target_if_dbr_add_ring_debug_entry(
 		}
 		hal_get_sw_hptp(hal_soc, srng, &tp, &hp);
 		hal_srng_access_end(hal_soc, srng);
+		tp = qdf_le32_to_cpu(tp);
 		entry = &ring_debug->entries[ring_debug->ring_debug_idx];
 
 		entry->head_idx = hp;
@@ -2093,6 +2094,7 @@ QDF_STATUS target_if_direct_buf_rx_print_ring_stat(
 			}
 			srng = dbr_ring_cfg->srng;
 			hal_get_sw_hptp(hal_soc, srng, &tp, &hp);
+			tp = qdf_le32_to_cpu(tp);
 			direct_buf_rx_debug("|%11d|%14s|%10x|%10x|",
 					    mod_idx, g_dbr_module_name[mod_idx].
 					    module_name_str,