summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Tomas <daniel.tomas@trusted-logic.com>2010-11-03 20:23:31 +0100
committerNick Pelly <npelly@google.com>2010-11-03 15:15:19 -0500
commitbad5c194e18faa70ceb9608019d3c2cfa0d4f10c (patch)
tree210afe2b4a84c886fba34e43fd0e3bd0bd09cd49
parent52ffcd90d9da60151c4343bc25f272da65cf6b98 (diff)
downloadexternal_libnfc-nxp-bad5c194e18faa70ceb9608019d3c2cfa0d4f10c.zip
external_libnfc-nxp-bad5c194e18faa70ceb9608019d3c2cfa0d4f10c.tar.gz
external_libnfc-nxp-bad5c194e18faa70ceb9608019d3c2cfa0d4f10c.tar.bz2
HCI timer enabled to HW reset NFC when HCI command times out.
Change-Id: Iee39957227fcdc8e97b520d22032dc97915323f3 Signed-off-by: Nick Pelly <npelly@google.com>
-rw-r--r--Linux_x86/phOsalNfc.c29
-rw-r--r--inc/phNfcConfig.h4
-rw-r--r--src/phHciNfc_Generic.c15
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 <phOsalNfc_Timer.h>
/** \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);
}