summaryrefslogtreecommitdiffstats
path: root/include/net/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-05-10 11:57:06 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-14 13:44:53 +0200
commit0a946301c2d3eac8673e556df820c0b6023ac6c3 (patch)
tree3cc74ad057df00a3dd6dd6f32d4a008473a21924 /include/net/nfc
parent0b456c418a5595b9d67f300c9ac6a2441e774603 (diff)
downloadop-kernel-dev-0a946301c2d3eac8673e556df820c0b6023ac6c3.zip
op-kernel-dev-0a946301c2d3eac8673e556df820c0b6023ac6c3.tar.gz
NFC: Extend and fix the internal secure element API
Secure elements need to be discovered after enabling the NFC controller. This is typically done by the NCI core and the HCI drivers (HCI does not specify how to discover SEs, it is left to the specific drivers). Also, the SE enable/disable API explicitely takes a SE index as its argument. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/net/nfc')
-rw-r--r--include/net/nfc/hci.h5
-rw-r--r--include/net/nfc/nfc.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index eca8846..0af851c 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -59,9 +59,10 @@ 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);
int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name);
+ int (*discover_se)(struct nfc_hci_dev *dev);
+ int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
+ int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx);
};
/* Pipes */
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 9900c0f..5187ec7 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -68,9 +68,12 @@ 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);
int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name);
+
+ /* Secure Element API */
+ int (*discover_se)(struct nfc_dev *dev);
+ int (*enable_se)(struct nfc_dev *dev, u32 se_idx);
+ int (*disable_se)(struct nfc_dev *dev, u32 se_idx);
};
#define NFC_TARGET_IDX_ANY -1
OpenPOWER on IntegriCloud