summaryrefslogtreecommitdiffstats
path: root/Linux_x86/phDal4Nfc_uart.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-061-3/+3
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I935ee4450e2e62ced1537bafb787ad402cfcb69c
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-051-3/+3
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I05dd3a5e5f671c0fdc17bf4e3d52395ccdb56e45
* Use NFC HAL for some libnfc settings.Martijn Coenen2011-11-031-36/+2
| | | | | | | | | | The NFC HAL in libhardware allows us to store and retrieve product-specific settings. This patch moves two product-specific settings to the HAL: the device port, and the usage of the i2c workaround we had for crespo. This means configuring the port no longer needs to be done from JNI land. Change-Id: I2e19b6f188f808bc2f2a1f1abc28f2a6c47e6a4c
* Use a 10s timeout in uart_read() in FW download mode.Nick Pelly2011-10-251-1/+5
| | | | | | | | | | | | | This provides a path to flush RX, necessary when we enter FW download mode with bogus data already in RX. This fixes a problem where NFC was dead on several HSPA and LTE devices. Also decrease FW timeout completition from 120s to 60s. Typically FW download takes 30s, and 120 is unnecessarily large and causes a long delay to bring up NFC when we need to retry FW. Bug: 5468674 Change-Id: I0fd40c199daac861fe5acda4f2d214bdcff8e869
* Fixes to LLC and DAL to handle unreliable UART.Nick Pelly2011-10-211-7/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a 100ms timeout in uart_read() when reading LLC payload only. Allow 200 retries on host. Note that we use pn544 timeout retransmit instead of an explicit REJ (do not use CRC_ERROR_REJ). The reason is that after a dropped frame, a host timeout on read() is the only reliable way to recover frame alignment, but if we send an immediate REJ then we are constantly reading and can never regain frame alignment. Also note that the pn544 timeout (200ms) is higher than the host (100ms). This allows the host to abort a partial read and return to known state before the pn544 re-transmits. We have to turn off timeout for FW mode. Typical read time is ~100ms, but some are 1 second+ Modify DAL & LLC layer to more reliably handle partial frames by searching for a LLC length byte again, and log the various error paths. Also introduce debugging tools: debug.nfc.LOW_LEVEL_TRACES 2 Will enable LLC header decoding in the trace output. Only read at NFC init time, use /data/local.prop to enable. debug.nfc.UART_ERROR_RATE X Will randomly inject errors at the uart transport, with a probability of X/1000 for every byte. 50% of those errors will be a dropped byte, 50% will be corrupted. Recommend X=10. FW mode can't handle any errors. Can be enabled after boot. adb shell dumpsys nfc Will now print the number of errors detected at the LLC layer. Change-Id: I739ed193e3d4caa563a866b6a9d834c154917962
* Disable read() timeout.Nick Pelly2011-07-141-1/+1
| | | | | | | | | | | | | During normal operation, there is a pending read of 1 byte. This reverts an earlier change to make FW download more stable. Will need to revisit this again, but fow now we have other FW download fixes in place that make FW download ok. So now its better to optimize normal operation. With this change NFC becomes reliable again on Prime. Change-Id: Ie5ea1c58ae7ddeb0359f344b9ceb6478b00f2158
* Return partial response on timeout during uart read()Nick Pelly2011-07-081-1/+1
| | | | | | | | This is just to match the behavior in the old uart read DAL. It does not actually fix any problems, just pushes errors higher in stack. Change-Id: Iee065f39a006804be2618c3704e32b3f41a8a59e
* 2 second timeout on read().Nick Pelly2011-07-011-0/+20
| | | | | | | | | This restores the previous DAL behavior for read. It turns out this is a necessary hack to allow us to abort a pending read when switching to FW download mode due to a non-responsive NFC controller. Change-Id: Ief6f82600bb0603daaa50097a54a5ac42ae0f6b4
* Implement power control and firmware download for UART.Nick Pelly2011-06-221-48/+69
| | | | | | | | | | | | | Also clean up some UART and I2C DAL functions. o Re-enable FW download o Use /system/vendor/firmware for pn544 firmware now o Clean up read() and write() paths for both I2C and UART o Use new sysfs entry for power and FW control on I2C platforms o Remove userspace sleep()'s on power control toggle. They are now done in the kernel as they should be. Change-Id: I39956d36e02c1eb526a5c546bd3cb74edce4ff18
* Misc changes for Nexus Prime bringup.Nick Pelly2011-06-141-28/+29
| | | | | | | | | | o Fix uart read() implementation o Temporarily disable firmware update o Rename ttySx to ttyOx (this should be properly abstracted later) o Bug fix in #ifdef code o Update verbose logging arguments Change-Id: I87814e2be9ddbf5036d5586a2fd82311d56ec47f
* Patch from NXP. Libnfc - Download,Reset mode management and driver ↵Jeff Hamilton2010-10-281-0/+29
| | | | | | workaround with delay Change-Id: I736e5f50db749c9570b24194fe3963efbacc5c52
* Initial libnfc checkinNick Pelly2010-09-231-0/+326
Source: Trusted_NFC_Device_Host_AA03.01e02_google.zip code drop (23-Sep-2010) Change-Id: Ie47f18423f949a8d3e0815d13f55c814312add24 Signed-off-by: Nick Pelly <npelly@google.com>