diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-12-14 10:43:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-14 14:50:13 -0500 |
commit | d646960f7986fefb460a2b062d5ccc8ccfeacc3a (patch) | |
tree | 0624d338715a8d275a39fbfce074df5c5d2783f5 /net/nfc/nfc.h | |
parent | 361f3cb7f9cfdb82c80926d0e7843c098c034545 (diff) |
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>
Diffstat (limited to 'net/nfc/nfc.h')
-rw-r--r-- | net/nfc/nfc.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h index 4d0fb125d033..2c2c4015c68b 100644 --- a/net/nfc/nfc.h +++ b/net/nfc/nfc.h | |||
@@ -46,6 +46,60 @@ struct nfc_rawsock { | |||
46 | #define to_rawsock_sk(_tx_work) \ | 46 | #define to_rawsock_sk(_tx_work) \ |
47 | ((struct sock *) container_of(_tx_work, struct nfc_rawsock, tx_work)) | 47 | ((struct sock *) container_of(_tx_work, struct nfc_rawsock, tx_work)) |
48 | 48 | ||
49 | #ifdef CONFIG_NFC_LLCP | ||
50 | |||
51 | void nfc_llcp_mac_is_down(struct nfc_dev *dev); | ||
52 | void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, | ||
53 | u8 comm_mode, u8 rf_mode); | ||
54 | int nfc_llcp_register_device(struct nfc_dev *dev); | ||
55 | void nfc_llcp_unregister_device(struct nfc_dev *dev); | ||
56 | int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len); | ||
57 | u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *general_bytes_len); | ||
58 | int __init nfc_llcp_init(void); | ||
59 | void nfc_llcp_exit(void); | ||
60 | |||
61 | #else | ||
62 | |||
63 | void nfc_llcp_mac_is_down(struct nfc_dev *dev) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, | ||
68 | u8 comm_mode, u8 rf_mode) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | static inline int nfc_llcp_register_device(struct nfc_dev *dev) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | static inline void nfc_llcp_unregister_device(struct nfc_dev *dev) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len) | ||
82 | { | ||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | static inline u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *gb_len) | ||
87 | { | ||
88 | *gb_len = 0; | ||
89 | return NULL; | ||
90 | } | ||
91 | |||
92 | static inline int nfc_llcp_init(void) | ||
93 | { | ||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static inline void nfc_llcp_exit(void) | ||
98 | { | ||
99 | } | ||
100 | |||
101 | #endif | ||
102 | |||
49 | int __init rawsock_init(void); | 103 | int __init rawsock_init(void); |
50 | void rawsock_exit(void); | 104 | void rawsock_exit(void); |
51 | 105 | ||