NFC: Initial Secure Element API

Each NFC adapter can have several links to different secure elements and
that property needs to be exported by the drivers.
A secure element link can be enabled and disabled, and card emulation will
be handled by the currently active one. Otherwise card emulation will be
host implemented.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2012-12-19 19:11:32 +01:00
parent 2ad554a502
commit 390a1bd853
11 changed files with 38 additions and 3 deletions
+3
View File
@@ -59,6 +59,8 @@ struct nfc_hci_ops {
struct nfc_target *target);
int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
struct sk_buff *skb);
int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
};
/* Pipes */
@@ -150,6 +152,7 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
struct nfc_hci_init_data *init_data,
unsigned long quirks,
u32 protocols,
u32 supported_se,
const char *llc_name,
int tx_headroom,
int tx_tailroom,
+1
View File
@@ -147,6 +147,7 @@ struct nci_dev {
/* ----- NCI Devices ----- */
struct nci_dev *nci_allocate_device(struct nci_ops *ops,
__u32 supported_protocols,
__u32 supported_se,
int tx_headroom,
int tx_tailroom);
void nci_free_device(struct nci_dev *ndev);
+6
View File
@@ -68,6 +68,8 @@ struct nfc_ops {
void *cb_context);
int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
};
#define NFC_TARGET_IDX_ANY -1
@@ -109,6 +111,9 @@ struct nfc_dev {
struct nfc_genl_data genl_data;
u32 supported_protocols;
u32 supported_se;
u32 active_se;
int tx_headroom;
int tx_tailroom;
@@ -125,6 +130,7 @@ extern struct class nfc_class;
struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
u32 supported_protocols,
u32 supported_se,
int tx_headroom,
int tx_tailroom);