diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2014-11-12 18:30:34 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-12-01 19:49:58 -0500 |
commit | 9b8d32b7acdcd237d3e58154d59551c71556fec1 (patch) | |
tree | f7e2377ecb268b5913e4e7eb25017fadc7bffe99 /net | |
parent | a80d0cb6f6addc5a1f3852466fe8d37ca4fe1350 (diff) |
NFC: hci: Add se_io HCI operand
se_io allows to send apdu over the CLF to the embedded Secure Element.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/hci/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 117708263ced..58b1610ca545 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -717,6 +717,19 @@ static int hci_disable_se(struct nfc_dev *nfc_dev, u32 se_idx) | |||
717 | return 0; | 717 | return 0; |
718 | } | 718 | } |
719 | 719 | ||
720 | static int hci_se_io(struct nfc_dev *nfc_dev, u32 se_idx, | ||
721 | u8 *apdu, size_t apdu_length, | ||
722 | se_io_cb_t cb, void *cb_context) | ||
723 | { | ||
724 | struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); | ||
725 | |||
726 | if (hdev->ops->se_io) | ||
727 | return hdev->ops->se_io(hdev, se_idx, apdu, | ||
728 | apdu_length, cb, cb_context); | ||
729 | |||
730 | return 0; | ||
731 | } | ||
732 | |||
720 | static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err) | 733 | static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err) |
721 | { | 734 | { |
722 | mutex_lock(&hdev->msg_tx_mutex); | 735 | mutex_lock(&hdev->msg_tx_mutex); |
@@ -830,6 +843,7 @@ static struct nfc_ops hci_nfc_ops = { | |||
830 | .discover_se = hci_discover_se, | 843 | .discover_se = hci_discover_se, |
831 | .enable_se = hci_enable_se, | 844 | .enable_se = hci_enable_se, |
832 | .disable_se = hci_disable_se, | 845 | .disable_se = hci_disable_se, |
846 | .se_io = hci_se_io, | ||
833 | }; | 847 | }; |
834 | 848 | ||
835 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | 849 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, |