NFC: Extend and fix the internal secure element API

Secure elements need to be discovered after enabling the NFC controller.
This is typically done by the NCI core and the HCI drivers (HCI does not
specify how to discover SEs, it is left to the specific drivers).
Also, the SE enable/disable API explicitely takes a SE index as its
argument.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2013-05-10 11:57:06 +02:00
parent 0b456c418a
commit 0a946301c2
5 changed files with 66 additions and 4 deletions

View File

@@ -126,6 +126,13 @@ int nfc_dev_up(struct nfc_dev *dev)
if (!rc)
dev->dev_up = true;
/* We have to enable the device before discovering SEs */
if (dev->ops->discover_se) {
rc = dev->ops->discover_se(dev);
if (!rc)
pr_warn("SE discovery failed\n");
}
error:
device_unlock(&dev->dev);
return rc;