Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 390a1bd8 authored by Samuel Ortiz's avatar Samuel Ortiz
Browse files

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: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 2ad554a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -542,6 +542,7 @@ static int nfcwilink_probe(struct platform_device *pdev)

	drv->ndev = nci_allocate_device(&nfcwilink_ops,
					protocols,
					NFC_SE_NONE,
					NFCWILINK_HDR_LEN,
					0);
	if (!drv->ndev) {
+1 −0
Original line number Diff line number Diff line
@@ -2525,6 +2525,7 @@ static int pn533_probe(struct usb_interface *interface,


	dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols,
					   NFC_SE_NONE,
					   dev->ops->tx_header_len +
					   PN533_CMD_DATAEXCH_HEAD_LEN,
					   dev->ops->tx_tail_len);
+4 −2
Original line number Diff line number Diff line
@@ -801,7 +801,7 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
		    struct nfc_hci_dev **hdev)
{
	struct pn544_hci_info *info;
	u32 protocols;
	u32 protocols, se;
	struct nfc_hci_init_data init_data;
	int r;

@@ -834,8 +834,10 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
		    NFC_PROTO_ISO14443_B_MASK |
		    NFC_PROTO_NFC_DEP_MASK;

	se = NFC_SE_UICC | NFC_SE_EMBEDDED;

	info->hdev = nfc_hci_allocate_device(&pn544_hci_ops, &init_data, 0,
					     protocols, llc_name,
					     protocols, se, llc_name,
					     phy_headroom + PN544_CMDS_HEADROOM,
					     phy_tailroom, phy_payload);
	if (!info->hdev) {
+3 −0
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
@@ -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);
Loading