mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
NFC: nci: Add se_io NCI 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>
This commit is contained in:
parent
e9ef9431a3
commit
a688bf55c5
@ -75,6 +75,9 @@ struct nci_ops {
|
|||||||
int (*discover_se)(struct nci_dev *ndev);
|
int (*discover_se)(struct nci_dev *ndev);
|
||||||
int (*disable_se)(struct nci_dev *ndev, u32 se_idx);
|
int (*disable_se)(struct nci_dev *ndev, u32 se_idx);
|
||||||
int (*enable_se)(struct nci_dev *ndev, u32 se_idx);
|
int (*enable_se)(struct nci_dev *ndev, u32 se_idx);
|
||||||
|
int (*se_io)(struct nci_dev *ndev, u32 se_idx,
|
||||||
|
u8 *apdu, size_t apdu_length,
|
||||||
|
se_io_cb_t cb, void *cb_context);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
|
#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
|
||||||
|
@ -774,6 +774,19 @@ static int nci_discover_se(struct nfc_dev *nfc_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int nci_se_io(struct nfc_dev *nfc_dev, u32 se_idx,
|
||||||
|
u8 *apdu, size_t apdu_length,
|
||||||
|
se_io_cb_t cb, void *cb_context)
|
||||||
|
{
|
||||||
|
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
|
||||||
|
|
||||||
|
if (ndev->ops->se_io)
|
||||||
|
return ndev->ops->se_io(ndev, se_idx, apdu,
|
||||||
|
apdu_length, cb, cb_context);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct nfc_ops nci_nfc_ops = {
|
static struct nfc_ops nci_nfc_ops = {
|
||||||
.dev_up = nci_dev_up,
|
.dev_up = nci_dev_up,
|
||||||
.dev_down = nci_dev_down,
|
.dev_down = nci_dev_down,
|
||||||
@ -788,6 +801,7 @@ static struct nfc_ops nci_nfc_ops = {
|
|||||||
.enable_se = nci_enable_se,
|
.enable_se = nci_enable_se,
|
||||||
.disable_se = nci_disable_se,
|
.disable_se = nci_disable_se,
|
||||||
.discover_se = nci_discover_se,
|
.discover_se = nci_discover_se,
|
||||||
|
.se_io = nci_se_io,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---- Interface to NCI drivers ---- */
|
/* ---- Interface to NCI drivers ---- */
|
||||||
|
Loading…
Reference in New Issue
Block a user