summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDániel Járai <jaraidaniel@gmail.com>2017-12-31 16:20:01 +0200
committerArne Coucheron <arco68@gmail.com>2018-03-25 19:46:17 +0000
commit81b278f3e7b10572b3f37e0421b391455cefc498 (patch)
tree00c18cae3e0a68cfbc68f6365a0448b0231c836e
parentcc331f665fbba9d6fde4cbd013125081448e7498 (diff)
downloadandroid_hardware_broadcom_nfc-81b278f3e7b10572b3f37e0421b391455cefc498.tar.gz
android_hardware_broadcom_nfc-81b278f3e7b10572b3f37e0421b391455cefc498.tar.bz2
android_hardware_broadcom_nfc-81b278f3e7b10572b3f37e0421b391455cefc498.zip
bcm2079x: Hardcode nci_ctrl_size to the Nougat value
* A race condition was dicovered wherein the value of the pointer 'p' is not given the value 255 (as per the NFC specification) by the time the code is ran. * To mitigate this, the value is hardcoded to 255, thus matching the value used for Broadcom NFC back in Nougat. * In explanation of the value being converted to a pointer, it looks like they were preparing to have future chips store different values. Although as upstream dropped Broadcom NFC support, said work will never take place. Change-Id: I78f3fab7587c9003ed6922eac807de7f1c7c84c5 Signed-off-by: D. Andrei Măceș <andrei@unlegacy-android.org> Signed-off-by: Nolen Johnson <johnsonnolen@gmail.com>
-rw-r--r--halimpl/bcm2079x/hal/hal/nfc_hal_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/halimpl/bcm2079x/hal/hal/nfc_hal_main.c b/halimpl/bcm2079x/hal/hal/nfc_hal_main.c
index c266e5c..c48270e 100644
--- a/halimpl/bcm2079x/hal/hal/nfc_hal_main.c
+++ b/halimpl/bcm2079x/hal/hal/nfc_hal_main.c
@@ -652,7 +652,7 @@ uint32_t nfc_hal_main_task(uint32_t param) {
p += 5;
STREAM_TO_UINT8(num_interfaces, p);
p += (num_interfaces + 3);
- nfc_hal_cb.ncit_cb.nci_ctrl_size = *p;
+ nfc_hal_cb.ncit_cb.nci_ctrl_size = 255;
/* start post initialization */
nfc_hal_cb.dev_cb.next_dm_config = NFC_HAL_DM_CONFIG_LPTD;