NFC: Introduce target mode tx ops
[deliverable/linux.git] / include / net / nfc / nfc.h
index 9a2505a5b8de7687aa266f6f631b0b4a7396021e..45c4c970575ceb7a741fbe0e19d510e847b31220 100644 (file)
@@ -48,26 +48,30 @@ struct nfc_dev;
 typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb,
                                                                int err);
 
+struct nfc_target;
+
 struct nfc_ops {
        int (*dev_up)(struct nfc_dev *dev);
        int (*dev_down)(struct nfc_dev *dev);
-       int (*start_poll)(struct nfc_dev *dev, u32 protocols);
+       int (*start_poll)(struct nfc_dev *dev,
+                         u32 im_protocols, u32 tm_protocols);
        void (*stop_poll)(struct nfc_dev *dev);
-       int (*dep_link_up)(struct nfc_dev *dev, int target_idx, u8 comm_mode,
-                          u8 *gb, size_t gb_len);
+       int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target,
+                          u8 comm_mode, u8 *gb, size_t gb_len);
        int (*dep_link_down)(struct nfc_dev *dev);
-       int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
+       int (*activate_target)(struct nfc_dev *dev, struct nfc_target *target,
                               u32 protocol);
-       void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx);
-       int (*data_exchange)(struct nfc_dev *dev, u32 target_idx,
+       void (*deactivate_target)(struct nfc_dev *dev,
+                                 struct nfc_target *target);
+       int (*im_transceive)(struct nfc_dev *dev, struct nfc_target *target,
                             struct sk_buff *skb, data_exchange_cb_t cb,
                             void *cb_context);
-       int (*check_presence)(struct nfc_dev *dev, u32 target_idx);
+       int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
+       int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
 };
 
 #define NFC_TARGET_IDX_ANY -1
 #define NFC_MAX_GT_LEN 48
-#define NFC_TARGET_IDX_NONE 0xffffffff
 
 struct nfc_target {
        u32 idx;
@@ -95,13 +99,12 @@ struct nfc_dev {
        struct nfc_target *targets;
        int n_targets;
        int targets_generation;
-       spinlock_t targets_lock;
        struct device dev;
        bool dev_up;
+       u8 rf_mode;
        bool polling;
-       u32 activated_target_idx;
+       struct nfc_target *active_target;
        bool dep_link_up;
-       u32 dep_rf_mode;
        struct nfc_genl_data genl_data;
        u32 supported_protocols;
 
@@ -187,6 +190,7 @@ struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp);
 
 int nfc_set_remote_general_bytes(struct nfc_dev *dev,
                                 u8 *gt, u8 gt_len);
+u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len);
 
 int nfc_targets_found(struct nfc_dev *dev,
                      struct nfc_target *targets, int ntargets);
@@ -195,4 +199,8 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx);
 int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx,
                       u8 comm_mode, u8 rf_mode);
 
+int nfc_tm_activated(struct nfc_dev *dev, u32 protocol, u8 comm_mode,
+                    u8 *gb, size_t gb_len);
+int nfc_tm_deactivated(struct nfc_dev *dev);
+
 #endif /* __NET_NFC_H */
This page took 0.025832 seconds and 5 git commands to generate.