Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  The NFC Controller Interface is the communication protocol between an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *  NFC Controller (NFCC) and a Device Host (DH).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *  Copyright (C) 2014 Marvell International Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Copyright (C) 2011 Texas Instruments, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  Written by Ilan Elias <ilane@ti.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *  Acknowledgements:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *  This file is based on hci.h, which was written
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  *  by Maxim Krasnyansky.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #ifndef __NCI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define __NCI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <net/nfc/nfc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) /* NCI constants */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define NCI_MAX_NUM_MAPPING_CONFIGS				10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define NCI_MAX_NUM_RF_CONFIGS					10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define NCI_MAX_NUM_CONN					10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define NCI_MAX_PARAM_LEN					251
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define NCI_MAX_PAYLOAD_SIZE					255
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define NCI_MAX_PACKET_SIZE					258
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) /* NCI Status Codes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define NCI_STATUS_OK						0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define NCI_STATUS_REJECTED					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #define NCI_STATUS_RF_FRAME_CORRUPTED				0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define NCI_STATUS_FAILED					0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define NCI_STATUS_NOT_INITIALIZED				0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #define NCI_STATUS_SYNTAX_ERROR					0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define NCI_STATUS_SEMANTIC_ERROR				0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define NCI_STATUS_UNKNOWN_GID					0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define NCI_STATUS_UNKNOWN_OID					0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define NCI_STATUS_INVALID_PARAM				0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define NCI_STATUS_MESSAGE_SIZE_EXCEEDED			0x0a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) /* Discovery Specific Status Codes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define NCI_STATUS_DISCOVERY_ALREADY_STARTED			0xa0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED		0xa1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define NCI_STATUS_DISCOVERY_TEAR_DOWN				0xa2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) /* RF Interface Specific Status Codes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define NCI_STATUS_RF_TRANSMISSION_ERROR			0xb0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define NCI_STATUS_RF_PROTOCOL_ERROR				0xb1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define NCI_STATUS_RF_TIMEOUT_ERROR				0xb2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) /* NFCEE Interface Specific Status Codes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED		0xc0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #define NCI_STATUS_NFCEE_TRANSMISSION_ERROR			0xc1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define NCI_STATUS_NFCEE_PROTOCOL_ERROR				0xc2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define NCI_STATUS_NFCEE_TIMEOUT_ERROR				0xc3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) /* NFCEE Interface/Protocols */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #define NCI_NFCEE_INTERFACE_APDU           0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define NCI_NFCEE_INTERFACE_HCI_ACCESS     0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #define NCI_NFCEE_INTERFACE_TYPE3_CMD_SET  0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define NCI_NFCEE_INTERFACE_TRANSPARENT        0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) /* Destination type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #define NCI_DESTINATION_NFCC_LOOPBACK      0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define NCI_DESTINATION_REMOTE_NFC_ENDPOINT    0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) #define NCI_DESTINATION_NFCEE              0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) /* Destination-specific parameters type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #define NCI_DESTINATION_SPECIFIC_PARAM_RF_TYPE     0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE  0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) /* NFCEE Discovery Action */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define NCI_NFCEE_DISCOVERY_ACTION_DISABLE			0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define NCI_NFCEE_DISCOVERY_ACTION_ENABLE			0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) /* NCI RF Technology and Mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define NCI_NFC_A_PASSIVE_POLL_MODE				0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) #define NCI_NFC_B_PASSIVE_POLL_MODE				0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #define NCI_NFC_F_PASSIVE_POLL_MODE				0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) #define NCI_NFC_A_ACTIVE_POLL_MODE				0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #define NCI_NFC_F_ACTIVE_POLL_MODE				0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) #define NCI_NFC_V_PASSIVE_POLL_MODE				0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define NCI_NFC_A_PASSIVE_LISTEN_MODE				0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #define NCI_NFC_B_PASSIVE_LISTEN_MODE				0x81
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define NCI_NFC_F_PASSIVE_LISTEN_MODE				0x82
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) #define NCI_NFC_A_ACTIVE_LISTEN_MODE				0x83
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) #define NCI_NFC_F_ACTIVE_LISTEN_MODE				0x85
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #define NCI_RF_TECH_MODE_LISTEN_MASK				0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) /* NCI RF Technologies */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) #define NCI_NFC_RF_TECHNOLOGY_A					0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #define NCI_NFC_RF_TECHNOLOGY_B					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) #define NCI_NFC_RF_TECHNOLOGY_F					0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) #define NCI_NFC_RF_TECHNOLOGY_V					0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) /* NCI Bit Rates */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #define NCI_NFC_BIT_RATE_106					0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) #define NCI_NFC_BIT_RATE_212					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) #define NCI_NFC_BIT_RATE_424					0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define NCI_NFC_BIT_RATE_848					0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define NCI_NFC_BIT_RATE_1695					0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define NCI_NFC_BIT_RATE_3390					0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define NCI_NFC_BIT_RATE_6780					0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define NCI_NFC_BIT_RATE_26					0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /* NCI RF Protocols */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define NCI_RF_PROTOCOL_UNKNOWN					0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define NCI_RF_PROTOCOL_T1T					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define NCI_RF_PROTOCOL_T2T					0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define NCI_RF_PROTOCOL_T3T					0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #define NCI_RF_PROTOCOL_ISO_DEP					0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define NCI_RF_PROTOCOL_NFC_DEP					0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #define NCI_RF_PROTOCOL_T5T					0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) /* NCI RF Interfaces */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define NCI_RF_INTERFACE_NFCEE_DIRECT				0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define NCI_RF_INTERFACE_FRAME					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define NCI_RF_INTERFACE_ISO_DEP				0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define NCI_RF_INTERFACE_NFC_DEP				0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /* NCI Configuration Parameter Tags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define NCI_PN_ATR_REQ_GEN_BYTES				0x29
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define NCI_LN_ATR_RES_GEN_BYTES				0x61
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define NCI_LA_SEL_INFO						0x32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define NCI_LF_PROTOCOL_TYPE					0x50
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define NCI_LF_CON_BITR_F					0x54
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) /* NCI Configuration Parameters masks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #define NCI_LA_SEL_INFO_ISO_DEP_MASK				0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #define NCI_LA_SEL_INFO_NFC_DEP_MASK				0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #define NCI_LF_PROTOCOL_TYPE_NFC_DEP_MASK			0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) #define NCI_LF_CON_BITR_F_212					0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #define NCI_LF_CON_BITR_F_424					0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /* NCI Reset types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) #define NCI_RESET_TYPE_KEEP_CONFIG				0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) #define NCI_RESET_TYPE_RESET_CONFIG				0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) /* NCI Static RF connection ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #define NCI_STATIC_RF_CONN_ID					0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) /* NCI Data Flow Control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #define NCI_DATA_FLOW_CONTROL_NOT_USED				0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /* NCI RF_DISCOVER_MAP_CMD modes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #define NCI_DISC_MAP_MODE_POLL					0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #define NCI_DISC_MAP_MODE_LISTEN				0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /* NCI Discover Notification Type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define NCI_DISCOVER_NTF_TYPE_LAST				0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) #define NCI_DISCOVER_NTF_TYPE_LAST_NFCC				0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #define NCI_DISCOVER_NTF_TYPE_MORE				0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) /* NCI Deactivation Type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #define NCI_DEACTIVATE_TYPE_IDLE_MODE				0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #define NCI_DEACTIVATE_TYPE_SLEEP_MODE				0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE			0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #define NCI_DEACTIVATE_TYPE_DISCOVERY				0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) /* Message Type (MT) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #define NCI_MT_DATA_PKT						0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #define NCI_MT_CMD_PKT						0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) #define NCI_MT_RSP_PKT						0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #define NCI_MT_NTF_PKT						0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #define nci_mt(hdr)			(((hdr)[0]>>5)&0x07)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #define nci_mt_set(hdr, mt)		((hdr)[0] |= (__u8)(((mt)&0x07)<<5))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) /* Packet Boundary Flag (PBF) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #define NCI_PBF_LAST						0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #define NCI_PBF_CONT						0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) #define nci_pbf(hdr)			(__u8)(((hdr)[0]>>4)&0x01)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) #define nci_pbf_set(hdr, pbf)		((hdr)[0] |= (__u8)(((pbf)&0x01)<<4))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /* Control Opcode manipulation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #define nci_opcode_pack(gid, oid)	(__u16)((((__u16)((gid)&0x0f))<<8)|\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 					((__u16)((oid)&0x3f)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #define nci_opcode(hdr)			nci_opcode_pack(hdr[0], hdr[1])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) #define nci_opcode_gid(op)		(__u8)(((op)&0x0f00)>>8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #define nci_opcode_oid(op)		(__u8)((op)&0x003f)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) /* Payload Length */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) #define nci_plen(hdr)			(__u8)((hdr)[2])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) /* Connection ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #define nci_conn_id(hdr)		(__u8)(((hdr)[0])&0x0f)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) /* GID values */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #define NCI_GID_CORE						0x0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define NCI_GID_RF_MGMT						0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) #define NCI_GID_NFCEE_MGMT					0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) #define NCI_GID_PROPRIETARY					0xf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /* ----- NCI over SPI head/crc(tail) room needed for outgoing frames ----- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) #define NCI_SPI_HDR_LEN						4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) #define NCI_SPI_CRC_LEN						2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) /* ---- NCI Packet structures ---- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #define NCI_CTRL_HDR_SIZE					3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define NCI_DATA_HDR_SIZE					3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) struct nci_ctrl_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	__u8	gid;		/* MT & PBF & GID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	__u8	oid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	__u8	plen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) struct nci_data_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	__u8	conn_id;	/* MT & PBF & ConnID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	__u8	rfu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	__u8	plen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) /* ------------------------ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) /* -----  NCI Commands ---- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) /* ------------------------ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #define NCI_OP_CORE_RESET_CMD		nci_opcode_pack(NCI_GID_CORE, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) struct nci_core_reset_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	__u8	reset_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #define NCI_OP_CORE_INIT_CMD		nci_opcode_pack(NCI_GID_CORE, 0x01)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) #define NCI_OP_CORE_SET_CONFIG_CMD	nci_opcode_pack(NCI_GID_CORE, 0x02)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) struct set_config_param {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	__u8	id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	__u8	len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	__u8	val[NCI_MAX_PARAM_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) struct nci_core_set_config_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	__u8	num_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	struct	set_config_param param; /* support 1 param per cmd is enough */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #define NCI_OP_CORE_CONN_CREATE_CMD	nci_opcode_pack(NCI_GID_CORE, 0x04)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) #define DEST_SPEC_PARAMS_ID_INDEX	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #define DEST_SPEC_PARAMS_PROTOCOL_INDEX	1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) struct dest_spec_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	__u8    id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	__u8    protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) struct core_conn_create_dest_spec_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	__u8    type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	__u8    length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	__u8    value[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) struct nci_core_conn_create_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	__u8    destination_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	__u8    number_destination_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	struct core_conn_create_dest_spec_params params[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) #define NCI_OP_CORE_CONN_CLOSE_CMD	nci_opcode_pack(NCI_GID_CORE, 0x05)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) #define NCI_OP_RF_DISCOVER_MAP_CMD	nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) struct disc_map_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	__u8	rf_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	__u8	mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	__u8	rf_interface;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) struct nci_rf_disc_map_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	__u8				num_mapping_configs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	struct disc_map_config		mapping_configs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 					[NCI_MAX_NUM_MAPPING_CONFIGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) #define NCI_OP_RF_DISCOVER_CMD		nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) struct disc_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	__u8	rf_tech_and_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	__u8	frequency;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) struct nci_rf_disc_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	__u8				num_disc_configs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	struct disc_config		disc_configs[NCI_MAX_NUM_RF_CONFIGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #define NCI_OP_RF_DISCOVER_SELECT_CMD	nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) struct nci_rf_discover_select_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	__u8	rf_discovery_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	__u8	rf_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	__u8	rf_interface;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) #define NCI_OP_RF_DEACTIVATE_CMD	nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) struct nci_rf_deactivate_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	__u8	type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #define NCI_OP_NFCEE_DISCOVER_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) struct nci_nfcee_discover_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	__u8	discovery_action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) #define NCI_OP_NFCEE_MODE_SET_CMD nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) #define NCI_NFCEE_DISABLE	0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) #define NCI_NFCEE_ENABLE	0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) struct nci_nfcee_mode_set_cmd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	__u8	nfcee_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	__u8	nfcee_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) #define NCI_OP_CORE_GET_CONFIG_CMD	nci_opcode_pack(NCI_GID_CORE, 0x03)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) /* ----------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) /* ---- NCI Responses ---- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) /* ----------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #define NCI_OP_CORE_RESET_RSP		nci_opcode_pack(NCI_GID_CORE, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) struct nci_core_reset_rsp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	__u8	nci_ver;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	__u8	config_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) #define NCI_OP_CORE_INIT_RSP		nci_opcode_pack(NCI_GID_CORE, 0x01)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) struct nci_core_init_rsp_1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	__le32	nfcc_features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	__u8	num_supported_rf_interfaces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	__u8	supported_rf_interfaces[];	/* variable size array */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	/* continuted in nci_core_init_rsp_2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) struct nci_core_init_rsp_2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	__u8	max_logical_connections;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	__le16	max_routing_table_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	__u8	max_ctrl_pkt_payload_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	__le16	max_size_for_large_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	__u8	manufact_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	__le32	manufact_specific_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) #define NCI_OP_CORE_SET_CONFIG_RSP	nci_opcode_pack(NCI_GID_CORE, 0x02)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) struct nci_core_set_config_rsp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	__u8	num_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	__u8	params_id[];	/* variable size array */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) #define NCI_OP_CORE_CONN_CREATE_RSP	nci_opcode_pack(NCI_GID_CORE, 0x04)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) struct nci_core_conn_create_rsp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	__u8	max_ctrl_pkt_payload_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	__u8    credits_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	__u8	conn_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) #define NCI_OP_CORE_CONN_CLOSE_RSP	nci_opcode_pack(NCI_GID_CORE, 0x05)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #define NCI_OP_RF_DISCOVER_MAP_RSP	nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) #define NCI_OP_RF_DISCOVER_RSP		nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) #define NCI_OP_RF_DISCOVER_SELECT_RSP	nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #define NCI_OP_RF_DEACTIVATE_RSP	nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) #define NCI_OP_NFCEE_DISCOVER_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) struct nci_nfcee_discover_rsp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	__u8	num_nfcee;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) #define NCI_OP_NFCEE_MODE_SET_RSP nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x01)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) #define NCI_OP_CORE_GET_CONFIG_RSP	nci_opcode_pack(NCI_GID_CORE, 0x03)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) /* --------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) /* ---- NCI Notifications ---- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) /* --------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #define NCI_OP_CORE_CONN_CREDITS_NTF	nci_opcode_pack(NCI_GID_CORE, 0x06)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) struct conn_credit_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	__u8	conn_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	__u8	credits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) struct nci_core_conn_credit_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	__u8				num_entries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	struct conn_credit_entry	conn_entries[NCI_MAX_NUM_CONN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) #define NCI_OP_CORE_GENERIC_ERROR_NTF	nci_opcode_pack(NCI_GID_CORE, 0x07)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) #define NCI_OP_CORE_INTF_ERROR_NTF	nci_opcode_pack(NCI_GID_CORE, 0x08)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) struct nci_core_intf_error_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	__u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	__u8	conn_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) #define NCI_OP_RF_DISCOVER_NTF		nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) struct rf_tech_specific_params_nfca_poll {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	__u16	sens_res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	__u8	nfcid1_len;	/* 0, 4, 7, or 10 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	__u8	nfcid1[NFC_NFCID1_MAXSIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	__u8	sel_res_len;	/* 0 or 1 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	__u8	sel_res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) struct rf_tech_specific_params_nfcb_poll {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	__u8	sensb_res_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	__u8	sensb_res[NFC_SENSB_RES_MAXSIZE];	/* 11 or 12 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) struct rf_tech_specific_params_nfcf_poll {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	__u8	bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	__u8	sensf_res_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	__u8	sensf_res[NFC_SENSF_RES_MAXSIZE];	/* 16 or 18 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) struct rf_tech_specific_params_nfcv_poll {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	__u8	res_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	__u8	dsfid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	__u8	uid[NFC_ISO15693_UID_MAXSIZE];	/* 8 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) struct rf_tech_specific_params_nfcf_listen {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	__u8	local_nfcid2_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	__u8	local_nfcid2[NFC_NFCID2_MAXSIZE];	/* 0 or 8 Bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) struct nci_rf_discover_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	__u8	rf_discovery_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	__u8	rf_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	__u8	rf_tech_and_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	__u8	rf_tech_specific_params_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 		struct rf_tech_specific_params_nfca_poll nfca_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 		struct rf_tech_specific_params_nfcb_poll nfcb_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 		struct rf_tech_specific_params_nfcf_poll nfcf_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		struct rf_tech_specific_params_nfcv_poll nfcv_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	} rf_tech_specific_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	__u8	ntf_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) #define NCI_OP_RF_INTF_ACTIVATED_NTF	nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) struct activation_params_nfca_poll_iso_dep {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	__u8	rats_res_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	__u8	rats_res[20];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) struct activation_params_nfcb_poll_iso_dep {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 	__u8	attrib_res_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 	__u8	attrib_res[50];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) struct activation_params_poll_nfc_dep {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	__u8	atr_res_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	__u8	atr_res[NFC_ATR_RES_MAXSIZE - 2]; /* ATR_RES from byte 3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) struct activation_params_listen_nfc_dep {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 	__u8	atr_req_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	__u8	atr_req[NFC_ATR_REQ_MAXSIZE - 2]; /* ATR_REQ from byte 3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) struct nci_rf_intf_activated_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	__u8	rf_discovery_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	__u8	rf_interface;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	__u8	rf_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	__u8	activation_rf_tech_and_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	__u8	max_data_pkt_payload_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	__u8	initial_num_credits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	__u8	rf_tech_specific_params_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 		struct rf_tech_specific_params_nfca_poll nfca_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 		struct rf_tech_specific_params_nfcb_poll nfcb_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 		struct rf_tech_specific_params_nfcf_poll nfcf_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 		struct rf_tech_specific_params_nfcv_poll nfcv_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 		struct rf_tech_specific_params_nfcf_listen nfcf_listen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	} rf_tech_specific_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	__u8	data_exch_rf_tech_and_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	__u8	data_exch_tx_bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	__u8	data_exch_rx_bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 	__u8	activation_params_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 		struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 		struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 		struct activation_params_poll_nfc_dep poll_nfc_dep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 		struct activation_params_listen_nfc_dep listen_nfc_dep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 	} activation_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) #define NCI_OP_RF_DEACTIVATE_NTF	nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) struct nci_rf_deactivate_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	__u8	type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 	__u8	reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) #define NCI_OP_RF_NFCEE_ACTION_NTF	nci_opcode_pack(NCI_GID_RF_MGMT, 0x09)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) struct nci_rf_nfcee_action_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 	__u8 nfcee_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 	__u8 trigger;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 	__u8 supported_data_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 	__u8 supported_data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) #define NCI_OP_NFCEE_DISCOVER_NTF nci_opcode_pack(NCI_GID_NFCEE_MGMT, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) struct nci_nfcee_supported_protocol {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 	__u8	num_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	__u8	supported_protocol[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) struct nci_nfcee_information_tlv {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 	__u8	num_tlv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	__u8	information_tlv[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) struct nci_nfcee_discover_ntf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 	__u8	nfcee_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 	__u8	nfcee_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) 	struct nci_nfcee_supported_protocol supported_protocols;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 	struct nci_nfcee_information_tlv	information_tlv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) #define NCI_OP_CORE_RESET_NTF		nci_opcode_pack(NCI_GID_CORE, 0x00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) #endif /* __NCI_H */