diff options
Diffstat (limited to 'include/net/nfc/nfc.h')
-rw-r--r-- | include/net/nfc/nfc.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f68ee68e4e3e..82fc4e43fc6e 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -28,9 +28,14 @@ | |||
28 | #include <linux/device.h> | 28 | #include <linux/device.h> |
29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
30 | 30 | ||
31 | #define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg) | 31 | #define nfc_info(dev, fmt, ...) dev_info((dev), "NFC: " fmt, ##__VA_ARGS__) |
32 | #define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg) | 32 | #define nfc_err(dev, fmt, ...) dev_err((dev), "NFC: " fmt, ##__VA_ARGS__) |
33 | #define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg) | 33 | |
34 | struct nfc_phy_ops { | ||
35 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
36 | int (*enable)(void *dev_id); | ||
37 | void (*disable)(void *dev_id); | ||
38 | }; | ||
34 | 39 | ||
35 | struct nfc_dev; | 40 | struct nfc_dev; |
36 | 41 | ||
@@ -48,6 +53,8 @@ struct nfc_dev; | |||
48 | typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, | 53 | typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, |
49 | int err); | 54 | int err); |
50 | 55 | ||
56 | typedef void (*se_io_cb_t)(void *context, u8 *apdu, size_t apdu_len, int err); | ||
57 | |||
51 | struct nfc_target; | 58 | struct nfc_target; |
52 | 59 | ||
53 | struct nfc_ops { | 60 | struct nfc_ops { |
@@ -74,12 +81,23 @@ struct nfc_ops { | |||
74 | int (*discover_se)(struct nfc_dev *dev); | 81 | int (*discover_se)(struct nfc_dev *dev); |
75 | int (*enable_se)(struct nfc_dev *dev, u32 se_idx); | 82 | int (*enable_se)(struct nfc_dev *dev, u32 se_idx); |
76 | int (*disable_se)(struct nfc_dev *dev, u32 se_idx); | 83 | int (*disable_se)(struct nfc_dev *dev, u32 se_idx); |
84 | int (*se_io) (struct nfc_dev *dev, u32 se_idx, | ||
85 | u8 *apdu, size_t apdu_length, | ||
86 | se_io_cb_t cb, void *cb_context); | ||
77 | }; | 87 | }; |
78 | 88 | ||
79 | #define NFC_TARGET_IDX_ANY -1 | 89 | #define NFC_TARGET_IDX_ANY -1 |
80 | #define NFC_MAX_GT_LEN 48 | 90 | #define NFC_MAX_GT_LEN 48 |
81 | #define NFC_ATR_RES_GT_OFFSET 15 | 91 | #define NFC_ATR_RES_GT_OFFSET 15 |
82 | 92 | ||
93 | /** | ||
94 | * struct nfc_target - NFC target descriptiom | ||
95 | * | ||
96 | * @sens_res: 2 bytes describing the target SENS_RES response, if the target | ||
97 | * is a type A one. The %sens_res most significant byte must be byte 2 | ||
98 | * as described by the NFC Forum digital specification (i.e. the platform | ||
99 | * configuration one) while %sens_res least significant byte is byte 1. | ||
100 | */ | ||
83 | struct nfc_target { | 101 | struct nfc_target { |
84 | u32 idx; | 102 | u32 idx; |
85 | u32 supported_protocols; | 103 | u32 supported_protocols; |
@@ -243,5 +261,6 @@ void nfc_driver_failure(struct nfc_dev *dev, int err); | |||
243 | 261 | ||
244 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); | 262 | int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); |
245 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); | 263 | int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); |
264 | struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); | ||
246 | 265 | ||
247 | #endif /* __NET_NFC_H */ | 266 | #endif /* __NET_NFC_H */ |