blob: 1894e92b15ea606d6854c12176cda38d8cbced75 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_NFC_H
20#define __LINUX_NFC_H
21#include <linux/types.h>
22#include <linux/socket.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define NFC_GENL_NAME "nfc"
25#define NFC_GENL_VERSION 1
26#define NFC_GENL_MCAST_EVENT_NAME "events"
27enum nfc_commands {
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 NFC_CMD_UNSPEC,
30 NFC_CMD_GET_DEVICE,
31 NFC_CMD_DEV_UP,
32 NFC_CMD_DEV_DOWN,
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034 NFC_CMD_DEP_LINK_UP,
35 NFC_CMD_DEP_LINK_DOWN,
36 NFC_CMD_START_POLL,
37 NFC_CMD_STOP_POLL,
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 NFC_CMD_GET_TARGET,
40 NFC_EVENT_TARGETS_FOUND,
41 NFC_EVENT_DEVICE_ADDED,
42 NFC_EVENT_DEVICE_REMOVED,
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 NFC_EVENT_TARGET_LOST,
45 NFC_EVENT_TM_ACTIVATED,
46 NFC_EVENT_TM_DEACTIVATED,
47 NFC_CMD_LLC_GET_PARAMS,
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 NFC_CMD_LLC_SET_PARAMS,
50 NFC_CMD_ENABLE_SE,
51 NFC_CMD_DISABLE_SE,
52 NFC_CMD_LLC_SDREQ,
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 NFC_EVENT_LLC_SDRES,
55 NFC_CMD_FW_DOWNLOAD,
56 NFC_EVENT_SE_ADDED,
57 NFC_EVENT_SE_REMOVED,
Christopher Ferris38062f92014-07-09 15:33:25 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 NFC_EVENT_SE_CONNECTIVITY,
60 NFC_EVENT_SE_TRANSACTION,
61 NFC_CMD_GET_SE,
62 NFC_CMD_SE_IO,
Christopher Ferris38062f92014-07-09 15:33:25 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080064 NFC_CMD_ACTIVATE_TARGET,
65 NFC_CMD_VENDOR,
Tao Baod7db5942015-01-28 10:07:51 -080066 __NFC_CMD_AFTER_LAST
Ben Cheng655a7c02013-10-16 16:09:24 -070067};
Christopher Ferris05d08e92016-02-04 13:16:38 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080070enum nfc_attrs {
Tao Baod7db5942015-01-28 10:07:51 -080071 NFC_ATTR_UNSPEC,
72 NFC_ATTR_DEVICE_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074 NFC_ATTR_DEVICE_NAME,
75 NFC_ATTR_PROTOCOLS,
Tao Baod7db5942015-01-28 10:07:51 -080076 NFC_ATTR_TARGET_INDEX,
77 NFC_ATTR_TARGET_SENS_RES,
Christopher Ferris05d08e92016-02-04 13:16:38 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 NFC_ATTR_TARGET_SEL_RES,
80 NFC_ATTR_TARGET_NFCID1,
Tao Baod7db5942015-01-28 10:07:51 -080081 NFC_ATTR_TARGET_SENSB_RES,
82 NFC_ATTR_TARGET_SENSF_RES,
Christopher Ferris05d08e92016-02-04 13:16:38 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080084 NFC_ATTR_COMM_MODE,
85 NFC_ATTR_RF_MODE,
Tao Baod7db5942015-01-28 10:07:51 -080086 NFC_ATTR_DEVICE_POWERED,
87 NFC_ATTR_IM_PROTOCOLS,
Christopher Ferris05d08e92016-02-04 13:16:38 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 NFC_ATTR_TM_PROTOCOLS,
90 NFC_ATTR_LLC_PARAM_LTO,
Tao Baod7db5942015-01-28 10:07:51 -080091 NFC_ATTR_LLC_PARAM_RW,
92 NFC_ATTR_LLC_PARAM_MIUX,
Christopher Ferris05d08e92016-02-04 13:16:38 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 NFC_ATTR_SE,
95 NFC_ATTR_LLC_SDP,
Tao Baod7db5942015-01-28 10:07:51 -080096 NFC_ATTR_FIRMWARE_NAME,
97 NFC_ATTR_SE_INDEX,
Christopher Ferris05d08e92016-02-04 13:16:38 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 NFC_ATTR_SE_TYPE,
100 NFC_ATTR_SE_AID,
Tao Baod7db5942015-01-28 10:07:51 -0800101 NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS,
102 NFC_ATTR_SE_APDU,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 NFC_ATTR_TARGET_ISO15693_DSFID,
105 NFC_ATTR_TARGET_ISO15693_UID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 NFC_ATTR_SE_PARAMS,
107 NFC_ATTR_VENDOR_ID,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109 NFC_ATTR_VENDOR_SUBCMD,
110 NFC_ATTR_VENDOR_DATA,
Tao Baod7db5942015-01-28 10:07:51 -0800111 __NFC_ATTR_AFTER_LAST
Ben Cheng655a7c02013-10-16 16:09:24 -0700112};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700114#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700115enum nfc_sdp_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800116 NFC_SDP_ATTR_UNSPEC,
117 NFC_SDP_ATTR_URI,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 NFC_SDP_ATTR_SAP,
120 __NFC_SDP_ATTR_AFTER_LAST
Ben Cheng655a7c02013-10-16 16:09:24 -0700121};
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700124#define NFC_DEVICE_NAME_MAXSIZE 8
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800125#define NFC_NFCID1_MAXSIZE 10
Christopher Ferris38062f92014-07-09 15:33:25 -0700126#define NFC_NFCID2_MAXSIZE 8
127#define NFC_NFCID3_MAXSIZE 10
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define NFC_SENSB_RES_MAXSIZE 12
130#define NFC_SENSF_RES_MAXSIZE 18
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131#define NFC_ATR_REQ_MAXSIZE 64
132#define NFC_ATR_RES_MAXSIZE 64
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800134#define NFC_ATR_REQ_GB_MAXSIZE 48
135#define NFC_ATR_RES_GB_MAXSIZE 47
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define NFC_GB_MAXSIZE 48
Christopher Ferris38062f92014-07-09 15:33:25 -0700137#define NFC_FIRMWARE_NAME_MAXSIZE 32
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700139#define NFC_ISO15693_UID_MAXSIZE 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define NFC_PROTO_JEWEL 1
141#define NFC_PROTO_MIFARE 2
142#define NFC_PROTO_FELICA 3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define NFC_PROTO_ISO14443 4
145#define NFC_PROTO_NFC_DEP 5
146#define NFC_PROTO_ISO14443_B 6
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700147#define NFC_PROTO_ISO15693 7
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700149#define NFC_PROTO_MAX 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define NFC_COMM_ACTIVE 0
151#define NFC_COMM_PASSIVE 1
152#define NFC_RF_INITIATOR 0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define NFC_RF_TARGET 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define NFC_RF_NONE 2
156#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
157#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
161#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
162#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700164#define NFC_PROTO_ISO15693_MASK (1 << NFC_PROTO_ISO15693)
Ben Cheng655a7c02013-10-16 16:09:24 -0700165#define NFC_SE_UICC 0x1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700166#define NFC_SE_EMBEDDED 0x2
Christopher Ferris38062f92014-07-09 15:33:25 -0700167#define NFC_SE_DISABLED 0x0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700169#define NFC_SE_ENABLED 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700170struct sockaddr_nfc {
Tao Baod7db5942015-01-28 10:07:51 -0800171 sa_family_t sa_family;
172 __u32 dev_idx;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u32 target_idx;
175 __u32 nfc_protocol;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700176};
Christopher Ferris38062f92014-07-09 15:33:25 -0700177#define NFC_LLCP_MAX_SERVICE_NAME 63
Christopher Ferris05d08e92016-02-04 13:16:38 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700179struct sockaddr_nfc_llcp {
Tao Baod7db5942015-01-28 10:07:51 -0800180 sa_family_t sa_family;
Tao Baod7db5942015-01-28 10:07:51 -0800181 __u32 dev_idx;
182 __u32 target_idx;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 nfc_protocol;
185 __u8 dsap;
Tao Baod7db5942015-01-28 10:07:51 -0800186 __u8 ssap;
187 char service_name[NFC_LLCP_MAX_SERVICE_NAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189;
190 size_t service_name_len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700191};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700192#define NFC_SOCKPROTO_RAW 0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700194#define NFC_SOCKPROTO_LLCP 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700195#define NFC_SOCKPROTO_MAX 2
Tao Baod7db5942015-01-28 10:07:51 -0800196#define NFC_HEADER_SIZE 1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700197#define NFC_RAW_HEADER_SIZE 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700199#define NFC_DIRECTION_RX 0x00
200#define NFC_DIRECTION_TX 0x01
Tao Baod7db5942015-01-28 10:07:51 -0800201#define RAW_PAYLOAD_LLCP 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700202#define RAW_PAYLOAD_NCI 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700204#define RAW_PAYLOAD_HCI 2
205#define RAW_PAYLOAD_DIGITAL 3
Tao Baod7db5942015-01-28 10:07:51 -0800206#define RAW_PAYLOAD_PROPRIETARY 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define NFC_LLCP_RW 0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700209#define NFC_LLCP_MIUX 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700210#define NFC_LLCP_REMOTE_MIU 2
Tao Baod7db5942015-01-28 10:07:51 -0800211#define NFC_LLCP_REMOTE_LTO 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700212#define NFC_LLCP_REMOTE_RW 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700214#endif