aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/nfc.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/nfc.h')
-rw-r--r--net/nfc/nfc.h70
1 files changed, 63 insertions, 7 deletions
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index d86583f4831d..6d28d75995b0 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -27,13 +27,6 @@
27#include <net/nfc/nfc.h> 27#include <net/nfc/nfc.h>
28#include <net/sock.h> 28#include <net/sock.h>
29 29
30__printf(2, 3)
31int nfc_printk(const char *level, const char *fmt, ...);
32
33#define nfc_info(fmt, arg...) nfc_printk(KERN_INFO, fmt, ##arg)
34#define nfc_err(fmt, arg...) nfc_printk(KERN_ERR, fmt, ##arg)
35#define nfc_dbg(fmt, arg...) pr_debug(fmt "\n", ##arg)
36
37struct nfc_protocol { 30struct nfc_protocol {
38 int id; 31 int id;
39 struct proto *proto; 32 struct proto *proto;
@@ -53,6 +46,60 @@ struct nfc_rawsock {
53#define to_rawsock_sk(_tx_work) \ 46#define to_rawsock_sk(_tx_work) \
54 ((struct sock *) container_of(_tx_work, struct nfc_rawsock, tx_work)) 47 ((struct sock *) container_of(_tx_work, struct nfc_rawsock, tx_work))
55 48
49#ifdef CONFIG_NFC_LLCP
50
51void nfc_llcp_mac_is_down(struct nfc_dev *dev);
52void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
53 u8 comm_mode, u8 rf_mode);
54int nfc_llcp_register_device(struct nfc_dev *dev);
55void nfc_llcp_unregister_device(struct nfc_dev *dev);
56int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len);
57u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *general_bytes_len);
58int __init nfc_llcp_init(void);
59void nfc_llcp_exit(void);
60
61#else
62
63static inline void nfc_llcp_mac_is_down(struct nfc_dev *dev)
64{
65}
66
67static inline void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx,
68 u8 comm_mode, u8 rf_mode)
69{
70}
71
72static inline int nfc_llcp_register_device(struct nfc_dev *dev)
73{
74 return 0;
75}
76
77static inline void nfc_llcp_unregister_device(struct nfc_dev *dev)
78{
79}
80
81static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len)
82{
83 return 0;
84}
85
86static inline u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, u8 *gb_len)
87{
88 *gb_len = 0;
89 return NULL;
90}
91
92static inline int nfc_llcp_init(void)
93{
94 return 0;
95}
96
97static inline void nfc_llcp_exit(void)
98{
99}
100
101#endif
102
56int __init rawsock_init(void); 103int __init rawsock_init(void);
57void rawsock_exit(void); 104void rawsock_exit(void);
58 105
@@ -75,6 +122,10 @@ int nfc_genl_targets_found(struct nfc_dev *dev);
75int nfc_genl_device_added(struct nfc_dev *dev); 122int nfc_genl_device_added(struct nfc_dev *dev);
76int nfc_genl_device_removed(struct nfc_dev *dev); 123int nfc_genl_device_removed(struct nfc_dev *dev);
77 124
125int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx,
126 u8 comm_mode, u8 rf_mode);
127int nfc_genl_dep_link_down_event(struct nfc_dev *dev);
128
78struct nfc_dev *nfc_get_device(unsigned idx); 129struct nfc_dev *nfc_get_device(unsigned idx);
79 130
80static inline void nfc_put_device(struct nfc_dev *dev) 131static inline void nfc_put_device(struct nfc_dev *dev)
@@ -109,6 +160,11 @@ int nfc_start_poll(struct nfc_dev *dev, u32 protocols);
109 160
110int nfc_stop_poll(struct nfc_dev *dev); 161int nfc_stop_poll(struct nfc_dev *dev);
111 162
163int nfc_dep_link_up(struct nfc_dev *dev, int target_idx,
164 u8 comm_mode, u8 rf_mode);
165
166int nfc_dep_link_down(struct nfc_dev *dev);
167
112int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol); 168int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol);
113 169
114int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx); 170int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx);