837efc3194a03beaaa32b370c63a9270ed9664d8 |
|
06-Mar-2013 |
Martijn Coenen <maco@google.com> |
Fix wrong callback being cleared. When a call to disconnect() failed, the connect() callback was cleared, not the disconnect() one. This would cause deadlocks, where JNI threads were forever blocked on doConnect(). Bug: 7324226 Change-Id: I784c8d700c87d643315f2417610ca75ef8f9aa7c
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
7c4b4fadb66959c50c170182847886e83393eebf |
|
02-Mar-2013 |
Martijn Coenen <maco@google.com> |
Fix some LLCP threading issues. On Android we now start connecting SNEP/other LLCP services as soon as the link comes up. That means we will have connect requests incoming, accept responses outgoing, connect requests outgoing and accept responses incoming. This lays bare a lot of threading issues in this lib. Since the receives come in serialized, those typically do not cause any issue. However, we may be sending something on a thread coming from the NfcService, while at the same time we'll receive for example a connect frame from the remote, to which the receive thread immediately wants to send a response. This is a first attempt at making sends thread-safe: already there was a lot of logic to deal with the fact that another send was in progress, in the form of the bSendPending variable. That variable was however not checked atomically, and some operations did not even set it correctly. This change tests and sets that variable atomically, more or less implementing a semaphore with try-acquires and fallbacks for the failure case. The generic structure is: if (testAndSetSendPending()) { // Another thread is sending, stash data // and most importantly do *NOT* change shared data } else { // We're now the only one sending, we're free // to change shared data until the callback is // called. } This is just a band-aid fix, but given the fact that this stack will be deprecated it is hopefully enough for our planned usecases. A decent fix would involve switching to a TX-queue per socket, and a generic TX-queue for the whole LLCP link. This allows us to fully decouple the connection layer from the transport layer, as it should be. Change-Id: Ibd8742f7350a58459771f5036a049af3a487f783
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
ce7e8806d59161969589c46abbef8ed1436cea8f |
|
04-Feb-2012 |
Sunil Jogi <sunil.jogi@nxp.com> |
Fixed FRMR sending on invalid LLCP frame received DSAP and SSAP were switched on with the other at multiple location in the code. This patch fix those. Change-Id: Iea8e499049a2cd4a234155a3044b875eb9c6ca7a
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
177497f518ad2bbb8fe6cab5cf55415244b86565 |
|
30-Jan-2012 |
Sunil Jogi <sunil.jogi@nxp.com> |
Handle inbound buffering in LLCP connectionless sockets 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
d25018da04378bf0529f82ed03d9e25390216b0b |
|
27-Jan-2012 |
Martijn Coenen <maco@google.com> |
LLCP 1.1: Fix some bugs. - Clear out send callback if send was not accepted. - Set transport busy status for RR/RNR frames. Change-Id: Idf8986f6b82995644b176247a644e36d2c879ebf
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
7b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767 |
|
16-Jan-2012 |
Sunil Jogi <sunil.jogi@nxp.com> |
LLCP 1.1 implementation. 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
955a8efe369ece977e4757f0ae37b3931169125b |
|
16-Jan-2012 |
Sunil Jogi <sunil.jogi@nxp.com> |
LLCP 1.1: allow pending operations on connectionless. 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
fbff1ec60cb5adacbee109fb0c0e07e8132b5d39 |
|
17-Jun-2011 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Factorized and fixed code for automatic LLCP socket binding. 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
3a9d18ff42ce17d62e1968ed93358d036989b670 |
|
23-May-2011 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Check SAP range in LLCP sockets. 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
34ff48f6cd6595a899e05fbd56f4c84891840d3f |
|
27-Jun-2011 |
Nick Pelly <npelly@google.com> |
libnfc spring cleaning 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
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
407d793f3038222dac95651866b99cd064e214eb |
|
14-Jan-2011 |
Arnaud Ferir <arnaud.ferir@trusted-logic.com> |
Fixed LLCP send callback triggering. The phLibNfc_Llcp_Send() function is expected to trigger a callback when the packet is actually sent but, in some situations, the callback was triggered by another frame sending (such as RR or DM frames). This patch fixes the following socket internal flags handling: - pfSocketSend_Cb: set to non-NULL value when a send operation is pending, - bSocketSendPending: set to TRUE if the LLCP link layer is not available for sending and reset to FALSE once the frame is actually forwarded to the LLCP link layer. The send callback triggering has been updated to ensure it is only done for the expected data frame (i.e.: send pending and already forwarded to link layer). Change-Id: Id7410ee4075fbbbc9de382abf54e89a97f6a8b37
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
a3af9c908f5c50e2405169015c86a1b667b42490 |
|
11-Jan-2011 |
Arnaud Ferir <arnaud.ferir@trusted-logic.com> |
Removed callback in case of immediate end of operation. The correct behavior of asynchronous functions should be: Immediate operation => function returns with success/error status, callback never invoked Delayed operation => function returns with pending status, callback is invoked at the end of operation Some minor fixes are also included in this commit (code style). Change-Id: Ieb801ab759045c5c5d9fc59b4715f3c142d5b33e
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
99e7261d709ad32e0203dced9f4a386c5f719adf |
|
05-Jan-2011 |
Arnaud Ferir <arnaud.ferir@trusted-logic.com> |
Fixed parameters checking in LLCP. Avoid NULL pointer dereferencing in some situations. Change-Id: I020f0a5342acdc49f7f3804e9341ed0fc0f307ee
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
76270e7c32ec0c558907430e756712d5b68b417c |
|
21-Dec-2010 |
Arnaud Ferir <arnaud.ferir@trusted-logic.com> |
Allow LLCP socket creation before link establishment. This enables to register a server socket prior to LLCP link establishement and avoid any race condition between the local server and the remote client. The modification implies a LLCP socket API change (added the device handle parameter in all LLCP API that can lead to active data exchange). The LLCP socket internal structures are now initialized during LLCP link parameter configuration step instead of LLCP compliancy check to save socket state independently from peer detection. Also removed unused socket states and added some traces. Change-Id: I961c48af4ca9ace68d41b9569dc1038bb2bbdc71
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
04f25b3ab4ed13edb3ffc8e7354bca9f7bc60b44 |
|
02-Nov-2010 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Enable reading a connection-oriented socket even if remotely closed. The receive function was failing when trying to read the data present in the linear buffer after receiving a remote disconnection request (DISC). Change-Id: I48a2aa058e85e265ca53e61dcde281e47a6e187f
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
c56a3c7bc332a6656bedf342236267b636051170 |
|
29-Nov-2010 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Close all LLCP sockets when the link goes down. The LLCP link status callback is now handled first in LIB layer before being forwarded to the client. This is needed to enable the LIB layer to detect the link status change and close the sockets accordingly. Change-Id: I607aaebb4c0c8f2da09c81d4d43b4c705ebfcb13
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
c2866714540bec65af19240e95a10d3090df0cf9 |
|
02-Nov-2010 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Fixed LLCP socket options storage. Socket options are now copied in the libnfc to avoid referencing a pointer that may not be valid during the whole socket life cycle. Change-Id: I7266164bf157242df1ce7fb7a0f9cffd52938140 Signed-off-by: Nick Pelly <npelly@google.com>
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
cf5cd1520ea32d2b65712a36a105f396df07345c |
|
28-Oct-2010 |
Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> |
Fixed LLCP Service Name matching failure. Service Name is now copied in the libnfc to avoid referencing a pointer that may not be valid during the whole socket life. Change-Id: I6572366ac51502d189cc8f1350fa089c11cc2bea
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|
5d9927ba30ba449badb9f6df0fbeb4d6aedc6e2a |
|
23-Sep-2010 |
Nick Pelly <npelly@google.com> |
Initial libnfc checkin 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>
/external/libnfc-nxp/src/phFriNfc_LlcpTransport.c
|