summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/llcp.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Move LLCP code to the NFC top level diirectorySamuel Ortiz2013-04-261-267/+0
| | | | | | | And stop making it optional. LLCP is a fundamental part of the NFC specifications and making it optional does not make much sense. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Reset RW, LTO, and MIU remote parameters when link goes downThierry Escande2013-04-111-0/+1
| | | | | | | | | This resets remote parameters in both local and socket llcp structures when the link goes down. That way, nfc_llcp_getsockopt won't return values corresponding to the previous link parameters. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Use localy stored remote_miu value if not set at socket levelThierry Escande2013-04-111-0/+1
| | | | | | | | If remote_miu value is not set in the socket (i.e. connection-less socket) the value stored in the local is used. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Aggregated frames supportThierry Escande2013-04-111-0/+1
| | | | | | | | This adds support for AGF PDUs. For each PDU contained in the AGF, a new sk_buff is allocated and dispatched to its corresponding handler. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Socket miux is a big endian fieldSamuel Ortiz2013-04-111-1/+1
| | | | | | | The MIUX must be transmitted in big endian and as such we have to convert it properly. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Add cleanup support for unreplied SNL requestsThierry Escande2013-03-101-0/+4
| | | | | | | | | | | | If the remote LLC doesn't reply in time to our SNL requests we remove them from the list of pending requests. The timeout is fixed to an arbitrary value of 3 times remote_lto. When not replied, the local LLC broadcasts NFC_EVENT_LLC_SDRES nl events for the concerned uris with sap values set to LLCP_SDP_UNBOUND (which is 65). Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Service Name Lookup netlink interfaceThierry Escande2013-03-101-0/+9
| | | | | | | | | | | | This adds a netlink interface for service name lookup support. Multiple URIs can be passed nested into the NFC_ATTR_LLC_SDP attribute using the NFC_CMD_LLC_SDREQ netlink command. When the SNL reply is received, a NFC_EVENT_LLC_SDRES event is sent to the user space. URI and SAP tuples are passed back, nested into NFC_ATTR_LLC_SDP attribute. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Service Name Lookup SDRES aggregationThierry Escande2013-03-101-1/+15
| | | | | | | | | This modifies the way SDRES PDUs are sent back. If multiple SDREQs are received within a single SNL PDU, all SDRES replies are sent packed in one SNL PDU too. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Implement socket optionsSamuel Ortiz2013-03-101-0/+3
| | | | | | | | Some LLCP services (e.g. the validation ones) require some control over the LLCP link parameters like the receive window (RW) or the MIU extension (MIUX). This can only be done through socket options. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Rename socket rw and miu fieldsSamuel Ortiz2013-03-101-2/+4
| | | | | | | They really are remote peer parameters, and we need to distinguish them from the local ones as we'll modify the latter with socket options. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: llcp: Remove the tx backlog queueSamuel Ortiz2013-01-101-1/+0
| | | | | | | | Not only it was improperly use to queue backlogged RX skbuffs, but it was also not processed at all. If the socket receive queue is full we simply drop the incoming packets. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Extend netlink interface for LTO, RW, and MIUX parameters supportThierry Escande2012-10-291-0/+3
| | | | | | | | | | | | | NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for a device. LTO must be set before the link is up otherwise -EINPROGRESS is returned. RW and MIUX can be set at anytime and will be passed in subsequent CONNECT and CC messages. If one of the passed parameters is wrong none is set and -EINVAL is returned. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: UI frame sending routine implementationSamuel Ortiz2012-10-261-0/+2
| | | | | | | UI frames still need to follow the MIU rule, and they need to use the client passed dsap as the listening socket dsap is stuck on SDP. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Handle LLCP UI framesSamuel Ortiz2012-10-261-0/+7
| | | | | | | UI (Unnumbered Information) frames are used for sending data over connection less links. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Add SNL frame building routineSamuel Ortiz2012-10-261-0/+1
| | | | | | | SNL (Service Name Lookup) frames are used to respond to SNL requests. This is needed for SDP implementation. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: LLCP raw socket supportThierry Escande2012-09-271-0/+3
| | | | | | | | | | | | | | | This adds support for socket of type SOCK_RAW to LLCP. sk_buff are copied and sent to raw sockets with a 2 bytes extra header: The first byte header contains the nfc adapter index. The second one contains flags: - 0x01 - Direction (0=RX, 1=TX) - 0x02-0x80 - Reserved A raw socket has to be explicitly bound to a nfc adapter. This is achieved by specifying the adapter index to be bound to in the dev_idx field of the sockaddr_nfc_llcp struct passed to bind(). Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Use system_nrt_wq instead of custom onesTejun Heo2012-09-251-3/+0
| | | | | | | | | | | | | | NFC is using a number of custom ordered workqueues w/ WQ_MEM_RECLAIM. WQ_MEM_RECLAIM is unnecessary unless NFC is gonna be used as transport for storage device, and all use cases match one work item to one ordered workqueue - IOW, there's no actual ordering going on at all and using system_nrt_wq gives the same behavior. There's nothing to be gained by using custom workqueues. Use system_nrt_wq instead and drop all the custom ones. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: LLCP late bindingSamuel Ortiz2012-07-091-0/+2
| | | | | | | | | | With the LLCP 16 local SAPs we can potentially quickly run out of source SAPs for non well known services. With the so called late binding we will reserve an SAP only when we actually get a client connection for a local service. The SAP will be released once the last client is gone, leaving it available to other services. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* NFC: Release LLCP SAP when the owner is releasedSamuel Ortiz2012-07-091-0/+3
| | | | | | | | 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: 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-3/+6
| | | | | | | 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-3/+9
| | | | | | | 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-0/+4
| | | | | | | 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 code identation fixesSamuel Ortiz2012-03-061-3/+3
| | | | | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* NFC: Set MIU and RW values from CONNECT and CC LLCP framesSamuel Ortiz2012-03-061-0/+4
| | | | | | | | We use the maximum values for the LLCP Maximum Information Unit and Receive Window Size. 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-1/+2
| | | | | | | | 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: LLCP socket sendmsg implemetationSamuel Ortiz2012-03-061-0/+2
| | | | | 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-0/+1
| | | | | | | 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: Initial LLCP supportSamuel Ortiz2011-12-141-0/+193
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>