NFC: Initial LLCP support

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>
This commit is contained in:
Samuel Ortiz
2011-12-14 16:43:12 +01:00
committed by John W. Linville
parent 361f3cb7f9
commit d646960f79
10 changed files with 2335 additions and 3 deletions

View File

@@ -139,9 +139,22 @@ struct sockaddr_nfc {
__u32 nfc_protocol;
};
#define NFC_LLCP_MAX_SERVICE_NAME 63
struct sockaddr_nfc_llcp {
sa_family_t sa_family;
__u32 dev_idx;
__u32 target_idx;
__u32 nfc_protocol;
__u8 dsap; /* Destination SAP, if known */
__u8 ssap; /* Source SAP to be bound to */
char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
size_t service_name_len;
};
/* NFC socket protocols */
#define NFC_SOCKPROTO_RAW 0
#define NFC_SOCKPROTO_MAX 1
#define NFC_SOCKPROTO_LLCP 1
#define NFC_SOCKPROTO_MAX 2
#define NFC_HEADER_SIZE 1