Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
nfc.h File Reference
#include <linux/types.h>
#include <linux/socket.h>

Go to the source code of this file.

Data Structures

struct  sockaddr_nfc
 
struct  sockaddr_nfc_llcp
 

Macros

#define NFC_GENL_NAME   "nfc"
 
#define NFC_GENL_VERSION   1
 
#define NFC_GENL_MCAST_EVENT_NAME   "events"
 
#define NFC_CMD_MAX   (__NFC_CMD_AFTER_LAST - 1)
 
#define NFC_ATTR_MAX   (__NFC_ATTR_AFTER_LAST - 1)
 
#define NFC_DEVICE_NAME_MAXSIZE   8
 
#define NFC_NFCID1_MAXSIZE   10
 
#define NFC_SENSB_RES_MAXSIZE   12
 
#define NFC_SENSF_RES_MAXSIZE   18
 
#define NFC_GB_MAXSIZE   48
 
#define NFC_PROTO_JEWEL   1
 
#define NFC_PROTO_MIFARE   2
 
#define NFC_PROTO_FELICA   3
 
#define NFC_PROTO_ISO14443   4
 
#define NFC_PROTO_NFC_DEP   5
 
#define NFC_PROTO_ISO14443_B   6
 
#define NFC_PROTO_MAX   7
 
#define NFC_COMM_ACTIVE   0
 
#define NFC_COMM_PASSIVE   1
 
#define NFC_RF_INITIATOR   0
 
#define NFC_RF_TARGET   1
 
#define NFC_RF_NONE   2
 
#define NFC_PROTO_JEWEL_MASK   (1 << NFC_PROTO_JEWEL)
 
#define NFC_PROTO_MIFARE_MASK   (1 << NFC_PROTO_MIFARE)
 
#define NFC_PROTO_FELICA_MASK   (1 << NFC_PROTO_FELICA)
 
#define NFC_PROTO_ISO14443_MASK   (1 << NFC_PROTO_ISO14443)
 
#define NFC_PROTO_NFC_DEP_MASK   (1 << NFC_PROTO_NFC_DEP)
 
#define NFC_PROTO_ISO14443_B_MASK   (1 << NFC_PROTO_ISO14443_B)
 
#define NFC_LLCP_MAX_SERVICE_NAME   63
 
#define NFC_SOCKPROTO_RAW   0
 
#define NFC_SOCKPROTO_LLCP   1
 
#define NFC_SOCKPROTO_MAX   2
 
#define NFC_HEADER_SIZE   1
 
#define NFC_LLCP_RAW_HEADER_SIZE   2
 
#define NFC_LLCP_DIRECTION_RX   0x00
 
#define NFC_LLCP_DIRECTION_TX   0x01
 

Enumerations

enum  nfc_commands {
  NFC_CMD_UNSPEC, NFC_CMD_GET_DEVICE, NFC_CMD_DEV_UP, NFC_CMD_DEV_DOWN,
  NFC_CMD_DEP_LINK_UP, NFC_CMD_DEP_LINK_DOWN, NFC_CMD_START_POLL, NFC_CMD_STOP_POLL,
  NFC_CMD_GET_TARGET, NFC_EVENT_TARGETS_FOUND, NFC_EVENT_DEVICE_ADDED, NFC_EVENT_DEVICE_REMOVED,
  NFC_EVENT_TARGET_LOST, NFC_EVENT_TM_ACTIVATED, NFC_EVENT_TM_DEACTIVATED, __NFC_CMD_AFTER_LAST
}
 
