aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-05-10 09:28:38 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-14 07:44:58 -0400
commitfed7c25ec0d4894edfc36bbe5c5231e52f45483a (patch)
treef481af4d3a05bd2f1b707a074cc49cf2d4a9f93b /include
parent0a946301c2d3eac8673e556df820c0b6023ac6c3 (diff)
NFC: Add secure elements addition and removal API
This API will allow NFC drivers to add and remove the secure elements they know about or detect. Typically this should be called (asynchronously or not) from the driver or the host interface stack detect_se hook. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/nfc/nfc.h22
-rw-r--r--include/uapi/linux/nfc.h4
2 files changed, 24 insertions, 2 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5187ec70b66a..0e353f1658bb 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -97,6 +97,23 @@ struct nfc_target {
97 u8 logical_idx; 97 u8 logical_idx;
98}; 98};
99 99
100/**
101 * nfc_se - A structure for NFC accessible secure elements.
102 *
103 * @idx: The secure element index. User space will enable or
104 * disable a secure element by its index.
105 * @type: The secure element type. It can be SE_UICC or
106 * SE_EMBEDDED.
107 * @state: The secure element state, either enabled or disabled.
108 *
109 */
110struct nfc_se {
111 struct list_head list;
112 u32 idx;
113 u16 type;
114 u16 state;
115};
116
100struct nfc_genl_data { 117struct nfc_genl_data {
101 u32 poll_req_portid; 118 u32 poll_req_portid;
102 struct mutex genl_data_mutex; 119 struct mutex genl_data_mutex;
@@ -118,7 +135,7 @@ struct nfc_dev {
118 struct nfc_genl_data genl_data; 135 struct nfc_genl_data genl_data;
119 u32 supported_protocols; 136 u32 supported_protocols;
120 137
121 u32 active_se; 138 struct list_head secure_elements;
122 139
123 int tx_headroom; 140 int tx_headroom;
124 int tx_tailroom; 141 int tx_tailroom;
@@ -221,4 +238,7 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
221 238
222void nfc_driver_failure(struct nfc_dev *dev, int err); 239void nfc_driver_failure(struct nfc_dev *dev, int err);
223 240
241int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
242int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
243
224#endif /* __NET_NFC_H */ 244#endif /* __NET_NFC_H */
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index fb304fb774cc..3a57cef0b986 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -199,10 +199,12 @@ enum nfc_sdp_attr {
199#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) 199#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
200 200
201/* NFC Secure Elements */ 201/* NFC Secure Elements */
202#define NFC_SE_NONE 0x0
203#define NFC_SE_UICC 0x1 202#define NFC_SE_UICC 0x1
204#define NFC_SE_EMBEDDED 0x2 203#define NFC_SE_EMBEDDED 0x2
205 204
205#define NFC_SE_DISABLED 0x0
206#define NFC_SE_ENABLED 0x1
207
206struct sockaddr_nfc { 208struct sockaddr_nfc {
207 sa_family_t sa_family; 209 sa_family_t sa_family;
208 __u32 dev_idx; 210 __u32 dev_idx;