diff options
Diffstat (limited to 'net/nfc/nfc.h')
-rw-r--r-- | net/nfc/nfc.h | 70 |
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) | ||
31 | int 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 | |||
37 | struct nfc_protocol { | 30 | struct 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 | |||
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 | static inline void nfc_llcp_mac_is_down(struct nfc_dev *dev) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | static inline 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 | |||
56 | int __init rawsock_init(void); | 103 | int __init rawsock_init(void); |
57 | void rawsock_exit(void); | 104 | void rawsock_exit(void); |
58 | 105 | ||
@@ -75,6 +122,10 @@ int nfc_genl_targets_found(struct nfc_dev *dev); | |||
75 | int nfc_genl_device_added(struct nfc_dev *dev); | 122 | int nfc_genl_device_added(struct nfc_dev *dev); |
76 | int nfc_genl_device_removed(struct nfc_dev *dev); | 123 | int nfc_genl_device_removed(struct nfc_dev *dev); |
77 | 124 | ||
125 | int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, | ||
126 | u8 comm_mode, u8 rf_mode); | ||
127 | int nfc_genl_dep_link_down_event(struct nfc_dev *dev); | ||
128 | |||
78 | struct nfc_dev *nfc_get_device(unsigned idx); | 129 | struct nfc_dev *nfc_get_device(unsigned idx); |
79 | 130 | ||
80 | static inline void nfc_put_device(struct nfc_dev *dev) | 131 | static 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 | ||
110 | int nfc_stop_poll(struct nfc_dev *dev); | 161 | int nfc_stop_poll(struct nfc_dev *dev); |
111 | 162 | ||
163 | int nfc_dep_link_up(struct nfc_dev *dev, int target_idx, | ||
164 | u8 comm_mode, u8 rf_mode); | ||
165 | |||
166 | int nfc_dep_link_down(struct nfc_dev *dev); | ||
167 | |||
112 | int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol); | 168 | int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol); |
113 | 169 | ||
114 | int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx); | 170 | int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx); |