summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixes to LLC and DAL to handle unreliable UART.Nick Pelly2011-10-213-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Manual port of 6900b4 from gingerbread:Rob von Behren2011-09-207-334/+1360
| | | | | | | | | | Patch to add Secure Download Mechanism in the libnfc This patch permit to support secure download update and also to avoid locking states in case of download failures Bug: 5331837 Change-Id: Ia5b6d9baf57231b0193bbbe85c88c7df557017c6
* Merge commit 'df34eb0e' into manualmergeJeff Hamilton2011-09-132-0/+12
|\ | | | | | | Change-Id: I9807e540bad19933452f4a9f86b74021265f29cf
| * am df82c4dd: Patch to add an API to load a FW image in the libnfcDaniel TOMAS2011-09-092-0/+12
| |\ | | | | | | | | | | | | * commit 'df82c4dd7c6d5ad232b5628edf73aa9ea3f8c2c0': Patch to add an API to load a FW image in the libnfc
| | * Patch to add an API to load a FW image in the libnfcDaniel TOMAS2011-09-092-0/+12
| | | | | | | | | | | | | | | | | | | | | This new API permit to load the PN544 FW image when a download is needed at boot time. Change-Id: I2b3406d7ae0f0211123bd680ef914e9948c81eef
* | | Merge "Felica system code related changes"Martijn Coenen2011-09-016-79/+230
|\ \ \
| * | | Felica system code related changesSunil Jogi2011-08-086-79/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified implementation for Felica card handling includes following: - SENSF_REQ with RC=0x00 during discovery - T3T NDEF detection with SC = 0x12FC - If card is not NDEF then poll for primary SC - NFC-F presence check with check for expected IDm Change-Id: I8e7e83a36ec2c6e8e423df751c4bc73badb6edb5
* | | | Add the NXP_EVT_SE_SWITCH_MODE event support in the libnfc.Daniel Tomas2011-08-242-2/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This event is used in the SE SetMode API to be able to enable/disable card emulation with not writting the EEPROM area. Change-Id: I80047d678f683c4dd364544c690440eb8d807793
* | | | Fix for removing unnecessary DESELECT before P2P activation in caseSunil Jogi2011-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | devices are moving in to the range and moving out of the range quickly Change-Id: I090367ad17de443c6af41c9ad507557e3eaaf7f9
* | | | Revert "Add the NXP_EVT_SE_SWITCH_MODE event support in the libnfc."Nick Pelly2011-08-182-67/+2
| | | | | | | | | | | | | | | | This reverts commit 39038381fd4a9922cdd07251ce1a0a8840681bcd.
* | | | Add the NXP_EVT_SE_SWITCH_MODE event support in the libnfc.Daniel Tomas2011-08-162-2/+67
|/ / / | | | | | | | | | | | | | | | | | | This event is used in the SE SetMode API to be able to enable/disable card emulation with not writting the EEPROM area. Change-Id: Iace438c3625f6a084c8bcc66d787a7a60d56b8f8
* | | ISO15693 Format fixSunil Jogi2011-08-021-80/+66
| | | | | | | | | | | | | | | | | | | | | Added for check of first 4 bytes 0x00 before performing NDEF format of ISO15693 tag. Updated with usage of Read one block. Change-Id: I7a5299edb67ca70f7af5ef5a0909225c0bdf8cb0
* | | Print a warning message on NXP_EVT_INFO_MEM_VIOLATION.Nick Pelly2011-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This indicates the pn544 trim values were over-written by the faulty FW procedure, I have a FW to reset trim values to default. Revert this commit before ship. It should only be needed for dev phones. Change-Id: I77d3d66b6937f181c83022a0e0791a44974c51ae
* | | Merge "Don't wait for timeout to send SYMM PDU's."Martijn Coenen2011-07-271-17/+9
|\ \ \
| * | | Don't wait for timeout to send SYMM PDU's.Martijn Coenen2011-07-271-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LLCP stack was holding onto the "I'm allowed to send" token for the full link time-out, even if there was nothing to send. This caused very bad round-trip delays. This fix just gives the token back immediately if there's nothing to send. Change-Id: Ib7bf87bd5fada2b682d28c9502b5ef010cd39815
* | | | Add the ability to enable LLCP logging.Jeff Hamilton2011-07-262-4/+2
| | | | | | | | | | | | | | | | Change-Id: I94f16770d1803f89370df5a798a6c76670581a63
* | | | Merge "Fixed LLCP receive function when accessing RW."Martijn Coenen2011-07-261-21/+20
|\ \ \ \ | |/ / /
| * | | Fixed LLCP receive function when accessing RW.Sylvain Fonteneau2011-07-251-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, the working buffer may be full and some packets are stored in the receive window when trying to read from upper layer. In this case, the receive function first reads data from the working buffer and if possible, also tries to read data stored in the receive window. The previous receive window data extraction algorithm could lead to an infinite loop. With this fix, we can ensure that this won't happen any more. Change-Id: Iddb412213f4e9cb5fb42691bd282dbf0a21a936e
* | | | Merge "Deal with LLCP send errors properly (part 1)."Martijn Coenen2011-07-262-51/+30
|\ \ \ \ | |/ / /
| * | | Deal with LLCP send errors properly (part 1).Martijn Coenen2011-07-252-51/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send failures on LLCP sockets were not dealt with at all - the transport was just left in a state where it thought there was a pending send and a pending callback. Before we typically only did one send and it didn't bite us so much, but now with multiple sockets we run into this frequently. This really just fixes part of the problem - we should also look if state rollbacks are necessary, as those are not done either on send failures. Change-Id: I484ca598e043ead835251aedaabe47d3a1da7a8f
* | | | am 0c4a5508: am d8b82bee: am 34caeca8: Patch to support multiple connection ↵Daniel Tomas2011-07-253-0/+12
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | on Multiple protocol TAG * commit '0c4a5508f22e067ab9b31581807b53406d161501': Patch to support multiple connection on Multiple protocol TAG
| * | am 34caeca8: Patch to support multiple connection on Multiple protocol TAGDaniel Tomas2011-07-213-0/+12
| |\ \ | | |/ | | | | | | | | | * commit '34caeca8a5ec2aedade68a77393d0aff03f9bd72': Patch to support multiple connection on Multiple protocol TAG
| | * Patch to support multiple connection on Multiple protocol TAGDaniel Tomas2011-07-143-0/+12
| | | | | | | | | | | | Change-Id: I0f09869458ebbc6d77363338975754335569b6a6
* | | Factorized and fixed code for automatic LLCP socket binding.Sylvain Fonteneau2011-07-251-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the SAP automatic allocation algorithm which could previously allocate the same SAP twice in some situations (e.g.: if first socket in socket table was bound to SAP 0x21 and second socket to 0x20, then autobind was allocating SAP 0x21 again). Change-Id: Ic94bbc7eaca260c69cb0ce22931e9241f459bbf5
* | | Merge "getTimeout() support in libnfc-nxp."Martijn Coenen2011-07-212-0/+22
|\ \ \
| * | | getTimeout() support in libnfc-nxp.Martijn Coenen2011-07-202-0/+22
| | | | | | | | | | | | | | | | | | | | Bug: 4492175 Change-Id: I7f85fc32bfaabeac8fa4da6c1509992d5523afa3
* | | | Latest phDnldNfc.c code from NXP.Nick Pelly2011-07-191-76/+224
|/ / / | | | | | | | | | | | | | | | This is to support 32 byte FW download. Change-Id: Id27e7d2673c37aab02d98fcbac9031af6153fea0
* | | Revert "Patch to decrease the maximum packet size for NFC firmware download"Nick Pelly2011-07-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 294b456a3692cd69f45713bc8e9700132a0e5aec. @#$% the pn544. This patch to execute FW download mode with 64 byte frames has some kind of side-affect. It causes the pn544 to send > NFC I2C Received buffer: 0xB2 0x83 0x53 0xC9 0x6B every 2 seconds. We do not yet know what this command means, it is undocumented. This side affect appear permanent - even after reverting to a 512 byte FW download, the NFC controller continues to send these messages. Reverting ASAP to minimize damage. Change-Id: I139a4a76c045f580df9760dc11d1c6df7b317a50
* | | Delay 5ms after FW SW reset command due to clock instability.Nick Pelly2011-07-141-0/+6
| | | | | | | | | | | | | | | | | | This was preventing reliable FW download. Change-Id: I28e5cb1e5855974f51578f5d45f2c581a75b2d07
* | | Patch to decrease the maximum packet size for NFC firmware downloadDaniel Tomas2011-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | This patch permit to decrease the max packet size to 64 bytes from 512 bytes and to fix an issue faced in response_data buffer with the new packet size. Change-Id: Ifc5cc9910b3b1a71b88624cd04c2bada7f1a413f
* | | Check SAP range in LLCP sockets.Sylvain Fonteneau2011-07-042-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLCP specification mentions that SAP numbers are allocated as follows: - from 0x00 to 0x0F, used for well-known services - from 0x10 to 0x1F, used for SDP advertised services - from 0x20 to 0x3F, used for *non* SDP advertised services This patch enforce this restriction. Change-Id: Idd8ab4da4cfa9ad9e2dbf7eddc3c66900bcf9ff8
* | | am 51c0ca53: am f1612434: am 967359c8: Patch to support the new PN544 ↵Daniel Tomas2011-06-284-4/+82
|\ \ \ | |/ / | | | | | | | | | | | | | | | firmware events * commit '51c0ca53011b86464dcf14aeb33944a69861a8f4': Patch to support the new PN544 firmware events
| * | am 967359c8: Patch to support the new PN544 firmware eventsDaniel Tomas2011-06-284-4/+82
| |\ \ | | |/ | | | | | | | | | * commit '967359c892ff74962b4f4243d989f447ffe4ae11': Patch to support the new PN544 firmware events
| | * Patch to support the new PN544 firmware eventsDaniel Tomas2011-06-284-4/+82
| | | | | | | | | | | | Change-Id: I6e5a976721fb52f2da30081276bb2ac15d27d186
* | | Patch to add the windowing support in the libnfcDaniel Tomas2011-06-287-196/+334
| | | | | | | | | | | | | | | | | | | | | | | | This patch enables windowing of LLC packets send from chipset to host. The host will now wait for up to 4 LLC packets from the chipset before sending an ACK (S-Frame RR). Change-Id: I6a70e1d780847a104e3ec8e403593a69e222aec9
* | | Print warning if no FW file found.Nick Pelly2011-06-272-2/+7
| | | | | | | | | | | | Change-Id: Id1ab6a1176fe4e7c559e2348261d0902bdffb03c
* | | libnfc spring cleaningNick Pelly2011-06-2718-68/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Make NfcA timeout configurable in libnfc.Martijn Coenen2011-06-093-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an interface for setting the NfcA timeout, which is called "mifare raw" in libnfc. Also changed the default, since it was set to only 2 ms, which is too short for most commands. Current setting is around 600ms. Change-Id: I00ccd85cd47a70895a3aca0f0bc34e1b0eab82c7
* | | am 055a5f95: am b76c80da: am 80c2d409: Merge "Prevent NFC crash-loop if ↵Jean-Baptiste Queru2011-06-082-5/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | firmware cannot be loaded." * commit '055a5f9542ba8fcfd2972111b707049732255ebe': Prevent NFC crash-loop if firmware cannot be loaded.
| * | am 80c2d409: Merge "Prevent NFC crash-loop if firmware cannot be loaded."Jean-Baptiste Queru2011-06-032-5/+9
| |\ \ | | |/ | |/| | | | | | | * commit '80c2d4090d6292a3fd2e20a18a981bc19e0a0429': Prevent NFC crash-loop if firmware cannot be loaded.
| | * Prevent NFC crash-loop if firmware cannot be loaded.Martijn Coenen2011-06-022-5/+9
| | | | | | | | | | | | | | | | | | Don't crash - just run off whatever firmware is in the chip now. Change-Id: I0d24c13452271aed63a5a0aea236db7b1cbd432c
* | | Merge "Implement Felica timeout handling (libNFC)."Martijn Coenen2011-06-063-2/+13
|\ \ \
| * | | Implement Felica timeout handling (libNFC).Martijn Coenen2011-06-033-2/+13
| |/ / | | | | | | | | | Change-Id: I1a88ae0807d5ba53a635e31f3c5284906bd40ea2
* | | Add support for connecting to NfcA on IsoDep tags.Martijn Coenen2011-06-061-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always add a ISO14443-3A device handle for tags that are found through the A-gate. This allows the upper stack to connect and maintain a connection to the NfcA technology, even if the tag has IsoDep on top of NfcA. The reason this can work is that libnfc does do the IsoDep activation in software, and if the NfcA target is on a separate handle this activation will not take place if you connect to this handle. Bug: 4195403 Change-Id: I00015e74bdadc6666c2971f8102244670a76e340
* | | Update V(RA) counter in LLCP sockets any time it is needed.Sylvain Fonteneau2011-06-031-173/+56
|/ / | | | | | | | | | | | | | | | | | | | | | | At some points, the V(RA) socket counter (used for Receive Window checking in connection-oriented sockets) was not properly updated, thus leading to sometimes reject (FRMR) inbound I-frames with valid sequence numbers. This patch factorize the I-frame emission and update V(RA) in the factorized code to ensure this is done at any time. Change-Id: Ic7ef92cb136c32e524a14e31a8d350f7b165c367
* | Patch to enable low level traces.Daniel Tomas2011-05-191-0/+13
| | | | | | | | | | | | | | 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
* | Fixed LLCP SAP value range.Sylvain Fonteneau2011-05-161-1/+1
|/ | | | | | | | Valid LLCP Service Access Point values are 0x00 to 0x3F, not 0x2F. Before this patch, a socket with a local SAP between 0x30 and 0x3F was unable to communicate (operation callbacks were never called). Change-Id: Ic3f9b9f353a01e2682e28575152f171d7ec421e4
* Avoid missing NFCIP inbound frame.Sylvain Fonteneau2011-04-141-1/+1
| | | | | | | | | | | | | | | If a NFCIP frame is received (NXP_EVT_NFC_RCV_DATA event) before a call to phHal4Nfc_Receive() function, the frame was lost. This could happen if the local host acts as a Target and the remote peer sends its first frame too fast. The data is actually saved in a temporary buffer but, when the phHal4Nfc_Receive() is eventualy called, it triggers a callback with a status code NFCSTATUS_MORE_INFORMATION, which is handled as an error. This patch fixes this behaviour and makes sure that the correct status code is provided with the frame itself. Change-Id: I5311762ca70c71f98dea0287b0844eb1c8dddb6b