summaryrefslogtreecommitdiff
path: root/net/nfc/core.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-05-10 11:57:06 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-14 13:44:53 +0200
commit0a946301c2d3eac8673e556df820c0b6023ac6c3 (patch)
tree3cc74ad057df00a3dd6dd6f32d4a008473a21924 /net/nfc/core.c
parent0b456c418a5595b9d67f300c9ac6a2441e774603 (diff)
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>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r--net/nfc/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 334954a1d6e8..a43a56d7f4be 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -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;