diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-02-01 22:26:16 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-02-02 21:50:40 +0100 |
commit | 447b27c4f29b510b98e99395120d635f009ed563 (patch) | |
tree | 07c6b790944aa9bb1c3a44e7f7f93da03982735c /net/nfc/core.c | |
parent | 8ae01f7967718ac9ed800a99964f88c0c8b07e11 (diff) | |
download | linux-447b27c4f29b510b98e99395120d635f009ed563.tar.gz linux-447b27c4f29b510b98e99395120d635f009ed563.tar.bz2 linux-447b27c4f29b510b98e99395120d635f009ed563.zip |
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 'net/nfc/core.c')
-rw-r--r-- | net/nfc/core.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index 7f1b6351755c..cff3f1614ad4 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -932,6 +932,27 @@ int nfc_remove_se(struct nfc_dev *dev, u32 se_idx) } EXPORT_SYMBOL(nfc_remove_se); +int nfc_se_transaction(struct nfc_dev *dev, u8 se_idx, + struct nfc_evt_transaction *evt_transaction) +{ + int rc; + + pr_debug("transaction: %x\n", se_idx); + + device_lock(&dev->dev); + + if (!evt_transaction) { + rc = -EPROTO; + goto out; + } + + rc = nfc_genl_se_transaction(dev, se_idx, evt_transaction); +out: + device_unlock(&dev->dev); + return rc; +} +EXPORT_SYMBOL(nfc_se_transaction); + static void nfc_release(struct device *d) { struct nfc_dev *dev = to_nfc_dev(d); |