diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-02-01 22:26:11 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-02-02 21:50:39 +0100 |
commit | f7f793f31378d5e83276871339c2a8374b0e8657 (patch) | |
tree | fbb5d1fe808f5a5ef1626e929cdc17717448420a /net/nfc/nci/core.c | |
parent | af9c8aa67d07adcd3b41fb2934af7af056eabecf (diff) | |
download | lwn-f7f793f31378d5e83276871339c2a8374b0e8657.tar.gz lwn-f7f793f31378d5e83276871339c2a8374b0e8657.zip |
NFC: nci: Add NFCEE enabling and disabling support
NFCEEs can be enabled or disabled by sending the
NCI_OP_NFCEE_MODE_SET_CMD command to the NFCC. This patch
provides an API for drivers to enable and disable e.g. their
NCI discoveredd secure elements.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci/core.c')
-rw-r--r-- | net/nfc/nci/core.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index a25857548524..e5fb8c8eed94 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -486,6 +486,27 @@ int nci_nfcee_discover(struct nci_dev *ndev, u8 action) } EXPORT_SYMBOL(nci_nfcee_discover); +static void nci_nfcee_mode_set_req(struct nci_dev *ndev, unsigned long opt) +{ + struct nci_nfcee_mode_set_cmd *cmd = + (struct nci_nfcee_mode_set_cmd *)opt; + + nci_send_cmd(ndev, NCI_OP_NFCEE_MODE_SET_CMD, + sizeof(struct nci_nfcee_mode_set_cmd), cmd); +} + +int nci_nfcee_mode_set(struct nci_dev *ndev, u8 nfcee_id, u8 nfcee_mode) +{ + struct nci_nfcee_mode_set_cmd cmd; + + cmd.nfcee_id = nfcee_id; + cmd.nfcee_mode = nfcee_mode; + + return nci_request(ndev, nci_nfcee_mode_set_req, (unsigned long)&cmd, + msecs_to_jiffies(NCI_CMD_TIMEOUT)); +} +EXPORT_SYMBOL(nci_nfcee_mode_set); + static int nci_set_local_general_bytes(struct nfc_dev *nfc_dev) { struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); |