aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/nfc/nci.h
diff options
context:
space:
mode:
authorIlan Elias <ilane@ti.com>2011-11-09 05:09:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-11 12:32:50 -0500
commite8c0dacd9836dc2dcb28d236c9cc3cfaa9965a20 (patch)
treeafc78589cb1a21a25d6ef0e1ad5532451bc47838 /include/net/nfc/nci.h
parente999882a052a2959571989b2db2b51893d23c0bb (diff)
NFC: Update names and structs to NCI spec 1.0 d18
Addition, deletion and modification of NCI constants. Changes in NCI commands, responses and notifications structures. Signed-off-by: Ilan Elias <ilane@ti.com> Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/nfc/nci.h')
-rw-r--r--include/net/nfc/nci.h81
1 files changed, 56 insertions, 25 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 39b85bc0804f..0ebf842b5946 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -36,24 +36,23 @@
36/* NCI Status Codes */ 36/* NCI Status Codes */
37#define NCI_STATUS_OK 0x00 37#define NCI_STATUS_OK 0x00
38#define NCI_STATUS_REJECTED 0x01 38#define NCI_STATUS_REJECTED 0x01
39#define NCI_STATUS_MESSAGE_CORRUPTED 0x02 39#define NCI_STATUS_RF_FRAME_CORRUPTED 0x02
40#define NCI_STATUS_BUFFER_FULL 0x03 40#define NCI_STATUS_FAILED 0x03
41#define NCI_STATUS_FAILED 0x04 41#define NCI_STATUS_NOT_INITIALIZED 0x04
42#define NCI_STATUS_NOT_INITIALIZED 0x05 42#define NCI_STATUS_SYNTAX_ERROR 0x05
43#define NCI_STATUS_SYNTAX_ERROR 0x06 43#define NCI_STATUS_SEMANTIC_ERROR 0x06
44#define NCI_STATUS_SEMANTIC_ERROR 0x07 44#define NCI_STATUS_UNKNOWN_GID 0x07
45#define NCI_STATUS_UNKNOWN_GID 0x08 45#define NCI_STATUS_UNKNOWN_OID 0x08
46#define NCI_STATUS_UNKNOWN_OID 0x09 46#define NCI_STATUS_INVALID_PARAM 0x09
47#define NCI_STATUS_INVALID_PARAM 0x0a 47#define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0a
48#define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0b
49/* Discovery Specific Status Codes */ 48/* Discovery Specific Status Codes */
50#define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0 49#define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0
51#define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1 50#define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1
51#define NCI_STATUS_DISCOVERY_TEAR_DOWN 0xa2
52/* RF Interface Specific Status Codes */ 52/* RF Interface Specific Status Codes */
53#define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0 53#define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0
54#define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1 54#define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1
55#define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2 55#define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2
56#define NCI_STATUS_RF_LINK_LOSS_ERROR 0xb3
57/* NFCEE Interface Specific Status Codes */ 56/* NFCEE Interface Specific Status Codes */
58#define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0 57#define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0
59#define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1 58#define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1
@@ -73,6 +72,21 @@
73#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 72#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83
74#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 73#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85
75 74
75/* NCI RF Technologies */
76#define NCI_NFC_RF_TECHNOLOGY_A 0x00
77#define NCI_NFC_RF_TECHNOLOGY_B 0x01
78#define NCI_NFC_RF_TECHNOLOGY_F 0x02
79#define NCI_NFC_RF_TECHNOLOGY_15693 0x03
80
81/* NCI Bit Rates */
82#define NCI_NFC_BIT_RATE_106 0x00
83#define NCI_NFC_BIT_RATE_212 0x01
84#define NCI_NFC_BIT_RATE_424 0x02
85#define NCI_NFC_BIT_RATE_848 0x03
86#define NCI_NFC_BIT_RATE_1696 0x04
87#define NCI_NFC_BIT_RATE_3392 0x05
88#define NCI_NFC_BIT_RATE_6784 0x06
89
76/* NCI RF Protocols */ 90/* NCI RF Protocols */
77#define NCI_RF_PROTOCOL_UNKNOWN 0x00 91#define NCI_RF_PROTOCOL_UNKNOWN 0x00
78#define NCI_RF_PROTOCOL_T1T 0x01 92#define NCI_RF_PROTOCOL_T1T 0x01
@@ -82,11 +96,18 @@
82#define NCI_RF_PROTOCOL_NFC_DEP 0x05 96#define NCI_RF_PROTOCOL_NFC_DEP 0x05
83 97
84/* NCI RF Interfaces */ 98/* NCI RF Interfaces */
85#define NCI_RF_INTERFACE_RFU 0x00 99#define NCI_RF_INTERFACE_NFCEE_DIRECT 0x00
86#define NCI_RF_INTERFACE_FRAME 0x01 100#define NCI_RF_INTERFACE_FRAME 0x01
87#define NCI_RF_INTERFACE_ISO_DEP 0x02 101#define NCI_RF_INTERFACE_ISO_DEP 0x02
88#define NCI_RF_INTERFACE_NFC_DEP 0x03 102#define NCI_RF_INTERFACE_NFC_DEP 0x03
89 103
104/* NCI Reset types */
105#define NCI_RESET_TYPE_KEEP_CONFIG 0x00
106#define NCI_RESET_TYPE_RESET_CONFIG 0x01
107
108/* NCI Static RF connection ID */
109#define NCI_STATIC_RF_CONN_ID 0x00
110
90/* NCI RF_DISCOVER_MAP_CMD modes */ 111/* NCI RF_DISCOVER_MAP_CMD modes */
91#define NCI_DISC_MAP_MODE_POLL 0x01 112#define NCI_DISC_MAP_MODE_POLL 0x01
92#define NCI_DISC_MAP_MODE_LISTEN 0x02 113#define NCI_DISC_MAP_MODE_LISTEN 0x02
@@ -98,8 +119,6 @@
98#define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02 119#define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02
99#define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03 120#define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03
100#define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05 121#define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05
101#define NCI_DISCOVERY_TYPE_WAKEUP_A_PASSIVE 0x06
102#define NCI_DISCOVERY_TYPE_WAKEUP_B_PASSIVE 0x07
103#define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09 122#define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09
104#define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80 123#define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80
105#define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81 124#define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81
@@ -111,8 +130,7 @@
111#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00 130#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
112#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01 131#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
113#define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02 132#define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02
114#define NCI_DEACTIVATE_TYPE_RF_LINK_LOSS 0x03 133#define NCI_DEACTIVATE_TYPE_DISCOVERY 0x03
115#define NCI_DEACTIVATE_TYPE_DISCOVERY_ERROR 0x04
116 134
117/* Message Type (MT) */ 135/* Message Type (MT) */
118#define NCI_MT_DATA_PKT 0x00 136#define NCI_MT_DATA_PKT 0x00
@@ -169,6 +187,9 @@ struct nci_data_hdr {
169/* ----- NCI Commands ---- */ 187/* ----- NCI Commands ---- */
170/* ------------------------ */ 188/* ------------------------ */
171#define NCI_OP_CORE_RESET_CMD nci_opcode_pack(NCI_GID_CORE, 0x00) 189#define NCI_OP_CORE_RESET_CMD nci_opcode_pack(NCI_GID_CORE, 0x00)
190struct nci_core_reset_cmd {
191 __u8 reset_type;
192} __packed;
172 193
173#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01) 194#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)
174 195
@@ -218,6 +239,7 @@ struct nci_rf_deactivate_cmd {
218struct nci_core_reset_rsp { 239struct nci_core_reset_rsp {
219 __u8 status; 240 __u8 status;
220 __u8 nci_ver; 241 __u8 nci_ver;
242 __u8 config_status;
221} __packed; 243} __packed;
222 244
223#define NCI_OP_CORE_INIT_RSP nci_opcode_pack(NCI_GID_CORE, 0x01) 245#define NCI_OP_CORE_INIT_RSP nci_opcode_pack(NCI_GID_CORE, 0x01)
@@ -232,10 +254,12 @@ struct nci_core_init_rsp_1 {
232struct nci_core_init_rsp_2 { 254struct nci_core_init_rsp_2 {
233 __u8 max_logical_connections; 255 __u8 max_logical_connections;
234 __le16 max_routing_table_size; 256 __le16 max_routing_table_size;
235 __u8 max_control_packet_payload_length; 257 __u8 max_ctrl_pkt_payload_len;
236 __le16 rf_sending_buffer_size; 258 __le16 max_size_for_large_params;
237 __le16 rf_receiving_buffer_size; 259 __u8 max_data_pkt_payload_size;
238 __le16 manufacturer_id; 260 __u8 initial_num_credits;
261 __u8 manufact_id;
262 __le32 manufact_specific_info;
239} __packed; 263} __packed;
240 264
241#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02) 265#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02)
@@ -275,7 +299,7 @@ struct nci_rf_field_info_ntf {
275 __u8 rf_field_status; 299 __u8 rf_field_status;
276} __packed; 300} __packed;
277 301
278#define NCI_OP_RF_ACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05) 302#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
279struct rf_tech_specific_params_nfca_poll { 303struct rf_tech_specific_params_nfca_poll {
280 __u16 sens_res; 304 __u16 sens_res;
281 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ 305 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
@@ -289,17 +313,20 @@ struct activation_params_nfca_poll_iso_dep {
289 __u8 rats_res[20]; 313 __u8 rats_res[20];
290}; 314};
291 315
292struct nci_rf_activate_ntf { 316struct nci_rf_intf_activated_ntf {
293 __u8 target_handle; 317 __u8 rf_discovery_id;
318 __u8 rf_interface_type;
294 __u8 rf_protocol; 319 __u8 rf_protocol;
295 __u8 rf_tech_and_mode; 320 __u8 activation_rf_tech_and_mode;
296 __u8 rf_tech_specific_params_len; 321 __u8 rf_tech_specific_params_len;
297 322
298 union { 323 union {
299 struct rf_tech_specific_params_nfca_poll nfca_poll; 324 struct rf_tech_specific_params_nfca_poll nfca_poll;
300 } rf_tech_specific_params; 325 } rf_tech_specific_params;
301 326
302 __u8 rf_interface_type; 327 __u8 data_exch_rf_tech_and_mode;
328 __u8 data_exch_tx_bit_rate;
329 __u8 data_exch_rx_bit_rate;
303 __u8 activation_params_len; 330 __u8 activation_params_len;
304 331
305 union { 332 union {
@@ -309,5 +336,9 @@ struct nci_rf_activate_ntf {
309} __packed; 336} __packed;
310 337
311#define NCI_OP_RF_DEACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) 338#define NCI_OP_RF_DEACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
339struct nci_rf_deactivate_ntf {
340 __u8 type;
341 __u8 reason;
342} __packed;
312 343
313#endif /* __NCI_H */ 344#endif /* __NCI_H */