aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/nfc/nfc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/nfc/nfc.h')
-rw-r--r--include/net/nfc/nfc.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 8696b773a695..bac070bf3514 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -24,6 +24,7 @@
24#ifndef __NET_NFC_H 24#ifndef __NET_NFC_H
25#define __NET_NFC_H 25#define __NET_NFC_H
26 26
27#include <linux/nfc.h>
27#include <linux/device.h> 28#include <linux/device.h>
28#include <linux/skbuff.h> 29#include <linux/skbuff.h>
29 30
@@ -52,20 +53,19 @@ struct nfc_ops {
52 int (*dev_down)(struct nfc_dev *dev); 53 int (*dev_down)(struct nfc_dev *dev);
53 int (*start_poll)(struct nfc_dev *dev, u32 protocols); 54 int (*start_poll)(struct nfc_dev *dev, u32 protocols);
54 void (*stop_poll)(struct nfc_dev *dev); 55 void (*stop_poll)(struct nfc_dev *dev);
55 int (*dep_link_up)(struct nfc_dev *dev, int target_idx, 56 int (*dep_link_up)(struct nfc_dev *dev, int target_idx, u8 comm_mode,
56 u8 comm_mode, u8 rf_mode); 57 u8 *gb, size_t gb_len);
57 int (*dep_link_down)(struct nfc_dev *dev); 58 int (*dep_link_down)(struct nfc_dev *dev);
58 int (*activate_target)(struct nfc_dev *dev, u32 target_idx, 59 int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
59 u32 protocol); 60 u32 protocol);
60 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx); 61 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx);
61 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx, 62 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx,
62 struct sk_buff *skb, data_exchange_cb_t cb, 63 struct sk_buff *skb, data_exchange_cb_t cb,
63 void *cb_context); 64 void *cb_context);
64}; 65};
65 66
66#define NFC_TARGET_IDX_ANY -1 67#define NFC_TARGET_IDX_ANY -1
67#define NFC_MAX_GT_LEN 48 68#define NFC_MAX_GT_LEN 48
68#define NFC_MAX_NFCID1_LEN 10
69 69
70struct nfc_target { 70struct nfc_target {
71 u32 idx; 71 u32 idx;
@@ -73,7 +73,11 @@ struct nfc_target {
73 u16 sens_res; 73 u16 sens_res;
74 u8 sel_res; 74 u8 sel_res;
75 u8 nfcid1_len; 75 u8 nfcid1_len;
76 u8 nfcid1[NFC_MAX_NFCID1_LEN]; 76 u8 nfcid1[NFC_NFCID1_MAXSIZE];
77 u8 sensb_res_len;
78 u8 sensb_res[NFC_SENSB_RES_MAXSIZE];
79 u8 sensf_res_len;
80 u8 sensf_res[NFC_SENSF_RES_MAXSIZE];
77}; 81};
78 82
79struct nfc_genl_data { 83struct nfc_genl_data {
@@ -83,7 +87,6 @@ struct nfc_genl_data {
83 87
84struct nfc_dev { 88struct nfc_dev {
85 unsigned idx; 89 unsigned idx;
86 unsigned target_idx;
87 struct nfc_target *targets; 90 struct nfc_target *targets;
88 int n_targets; 91 int n_targets;
89 int targets_generation; 92 int targets_generation;
@@ -107,9 +110,9 @@ struct nfc_dev {
107extern struct class nfc_class; 110extern struct class nfc_class;
108 111
109struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 112struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
110 u32 supported_protocols, 113 u32 supported_protocols,
111 int tx_headroom, 114 int tx_headroom,
112 int tx_tailroom); 115 int tx_tailroom);
113 116
114/** 117/**
115 * nfc_free_device - free nfc device 118 * nfc_free_device - free nfc device
@@ -132,7 +135,7 @@ void nfc_unregister_device(struct nfc_dev *dev);
132 * @dev: The parent device 135 * @dev: The parent device
133 */ 136 */
134static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev, 137static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev,
135 struct device *dev) 138 struct device *dev)
136{ 139{
137 nfc_dev->dev.parent = dev; 140 nfc_dev->dev.parent = dev;
138} 141}
@@ -169,17 +172,15 @@ static inline const char *nfc_device_name(struct nfc_dev *dev)
169} 172}
170 173
171struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk, 174struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk,
172 unsigned int flags, unsigned int size, 175 unsigned int flags, unsigned int size,
173 unsigned int *err); 176 unsigned int *err);
174struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp); 177struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp);
175 178
176int nfc_set_remote_general_bytes(struct nfc_dev *dev, 179int nfc_set_remote_general_bytes(struct nfc_dev *dev,
177 u8 *gt, u8 gt_len); 180 u8 *gt, u8 gt_len);
178 181
179u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, u8 *gt_len); 182int nfc_targets_found(struct nfc_dev *dev,
180 183 struct nfc_target *targets, int ntargets);
181int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
182 int ntargets);
183 184
184int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, 185int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx,
185 u8 comm_mode, u8 rf_mode); 186 u8 comm_mode, u8 rf_mode);