diff options
| author | Hiren Tandel <hirent@marvell.com> | 2014-05-05 06:43:31 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-05-19 18:06:04 -0400 |
| commit | 57be1f3f3ec1ccab6432615ca161c4c9ece2a2aa (patch) | |
| tree | bb0021acf67dcb66957f0482cb89f894d8fa77f0 /include | |
| parent | c79d9f9ef86683824c195b093106222ff0611c10 (diff) | |
NFC: Add RAW socket type support for SOCKPROTO_RAW
This allows for a more generic NFC sniffing by using SOCKPROTO_RAW
SOCK_RAW to read RAW NFC frames. This is for sniffing anything but LLCP
(HCI, NCI, etc...).
Signed-off-by: Hiren Tandel <hirent@marvell.com>
Signed-off-by: Rahul Tank <rahult@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/nfc/nfc.h | 3 | ||||
| -rw-r--r-- | include/uapi/linux/nfc.h | 16 |
2 files changed, 15 insertions, 4 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 2e8b40c16274..6c583e244de2 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -264,4 +264,7 @@ int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); | |||
| 264 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); | 264 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); |
| 265 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); | 265 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); |
| 266 | 266 | ||
| 267 | void nfc_send_to_raw_sock(struct nfc_dev *dev, struct sk_buff *skb, | ||
| 268 | u8 payload_type, u8 direction); | ||
| 269 | |||
| 267 | #endif /* __NET_NFC_H */ | 270 | #endif /* __NET_NFC_H */ |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 9789dc95b6a8..9b19b4461928 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
| @@ -273,11 +273,19 @@ struct sockaddr_nfc_llcp { | |||
| 273 | * First byte is the adapter index | 273 | * First byte is the adapter index |
| 274 | * Second byte contains flags | 274 | * Second byte contains flags |
| 275 | * - 0x01 - Direction (0=RX, 1=TX) | 275 | * - 0x01 - Direction (0=RX, 1=TX) |
| 276 | * - 0x02-0x80 - Reserved | 276 | * - 0x02-0x04 - Payload type (000=LLCP, 001=NCI, 010=HCI, 011=Digital, |
| 277 | * 100=Proprietary) | ||
| 278 | * - 0x05-0x80 - Reserved | ||
| 277 | **/ | 279 | **/ |
| 278 | #define NFC_LLCP_RAW_HEADER_SIZE 2 | 280 | #define NFC_RAW_HEADER_SIZE 2 |
| 279 | #define NFC_LLCP_DIRECTION_RX 0x00 | 281 | #define NFC_DIRECTION_RX 0x00 |
| 280 | #define NFC_LLCP_DIRECTION_TX 0x01 | 282 | #define NFC_DIRECTION_TX 0x01 |
| 283 | |||
| 284 | #define RAW_PAYLOAD_LLCP 0 | ||
| 285 | #define RAW_PAYLOAD_NCI 1 | ||
| 286 | #define RAW_PAYLOAD_HCI 2 | ||
| 287 | #define RAW_PAYLOAD_DIGITAL 3 | ||
| 288 | #define RAW_PAYLOAD_PROPRIETARY 4 | ||
| 281 | 289 | ||
| 282 | /* socket option names */ | 290 | /* socket option names */ |
| 283 | #define NFC_LLCP_RW 0 | 291 | #define NFC_LLCP_RW 0 |
