In order to send and receive ISO7816 APDUs to and from NFC embedded secure elements, we define a specific netlink command. On a typical SE use case, host applications will send very few APDUs (Less than 10) per transaction. This is why we decided to go for a simple netlink API. Defining another NFC socket protocol for such low traffic would have been overengineered.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -85,6 +85,7 @@ · 84 unmodified lines | ||
| 85 | 85 | * a specific SE notifies us about the end of a transaction. The parameter |
| 86 | 86 | * for this event is the application ID (AID). |
| 87 | 87 | * @NFC_CMD_GET_SE: Dump all discovered secure elements from an NFC controller. |
| 88 | + * @NFC_CMD_SE_IO: Send/Receive APDUs to/from the selected secure element. | |
| 88 | 89 | */ |
| 89 | 90 | enum nfc_commands { |
| 90 | 91 | NFC_CMD_UNSPEC, |
| @@ -114,6 +115,7 @@ enum nfc_commands { · 23 unmodified lines | ||
| 114 | 115 | NFC_EVENT_SE_CONNECTIVITY, |
| 115 | 116 | NFC_EVENT_SE_TRANSACTION, |
| 116 | 117 | NFC_CMD_GET_SE, |
| 118 | + NFC_CMD_SE_IO, | |
| 117 | 119 | /* private: internal use only */ |
| 118 | 120 | __NFC_CMD_AFTER_LAST |
| 119 | 121 | }; |
| @@ -147,6 +149,7 @@ enum nfc_commands { · 27 unmodified lines | ||
| 147 | 149 | * @NFC_ATTR_SE_INDEX: Secure element index |
| 148 | 150 | * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED) |
| 149 | 151 | * @NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS: Firmware download operation status |
| 152 | + * @NFC_ATTR_APDU: Secure element APDU | |
| 150 | 153 | */ |
| 151 | 154 | enum nfc_attrs { |
| 152 | 155 | NFC_ATTR_UNSPEC, |
| @@ -174,6 +177,7 @@ enum nfc_attrs { · 21 unmodified lines | ||
| 174 | 177 | NFC_ATTR_SE_TYPE, |
| 175 | 178 | NFC_ATTR_SE_AID, |
| 176 | 179 | NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS, |
| 180 | + NFC_ATTR_SE_APDU, | |
| 177 | 181 | /* private: internal use only */ |
| 178 | 182 | __NFC_ATTR_AFTER_LAST |
| 179 | 183 | }; |