diff options
| author | Samuel Ortiz <sameo@linux.intel.com> | 2012-12-19 13:11:32 -0500 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-09 18:51:54 -0500 |
| commit | 390a1bd8538132186ddb679cafe9e75b7ef7e2d2 (patch) | |
| tree | 1c548396163a30e0e29f6572cf7b6f0c645085ba /include/uapi/linux | |
| parent | 2ad554a502facd705ce6eb362d0f1ac3ca426508 (diff) | |
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>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/nfc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 0e63cee8d810..80e4ecd8c04c 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
| @@ -67,6 +67,11 @@ | |||
| 67 | * subsequent CONNECT and CC messages. | 67 | * subsequent CONNECT and CC messages. |
| 68 | * If one of the passed parameters is wrong none is set and -EINVAL is | 68 | * If one of the passed parameters is wrong none is set and -EINVAL is |
| 69 | * returned. | 69 | * returned. |
| 70 | * @NFC_CMD_ENABLE_SE: Enable the physical link to a specific secure element. | ||
| 71 | * Once enabled a secure element will handle card emulation mode, i.e. | ||
| 72 | * starting a poll from a device which has a secure element enabled means | ||
| 73 | * we want to do SE based card emulation. | ||
| 74 | * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. | ||
| 70 | */ | 75 | */ |
| 71 | enum nfc_commands { | 76 | enum nfc_commands { |
| 72 | NFC_CMD_UNSPEC, | 77 | NFC_CMD_UNSPEC, |
| @@ -86,6 +91,8 @@ enum nfc_commands { | |||
| 86 | NFC_EVENT_TM_DEACTIVATED, | 91 | NFC_EVENT_TM_DEACTIVATED, |
| 87 | NFC_CMD_LLC_GET_PARAMS, | 92 | NFC_CMD_LLC_GET_PARAMS, |
| 88 | NFC_CMD_LLC_SET_PARAMS, | 93 | NFC_CMD_LLC_SET_PARAMS, |
| 94 | NFC_CMD_ENABLE_SE, | ||
| 95 | NFC_CMD_DISABLE_SE, | ||
| 89 | /* private: internal use only */ | 96 | /* private: internal use only */ |
| 90 | __NFC_CMD_AFTER_LAST | 97 | __NFC_CMD_AFTER_LAST |
| 91 | }; | 98 | }; |
| @@ -114,6 +121,7 @@ enum nfc_commands { | |||
| 114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | 121 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter |
| 115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | 122 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter |
| 116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | 123 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter |
| 124 | * @NFC_ATTR_SE: Available Secure Elements | ||
| 117 | */ | 125 | */ |
| 118 | enum nfc_attrs { | 126 | enum nfc_attrs { |
| 119 | NFC_ATTR_UNSPEC, | 127 | NFC_ATTR_UNSPEC, |
| @@ -134,6 +142,7 @@ enum nfc_attrs { | |||
| 134 | NFC_ATTR_LLC_PARAM_LTO, | 142 | NFC_ATTR_LLC_PARAM_LTO, |
| 135 | NFC_ATTR_LLC_PARAM_RW, | 143 | NFC_ATTR_LLC_PARAM_RW, |
| 136 | NFC_ATTR_LLC_PARAM_MIUX, | 144 | NFC_ATTR_LLC_PARAM_MIUX, |
| 145 | NFC_ATTR_SE, | ||
| 137 | /* private: internal use only */ | 146 | /* private: internal use only */ |
| 138 | __NFC_ATTR_AFTER_LAST | 147 | __NFC_ATTR_AFTER_LAST |
| 139 | }; | 148 | }; |
| @@ -172,6 +181,11 @@ enum nfc_attrs { | |||
| 172 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) | 181 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) |
| 173 | #define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) | 182 | #define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) |
| 174 | 183 | ||
| 184 | /* NFC Secure Elements */ | ||
| 185 | #define NFC_SE_NONE 0x0 | ||
| 186 | #define NFC_SE_UICC 0x1 | ||
| 187 | #define NFC_SE_EMBEDDED 0x2 | ||
| 188 | |||
| 175 | struct sockaddr_nfc { | 189 | struct sockaddr_nfc { |
| 176 | sa_family_t sa_family; | 190 | sa_family_t sa_family; |
| 177 | __u32 dev_idx; | 191 | __u32 dev_idx; |
