dataipa: ipahal: Filtering & routing rules generation extra word pointer fix
* In case extension header exists the rule is 2 bytes into the extra words
area
* Subtract extension header size to point to the next whole 8 byte word
right after the header
Change-Id: Ic6e4fc05ca8e03408530cc9815f4ce7455bd7c57
Signed-off-by: Eliad Ben Yishay <quic_ebenyish@quicinc.com>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
index 4e171f2..b16e5d1 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
@@ -2853,19 +2853,19 @@
} else if (extra_bytes > IPA3_0_HW_TBL_HDR_WIDTH) {
/* two extra words */
extra = *buf;
- rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH * 2;
+ rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH * 2 - ext_hdr * 2;
} else if (extra_bytes > 0) {
/* single exra word */
extra = *buf;
/* With ext_hdr, 2 bytes are already occupied. */
if (ext_hdr && extra_bytes > (IPA3_0_HW_TBL_HDR_WIDTH - 2))
- rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH * 2;
+ rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH * 2 - ext_hdr * 2;
else
- rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH;
+ rest = *buf + IPA3_0_HW_TBL_HDR_WIDTH - ext_hdr * 2;
} else {
/* no extra words */
- extra = NULL;
- rest = *buf;
+ extra = ext_hdr ? *buf : NULL;
+ rest = *buf - ext_hdr * 2 + ext_hdr * IPA3_0_HW_TBL_HDR_WIDTH;
}
/*