Project

General

Profile

Issue #957 » 0001-Reject-non-whitelisted-NFC-firmwares.patch

Simon Josefsson, 08/14/2014 05:39 PM

View differences:

nxp/jni/com_android_nfc_NativeNfcManager.cpp
460 460
   {
461 461
       TRACE("Firmware version UpToDate");
462 462
   }
463
   /* ====== REPLICANT NFC CHIP TEST ======= */
464

  
465
   REENTRANCE_LOCK();
466
   status = phLibNfc_Mgt_GetstackCapabilities(&caps, (void*)nat);
467
   REENTRANCE_UNLOCK();
468
   if (status == NFCSTATUS_SUCCESS &&
469
       caps.psDevCapabilities.hal_version == 0x8150100 &&
470
       caps.psDevCapabilities.fw_version == 0xb10122 &&
471
       caps.psDevCapabilities.hw_version == 0x620003 &&
472
       caps.psDevCapabilities.model_id == 0x12 &&
473
       caps.psDevCapabilities.hci_version == 1 &&
474
       caps.psDevCapabilities.full_version[NXP_FULL_VERSION_LEN-1] == 1 &&
475
       caps.psDevCapabilities.full_version[NXP_FULL_VERSION_LEN-2] == 34)
476
     {
477
       ALOGD("NFC chip does not need firmware to work");
478
     }
479
   else
480
     {
481
       ALOGE("NFC chip too old, disabling NFC...");
482
       goto clean_and_return;
483
     }
484

  
463 485
   /* ====== EEPROM SETTINGS ======= */
464 486

  
465 487
   // Update EEPROM settings
(3-3/3)