NFC: LLCP raw socket support
authorThierry Escande <thierry.escande@linux.intel.com>
Wed, 26 Sep 2012 16:16:44 +0000 (18:16 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 27 Sep 2012 08:47:59 +0000 (10:47 +0200)
commit4463523bef98ff827a89cf8219db7dfac4350241
tree50b87765b5b8e14074812b6fa3f442a6d5d661ab
parentee5e8d812ca25bf95a97b4368aec4e680678e75e
NFC: LLCP raw socket support

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>
include/linux/nfc.h
net/nfc/llcp/commands.c
net/nfc/llcp/llcp.c
net/nfc/llcp/llcp.h
net/nfc/llcp/sock.c