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

Go to the source code of this file.

Data Structures

struct  nfc_ops
 
struct  nfc_target
 
struct  nfc_genl_data
 
struct  nfc_dev
 

Macros

#define nfc_dev_info(dev, fmt, arg...)   dev_info((dev), "NFC: " fmt "\n", ## arg)
 
#define nfc_dev_err(dev, fmt, arg...)   dev_err((dev), "NFC: " fmt "\n", ## arg)
 
#define nfc_dev_dbg(dev, fmt, arg...)   dev_dbg((dev), fmt "\n", ## arg)
 
#define NFC_TARGET_IDX_ANY   -1
 
#define NFC_MAX_GT_LEN   48
 
#define NFC_ATR_RES_GT_OFFSET   15
 
#define to_nfc_dev(_dev)   container_of(_dev, struct nfc_dev, dev)
 

Typedefs

typedef void(* data_exchange_cb_t )(void *context, struct sk_buff *skb, int err)
 

Functions

struct nfc_devnfc_allocate_device (struct nfc_ops *ops, u32 supported_protocols, int tx_headroom, int tx_tailroom)
 
int nfc_register_device (struct nfc_dev *dev)
 
void nfc_unregister_device (struct nfc_dev *dev)
 
struct sk_buffnfc_alloc_send_skb (struct nfc_dev *dev, struct sock *sk, unsigned int flags, unsigned int size, unsigned int *err)
 
struct sk_buffnfc_alloc_recv_skb (unsigned int size, gfp_t gfp)
 
int nfc_set_remote_general_bytes (struct nfc_dev *dev, u8 *gt, u8 gt_len)
 
u8nfc_get_local_general_bytes (struct nfc_dev *dev, size_t *gb_len)
 
int nfc_targets_found (struct nfc_dev *dev, struct nfc_target *targets, int ntargets)
 
int nfc_target_lost (struct nfc_dev *dev, u32 target_idx)
 
int nfc_dep_link_is_up (struct nfc_dev *dev, u32 target_idx, u8 comm_mode, u8 rf_mode)
 
int nfc_tm_activated (struct nfc_dev *dev, u32 protocol, u8 comm_mode, u8 *gb, size_t gb_len)
 
int nfc_tm_deactivated (struct nfc_dev *dev)
 
int nfc_tm_data_received (struct nfc_dev *dev, struct sk_buff *skb)
 
void nfc_driver_failure (struct nfc_dev *dev, int err)
 

Variables

struct class nfc_class
 

Macro Definition Documentation

#define NFC_ATR_RES_GT_OFFSET   15

Definition at line 75 of file nfc.h.

#define nfc_dev_dbg (   dev,
  fmt,
  arg... 
)    dev_dbg((dev), fmt "\n", ## arg)

Definition at line 33 of file nfc.h.

#define nfc_dev_err (   dev,
  fmt,
  arg... 
)    dev_err((dev), "NFC: " fmt "\n", ## arg)

Definition at line 32 of file nfc.h.

#define nfc_dev_info (   dev,
  fmt,
  arg... 
)    dev_info((dev), "NFC: " fmt "\n", ## arg)

Definition at line 31 of file nfc.h.

#define NFC_MAX_GT_LEN   48

Definition at line 74 of file nfc.h.

#define NFC_TARGET_IDX_ANY   -1

Definition at line 73 of file nfc.h.

#define to_nfc_dev (   _dev)    container_of(_dev, struct nfc_dev, dev)

Definition at line 120 of file nfc.h.

Typedef Documentation

typedef void(* data_exchange_cb_t)(void *context, struct sk_buff *skb, int err)

data_exchange_cb_t - Definition of nfc_data_exchange callback

: nfc_data_exchange cb_context parameter : response data : If an error has occurred during data exchange, it is the error number. Zero means no error.

When a rx or tx package is lost or corrupted or the target gets out of the operating field, err is -EIO.

Definition at line 48 of file nfc.h.

Function Documentation

struct sk_buff* nfc_alloc_recv_skb ( unsigned int  size,
gfp_t  gfp 
)
read

nfc_alloc_recv_skb - allocate a skb for data exchange responses

: size to allocate : gfp flags

Definition at line 540 of file core.c.

struct sk_buff* nfc_alloc_send_skb ( struct nfc_dev dev,
struct sock sk,
unsigned int  flags,
unsigned int  size,
unsigned int err 
)
read

nfc_alloc_send_skb - allocate a skb for data exchange responses

: size to allocate : gfp flags

Definition at line 517 of file core.c.

struct nfc_dev* nfc_allocate_device ( struct nfc_ops ops,
u32  supported_protocols,
int  tx_headroom,
int  tx_tailroom 
)
read

nfc_allocate_device - allocate a new nfc device

: device operations : NFC protocols supported by the device

Definition at line 752 of file core.c.

int nfc_dep_link_is_up ( struct nfc_dev dev,
u32  target_idx,
u8  comm_mode,
u8  rf_mode 
)

Definition at line 286 of file core.c.

void nfc_driver_failure ( struct nfc_dev dev,
int  err 
)
inline

Definition at line 668 of file core.c.

u8* nfc_get_local_general_bytes ( struct nfc_dev dev,
size_t gb_len 
)

Definition at line 454 of file core.c.

int nfc_register_device ( struct nfc_dev dev)

nfc_register_device - register a nfc device in the nfc subsystem

: The nfc device to register

Definition at line 803 of file core.c.

int nfc_set_remote_general_bytes ( struct nfc_dev dev,
u8 gt,
u8  gt_len 
)

Definition at line 443 of file core.c.

int nfc_target_lost ( struct nfc_dev dev,
u32  target_idx 
)

nfc_target_lost - inform that an activated target went out of field

: The nfc device that had the activated target in field : the nfc index of the target

The device driver must call this function when the activated target goes out of the field. IMPORTANT: this function must not be called from an atomic context. In addition, it must also not be called from a context that would prevent the NFC Core to call other nfc ops entry point concurrently.

Definition at line 628 of file core.c.

int nfc_targets_found ( struct nfc_dev dev,
struct nfc_target targets,
int  n_targets 
)

nfc_targets_found - inform that targets were found

: The nfc device that found the targets : array of nfc targets found : targets array size

The device driver must call this function when one or many nfc targets are found. After calling this function, the device driver must stop polling for targets. NOTE: This function can be called with targets=NULL and n_targets=0 to notify a driver error, meaning that the polling operation cannot complete. IMPORTANT: this function must not be called from an atomic context. In addition, it must also not be called from a context that would prevent the NFC Core to call other nfc ops entry point concurrently.

Definition at line 571 of file core.c.

int nfc_tm_activated ( struct nfc_dev dev,
u32  protocol,
u8  comm_mode,
u8 gb,
size_t  gb_len 
)

Definition at line 474 of file core.c.

int nfc_tm_data_received ( struct nfc_dev dev,
struct sk_buff skb 
)

Definition at line 462 of file core.c.

int nfc_tm_deactivated ( struct nfc_dev dev)

Definition at line 503 of file core.c.

void nfc_unregister_device ( struct nfc_dev dev)

nfc_unregister_device - unregister a nfc device in the nfc subsystem

: The nfc device to unregister

Definition at line 835 of file core.c.

Variable Documentation

struct class nfc_class

Definition at line 721 of file core.c.