From: Christophe Ricard Date: Wed, 12 Nov 2014 23:30:36 +0000 (+0100) Subject: NFC: nci: Update nci_enable_se to run proprietary commands to enable a secure element X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=93bca2bfa4b79b689603b56feeea0ebed2842cbe;p=linux-beck.git NFC: nci: Update nci_enable_se to run proprietary commands to enable a secure element Some NFC controller using NCI protocols may need a proprietary commands flow to enable a secure element Signed-off-by: Christophe Ricard Signed-off-by: Samuel Ortiz --- diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 8399a7964de4..db2d12790112 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h @@ -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 (*enable_se)(struct nci_dev *ndev, u32 se_idx); }; #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 4044973084a7..6c36ec6e477c 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -746,6 +746,11 @@ static int nci_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) static int nci_enable_se(struct nfc_dev *nfc_dev, u32 se_idx) { + struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); + + if (ndev->ops->enable_se) + return ndev->ops->enable_se(ndev, se_idx); + return 0; }