enum  nfc_attrs {
  NFC_ATTR_UNSPEC, NFC_ATTR_DEVICE_INDEX, NFC_ATTR_DEVICE_NAME, NFC_ATTR_PROTOCOLS,
  NFC_ATTR_TARGET_INDEX, NFC_ATTR_TARGET_SENS_RES, NFC_ATTR_TARGET_SEL_RES, NFC_ATTR_TARGET_NFCID1,
  NFC_ATTR_TARGET_SENSB_RES, NFC_ATTR_TARGET_SENSF_RES, NFC_ATTR_COMM_MODE, NFC_ATTR_RF_MODE,
  NFC_ATTR_DEVICE_POWERED, NFC_ATTR_IM_PROTOCOLS, NFC_ATTR_TM_PROTOCOLS, __NFC_ATTR_AFTER_LAST
}
 

Macro Definition Documentation

#define NFC_ATTR_MAX   (__NFC_ATTR_AFTER_LAST - 1)

Definition at line 125 of file nfc.h.

#define NFC_CMD_MAX   (__NFC_CMD_AFTER_LAST - 1)

Definition at line 83 of file nfc.h.

#define NFC_COMM_ACTIVE   0

Definition at line 144 of file nfc.h.

#define NFC_COMM_PASSIVE   1

Definition at line 145 of file nfc.h.

#define NFC_DEVICE_NAME_MAXSIZE   8

Definition at line 127 of file nfc.h.

#define NFC_GB_MAXSIZE   48

Definition at line 131 of file nfc.h.

#define NFC_GENL_MCAST_EVENT_NAME   "events"

Definition at line 33 of file nfc.h.

#define NFC_GENL_NAME   "nfc"

Definition at line 30 of file nfc.h.

#define NFC_GENL_VERSION   1

Definition at line 31 of file nfc.h.

#define NFC_HEADER_SIZE   1

Definition at line 184 of file nfc.h.

#define NFC_LLCP_DIRECTION_RX   0x00

Definition at line 194 of file nfc.h.

#define NFC_LLCP_DIRECTION_TX   0x01

Definition at line 195 of file nfc.h.

#define NFC_LLCP_MAX_SERVICE_NAME   63

Definition at line 167 of file nfc.h.

#define NFC_LLCP_RAW_HEADER_SIZE   2

Pseudo-header info for raw socket packets First byte is the adapter index Second byte contains flags

  • 0x01 - Direction (0=RX, 1=TX)
  • 0x02-0x80 - Reserved

Definition at line 193 of file nfc.h.

#define NFC_NFCID1_MAXSIZE   10

Definition at line 128 of file nfc.h.

#define NFC_PROTO_FELICA   3

Definition at line 136 of file nfc.h.

#define NFC_PROTO_FELICA_MASK   (1 << NFC_PROTO_FELICA)

Definition at line 155 of file nfc.h.

#define NFC_PROTO_ISO14443   4

Definition at line 137 of file nfc.h.

#define NFC_PROTO_ISO14443_B   6

Definition at line 139 of file nfc.h.

#define NFC_PROTO_ISO14443_B_MASK   (1 << NFC_PROTO_ISO14443_B)

Definition at line 158 of file nfc.h.

#define NFC_PROTO_ISO14443_MASK   (1 << NFC_PROTO_ISO14443)

Definition at line 156 of file nfc.h.

#define NFC_PROTO_JEWEL   1

Definition at line 134 of file nfc.h.

#define NFC_PROTO_JEWEL_MASK   (1 << NFC_PROTO_JEWEL)

Definition at line 153 of file nfc.h.

#define NFC_PROTO_MAX   7

Definition at line 141 of file nfc.h.

#define NFC_PROTO_MIFARE   2

Definition at line 135 of file nfc.h.

#define NFC_PROTO_MIFARE_MASK   (1 << NFC_PROTO_MIFARE)

Definition at line 154 of file nfc.h.

#define NFC_PROTO_NFC_DEP   5

Definition at line 138 of file nfc.h.

#define NFC_PROTO_NFC_DEP_MASK   (1 << NFC_PROTO_NFC_DEP)

Definition at line 157 of file nfc.h.

#define NFC_RF_INITIATOR   0

Definition at line 148 of file nfc.h.

#define NFC_RF_NONE   2

Definition at line 150 of file nfc.h.

#define NFC_RF_TARGET   1

