summaryrefslogtreecommitdiffstats
path: root/Linux_x86
Commit message (Collapse)AuthorAgeFilesLines
* Added recovery function when SE wired mode selectedSunil Jogi2012-04-131-0/+3
| | | | | | | | Added a recovery function with delay when SE wired mode selected. This function will add extra delay before any abort when SE is in wired mode. This will allow SE to complete any operation and do not power off the SE immediately when wired mode transaction is on going.
* Replace loge with aloge.Ramanan Rajeswaran2012-03-091-1/+1
| | | | Change-Id: Ie2a90be2152c28029990f5e4db5dffd5928fd030
* am da7d267e: am 3f791036: nfc-hal: generalize error handling in Reader thread.Rakesh Goyal2012-03-091-5/+16
|\ | | | | | | | | * commit 'da7d267e855affe83c0bc5958292fe74d6e27d7e': nfc-hal: generalize error handling in Reader thread.
| * nfc-hal: generalize error handling in Reader thread.Rakesh Goyal2012-03-091-5/+16
| | | | | | | | | | | | | | | | | | If host runs faster than the nfc chip, it tries to read response immediately. In this scenario nfc chip responds back with it's read address and software should ignore this data and retry. This patch generalizes the retry mechanism to accomodate other versions of the nfc chip. Change-Id: I3e18e34fd3edf6ed0a7f302a6be9321ab8ed7875
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-063-9/+9
| | | | | | | | | | | | | | 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
* | Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-6/+6
|/ | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ie5dac4fad8942433d2b8fe3c0539e4c3c678a082
* Use NFC HAL for some libnfc settings.Martijn Coenen2011-11-033-69/+51
| | | | | | | | | | 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-213-15/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge commit 'df34eb0e' into manualmergeJeff Hamilton2011-09-131-23/+38
|\ | | | | | | Change-Id: I9807e540bad19933452f4a9f86b74021265f29cf
| * Patch to add an API to load a FW image in the libnfcDaniel TOMAS2011-09-091-23/+38
| | | | | | | | | | | | | | This new API permit to load the PN544 FW image when a download is needed at boot time. Change-Id: I2b3406d7ae0f0211123bd680ef914e9948c81eef
* | 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-012-0/+40
| | | | | | | | | | | | | | | | | | 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
* | Improve LOW_LEVEL_TRACES logging.Nick Pelly2011-06-272-11/+10
| | | | | | | | | | | | | | | | | | Log ALL buffers (including size 1 and long buffers). Use a more concise format. This is helpful for debugging FW download failures. Change-Id: I97370e8daf93ce851a036274ffa2856af05b6941
* | libnfc spring cleaningNick Pelly2011-06-271-6/+6
| | | | | | | | | | | | | | | | | | | | o Fix most libnfc warnings, from 360 to 18 o Make DAL_DEBUG much less verbose and more useful o Clean up Android.mk Done with minimal textual diff to minimize merge conflicts. Change-Id: I918645500723ff7bb092ad9959628fcabac45bec
* | Implement power control and firmware download for UART.Nick Pelly2011-06-224-101/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Do not allow run-time LOW_LEVEL_TRACES on user builds.Nick Pelly2011-06-201-6/+16
| | | | | | | | Change-Id: Ie78432b46ded168c72b5f00dd05ea72287ab155d
* | Misc changes for Nexus Prime bringup.Nick Pelly2011-06-142-29/+30
| | | | | | | | | | | | | | | | | | | | 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
* | am 252aedb3: am 6a7a2870: am 99141cdd: Sleep 500us between i2c writes, as ↵Nick Pelly2011-06-091-0/+1
|\ \ | |/ | | | | | | | | | | per latest advice from NXP. * commit '252aedb3edd2c04adedeb5c9f8369af504411dad': Sleep 500us between i2c writes, as per latest advice from NXP.
| * Sleep 500us between i2c writes, as per latest advice from NXP.Nick Pelly2011-06-081-0/+1
| | | | | | | | | | | | This should fix pn544 lock-ups seen during wired-mode stress tests. Change-Id: I606b5909338dc889a475ad880df8646546b9ba40
* | Patch to dynamically enable NFC LOW_LEVEL_TRACESNick Pelly2011-06-081-6/+29
|/ | | | | | | | | | | | | low level traces can be enabled at run-time with: adb shell setprop debug.nfc.LOW_LEVEL_TRACES 1 and disabled with adb shell setprop debug.nfc.LOW_LEVEL_TRACES 0 NFC must be turned off and on again for this change to take affect. Change-Id: Iefdc4873b3ee5bc697f34b307c22c06a6eda0667 Signed-off-by: Nick Pelly <npelly@google.com>
* Merge "Guard some code by LOW_LEVEL_TRACES; see ↵Nick Pelly2011-05-251-0/+2
|\ | | | | | | c1f33130d9d2100e6232f8f3c782949c75205be6" into gingerbread
| * Guard some code by LOW_LEVEL_TRACES; see ↵Robert Tsai2011-05-241-0/+2
| | | | | | | | | | | | c1f33130d9d2100e6232f8f3c782949c75205be6 Change-Id: I8c2bd923d9dedf89c784199f03fba0e2cfc12009
* | Do not wait 3ms before each write.Nick Pelly2011-05-231-1/+1
|/ | | | | | NXP have confirmed that 3ms delay is only needed for writes destined for SWP. Change-Id: I90a5229dbb738e1f00d37a052c7ac55e0e9d215c
* Patch to enable low level traces.Daniel Tomas2011-05-192-0/+29
| | | | | | | This patch permit to display the NFC frames exchanged through the I2C line. To enable that, you just need to enable LOW_LEVEL_TRACES macro. Change-Id: Ica2ff2e6d111b76c056161ec557346f23d21ada0
* Retry i2c read 5 times on i2c read error.Nick Pelly2011-05-121-0/+11
| | | | Change-Id: I9fd0291bfd8ba9d26a0c93bc14d7184a9a188b90
* Patch to perform a recover in case of a transaction failureDaniel Tomas2011-04-261-11/+23
| | | | | | | | This patch permit to perform a recovery when a transaction failure is detected. To detect this exception, we are filtering the Ox57 bytes because this means that the IRQ line is high but no data is available from PN544. Change-Id: Ibb55ea3db2bc6cdff2c5b28bbe2127250c5637a8
* Fix to prevent accidental stopping of timers.Jan Brands2011-02-181-0/+5
| | | | | | | | Time-out value of 0 is used to indicate minimum value, see e.g. PH_HAL4NFC_RECV_CB_TIMEOUT in phHal4Nfc_P2P.c where it is used with P2P target receive in case data has already been received by the PN544 Change-Id: I9f15f2135ca003b848590fc87265edb39d85bf4c
* Download feature added in the libnfcdaniel_Tomas2010-12-094-38/+17
| | | | Change-Id: Idfed8c90453a0acc7fa632f62a1e20617b4ae7f6
* Fix to increase the stability of the Init/Deint actiondaniel_Tomas2010-12-052-3/+12
| | | | Change-Id: I89e08ab079a6c0a83cd5a128ecfee2026411af15
* Fix buffer display in LLCP receive callbackdaniel_Tomas2010-12-051-3/+0
| | | | Change-Id: I85a4235a4f13e02a61d2c07ca301e72e7b369c8b
* HCI timer enabled to HW reset NFC when HCI command times out.Daniel Tomas2010-11-031-21/+8
| | | | | Change-Id: Iee39957227fcdc8e97b520d22032dc97915323f3 Signed-off-by: Nick Pelly <npelly@google.com>
* Increase hardware reset time.Nick Pelly2010-11-031-0/+13
| | | | | | | | VEN was pulled low for 7ms, as per data sheet, but pn544 not awlays reset. Increase time. Change-Id: I7de9e4fc94a0493605f706505962bdfab9d03666 Signed-off-by: Nick Pelly <npelly@google.com>
* Use new PN544_SET_PWR ioctlNick Pelly2010-11-011-6/+7
| | | | | Change-Id: I2d8d981d01d1e0f035d3dd3485d62dd26028b8ba Signed-off-by: Nick Pelly <npelly@google.com>
* Avoid overrun when setting timer.Sylvain Fonteneau2010-10-281-2/+2
| | | | Change-Id: I27ef4ab66c1b3a9ed4eb668125cda36f7cccd4a7
* Patch from NXP. New Dal implementationJeff Hamilton2010-10-281-385/+119
| | | | Change-Id: Ib9fe02224daa65a59a87fcd7b5cd8506fca0f3ab
* Patch from NXP. Libnfc - Download,Reset mode management and driver ↵Jeff Hamilton2010-10-287-10/+146
| | | | | | workaround with delay Change-Id: I736e5f50db749c9570b24194fe3963efbacc5c52
* Assign names to reader and writer thread so its easier to debug them.Nick Pelly2010-10-271-0/+4
| | | | | Change-Id: I2580675e2002546ac28a6a3a5ced7683af9448d9 Signed-off-by: Nick Pelly <npelly@google.com>
* STANDBY mode and Polling loopgoodsc.lee2010-10-122-3/+9
| | | | | Change-Id: Ib6563a94b29c7eb9de6615881eadbdf0e94994c8 S5PC11X: NFC: Enable the STANDBY mode and add enableDiscovery and disableDiscovery for polling loop.
* Initial libnfc checkinNick Pelly2010-09-2312-0/+2639
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>