summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Added recovery function when SE wired mode selected"Martijn Coenen2012-04-202-0/+16
|\
| * Added recovery function when SE wired mode selectedSunil Jogi2012-04-132-0/+16
| | | | | | | | | | | | | | | | 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.
* | Fix T2T makeReadonly.Martijn Coenen2012-04-191-1/+1
| | | | | | | | Change-Id: Ie4a87d23034cfdbb3c1db227a7f54c2e1a45c98c
* | Added addr field in response of Jewel commandSunil Jogi2012-04-171-0/+63
|/ | | | | | | | | Most of the Jewel command response includes the address which is sent as part of command. The response of Jewel command was missing address field. This patch fix that problem by adding the missing addr field. Bug: 5341397 Change-Id: Icba0b37dd9987bc34c3490fa12ebda51ac25ad1e
* Added support for tearing recovery for MIFARE Classic ReadonlySunil Jogi2012-04-023-14/+16
| | | | | | | | When readonly is interrupted in between next readonly call make remaining sectors readonly and return true. If all sectors are readonly then call to readonly returns error. Change-Id: Id47a77198b41d69b743f24259849e943954c7a58
* Mifare readonly support.Sunil Jogi2012-04-027-22/+455
| | | | | | | | This patch requires changes done in following projects submited as patches: 1. packages/apps/Nfc 2. frameworks/base Change-Id: I9036309d82dd897e77f6bc14c30fbde255bf955c
* Patch to support MIFARE with SAK 0x01Sunil Jogi2012-04-025-4/+9
| | | | Change-Id: Ifb1389d428855c2eea99390790af13f28571097a
* Don't dump nfc target/initiator modes to system log.Martijn Coenen2012-03-161-2/+2
| | | | Change-Id: I1938f348704f6fabefa6600ecf32ff7d6204d021
* am bbda0171: am 65ce3454: Merge "Fix one coding error of using a temporary ↵Nick Pelly2012-03-071-1/+1
|\ | | | | | | | | | | | | variable in the global structure NdefMap" * commit 'bbda017196474931e686669f0b6bc749f6dc1b0a': Fix one coding error of using a temporary variable in the global structure NdefMap
| * Fix one coding error of using a temporary variable in the global structure ↵Jack Ren2012-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NdefMap In the following code: the local variable PacketDataLength is a local variable in stack, but used in the ndefMap which is a global structure. When the function phFriNfc_NdefMap_EraseNdef( ) returns, the PacketDataLength will be freed, too. If it is used later via the pointer in NdefMap, will cause some of potential issues. Fix it by re-define it as static. NFCSTATUS phFriNfc_NdefMap_EraseNdef(phFriNfc_NdefMap_t *NdefMap) { NFCSTATUS status = NFCSTATUS_PENDING; static uint8_t PktData[3] = PH_FRINFC_NDEFMAP_EMPTY_NDEF_MSG; uint8_t MemOffset = PH_FRINFC_NDEFMAP_SEEK_BEGIN; uint32_t PacketDataLength = sizeof(PktData); ... /* Mifare card selected. Call Mifare Write */ status = phFriNfc_NdefMap_WrNdef( NdefMap, PktData, &PacketDataLength, MemOffset); break; ... } Change-Id: Iee278fe39749619aa44c620138eae85a46f6e4a5 Signed-off-by: Dejan REBRACA <dejanx.rebraca@intel.com> Signed-off-by: Ken Wahid <kenx.wahid@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* | Support for handling of proprietry TLV in T4TSunil Jogi2012-03-051-1/+1
| | | | | | | | | | | | | | If CC file is including proprietory TLV then Check NDEF was returning tag is not NDEF compilant. This patch fix that problem. Change-Id: I28e7701c7d6e78de8b19b93d09789c09fa9357bd
* | Skip proprietry TLV for Type 2Sunil Jogi2012-03-051-1/+3
| | | | | | | | | | | | | | Skipping proprietry TLV for Type 2 reading if it is present. Earlier Type 2 tag was not detected as NDEF tag is proprietry TLV present. Change-Id: Ia3ca722790f4a990fe976617aecbbdf6a7d53570
* | (DEBUG) Add support for setting p2p modes.Martijn Coenen2012-02-172-3/+31
| | | | | | | | Change-Id: Ic6df1fc458cef2531119e5e5e2ef5f9a7b21a524
* | Fix NFCSTATUS_BUSY responses after doing p2p.Martijn Coenen2012-02-061-2/+3
| | | | | | | | | | | | | | LLCP state was not reset properly. Bug: 5971895 Change-Id: I4fda6ef7c78ae2730359cf5c90d887d205e57799
* | Fixed FRMR sending on invalid LLCP frame receivedSunil Jogi2012-02-062-12/+12
| | | | | | | | | | | | | | DSAP and SSAP were switched on with the other at multiple location in the code. This patch fix those. Change-Id: Iea8e499049a2cd4a234155a3044b875eb9c6ca7a
* | Handle inbound buffering in LLCP connectionless socketsSunil Jogi2012-01-303-67/+171
| | | | | | | | | | | | | | | | This enables the server to avoid losing packets, especially when receiving them in an aggregated packet. The size of the buffer is determined by the size of the working buffer provided by the application. Change-Id: Ia3c72e19fdb74e2a43390af5607c497c2275fe46
* | Fixed rejected receive request in LLCPSunil Jogi2012-01-301-1/+1
| | | | | | | | | | | | | | | | If phLibNfc_Llcp_Recv() is called in the callback of a previous phLibNfc_Llcp_Recv(), it could be rejected due to the bSocketRecvPending flag which was not properly reset. Change-Id: I6c41469480b50bb7adc9a721ec96f715e5d56a60
* | Fixed wrong callbacks callSunil Jogi2012-01-301-19/+17
| | | | | | | | | | | | Call the callback only if the context is not null. Change-Id: I783d9e8ddedb2546eff85837826703db189f9f59
* | Increase internal LLCP buffers to fit max MIUSunil Jogi2012-01-271-2/+2
| | | | | | | | | | | | | | | | Interal buffer increased to 2178 = 3 (max LLCP header size) + 128 (default MIU) + 2047 (max MIU) Change-Id: I3cc2ff705e74ae657d93b5e50a577b0e7e5ebfcf
* | Reset LLCP socket internal variables before next use.Sunil Jogi2012-01-271-0/+6
| | | | | | | | | | | | | | | | Some internal variables used in reveive window checkings were not reset on socket closure/re-opening. This was leading to have the send() function waiting forever for remote acknowledgments. Change-Id: Ic7741b004de80af3f851f620842d46c42f654804
* | Update for LLCP V(SA) internal variableSunil Jogi2012-01-271-6/+3
| | | | | | | | | | | | | | | | | | | | The V(SA) is an internal variable used in LLCP connection-oriented data links to check receive window conditions. It corresponds to the last frame number acknowledged by remote peer + 1. The patch makes sure this variable is updated evry time it is needed. Change-Id: Ie5ac925a6f1dfa19b22ac2b6e96659440d5daf21
* | LLCP 1.1: Fix some bugs.Martijn Coenen2012-01-272-3/+14
| | | | | | | | | | | | | | - Clear out send callback if send was not accepted. - Set transport busy status for RR/RNR frames. Change-Id: Idf8986f6b82995644b176247a644e36d2c879ebf
* | Adding support for handling maximum length supported by peerSunil Jogi2012-01-274-21/+34
| | | | | | | | | | | | | | Support for chaining is added based on maximum length supported by and passed in ATS by peer and maximum length supported by the device. Change-Id: I8f9f8468ff8ac9d3579bc8b6afbe3e2072e56de8
* | LLCP 1.1 implementation.Sunil Jogi2012-01-2710-108/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in LLCP v1.0, the only way to use the SDP (Service Discovery Protocol) service was to send a CONNECT frame containing the Service Name to the SDP service. This was implicitly preforming a connection request to the requested service. LLCP v1.1 introduced a way to discover services more efficiently and without implicit connection. It also enables connectionless services to have a service name. It is based on a new protocol based on a new SNL frame containing discovery requests and responses. This update comes with new APIs: - phLibNfc_Llcp_DiscoverServices() function can be used to discover remote services. It can take multiple service names and resolve all of them in a single call. - Register service name at bind time. Cache LLCP service name/sap pairs. In LLCP 1.1 specification defines at section 5.9 that any service lookup answer must be valid for the whole LLCP session duration. To enforce this, we cache the SAP/SN pairs locally and make sure that the applications don't break the cache. The stack remains fully retro-compatible with v1.0 devices. Change-Id: I052edd3838013cee65e7415d0ed01fc3e9cad36d
* | LLCP 1.1: allow pending operations on connectionless.Sunil Jogi2012-01-276-469/+595
| | | | | | | | | | | | | | | | | | | | | | | | | | The pending operations were handled at the connection-oriented sockets level, with no possibility for other transport types to handle pending operations. A dispatcher has been added at the generic transport level to remove this limitation. This feature is needed to implement LLCP v1.1. Change-Id: I69e37ba800d1c531396ca97ab0a0480e0f53d63f
* | Don't overwrite psUpperLayerContext when reconfiguring the SE.Martijn Coenen2012-01-202-54/+49
| | | | | | | | | | | | | | This fixes one of the crashes occuring when turning the screen off during p2p transfers. One remaining. Change-Id: I3e45be9b8f4be40350ba4dd9db7e596631206bd1
* | Clear out send/recv callbacks for connectionless sockets.Martijn Coenen2012-01-201-3/+14
| | | | | | | | | | | | | | | | | | | | When a connectionless socket is closed, Connectionless_Abort() is called, which in turn calls the send and receive callbacks to indicate abortion. But since these callbacks are not cleared out after a previous send/receive has completed, this can lead to spurious callbacks and consequently memory corruption. Change-Id: Iea7a34829c4db1cae3b49f33117b25b50205683f
* | Prevent LLCP stack from deactiving twice.Martijn Coenen2012-01-131-2/+2
| | | | | | | | | | | | | | | | | | Some parts of the code reset the state to an operation state, even if the link has already been shutdown. This allowed for a second deactivation callback, causing a crash higher up in the stack. Bug: 5765077 Change-Id: I2f2ac720756353d45d82634d27a3dd9acecae43d
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-062-6/+6
| | | | | | | | | | | | | | 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-053-7/+7
| | | | | | | | | | | | | | 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-1/+1
|/ | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ie5dac4fad8942433d2b8fe3c0539e4c3c678a082
* Use NFC HAL for some libnfc settings.Martijn Coenen2011-11-031-20/+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
* 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