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>
This commit is contained in:
Christophe Ricard
2015-02-01 22:26:16 +01:00
committed by Samuel Ortiz
parent 8ae01f7967
commit 447b27c4f2
5 changed files with 98 additions and 0 deletions

View File

@@ -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);