diff options
Diffstat (limited to 'include/net/nfc/nci.h')
| -rw-r--r-- | include/net/nfc/nci.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index e7257a4653b4..a2f2f3d3196d 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
| @@ -62,6 +62,25 @@ | |||
| 62 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 | 62 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc2 |
| 63 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 | 63 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc3 |
| 64 | 64 | ||
| 65 | /* NFCEE Interface/Protocols */ | ||
| 66 | #define NCI_NFCEE_INTERFACE_APDU 0x00 | ||
| 67 | #define NCI_NFCEE_INTERFACE_HCI_ACCESS 0x01 | ||
| 68 | #define NCI_NFCEE_INTERFACE_TYPE3_CMD_SET 0x02 | ||
| 69 | #define NCI_NFCEE_INTERFACE_TRANSPARENT 0x03 | ||
| 70 | |||
| 71 | /* Destination type */ | ||
| 72 | #define NCI_DESTINATION_NFCC_LOOPBACK 0x01 | ||
| 73 | #define NCI_DESTINATION_REMOTE_NFC_ENDPOINT 0x02 | ||
| 74 | #define NCI_DESTINATION_NFCEE 0x03 | ||
| 75 | |||
| 76 | /* Destination-specific parameters type */ | ||
| 77 | #define NCI_DESTINATION_SPECIFIC_PARAM_RF_TYPE 0x00 | ||
| 78 | #define NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE 0x01 | ||
| 79 | |||
| 80 | /* NFCEE Discovery Action */ | ||
| 81 | #define NCI_NFCEE_DISCOVERY_ACTION_DISABLE 0x00 | ||
| 82 | #define NCI_NFCEE_DISCOVERY_ACTION_ENABLE 0x01 | ||
| 83 | |||
| 65 | /* NCI RF Technology and Mode */ | 84 | /* NCI RF Technology and Mode */ |
| 66 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 | 85 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 |
| 67 | #define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 | 86 | #define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 |
| @@ -224,6 +243,28 @@ struct nci_core_set_config_cmd { | |||
| 224 | struct set_config_param param; /* support 1 param per cmd is enough */ | 243 | struct set_config_param param; /* support 1 param per cmd is enough */ |
| 225 | } __packed; | 244 | } __packed; |
| 226 | 245 | ||
| 246 | #define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
| 247 | #define DEST_SPEC_PARAMS_ID_INDEX 0 | ||
| 248 | #define DEST_SPEC_PARAMS_PROTOCOL_INDEX 1 | ||
| 249 | struct dest_spec_params { | ||
| 250 | __u8 id; | ||
| 251 | __u8 protocol; | ||
| 252 | } __packed; | ||
| 253 | |||
| 254 | struct core_conn_create_dest_spec_params { | ||
| 255 | __u8 type; | ||
| 256 | __u8 length; | ||
| 257 | __u8 value[0]; | ||
| 258 | } __packed; | ||
| 259 | |||
| 260 | struct nci_core_conn_create_cmd { | ||
| 261 | __u8 destination_type; | ||
| 262 | __u8 number_destination_params; | ||
| 263 | struct core_conn_create_dest_spec_params params[0]; | ||
| 264 | } __packed; | ||
| 265 | |||
| 266 | #define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x05) | ||
| 267 | |||
| 227 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 268 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
| 228 | struct disc_map_config { | 269 | struct disc_map_config { |
| 229 | __u8 rf_protocol; | 270 | __u8 rf_protocol; |
| @@ -260,6 +301,19 @@ struct nci_rf_deactivate_cmd { | |||
| 260 | __u8 type; | 301 | __u8 type; |
| 261 | } __packed; | 302 | } __packed; |
| 262 | 303 | ||
| 304 | #define NCI_OP_NFCEE_DISCOVER_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
| 305 | struct nci_nfcee_discover_cmd { | ||
| 306 | __u8 discovery_action; | ||
| 307 | } __packed; | ||
| 308 | |||
| 309 | #define NCI_OP_NFCEE_MODE_SET_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01) | ||
| 310 | #define NCI_NFCEE_DISABLE 0x00 | ||
| 311 | #define NCI_NFCEE_ENABLE 0x01 | ||
| 312 | struct nci_nfcee_mode_set_cmd { | ||
| 313 | __u8 nfcee_id; | ||
| 314 | __u8 nfcee_mode; | ||
| 315 | } __packed; | ||
| 316 | |||
| 263 | /* ----------------------- */ | 317 | /* ----------------------- */ |
| 264 | /* ---- NCI Responses ---- */ | 318 | /* ---- NCI Responses ---- */ |
| 265 | /* ----------------------- */ | 319 | /* ----------------------- */ |
| @@ -295,6 +349,16 @@ struct nci_core_set_config_rsp { | |||
| 295 | __u8 params_id[0]; /* variable size array */ | 349 | __u8 params_id[0]; /* variable size array */ |
| 296 | } __packed; | 350 | } __packed; |
| 297 | 351 | ||
| 352 | #define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
| 353 | struct nci_core_conn_create_rsp { | ||
| 354 | __u8 status; | ||
| 355 | __u8 max_ctrl_pkt_payload_len; | ||
| 356 | __u8 credits_cnt; | ||
| 357 | __u8 conn_id; | ||
| 358 | } __packed; | ||
| 359 | |||
| 360 | #define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x05) | ||
| 361 | |||
| 298 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 362 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
| 299 | 363 | ||
| 300 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | 364 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) |
| @@ -303,6 +367,13 @@ struct nci_core_set_config_rsp { | |||
| 303 | 367 | ||
| 304 | #define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) | 368 | #define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) |
| 305 | 369 | ||
| 370 | #define NCI_OP_NFCEE_DISCOVER_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
| 371 | struct nci_nfcee_discover_rsp { | ||
| 372 | __u8 status; | ||
| 373 | __u8 num_nfcee; | ||
| 374 | } __packed; | ||
| 375 | |||
| 376 | #define NCI_OP_NFCEE_MODE_SET_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01) | ||
| 306 | /* --------------------------- */ | 377 | /* --------------------------- */ |
| 307 | /* ---- NCI Notifications ---- */ | 378 | /* ---- NCI Notifications ---- */ |
| 308 | /* --------------------------- */ | 379 | /* --------------------------- */ |
| @@ -430,4 +501,30 @@ struct nci_rf_deactivate_ntf { | |||
| 430 | __u8 reason; | 501 | __u8 reason; |
| 431 | } __packed; | 502 | } __packed; |
| 432 | 503 | ||
| 504 | #define NCI_OP_RF_NFCEE_ACTION_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x09) | ||
| 505 | struct nci_rf_nfcee_action_ntf { | ||
| 506 | __u8 nfcee_id; | ||
| 507 | __u8 trigger; | ||
| 508 | __u8 supported_data_length; | ||
| 509 | __u8 supported_data[0]; | ||
| 510 | } __packed; | ||
| 511 | |||
| 512 | #define NCI_OP_NFCEE_DISCOVER_NTF nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00) | ||
| 513 | struct nci_nfcee_supported_protocol { | ||
| 514 | __u8 num_protocol; | ||
| 515 | __u8 supported_protocol[0]; | ||
| 516 | } __packed; | ||
| 517 | |||
| 518 | struct nci_nfcee_information_tlv { | ||
| 519 | __u8 num_tlv; | ||
| 520 | __u8 information_tlv[0]; | ||
| 521 | } __packed; | ||
| 522 | |||
| 523 | struct nci_nfcee_discover_ntf { | ||
| 524 | __u8 nfcee_id; | ||
| 525 | __u8 nfcee_status; | ||
| 526 | struct nci_nfcee_supported_protocol supported_protocols; | ||
| 527 | struct nci_nfcee_information_tlv information_tlv; | ||
| 528 | } __packed; | ||
| 529 | |||
| 433 | #endif /* __NCI_H */ | 530 | #endif /* __NCI_H */ |
