diff options
author | David S. Miller | 2015-02-08 07:22:25 +0100 |
---|---|---|
committer | David S. Miller | 2015-02-08 07:22:25 +0100 |
commit | 3c09e92fb6b94b7597442c1f232a260c35b30698 (patch) | |
tree | d26115f0e99cb8e5529e0fd37596b0d4592511b2 /include/net/nfc/nfc.h | |
parent | rhashtable: Fix remove logic to avoid cross references between buckets (diff) | |
parent | NFC: nci: Move NFCEE discovery logic (diff) | |
download | kernel-qcow2-linux-3c09e92fb6b94b7597442c1f232a260c35b30698.tar.gz kernel-qcow2-linux-3c09e92fb6b94b7597442c1f232a260c35b30698.tar.xz kernel-qcow2-linux-3c09e92fb6b94b7597442c1f232a260c35b30698.zip |
Merge tag 'nfc-next-3.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next
NFC: 3.20 second pull request
This is the second NFC pull request for 3.20.
It brings:
- NCI NFCEE (NFC Execution Environment, typically an embedded or
external secure element) discovery and enabling/disabling support.
In order to communicate with an NFCEE, we also added NCI's logical
connections support to the NCI stack.
- HCI over NCI protocol support. Some secure elements only understand
HCI and thus we need to send them HCI frames when they're part of
an NCI chipset.
- NFC_EVT_TRANSACTION userspace API addition. Whenever an application
running on a secure element needs to notify its host counterpart,
we send an NFC_EVENT_SE_TRANSACTION event to userspace through the
NFC netlink socket.
- Secure element and HCI transaction event support for the st21nfcb
chipset.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/nfc/nfc.h')
-rw-r--r-- | include/net/nfc/nfc.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 12adb817c27a..73190e65d5c1 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h @@ -135,6 +135,31 @@ struct nfc_se { u16 state; }; +/** + * nfc_evt_transaction - A struct for NFC secure element event transaction. + * + * @aid: The application identifier triggering the event + * + * @aid_len: The application identifier length [5:16] + * + * @params: The application parameters transmitted during the transaction + * + * @params_len: The applications parameters length [0:255] + * + */ +#define NFC_MIN_AID_LENGTH 5 +#define NFC_MAX_AID_LENGTH 16 +#define NFC_MAX_PARAMS_LENGTH 255 + +#define NFC_EVT_TRANSACTION_AID_TAG 0x81 +#define NFC_EVT_TRANSACTION_PARAMS_TAG 0x82 +struct nfc_evt_transaction { + u32 aid_len; + u8 aid[NFC_MAX_AID_LENGTH]; + u8 params_len; + u8 params[NFC_MAX_PARAMS_LENGTH]; +} __packed; + struct nfc_genl_data { u32 poll_req_portid; struct mutex genl_data_mutex; @@ -262,6 +287,8 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); void nfc_driver_failure(struct nfc_dev *dev, int err); +int nfc_se_transaction(struct nfc_dev *dev, u8 se_idx, + struct nfc_evt_transaction *evt_transaction); int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type); int nfc_remove_se(struct nfc_dev *dev, u32 se_idx); struct nfc_se *nfc_find_se(struct nfc_dev *dev, u32 se_idx); |