summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/llcp.c
Commit message (Collapse)AuthorAgeFilesLines
...
* NFC: Release LLCP SAP when the owner is releasedSamuel Ortiz2012-07-091-13/+0
| | | | | | | | The LLCP SAP should only be freed when the socket owning it is released. As long as the socket is alive, the SAP should be reserved in order to e.g. send the right wks array when bringing the MAC up. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Close listening LLCP sockets when the device is goneSamuel Ortiz2012-07-091-3/+8
| | | | | | | | When the MAC link goes down, we should only keep the bound sockets alive. They will be closed by sock_release or when the underlying NFC device is moving away. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Build LLCP general bytes upon requestSamuel Ortiz2012-07-091-15/+17
| | | | | | | | Drivers will need them before starting a poll or when being activated as targets. Mostly WKS can have changed between device registration and then so we need to re-build the whole array. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Update LLCP socket target index when getting a connectionSamuel Ortiz2012-07-091-0/+1
| | | | | | Getting a valid CONNECT means we have a valid target index. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Destroy LLCP timout workqueue when releasing the linkSamuel Ortiz2012-06-041-0/+1
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Send a receiver ready frame only to reply to an I frameSamuel Ortiz2012-06-041-1/+1
| | | | | | | Sending an RR as a reply to another RR is fine but not quite logical. We should send RRs only as a reply to I frames. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Requeue lost LLCP framesSamuel Ortiz2012-06-041-31/+55
| | | | | | | When receiving an I or RR frame telling us that some of the pending queues were not received, we should requeue them before the currently pending ones. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Don't hold a NULL connecting LLCP socket lockSamuel Ortiz2012-06-041-3/+3
| | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Introduce target mode rx data callbackSamuel Ortiz2012-06-041-0/+15
| | | | | | | | This routine will be called by drivers whenever they receive data in target mode. This should be unexpected events and as such should be handled by a standalone API (i.e. not as a callback pointer from an existing API). Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Move LLCP MIU extension value to socket structureSamuel Ortiz2012-06-041-0/+1
| | | | | | | | The MIU extension value can be received during the PAX or during the connection establishment process. It's definitely a connection related value rather than a link one. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Move LLCP receiver window value to socket structureSamuel Ortiz2012-06-041-11/+10
| | | | | | | RW can only be fetched from a CONNECT or a CC frame thus making it an end points specific value, not a link one. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Socket linked listSamuel Ortiz2012-06-041-112/+137
| | | | | | | Simplify the LLCP sockets structure by putting all the connected ones into a single linked list. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Take a reference on the LLCP local pointer when creating a socketSamuel Ortiz2012-06-041-15/+31
| | | | | | | LLCP sockets point to their local LLCP service, so they need to take a reference on it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: LLCP connect must wait for a CC frameSamuel Ortiz2012-05-151-0/+7
| | | | | | | | Blocking sockets should sleep on a CC (Connection Complete) reception from the connect() call. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Fix LLCP link timeout typoSamuel Ortiz2012-04-121-1/+1
| | | | | | | | We were sending the LTO TLV as a version TLV instead of the actual link timeout one. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Add MIUX to the local LLCP general bytesSamuel Ortiz2012-04-121-0/+10
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: No need to apply twice the modulo op to LLCP's recv_nSamuel Ortiz2012-04-121-1/+1
| | | | | | | recv_n is set properly when receiving an HDLC frame. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Dump LLCP framesSamuel Ortiz2012-04-121-0/+7
| | | | | | | At KERN_DEBUG level. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: LLCP code identation fixesSamuel Ortiz2012-03-061-46/+47
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Fix LLCP sockets releasing pathSamuel Ortiz2012-03-061-4/+11
| | | | | | | | | | | The socket local pointer needs to be set to NULL when the adapter is removed or the MAC goes down. If the socket release code is called after such an event, the socket reference count still needs to be decreased in order for the socket to eventually be freed. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Remove the rf mode parameter from the DEP link up routineSamuel Ortiz2012-03-061-1/+1
| | | | | | | | | When calling nfc_dep_link_up, we implicitely are in initiator mode. Which means we also can provide the general bytes as a function argument, as all drivers will eventually request them. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Send LLCP RR frames to acknowledge received I framesSamuel Ortiz2012-03-061-2/+7
| | | | | | | | In order to acknowledge an I frame, we have to either queue pending local I frames or queue a receiver ready frame. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Set the right LLCP N(R) value for I framesSamuel Ortiz2012-03-061-1/+1
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Clear LLCP SDPs whan MAC goes downSamuel Ortiz2012-03-061-0/+13
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Fix bitops usage in LLCPSamuel Ortiz2012-03-061-10/+10
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Handle Receiver Not Ready LLCP frameSamuel Ortiz2012-03-061-5/+11
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Factorize the I frame queueing routineSamuel Ortiz2012-03-061-17/+28
| | | | | | | This one will be called from the I frame command sending. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: use kfree_skb() for sk_buffsDan Carpenter2011-12-191-1/+1
| | | | | | | | | This is a struct sk_buff pointer and it should be freed with kfree_skb() instead of kfree(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: double unlock in nfc_llcp_recv_connect()Dan Carpenter2011-12-191-3/+1
| | | | | | | | | We unlock inside the if block on the other side of this if else statement. It could result in calling mutex_unlock() twice. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Initial LLCP supportSamuel Ortiz2011-12-141-0/+973
This patch is an initial implementation for the NFC Logical Link Control protocol. It's also known as NFC peer to peer mode. This is a basic implementation as it lacks SDP (services Discovery Protocol), frames aggregation support, and frame rejecion parsing. Follow up patches will implement those missing features. This code has been tested against a Nexus S phone implementing LLCP 1.0. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud