summaryrefslogtreecommitdiffstats
path: root/halimpl/hal
diff options
context:
space:
mode:
authorLove Khanna <love.khanna@nxp.com>2018-03-19 19:03:30 +0530
committerRuchi Kandoi <kandoiruchi@google.com>2018-03-26 23:31:54 +0000
commitfc21a70766bdb970c7c695d0ead58b1a3ce6bae5 (patch)
treeca03ad752e6e8cf108da8fad6207818edfcfe9e7 /halimpl/hal
parent775c2b8116ddd38e944ae9e3d359a1a562938512 (diff)
downloadandroid_hardware_nxp_nfc-fc21a70766bdb970c7c695d0ead58b1a3ce6bae5.tar.gz
android_hardware_nxp_nfc-fc21a70766bdb970c7c695d0ead58b1a3ce6bae5.tar.bz2
android_hardware_nxp_nfc-fc21a70766bdb970c7c695d0ead58b1a3ce6bae5.zip
Removed support for PN548, PN547
Bug: 75980364 Test: Compiles, NFC enable/disable Merged-In: I04ecb809e9b8c07e1c3c184a61e2887758ec449f Change-Id: I04ecb809e9b8c07e1c3c184a61e2887758ec449f (cherry picked from commit 2f2631a4d0cf9c26003f1d796859ea81745d983c)
Diffstat (limited to 'halimpl/hal')
-rwxr-xr-xhalimpl/hal/phNxpNciHal.cc124
-rwxr-xr-xhalimpl/hal/phNxpNciHal.h6
-rwxr-xr-xhalimpl/hal/phNxpNciHal_ext.cc80
3 files changed, 0 insertions, 210 deletions
diff --git a/halimpl/hal/phNxpNciHal.cc b/halimpl/hal/phNxpNciHal.cc
index 24c994f..af2062f 100755
--- a/halimpl/hal/phNxpNciHal.cc
+++ b/halimpl/hal/phNxpNciHal.cc
@@ -80,16 +80,10 @@ EseAdaptation *gpEseAdapt = NULL;
extern uint16_t wFwVer;
extern uint16_t fw_maj_ver;
extern uint16_t rom_version;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
extern uint8_t gRecFWDwnld;
static uint8_t gRecFwRetryCount; // variable to hold dummy FW recovery count
-#endif
static uint8_t Rx_data[NCI_MAX_DATA_LEN];
extern int phPalEse_spi_ioctl(phPalEse_ControlCode_t eControlCode,void *pDevHandle, long level);
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
-uint8_t discovery_cmd[50] = {0};
-uint8_t discovery_cmd_len = 0;
-#endif
uint32_t timeoutTimerId = 0;
bool nfc_debug_enabled = true;
@@ -128,10 +122,8 @@ NFCSTATUS phNxpNciHal_check_clock_config(void);
NFCSTATUS phNxpNciHal_china_tianjin_rf_setting(void);
static void phNxpNciHal_gpio_restore(phNxpNciHal_GpioInfoState state);
static void phNxpNciHal_initialize_debug_enabled_flag();
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
static NFCSTATUS phNxpNciHalRFConfigCmdRecSequence();
static NFCSTATUS phNxpNciHal_CheckRFCmdRespStatus();
-#endif
int check_config_parameter();
/******************************************************************************
* Function phNxpNciHal_initialize_debug_enabled_flag
@@ -405,11 +397,9 @@ static NFCSTATUS phNxpNciHal_CheckValidFwVersion(void) {
}
}
}
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
else if (gRecFWDwnld == TRUE) {
status = NFCSTATUS_SUCCESS;
}
-#endif
else if (wFwVerRsp == 0) {
NXPLOG_NCIHAL_E(
"FW Version not received by NCI command >>> Force Firmware download");
@@ -562,10 +552,6 @@ int phNxpNciHal_MinOpen (){
tOsalConfig.pLogFile = NULL;
tTmlConfig.dwGetMsgThreadId = (uintptr_t)nxpncihal_ctrl.gDrvCfg.nClientId;
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- memset(discovery_cmd, 0, sizeof(discovery_cmd));
- discovery_cmd_len = 0;
-#endif
/* Initialize TML layer */
wConfigStatus = phTmlNfc_Init(&tTmlConfig);
@@ -804,14 +790,6 @@ int phNxpNciHal_fw_mw_ver_check() {
(rom_version == FW_MOBILE_ROM_VERSION_PN551) &&
(fw_maj_ver == 0x05)) {
status = NFCSTATUS_SUCCESS;
- } else if (!strcmp(COMPILATION_MW, "PN548C2") &&
- (rom_version == FW_MOBILE_ROM_VERSION_PN548AD) &&
- (fw_maj_ver == 0x01)) {
- status = NFCSTATUS_SUCCESS;
- } else if (!strcmp(COMPILATION_MW, "PN547C2") &&
- (rom_version == FW_MOBILE_ROM_VERSION_PN547C2) &&
- (fw_maj_ver == 0x01)) {
- status = NFCSTATUS_SUCCESS;
}
return status;
}
@@ -1190,11 +1168,9 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
int temp_fix = 1;
#endif
unsigned long num = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
// initialize dummy FW recovery variables
gRecFwRetryCount = 0;
gRecFWDwnld = 0;
-#endif
// recovery --start
/*NCI_INIT_CMD*/
static uint8_t cmd_init_nci[] = {0x20, 0x01, 0x00};
@@ -1367,7 +1343,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
retlen = 0;
fw_download_success = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
NXPLOG_NCIHAL_D("Performing TVDD Settings");
isfound = GetNxpNumValue(NAME_NXP_EXT_TVDD_CFG, &num, sizeof(num));
if (isfound > 0) {
@@ -1408,17 +1383,13 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
NXPLOG_NCIHAL_E("Wrong Configuration Value %ld", num);
}
}
-#endif
retlen = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
config_access = false;
-#endif
NXPLOG_NCIHAL_D("Performing RF Settings BLK 1");
isfound = GetNxpByteArrayValue(NAME_NXP_RF_CONF_BLK_1, (char*)buffer,
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1428,7 +1399,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 1 failed");
retry_core_init_cnt++;
@@ -1442,7 +1412,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1452,7 +1421,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 2 failed");
retry_core_init_cnt++;
@@ -1466,7 +1434,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1476,7 +1443,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 3 failed");
retry_core_init_cnt++;
@@ -1490,7 +1456,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1500,7 +1465,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 4 failed");
retry_core_init_cnt++;
@@ -1514,7 +1478,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1524,7 +1487,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 5 failed");
retry_core_init_cnt++;
@@ -1538,7 +1500,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
bufflen, &retlen);
if (retlen > 0) {
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1548,7 +1509,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("RF Settings BLK 6 failed");
retry_core_init_cnt++;
@@ -1556,9 +1516,7 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
}
}
retlen = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
config_access = true;
-#endif
NXPLOG_NCIHAL_D("Performing NAME_NXP_CORE_CONF_EXTN Settings");
isfound = GetNxpByteArrayValue(NAME_NXP_CORE_CONF_EXTN, (char*)buffer,
bufflen, &retlen);
@@ -1587,15 +1545,12 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
}
retlen = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
config_access = false;
-#endif
isfound = GetNxpByteArrayValue(NAME_NXP_CORE_RF_FIELD, (char*)buffer,
bufflen, &retlen);
if (retlen > 0) {
/* NXP ACT Proprietary Ext */
status = phNxpNciHal_send_ext_cmd(retlen, buffer);
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
if (status == NFCSTATUS_SUCCESS) {
status = phNxpNciHal_CheckRFCmdRespStatus();
/*STATUS INVALID PARAM 0x09*/
@@ -1605,19 +1560,15 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
goto retry_core_init;
}
} else
-#endif
if (status != NFCSTATUS_SUCCESS) {
NXPLOG_NCIHAL_E("Setting NXP_CORE_RF_FIELD status failed");
retry_core_init_cnt++;
goto retry_core_init;
}
}
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
config_access = true;
-#endif
retlen = 0;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
/* NXP SWP switch timeout Setting*/
if (GetNxpNumValue(NAME_NXP_SWP_SWITCH_TIMEOUT, (void*)&retlen,
sizeof(retlen))) {
@@ -1652,7 +1603,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
NXPLOG_NCIHAL_E("phNxpNciHal_china_tianjin_rf_setting failed");
return NFCSTATUS_FAILED;
}
-#endif
// Update eeprom value
status = phNxpNciHal_set_mw_eeprom();
if (status != NFCSTATUS_SUCCESS) {
@@ -1883,11 +1833,9 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
free(buffer);
buffer = NULL;
}
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
// initialize dummy FW recovery variables
gRecFWDwnld = 0;
gRecFwRetryCount = 0;
-#endif
if (!((*p_core_init_rsp_params > 0) && (*p_core_init_rsp_params < 4)))
phNxpNciHal_core_initialized_complete(status);
else {
@@ -1909,7 +1857,6 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
#endif
return NFCSTATUS_SUCCESS;
}
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
/******************************************************************************
* Function phNxpNciHal_CheckRFCmdRespStatus
*
@@ -1986,7 +1933,6 @@ NFCSTATUS phNxpNciHalRFConfigCmdRecSequence() {
gRecFWDwnld = false;
return status;
}
-#endif
/******************************************************************************
* Function phNxpNciHal_core_initialized_complete
*
@@ -3037,73 +2983,3 @@ static void phNxpNciHal_print_res_status(uint8_t* p_rx_data, uint16_t* p_len) {
}
}
}
-
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
-NFCSTATUS phNxpNciHal_core_reset_recovery() {
- NFCSTATUS status = NFCSTATUS_FAILED;
-
- /*NCI_INIT_CMD*/
- static uint8_t cmd_init_nci[] = {0x20, 0x01, 0x00};
- /*NCI_RESET_CMD*/
- static uint8_t cmd_reset_nci[] = {0x20, 0x00, 0x01,
- 0x00}; // keep configuration
- static uint8_t cmd_init_nci2_0[] = {0x20, 0x01, 0x02, 0x00, 0x00};
- /* reset config cache */
- uint8_t retry_core_init_cnt = 0;
-
- if (discovery_cmd_len == 0) {
- goto FAILURE;
- }
- NXPLOG_NCIHAL_D("%s: recovery", __func__);
-
-retry_core_init:
- if (retry_core_init_cnt > 3) {
- goto FAILURE;
- }
-
- status = phTmlNfc_IoCtl(phTmlNfc_e_ResetDevice);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_D("PN54X Reset - FAILED\n");
- goto FAILURE;
- }
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_reset_nci), cmd_reset_nci);
- if ((status != NFCSTATUS_SUCCESS) &&
- (nxpncihal_ctrl.retry_cnt >= MAX_RETRY_COUNT)) {
- retry_core_init_cnt++;
- goto retry_core_init;
- } else if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_D("NCI_CORE_RESET: Failed");
- retry_core_init_cnt++;
- goto retry_core_init;
- }
- if (nxpncihal_ctrl.nci_info.nci_version == NCI_VERSION_2_0) {
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_init_nci2_0), cmd_init_nci2_0);
- } else {
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_init_nci), cmd_init_nci);
- }
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_D("NCI_CORE_INIT : Failed");
- retry_core_init_cnt++;
- goto retry_core_init;
- }
-
- status = phNxpNciHal_send_ext_cmd(discovery_cmd_len, discovery_cmd);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_D("RF_DISCOVERY : Failed");
- retry_core_init_cnt++;
- goto retry_core_init;
- }
-
- return NFCSTATUS_SUCCESS;
-FAILURE:
- abort();
-}
-
-void phNxpNciHal_discovery_cmd_ext(uint8_t* p_cmd_data, uint16_t cmd_len) {
- NXPLOG_NCIHAL_D("phNxpNciHal_discovery_cmd_ext");
- if (cmd_len > 0 && cmd_len <= sizeof(discovery_cmd)) {
- memcpy(discovery_cmd, p_cmd_data, cmd_len);
- discovery_cmd_len = cmd_len;
- }
-}
-#endif
diff --git a/halimpl/hal/phNxpNciHal.h b/halimpl/hal/phNxpNciHal.h
index ce71856..9a216e1 100755
--- a/halimpl/hal/phNxpNciHal.h
+++ b/halimpl/hal/phNxpNciHal.h
@@ -35,8 +35,6 @@ typedef void(phNxpNciHal_control_granted_callback_t)();
#define FW_MOBILE_ROM_VERSION_PN551 0x10
#define FW_MOBILE_ROM_VERSION_PN553 0x11
#define FW_MOBILE_ROM_VERSION_PN557 0x12
-#define FW_MOBILE_ROM_VERSION_PN548AD 0x10
-#define FW_MOBILE_ROM_VERSION_PN547C2 0x08
/* NCI Data */
#define NCI_MT_CMD 0x20
@@ -177,8 +175,4 @@ int phNxpNciHal_check_ncicmd_write_window(uint16_t cmd_len, uint8_t* p_cmd);
void phNxpNciHal_request_control(void);
void phNxpNciHal_release_control(void);
int phNxpNciHal_write_unlocked(uint16_t data_len, const uint8_t* p_data);
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
-NFCSTATUS phNxpNciHal_core_reset_recovery();
-void phNxpNciHal_discovery_cmd_ext(uint8_t* p_cmd_data, uint16_t cmd_len);
-#endif
#endif /* _PHNXPNCIHAL_H_ */
diff --git a/halimpl/hal/phNxpNciHal_ext.cc b/halimpl/hal/phNxpNciHal_ext.cc
index 4240c58..a24317c 100755
--- a/halimpl/hal/phNxpNciHal_ext.cc
+++ b/halimpl/hal/phNxpNciHal_ext.cc
@@ -36,9 +36,6 @@ extern uint32_t cleanup_timer;
extern bool nfc_debug_enabled;
uint8_t icode_detected = 0x00;
uint8_t icode_send_eof = 0x00;
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
-uint8_t nfcdep_detected = 0x00;
-#endif
static uint8_t ee_disc_done = 0x00;
uint8_t EnableP2P_PrioLogic = false;
static uint32_t RfDiscID = 1;
@@ -100,9 +97,6 @@ void phNxpNciHal_ext_init(void) {
*******************************************************************************/
NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
NFCSTATUS status = NFCSTATUS_SUCCESS;
-#if (NFC_NXP_CHIP_TYPE == PN547C2)
- uint16_t rf_technology_length_param = 0;
-#endif
if (p_ntf[0] == 0x61 && p_ntf[1] == 0x05 && p_ntf[4] == 0x03 &&
p_ntf[5] == 0x05 && nxpprofile_ctrl.profile_type == EMV_CO_PROFILE) {
@@ -142,11 +136,6 @@ NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
status = NFCSTATUS_SUCCESS;
if (p_ntf[0] == 0x61 && p_ntf[1] == 0x05) {
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- if (nfcdep_detected) {
- nfcdep_detected = 0x00;
- }
-#endif
switch (p_ntf[4]) {
case 0x00:
@@ -160,9 +149,6 @@ NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
break;
case 0x03:
NXPLOG_NCIHAL_D("NxpNci: RF Interface = NFC-DEP");
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- nfcdep_detected = 0x01;
-#endif
break;
case 0x80:
NXPLOG_NCIHAL_D("NxpNci: RF Interface = MIFARE");
@@ -195,11 +181,7 @@ NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
case 0x80:
NXPLOG_NCIHAL_D("NxpNci: Protocol = MIFARE");
break;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
case 0x81:
-#else
- case 0x8A:
-#endif
NXPLOG_NCIHAL_D("NxpNci: Protocol = Kovio");
break;
default:
@@ -226,11 +208,7 @@ NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
case 0x06:
NXPLOG_NCIHAL_D("NxpNci: Mode = 15693 Passive Poll");
break;
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
case 0x70:
-#else
- case 0x77:
-#endif
NXPLOG_NCIHAL_D("NxpNci: Mode = Kovio");
break;
case 0x80:
@@ -324,18 +302,6 @@ NFCSTATUS phNxpNciHal_process_ext_rsp(uint8_t* p_ntf, uint16_t* p_len) {
status = NFCSTATUS_FAILED;
return status;
}
-#if (NFC_NXP_CHIP_TYPE == PN547C2)
- else if (p_ntf[0] == 0x61 && p_ntf[1] == 0x05 && p_ntf[4] == 0x02 &&
- p_ntf[5] == 0x80 && p_ntf[6] == 0x00) {
- NXPLOG_NCIHAL_D(
- "Going through workaround - iso-dep interface mifare protocol with "
- "sak value not equal to 0x20");
- rf_technology_length_param = p_ntf[9];
- if ((p_ntf[9 + rf_technology_length_param] & 0x20) != 0x20) {
- p_ntf[4] = 0x80;
- }
- }
-#endif
else if (*p_len == 4 && p_ntf[0] == 0x4F && p_ntf[1] == 0x11 &&
p_ntf[2] == 0x01) {
if (p_ntf[3] == 0x00) {
@@ -467,17 +433,6 @@ static NFCSTATUS phNxpNciHal_ext_process_nfc_init_rsp(uint8_t* p_ntf,
}
NXPLOG_NCIHAL_E("CORE_RESET_NTF received !");
NXPLOG_NCIR_E("len = %3d > %s", *p_len, print_buffer);
-
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- if (nfcdep_detected &&
- !(p_ntf[2] == 0x06 && p_ntf[3] == 0xA0 && p_ntf[4] == 0x00 &&
- ((p_ntf[5] == 0xC9 && p_ntf[6] == 0x95 && p_ntf[7] == 0x00 &&
- p_ntf[8] == 0x00) ||
- (p_ntf[5] == 0x07 && p_ntf[6] == 0x39 && p_ntf[7] == 0xF2 &&
- p_ntf[8] == 0x00)))) {
- nfcdep_detected = 0x00;
- }
-#endif
phNxpNciHal_emergency_recovery();
status = NFCSTATUS_FAILED;
} /* Parsing CORE_INIT_RSP*/
@@ -705,18 +660,11 @@ NFCSTATUS phNxpNciHal_write_ext(uint16_t* cmd_len, uint8_t* p_cmd_data,
if (nxpncihal_ctrl.nci_info.nci_version != NCI_VERSION_2_0) {
NXPLOG_NCIHAL_D("> Going through workaround - set host list");
-#if (NFC_NXP_CHIP_TYPE != PN547C2)
*cmd_len = 8;
p_cmd_data[2] = 0x05;
p_cmd_data[6] = 0x02;
p_cmd_data[7] = 0xC0;
-#else
- *cmd_len = 7;
-
- p_cmd_data[2] = 0x04;
- p_cmd_data[6] = 0xC0;
-#endif
NXPLOG_NCIHAL_D("> Going through workaround - set host list - END");
status = NFCSTATUS_SUCCESS;
@@ -740,10 +688,6 @@ NFCSTATUS phNxpNciHal_write_ext(uint16_t* cmd_len, uint8_t* p_cmd_data,
NXPLOG_NCIHAL_D("> Polling Loop Started");
icode_detected = 0;
icode_send_eof = 0;
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- // Cache discovery cmd for recovery
- phNxpNciHal_discovery_cmd_ext(p_cmd_data, *cmd_len);
-#endif
}
// 22000100
else if (p_cmd_data[0] == 0x22 && p_cmd_data[1] == 0x00 &&
@@ -902,30 +846,6 @@ NFCSTATUS phNxpNciHal_write_ext(uint16_t* cmd_len, uint8_t* p_cmd_data,
}
}
-#if (NFC_NXP_CHIP_TYPE == PN548C2)
- if (p_cmd_data[0] == 0x20 && p_cmd_data[1] == 0x02) {
- uint8_t temp;
- uint8_t* p = p_cmd_data + 4;
- uint8_t* end = p_cmd_data + *cmd_len;
- while (p < end) {
- if (*p == 0x53) // LF_T3T_FLAGS
- {
- NXPLOG_NCIHAL_D("> Going through workaround - LF_T3T_FLAGS swap");
- temp = *(p + 3);
- *(p + 3) = *(p + 2);
- *(p + 2) = temp;
- NXPLOG_NCIHAL_D("> Going through workaround - LF_T3T_FLAGS - End");
- status = NFCSTATUS_SUCCESS;
- break;
- }
- if (*p == 0xA0) {
- p += *(p + 2) + 3;
- } else {
- p += *(p + 1) + 2;
- }
- }
- }
-#endif
return status;
}