Definition at line 149 of file nfc.h.

#define NFC_SENSB_RES_MAXSIZE   12

Definition at line 129 of file nfc.h.

#define NFC_SENSF_RES_MAXSIZE   18

Definition at line 130 of file nfc.h.

#define NFC_SOCKPROTO_LLCP   1

Definition at line 181 of file nfc.h.

#define NFC_SOCKPROTO_MAX   2

Definition at line 182 of file nfc.h.

#define NFC_SOCKPROTO_RAW   0

Definition at line 180 of file nfc.h.

Enumeration Type Documentation

enum nfc_attrs

enum nfc_attrs - supported nfc attributes

: unspecified attribute

: index of nfc device : device name, max 8 chars : nfc protocols - bitwise or-ed combination from NFC_PROTO_*_MASK constants : index of the nfc target : NFC-A targets extra information such as NFCID : NFC-A targets extra information (useful if the target is not NFC-Forum compliant) : NFC-A targets identifier, max 10 bytes : NFC-B targets extra information, max 12 bytes : NFC-F targets extra information, max 18 bytes : Passive or active mode : Initiator or target : Initiator mode protocols to poll for : Target mode protocols to listen for

Enumerator:
NFC_ATTR_UNSPEC 
NFC_ATTR_DEVICE_INDEX 
NFC_ATTR_DEVICE_NAME 
NFC_ATTR_PROTOCOLS 
NFC_ATTR_TARGET_INDEX 
NFC_ATTR_TARGET_SENS_RES 
NFC_ATTR_TARGET_SEL_RES 
NFC_ATTR_TARGET_NFCID1 
NFC_ATTR_TARGET_SENSB_RES 
NFC_ATTR_TARGET_SENSF_RES 
NFC_ATTR_COMM_MODE 
NFC_ATTR_RF_MODE 
NFC_ATTR_DEVICE_POWERED 
NFC_ATTR_IM_PROTOCOLS 
NFC_ATTR_TM_PROTOCOLS 
__NFC_ATTR_AFTER_LAST 

Definition at line 106 of file nfc.h.

enum nfc_commands - supported nfc commands

: unspecified command

: request information about a device (requires NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices : turn on the nfc device (requires NFC_ATTR_DEVICE_INDEX) : turn off the nfc device (requires NFC_ATTR_DEVICE_INDEX) : start polling for targets using the given protocols (requires NFC_ATTR_DEVICE_INDEX and NFC_ATTR_PROTOCOLS) : stop polling for targets (requires NFC_ATTR_DEVICE_INDEX) : dump all targets found by the previous poll (requires NFC_ATTR_DEVICE_INDEX) : event emitted when a new target is found (it sends NFC_ATTR_DEVICE_INDEX) : event emitted when a new device is registred (it sends NFC_ATTR_DEVICE_NAME, NFC_ATTR_DEVICE_INDEX and NFC_ATTR_PROTOCOLS) : event emitted when a device is removed (it sends NFC_ATTR_DEVICE_INDEX) : event emitted when the adapter is activated in target mode. : event emitted when the adapter is deactivated from target mode.

Enumerator:
NFC_CMD_UNSPEC 
NFC_CMD_GET_DEVICE 
NFC_CMD_DEV_UP 
NFC_CMD_DEV_DOWN 
NFC_CMD_DEP_LINK_UP 
NFC_CMD_DEP_LINK_DOWN 
NFC_CMD_START_POLL 
NFC_CMD_STOP_POLL 
NFC_CMD_GET_TARGET 
NFC_EVENT_TARGETS_FOUND 
NFC_EVENT_DEVICE_ADDED 
NFC_EVENT_DEVICE_REMOVED 
NFC_EVENT_TARGET_LOST 
NFC_EVENT_TM_ACTIVATED 
NFC_EVENT_TM_DEACTIVATED 
__NFC_CMD_AFTER_LAST 

Definition at line 64 of file nfc.h.