aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/nfc/nci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/nfc/nci.h')
-rw-r--r--include/net/nfc/nci.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 9eca9ae2280c..e7257a4653b4 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -28,6 +28,8 @@
28#ifndef __NCI_H 28#ifndef __NCI_H
29#define __NCI_H 29#define __NCI_H
30 30
31#include <net/nfc/nfc.h>
32
31/* NCI constants */ 33/* NCI constants */
32#define NCI_MAX_NUM_MAPPING_CONFIGS 10 34#define NCI_MAX_NUM_MAPPING_CONFIGS 10
33#define NCI_MAX_NUM_RF_CONFIGS 10 35#define NCI_MAX_NUM_RF_CONFIGS 10
@@ -73,6 +75,8 @@
73#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 75#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83
74#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 76#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85
75 77
78#define NCI_RF_TECH_MODE_LISTEN_MASK 0x80
79
76/* NCI RF Technologies */ 80/* NCI RF Technologies */
77#define NCI_NFC_RF_TECHNOLOGY_A 0x00 81#define NCI_NFC_RF_TECHNOLOGY_A 0x00
78#define NCI_NFC_RF_TECHNOLOGY_B 0x01 82#define NCI_NFC_RF_TECHNOLOGY_B 0x01
@@ -106,6 +110,17 @@
106 110
107/* NCI Configuration Parameter Tags */ 111/* NCI Configuration Parameter Tags */
108#define NCI_PN_ATR_REQ_GEN_BYTES 0x29 112#define NCI_PN_ATR_REQ_GEN_BYTES 0x29
113#define NCI_LN_ATR_RES_GEN_BYTES 0x61
114#define NCI_LA_SEL_INFO 0x32
115#define NCI_LF_PROTOCOL_TYPE 0x50
116#define NCI_LF_CON_BITR_F 0x54
117
118/* NCI Configuration Parameters masks */
119#define NCI_LA_SEL_INFO_ISO_DEP_MASK 0x20
120#define NCI_LA_SEL_INFO_NFC_DEP_MASK 0x40
121#define NCI_LF_PROTOCOL_TYPE_NFC_DEP_MASK 0x02
122#define NCI_LF_CON_BITR_F_212 0x02
123#define NCI_LF_CON_BITR_F_424 0x04
109 124
110/* NCI Reset types */ 125/* NCI Reset types */
111#define NCI_RESET_TYPE_KEEP_CONFIG 0x00 126#define NCI_RESET_TYPE_KEEP_CONFIG 0x00
@@ -314,26 +329,31 @@ struct nci_core_intf_error_ntf {
314struct rf_tech_specific_params_nfca_poll { 329struct rf_tech_specific_params_nfca_poll {
315 __u16 sens_res; 330 __u16 sens_res;
316 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ 331 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
317 __u8 nfcid1[10]; 332 __u8 nfcid1[NFC_NFCID1_MAXSIZE];
318 __u8 sel_res_len; /* 0 or 1 Bytes */ 333 __u8 sel_res_len; /* 0 or 1 Bytes */
319 __u8 sel_res; 334 __u8 sel_res;
320} __packed; 335} __packed;
321 336
322struct rf_tech_specific_params_nfcb_poll { 337struct rf_tech_specific_params_nfcb_poll {
323 __u8 sensb_res_len; 338 __u8 sensb_res_len;
324 __u8 sensb_res[12]; /* 11 or 12 Bytes */ 339 __u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; /* 11 or 12 Bytes */
325} __packed; 340} __packed;
326 341
327struct rf_tech_specific_params_nfcf_poll { 342struct rf_tech_specific_params_nfcf_poll {
328 __u8 bit_rate; 343 __u8 bit_rate;
329 __u8 sensf_res_len; 344 __u8 sensf_res_len;
330 __u8 sensf_res[18]; /* 16 or 18 Bytes */ 345 __u8 sensf_res[NFC_SENSF_RES_MAXSIZE]; /* 16 or 18 Bytes */
331} __packed; 346} __packed;
332 347
333struct rf_tech_specific_params_nfcv_poll { 348struct rf_tech_specific_params_nfcv_poll {
334 __u8 res_flags; 349 __u8 res_flags;
335 __u8 dsfid; 350 __u8 dsfid;
336 __u8 uid[8]; /* 8 Bytes */ 351 __u8 uid[NFC_ISO15693_UID_MAXSIZE]; /* 8 Bytes */
352} __packed;
353
354struct rf_tech_specific_params_nfcf_listen {
355 __u8 local_nfcid2_len;
356 __u8 local_nfcid2[NFC_NFCID2_MAXSIZE]; /* 0 or 8 Bytes */
337} __packed; 357} __packed;
338 358
339struct nci_rf_discover_ntf { 359struct nci_rf_discover_ntf {
@@ -365,7 +385,12 @@ struct activation_params_nfcb_poll_iso_dep {
365 385
366struct activation_params_poll_nfc_dep { 386struct activation_params_poll_nfc_dep {
367 __u8 atr_res_len; 387 __u8 atr_res_len;
368 __u8 atr_res[63]; 388 __u8 atr_res[NFC_ATR_RES_MAXSIZE - 2]; /* ATR_RES from byte 3 */
389};
390
391struct activation_params_listen_nfc_dep {
392 __u8 atr_req_len;
393 __u8 atr_req[NFC_ATR_REQ_MAXSIZE - 2]; /* ATR_REQ from byte 3 */
369}; 394};
370 395
371struct nci_rf_intf_activated_ntf { 396struct nci_rf_intf_activated_ntf {
@@ -382,6 +407,7 @@ struct nci_rf_intf_activated_ntf {
382 struct rf_tech_specific_params_nfcb_poll nfcb_poll; 407 struct rf_tech_specific_params_nfcb_poll nfcb_poll;
383 struct rf_tech_specific_params_nfcf_poll nfcf_poll; 408 struct rf_tech_specific_params_nfcf_poll nfcf_poll;
384 struct rf_tech_specific_params_nfcv_poll nfcv_poll; 409 struct rf_tech_specific_params_nfcv_poll nfcv_poll;
410 struct rf_tech_specific_params_nfcf_listen nfcf_listen;
385 } rf_tech_specific_params; 411 } rf_tech_specific_params;
386 412
387 __u8 data_exch_rf_tech_and_mode; 413 __u8 data_exch_rf_tech_and_mode;
@@ -393,6 +419,7 @@ struct nci_rf_intf_activated_ntf {
393 struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; 419 struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep;
394 struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep; 420 struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep;
395 struct activation_params_poll_nfc_dep poll_nfc_dep; 421 struct activation_params_poll_nfc_dep poll_nfc_dep;
422 struct activation_params_listen_nfc_dep listen_nfc_dep;
396 } activation_params; 423 } activation_params;
397 424
398} __packed; 425} __packed;