aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-01 16:26:16 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2015-02-02 15:50:40 -0500
commit447b27c4f29b510b98e99395120d635f009ed563 (patch)
tree07c6b790944aa9bb1c3a44e7f7f93da03982735c /include/net
parent8ae01f7967718ac9ed800a99964f88c0c8b07e11 (diff)
NFC: Forward NFC_EVT_TRANSACTION to user space
NFC_EVT_TRANSACTION is sent through netlink in order for a specific application running on a secure element to notify userspace of an event. Typically the secure element application counterpart on the host could interpret that event and act upon it. Forwarded information contains: - SE host generating the event - Application IDentifier doing the operation - Applications parameters Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/nfc/nfc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 12adb817c27a..73190e65d5c1 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -135,6 +135,31 @@ struct nfc_se {
135 u16 state; 135 u16 state;
136}; 136};
137 137
138/**
139 * nfc_evt_transaction - A struct for NFC secure element event transaction.
140 *
141 * @aid: The application identifier triggering the event
142 *
143 * @aid_len: The application identifier length [5:16]
144 *
145 * @params: The application parameters transmitted during the transaction
146 *
147 * @params_len: The applications parameters length [0:255]
148 *
149 */
150#define NFC_MIN_AID_LENGTH 5
151#define NFC_MAX_AID_LENGTH 16
152#define NFC_MAX_PARAMS_LENGTH 255
153
154#define NFC_EVT_TRANSACTION_AID_TAG 0x81
155#define NFC_EVT_TRANSACTION_PARAMS_TAG 0x82
156struct nfc_evt_transaction {
157 u32 aid_len;
158 u8 aid[NFC_MAX_AID_LENGTH];
159 u8 params_len;
160 u8 params[NFC_MAX_PARAMS_LENGTH];
161} __packed;
162
138struct nfc_genl_data { 163struct nfc_genl_data {
139 u32 poll_req_portid; 164 u32 poll_req_portid;
140 struct mutex genl_data_mutex; 165 struct mutex genl_data_mutex;
@@ -262,6 +287,8 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
262 287
263void nfc_driver_failure(struct nfc_dev *dev, int err); 288void nfc_driver_failure(struct nfc_dev *dev, int err);
264 289
290int nfc_se_transaction(struct nfc_dev *dev, u8 se_idx,
291 struct nfc_evt_transaction *evt_transaction);
265int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); 292int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
266int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); 293int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
267struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); 294struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx);