diff options
author | Thierry Escande <thierry.escande@linux.intel.com> | 2012-09-26 12:16:44 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-09-27 04:47:59 -0400 |
commit | 4463523bef98ff827a89cf8219db7dfac4350241 (patch) | |
tree | 50b87765b5b8e14074812b6fa3f442a6d5d661ab /include/linux/nfc.h | |
parent | ee5e8d812ca25bf95a97b4368aec4e680678e75e (diff) |
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>
Diffstat (limited to 'include/linux/nfc.h')
-rw-r--r-- | include/linux/nfc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 6189f27e305b..d908d17da56d 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
@@ -183,4 +183,15 @@ struct sockaddr_nfc_llcp { | |||
183 | 183 | ||
184 | #define NFC_HEADER_SIZE 1 | 184 | #define NFC_HEADER_SIZE 1 |
185 | 185 | ||
186 | /** | ||
187 | * Pseudo-header info for raw socket packets | ||
188 | * First byte is the adapter index | ||
189 | * Second byte contains flags | ||
190 | * - 0x01 - Direction (0=RX, 1=TX) | ||
191 | * - 0x02-0x80 - Reserved | ||
192 | **/ | ||
193 | #define NFC_LLCP_RAW_HEADER_SIZE 2 | ||
194 | #define NFC_LLCP_DIRECTION_RX 0x00 | ||
195 | #define NFC_LLCP_DIRECTION_TX 0x01 | ||
196 | |||
186 | #endif /*__LINUX_NFC_H */ | 197 | #endif /*__LINUX_NFC_H */ |