mac: read negative tof after aoa_fom Bug: 282202178 Change-Id: Ica945b3e774a6e22c179072c770218d2540cb30e Signed-off-by: Clément Viel <[email protected]>
diff --git a/mac/fira_frame.c b/mac/fira_frame.c index ca44ba2..7bbf9d0 100644 --- a/mac/fira_frame.c +++ b/mac/fira_frame.c
@@ -766,13 +766,6 @@ ranging_info->remote_aoa_elevation_pi = get_unaligned_le16(p); p += sizeof(s16); } - if (neg_tof_present) { - /* When negative ToF is present at end of frame, - * ToF read ahead MUST be 0, so, is safe to overwrite */ - ranging_info->tof_rctu = -get_unaligned_le32(p); - p += sizeof(u32); - } - if (aoa_fom_present) { ranging_info->remote_aoa_fom_present = true; if (aoa_azimuth_present) @@ -780,6 +773,13 @@ if (aoa_elevation_present) ranging_info->remote_aoa_elevation_fom = *p++; } + if (neg_tof_present) { + /* When negative ToF is present at end of frame, + * ToF read ahead MUST be 0, so, is safe to overwrite */ + ranging_info->tof_rctu = -get_unaligned_le32(p); + p += sizeof(u32); + } + return true; }