OSDN Git Service

NFC: nci: Update nci_disable_se to run proprietary commands to disable a secure element
authorChristophe Ricard <christophe.ricard@gmail.com>
Wed, 12 Nov 2014 23:30:37 +0000 (00:30 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 2 Dec 2014 01:01:21 +0000 (02:01 +0100)
Some NFC controller using NCI protocols may need a proprietary commands
flow to disable a secure element

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
include/net/nfc/nci_core.h
net/nfc/nci/core.c

index db2d127..dd97dd7 100644 (file)
@@ -73,6 +73,7 @@ struct nci_ops {
        int   (*setup)(struct nci_dev *ndev);
        __u32 (*get_rfprotocol)(struct nci_dev *ndev, __u8 rf_protocol);
        int   (*discover_se)(struct nci_dev *ndev);
+       int   (*disable_se)(struct nci_dev *ndev, u32 se_idx);
        int   (*enable_se)(struct nci_dev *ndev, u32 se_idx);
 };
 
index 6c36ec6..bcb70a6 100644 (file)
@@ -756,6 +756,11 @@ static int nci_enable_se(struct nfc_dev *nfc_dev, u32 se_idx)
 
 static int nci_disable_se(struct nfc_dev *nfc_dev, u32 se_idx)
 {
+       struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
+
+       if (ndev->ops->disable_se)
+               return ndev->ops->disable_se(ndev, se_idx);
+
        return 0;
 }