NFC: add nfc generic netlink interface
The NFC generic netlink interface exports the NFC control operations
to the user space.
Signed-off-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/include/net/nfc.h b/include/net/nfc.h
index c57b579..cc01303 100644
--- a/include/net/nfc.h
+++ b/include/net/nfc.h
@@ -58,10 +58,28 @@
void *cb_context);
};
+struct nfc_target {
+ u32 idx;
+ u32 supported_protocols;
+ u16 sens_res;
+ u8 sel_res;
+};
+
+struct nfc_genl_data {
+ u32 poll_req_pid;
+ struct mutex genl_data_mutex;
+};
+
struct nfc_dev {
unsigned idx;
+ unsigned target_idx;
+ struct nfc_target *targets;
+ int n_targets;
+ int targets_generation;
+ spinlock_t targets_lock;
struct device dev;
bool polling;
+ struct nfc_genl_data genl_data;
u32 supported_protocols;
struct nfc_ops *ops;
@@ -132,4 +150,7 @@
struct sk_buff *nfc_alloc_skb(unsigned int size, gfp_t gfp);
+int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
+ int ntargets);
+
#endif /* __NET_NFC_H */