summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-10-21 16:31:30 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-21 16:31:30 -0700
commit17abc6eb45b326f574c657e227670a8fddf9385e (patch)
treec3f8f7d02b2937c57cade4ce0917a66a1418ec5d
parent5ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28 (diff)
parentbb6fce1837b09954db7268c47c66bd5590ac1e37 (diff)
downloadexternal_libnfc-nxp-17abc6eb45b326f574c657e227670a8fddf9385e.zip
external_libnfc-nxp-17abc6eb45b326f574c657e227670a8fddf9385e.tar.gz
external_libnfc-nxp-17abc6eb45b326f574c657e227670a8fddf9385e.tar.bz2
Merge "Remove NFC I2C workaround for Prime (DO NOT MERGE)." into ics-mr0
-rw-r--r--Linux_x86/phDal4Nfc.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/Linux_x86/phDal4Nfc.c b/Linux_x86/phDal4Nfc.c
index 8b4f687..ba8a6cc 100644
--- a/Linux_x86/phDal4Nfc.c
+++ b/Linux_x86/phDal4Nfc.c
@@ -720,35 +720,12 @@ int phDal4Nfc_ReaderThread(void * pArg)
}
/* Issue read operation.*/
+ gReadWriteContext.nNbOfBytesRead=0;
+ DAL_DEBUG("RX Thread *New *** *****Request Length = %d",gReadWriteContext.nNbOfBytesToRead);
+ memsetRet=memset(gReadWriteContext.pReadBuffer,0,gReadWriteContext.nNbOfBytesToRead);
- i2c_error_count = 0;
-retry:
- gReadWriteContext.nNbOfBytesRead=0;
- DAL_DEBUG("RX Thread *New *** *****Request Length = %d",gReadWriteContext.nNbOfBytesToRead);
- memsetRet=memset(gReadWriteContext.pReadBuffer,0,gReadWriteContext.nNbOfBytesToRead);
-
- /* Wait for IRQ !!! */
- gReadWriteContext.nNbOfBytesRead = gLinkFunc.read(gReadWriteContext.pReadBuffer, gReadWriteContext.nNbOfBytesToRead);
-
- /* TODO: Remove this hack
- * Reading the value 0x57 indicates a HW I2C error at I2C address 0x57
- * (pn544). There should not be false positives because a read of length 1
- * must be a HCI length read, and a length of 0x57 is impossible (max is 33).
- */
- if(gReadWriteContext.nNbOfBytesToRead == 1 && gReadWriteContext.pReadBuffer[0] == 0x57)
- {
- i2c_error_count++;
- DAL_DEBUG("RX Thread Read 0x57 %d times\n", i2c_error_count);
- if (i2c_error_count < 5) {
- usleep(2000);
- goto retry;
- }
- DAL_PRINT("RX Thread NOTHING TO READ, RECOVER");
- phOsalNfc_RaiseException(phOsalNfc_e_UnrecovFirmwareErr,1);
- }
- else
- {
- i2c_error_count = 0;
+ /* Wait for IRQ !!! */
+ gReadWriteContext.nNbOfBytesRead = gLinkFunc.read(gReadWriteContext.pReadBuffer, gReadWriteContext.nNbOfBytesToRead);
if (low_level_traces)
{
@@ -757,12 +734,6 @@ retry:
}
DAL_DEBUG("RX Thread Read ok. nbToRead=%d\n", gReadWriteContext.nNbOfBytesToRead);
DAL_DEBUG("RX Thread NbReallyRead=%d\n", gReadWriteContext.nNbOfBytesRead);
-/* DAL_PRINT("RX Thread ReadBuff[]={ ");
- for (i = 0; i < gReadWriteContext.nNbOfBytesRead; i++)
- {
- DAL_DEBUG("RX Thread 0x%x ", gReadWriteContext.pReadBuffer[i]);
- }
- DAL_PRINT("RX Thread }\n"); */
/* read completed immediately */
sMsg.eMsgType= PHDAL4NFC_READ_MESSAGE;
@@ -771,7 +742,6 @@ retry:
phDal4Nfc_DeferredCall((pphDal4Nfc_DeferFuncPointer_t)phDal4Nfc_DeferredCb,(void *)pmsgType);
memsetRet=memset(&sMsg,0,sizeof(phDal4Nfc_Message_t));
memsetRet=memset(&OsalMsg,0,sizeof(phOsalNfc_Message_t));
- }
} /* End of thread Loop*/