diff options
author | Ilan Elias <ilane@ti.com> | 2012-01-18 13:16:14 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:32:29 -0500 |
commit | 019c4fbaa790e2b3f11dab0c8b7d9896d77db3e5 (patch) | |
tree | 593fc051bc96a40e48406f6cba883b1f95822422 /include/net/nfc/nci_core.h | |
parent | 25a1d9dc850b1bdcc4760eb625f0a67057f54d26 (diff) | |
download | kernel_goldelico_gta04-019c4fbaa790e2b3f11dab0c8b7d9896d77db3e5.zip kernel_goldelico_gta04-019c4fbaa790e2b3f11dab0c8b7d9896d77db3e5.tar.gz kernel_goldelico_gta04-019c4fbaa790e2b3f11dab0c8b7d9896d77db3e5.tar.bz2 |
NFC: Add NCI multiple targets support
Add the ability to select between multiple targets in NCI.
If only one target is found, it will be auto-activated.
If more than one target is found, then DISCOVER_NTF will be
generated for each target, and the host should select one by
calling DISCOVER_SELECT_CMD. Then, the target will be activated.
If the activation fails, GENERIC_ERROR_NTF is generated.
Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/nfc/nci_core.h')
-rw-r--r-- | include/net/nfc/nci_core.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index b9c3f8d..86fee8b 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h @@ -46,6 +46,8 @@ enum nci_flag { enum nci_state { NCI_IDLE, NCI_DISCOVERY, + NCI_W4_ALL_DISCOVERIES, + NCI_W4_HOST_SELECT, NCI_POLL_ACTIVE, }; @@ -53,6 +55,7 @@ enum nci_state { #define NCI_RESET_TIMEOUT 5000 #define NCI_INIT_TIMEOUT 5000 #define NCI_RF_DISC_TIMEOUT 5000 +#define NCI_RF_DISC_SELECT_TIMEOUT 5000 #define NCI_RF_DEACTIVATE_TIMEOUT 30000 #define NCI_CMD_TIMEOUT 5000 #define NCI_DATA_TIMEOUT 700 @@ -66,6 +69,7 @@ struct nci_ops { }; #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 +#define NCI_MAX_DISCOVERED_TARGETS 10 /* NCI Core structures */ struct nci_dev { @@ -105,9 +109,11 @@ struct nci_dev { void *driver_data; __u32 poll_prots; - __u32 target_available_prots; __u32 target_active_prot; + struct nfc_target targets[NCI_MAX_DISCOVERED_TARGETS]; + int n_targets; + /* received during NCI_OP_CORE_RESET_RSP */ __u8 nci_ver; @@ -178,6 +184,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload); int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, int err); +void nci_clear_target_list(struct nci_dev *ndev); /* ----- NCI requests ----- */ #define NCI_REQ_DONE 0 |