122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef __LINUX_NFC_H
2022851890Sopenharmony_ci#define __LINUX_NFC_H
2122851890Sopenharmony_ci#include <linux/types.h>
2222851890Sopenharmony_ci#include <linux/socket.h>
2322851890Sopenharmony_ci#define NFC_GENL_NAME "nfc"
2422851890Sopenharmony_ci#define NFC_GENL_VERSION 1
2522851890Sopenharmony_ci#define NFC_GENL_MCAST_EVENT_NAME "events"
2622851890Sopenharmony_cienum nfc_commands {
2722851890Sopenharmony_ci  NFC_CMD_UNSPEC,
2822851890Sopenharmony_ci  NFC_CMD_GET_DEVICE,
2922851890Sopenharmony_ci  NFC_CMD_DEV_UP,
3022851890Sopenharmony_ci  NFC_CMD_DEV_DOWN,
3122851890Sopenharmony_ci  NFC_CMD_DEP_LINK_UP,
3222851890Sopenharmony_ci  NFC_CMD_DEP_LINK_DOWN,
3322851890Sopenharmony_ci  NFC_CMD_START_POLL,
3422851890Sopenharmony_ci  NFC_CMD_STOP_POLL,
3522851890Sopenharmony_ci  NFC_CMD_GET_TARGET,
3622851890Sopenharmony_ci  NFC_EVENT_TARGETS_FOUND,
3722851890Sopenharmony_ci  NFC_EVENT_DEVICE_ADDED,
3822851890Sopenharmony_ci  NFC_EVENT_DEVICE_REMOVED,
3922851890Sopenharmony_ci  NFC_EVENT_TARGET_LOST,
4022851890Sopenharmony_ci  NFC_EVENT_TM_ACTIVATED,
4122851890Sopenharmony_ci  NFC_EVENT_TM_DEACTIVATED,
4222851890Sopenharmony_ci  NFC_CMD_LLC_GET_PARAMS,
4322851890Sopenharmony_ci  NFC_CMD_LLC_SET_PARAMS,
4422851890Sopenharmony_ci  NFC_CMD_ENABLE_SE,
4522851890Sopenharmony_ci  NFC_CMD_DISABLE_SE,
4622851890Sopenharmony_ci  NFC_CMD_LLC_SDREQ,
4722851890Sopenharmony_ci  NFC_EVENT_LLC_SDRES,
4822851890Sopenharmony_ci  NFC_CMD_FW_DOWNLOAD,
4922851890Sopenharmony_ci  NFC_EVENT_SE_ADDED,
5022851890Sopenharmony_ci  NFC_EVENT_SE_REMOVED,
5122851890Sopenharmony_ci  NFC_EVENT_SE_CONNECTIVITY,
5222851890Sopenharmony_ci  NFC_EVENT_SE_TRANSACTION,
5322851890Sopenharmony_ci  NFC_CMD_GET_SE,
5422851890Sopenharmony_ci  NFC_CMD_SE_IO,
5522851890Sopenharmony_ci  NFC_CMD_ACTIVATE_TARGET,
5622851890Sopenharmony_ci  NFC_CMD_VENDOR,
5722851890Sopenharmony_ci  NFC_CMD_DEACTIVATE_TARGET,
5822851890Sopenharmony_ci  __NFC_CMD_AFTER_LAST
5922851890Sopenharmony_ci};
6022851890Sopenharmony_ci#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
6122851890Sopenharmony_cienum nfc_attrs {
6222851890Sopenharmony_ci  NFC_ATTR_UNSPEC,
6322851890Sopenharmony_ci  NFC_ATTR_DEVICE_INDEX,
6422851890Sopenharmony_ci  NFC_ATTR_DEVICE_NAME,
6522851890Sopenharmony_ci  NFC_ATTR_PROTOCOLS,
6622851890Sopenharmony_ci  NFC_ATTR_TARGET_INDEX,
6722851890Sopenharmony_ci  NFC_ATTR_TARGET_SENS_RES,
6822851890Sopenharmony_ci  NFC_ATTR_TARGET_SEL_RES,
6922851890Sopenharmony_ci  NFC_ATTR_TARGET_NFCID1,
7022851890Sopenharmony_ci  NFC_ATTR_TARGET_SENSB_RES,
7122851890Sopenharmony_ci  NFC_ATTR_TARGET_SENSF_RES,
7222851890Sopenharmony_ci  NFC_ATTR_COMM_MODE,
7322851890Sopenharmony_ci  NFC_ATTR_RF_MODE,
7422851890Sopenharmony_ci  NFC_ATTR_DEVICE_POWERED,
7522851890Sopenharmony_ci  NFC_ATTR_IM_PROTOCOLS,
7622851890Sopenharmony_ci  NFC_ATTR_TM_PROTOCOLS,
7722851890Sopenharmony_ci  NFC_ATTR_LLC_PARAM_LTO,
7822851890Sopenharmony_ci  NFC_ATTR_LLC_PARAM_RW,
7922851890Sopenharmony_ci  NFC_ATTR_LLC_PARAM_MIUX,
8022851890Sopenharmony_ci  NFC_ATTR_SE,
8122851890Sopenharmony_ci  NFC_ATTR_LLC_SDP,
8222851890Sopenharmony_ci  NFC_ATTR_FIRMWARE_NAME,
8322851890Sopenharmony_ci  NFC_ATTR_SE_INDEX,
8422851890Sopenharmony_ci  NFC_ATTR_SE_TYPE,
8522851890Sopenharmony_ci  NFC_ATTR_SE_AID,
8622851890Sopenharmony_ci  NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS,
8722851890Sopenharmony_ci  NFC_ATTR_SE_APDU,
8822851890Sopenharmony_ci  NFC_ATTR_TARGET_ISO15693_DSFID,
8922851890Sopenharmony_ci  NFC_ATTR_TARGET_ISO15693_UID,
9022851890Sopenharmony_ci  NFC_ATTR_SE_PARAMS,
9122851890Sopenharmony_ci  NFC_ATTR_VENDOR_ID,
9222851890Sopenharmony_ci  NFC_ATTR_VENDOR_SUBCMD,
9322851890Sopenharmony_ci  NFC_ATTR_VENDOR_DATA,
9422851890Sopenharmony_ci  __NFC_ATTR_AFTER_LAST
9522851890Sopenharmony_ci};
9622851890Sopenharmony_ci#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
9722851890Sopenharmony_cienum nfc_sdp_attr {
9822851890Sopenharmony_ci  NFC_SDP_ATTR_UNSPEC,
9922851890Sopenharmony_ci  NFC_SDP_ATTR_URI,
10022851890Sopenharmony_ci  NFC_SDP_ATTR_SAP,
10122851890Sopenharmony_ci  __NFC_SDP_ATTR_AFTER_LAST
10222851890Sopenharmony_ci};
10322851890Sopenharmony_ci#define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1)
10422851890Sopenharmony_ci#define NFC_DEVICE_NAME_MAXSIZE 8
10522851890Sopenharmony_ci#define NFC_NFCID1_MAXSIZE 10
10622851890Sopenharmony_ci#define NFC_NFCID2_MAXSIZE 8
10722851890Sopenharmony_ci#define NFC_NFCID3_MAXSIZE 10
10822851890Sopenharmony_ci#define NFC_SENSB_RES_MAXSIZE 12
10922851890Sopenharmony_ci#define NFC_SENSF_RES_MAXSIZE 18
11022851890Sopenharmony_ci#define NFC_ATR_REQ_MAXSIZE 64
11122851890Sopenharmony_ci#define NFC_ATR_RES_MAXSIZE 64
11222851890Sopenharmony_ci#define NFC_ATR_REQ_GB_MAXSIZE 48
11322851890Sopenharmony_ci#define NFC_ATR_RES_GB_MAXSIZE 47
11422851890Sopenharmony_ci#define NFC_GB_MAXSIZE 48
11522851890Sopenharmony_ci#define NFC_FIRMWARE_NAME_MAXSIZE 32
11622851890Sopenharmony_ci#define NFC_ISO15693_UID_MAXSIZE 8
11722851890Sopenharmony_ci#define NFC_PROTO_JEWEL 1
11822851890Sopenharmony_ci#define NFC_PROTO_MIFARE 2
11922851890Sopenharmony_ci#define NFC_PROTO_FELICA 3
12022851890Sopenharmony_ci#define NFC_PROTO_ISO14443 4
12122851890Sopenharmony_ci#define NFC_PROTO_NFC_DEP 5
12222851890Sopenharmony_ci#define NFC_PROTO_ISO14443_B 6
12322851890Sopenharmony_ci#define NFC_PROTO_ISO15693 7
12422851890Sopenharmony_ci#define NFC_PROTO_MAX 8
12522851890Sopenharmony_ci#define NFC_COMM_ACTIVE 0
12622851890Sopenharmony_ci#define NFC_COMM_PASSIVE 1
12722851890Sopenharmony_ci#define NFC_RF_INITIATOR 0
12822851890Sopenharmony_ci#define NFC_RF_TARGET 1
12922851890Sopenharmony_ci#define NFC_RF_NONE 2
13022851890Sopenharmony_ci#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
13122851890Sopenharmony_ci#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
13222851890Sopenharmony_ci#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
13322851890Sopenharmony_ci#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
13422851890Sopenharmony_ci#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
13522851890Sopenharmony_ci#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
13622851890Sopenharmony_ci#define NFC_PROTO_ISO15693_MASK (1 << NFC_PROTO_ISO15693)
13722851890Sopenharmony_ci#define NFC_SE_UICC 0x1
13822851890Sopenharmony_ci#define NFC_SE_EMBEDDED 0x2
13922851890Sopenharmony_ci#define NFC_SE_DISABLED 0x0
14022851890Sopenharmony_ci#define NFC_SE_ENABLED 0x1
14122851890Sopenharmony_cistruct sockaddr_nfc {
14222851890Sopenharmony_ci  sa_family_t sa_family;
14322851890Sopenharmony_ci  __u32 dev_idx;
14422851890Sopenharmony_ci  __u32 target_idx;
14522851890Sopenharmony_ci  __u32 nfc_protocol;
14622851890Sopenharmony_ci};
14722851890Sopenharmony_ci#define NFC_LLCP_MAX_SERVICE_NAME 63
14822851890Sopenharmony_cistruct sockaddr_nfc_llcp {
14922851890Sopenharmony_ci  sa_family_t sa_family;
15022851890Sopenharmony_ci  __u32 dev_idx;
15122851890Sopenharmony_ci  __u32 target_idx;
15222851890Sopenharmony_ci  __u32 nfc_protocol;
15322851890Sopenharmony_ci  __u8 dsap;
15422851890Sopenharmony_ci  __u8 ssap;
15522851890Sopenharmony_ci  char service_name[NFC_LLCP_MAX_SERVICE_NAME];
15622851890Sopenharmony_ci;
15722851890Sopenharmony_ci  size_t service_name_len;
15822851890Sopenharmony_ci};
15922851890Sopenharmony_ci#define NFC_SOCKPROTO_RAW 0
16022851890Sopenharmony_ci#define NFC_SOCKPROTO_LLCP 1
16122851890Sopenharmony_ci#define NFC_SOCKPROTO_MAX 2
16222851890Sopenharmony_ci#define NFC_HEADER_SIZE 1
16322851890Sopenharmony_ci#define NFC_RAW_HEADER_SIZE 2
16422851890Sopenharmony_ci#define NFC_DIRECTION_RX 0x00
16522851890Sopenharmony_ci#define NFC_DIRECTION_TX 0x01
16622851890Sopenharmony_ci#define RAW_PAYLOAD_LLCP 0
16722851890Sopenharmony_ci#define RAW_PAYLOAD_NCI 1
16822851890Sopenharmony_ci#define RAW_PAYLOAD_HCI 2
16922851890Sopenharmony_ci#define RAW_PAYLOAD_DIGITAL 3
17022851890Sopenharmony_ci#define RAW_PAYLOAD_PROPRIETARY 4
17122851890Sopenharmony_ci#define NFC_LLCP_RW 0
17222851890Sopenharmony_ci#define NFC_LLCP_MIUX 1
17322851890Sopenharmony_ci#define NFC_LLCP_REMOTE_MIU 2
17422851890Sopenharmony_ci#define NFC_LLCP_REMOTE_LTO 3
17522851890Sopenharmony_ci#define NFC_LLCP_REMOTE_RW 4
17622851890Sopenharmony_ci#endif
177