From bad5c194e18faa70ceb9608019d3c2cfa0d4f10c Mon Sep 17 00:00:00 2001 From: Daniel Tomas Date: Wed, 3 Nov 2010 20:23:31 +0100 Subject: HCI timer enabled to HW reset NFC when HCI command times out. Change-Id: Iee39957227fcdc8e97b520d22032dc97915323f3 Signed-off-by: Nick Pelly --- Linux_x86/phOsalNfc.c | 29 ++++++++--------------------- inc/phNfcConfig.h | 4 ++-- src/phHciNfc_Generic.c | 15 ++------------- 3 files changed, 12 insertions(+), 36 deletions(-) diff --git a/Linux_x86/phOsalNfc.c b/Linux_x86/phOsalNfc.c index 7d8e7da..6149fc3 100644 --- a/Linux_x86/phOsalNfc.c +++ b/Linux_x86/phOsalNfc.c @@ -140,26 +140,13 @@ void phOsalNfc_DbgTrace(uint8_t data[], uint32_t size) */ void phOsalNfc_RaiseException(phOsalNfc_ExceptionType_t eExceptionType, uint16_t reason) { - pid_t pid; -#ifndef ANDROID - static phOsalNfc_Exception_t phOsalNfc_Exception; - union sigval sv; -#endif - - phOsalNfc_Exception.eExceptionType = eExceptionType; - phOsalNfc_Exception.reason = reason; - - pid = getpid(); - - /* - * JCO: Bionic does not provide, among other things, sigqueue... - */ -#ifdef ANDROID - kill(pid, SIGABRT); -#else - sv.sival_ptr = &phOsalNfc_Exception; - - sigqueue(pid, SIGABRT, sv); -#endif + LOGD("phOsalNfc_RaiseException() called"); + + if(eExceptionType == phOsalNfc_e_UnrecovFirmwareErr) + { + LOGE("HCI Timeout - Exception raised"); + LOGE("Force restart of NFC Service"); + abort(); + } } diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h index e5fe6d7..5334484 100644 --- a/inc/phNfcConfig.h +++ b/inc/phNfcConfig.h @@ -255,7 +255,7 @@ #ifndef NXP_NFC_HCI_TIMER #define NXP_NFC_HCI_TIMER 0 -#define NXP_NFC_HCI_TIMEOUT 0x5000 +#define NXP_NFC_HCI_TIMEOUT 6000 #endif @@ -411,7 +411,7 @@ #define LLC_TIMER_ENABLE /**< Macro to enable HCI Response timer */ -/* #define NXP_NFC_HCI_TIMER 1 */ +#define NXP_NFC_HCI_TIMER 1 /* A Workaround to Delay and obtain the UICC Status Information */ /* #define UICC_STATUS_DELAY */ diff --git a/src/phHciNfc_Generic.c b/src/phHciNfc_Generic.c index db78725..4433344 100644 --- a/src/phHciNfc_Generic.c +++ b/src/phHciNfc_Generic.c @@ -66,13 +66,7 @@ #if (NXP_NFC_HCI_TIMER == 1) -#define HCI_RES_DEFAULT_TO 0x5000 - -#if ((NXP_NFC_HCI_TIMEOUT) < (HCI_RES_DEFAULT_TO)) -#define NXP_HCI_RESPONSE_TIMEOUT (HCI_RES_DEFAULT_TO) -#else #define NXP_HCI_RESPONSE_TIMEOUT (NXP_NFC_HCI_TIMEOUT) -#endif #include /** \internal HCI Response Timer to detect the @@ -83,11 +77,6 @@ static phHciNfc_sContext_t *gpsHciContext= NULL; #endif /* (NXP_NFC_HCI_TIMER == 1) */ - - - - - /* ################################################################################ ************************* Function Prototype Declaration *********************** @@ -99,7 +88,7 @@ static phHciNfc_sContext_t *gpsHciContext= NULL; static void phHciNfc_Response_Timeout ( - uint32_t resp_timer_id + uint32_t resp_timer_id ); #endif /* (NXP_NFC_HCI_TIMER == 1) */ @@ -588,7 +577,7 @@ phHciNfc_Release_Lower( { /* Start the HCI Response Timer */ phOsalNfc_Timer_Start( hci_resp_timer_id, - NXP_HCI_RESPONSE_TIMEOUT, phHciNfc_Response_Timeout ); + NXP_HCI_RESPONSE_TIMEOUT, phHciNfc_Response_Timeout, NULL); HCI_DEBUG(" HCI : Timer %X Started \n", hci_resp_timer_id); } -- cgit v1.1