Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
pn544_hci.c File Reference
#include <linux/crc-ccitt.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/nfc.h>
#include <net/nfc/hci.h>
#include <net/nfc/llc.h>
#include <linux/nfc/pn544.h>

Go to the source code of this file.

Data Structures

struct  pn544_hci_info
 

Macros

#define DRIVER_DESC   "HCI NFC driver for PN544"
 
#define PN544_HCI_DRIVER_NAME   "pn544_hci"
 
#define PN544_HCI_RESETVEN_TIME   30
 
#define HCI_MODE   0
 
#define FW_MODE   1
 
#define PN544_HCI_LLC_LEN   1
 
#define PN544_HCI_LLC_CRC   2
 
#define PN544_HCI_LLC_LEN_CRC   (PN544_HCI_LLC_LEN + PN544_HCI_LLC_CRC)
 
#define PN544_HCI_LLC_MIN_SIZE   (1 + PN544_HCI_LLC_LEN_CRC)
 
#define PN544_HCI_LLC_MAX_PAYLOAD   29
 
#define PN544_HCI_LLC_MAX_SIZE
 
#define FULL_VERSION_LEN   11
 
#define PN544_WRITE   0x3f
 
#define PN544_RF_READER_A_AUTO_ACTIVATION   0x10
 
#define PN544_RF_READER_A_CMD_CONTINUE_ACTIVATION   0x12
 
#define PN544_MIFARE_CMD   0x21
 
#define PN544_RF_READER_CMD_PRESENCE_CHECK   0x30
 
#define PN544_RF_READER_CMD_ACTIVATE_NEXT   0x32
 
#define PN544_ID_MGMT_FULL_VERSION_SW   0x10
 
#define PN544_RF_READER_ISO15693_GATE   0x12
 
#define PN544_RF_READER_F_GATE   0x14
 
#define PN544_FELICA_ID   0x04
 
#define PN544_FELICA_RAW   0x20
 
#define PN544_RF_READER_JEWEL_GATE   0x15
 
#define PN544_JEWEL_RAW_CMD   0x23
 
#define PN544_RF_READER_NFCIP1_INITIATOR_GATE   0x30
 
#define PN544_RF_READER_NFCIP1_TARGET_GATE   0x31
 
#define PN544_SYS_MGMT_GATE   0x90
 
#define PN544_SYS_MGMT_INFO_NOTIFICATION   0x02
 
#define PN544_POLLING_LOOP_MGMT_GATE   0x94
 
#define PN544_PL_RDPHASES   0x06
 
#define PN544_PL_EMULATION   0x07
 
#define PN544_PL_NFCT_DEACTIVATED   0x09
 
#define PN544_SWP_MGMT_GATE   0xA0
 
#define PN544_NFC_WI_MGMT_GATE   0xA1
 
#define PN544_CMDS_HEADROOM   2
 
#define PN544_FRAME_HEADROOM   1
 
#define PN544_FRAME_TAILROOM   2
 
#define PN544_CB_TYPE_READER_F   1
 
#define MIFARE_CMD_AUTH_KEY_A   0x60
 
#define MIFARE_CMD_AUTH_KEY_B   0x61
 
#define MIFARE_CMD_HEADER   2
 
#define MIFARE_UID_LEN   4
 
#define MIFARE_KEY_LEN   6
 
#define MIFARE_CMD_LEN   12
 

Enumerations

enum  pn544_state { PN544_ST_COLD, PN544_ST_FW_READY, PN544_ST_READY }
 

Functions

 MODULE_DEVICE_TABLE (i2c, pn544_hci_id_table)
 
 module_init (pn544_hci_init)
 
 module_exit (pn544_hci_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 

Macro Definition Documentation

#define DRIVER_DESC   "HCI NFC driver for PN544"

Definition at line 36 of file pn544_hci.c.

#define FULL_VERSION_LEN   11

Definition at line 68 of file pn544_hci.c.

#define FW_MODE   1

Definition at line 51 of file pn544_hci.c.

#define HCI_MODE   0

Definition at line 50 of file pn544_hci.c.

#define MIFARE_CMD_AUTH_KEY_A   0x60

Definition at line 761 of file pn544_hci.c.

#define MIFARE_CMD_AUTH_KEY_B   0x61

Definition at line 762 of file pn544_hci.c.

#define MIFARE_CMD_HEADER   2

Definition at line 763 of file pn544_hci.c.

#define MIFARE_CMD_LEN   12

Definition at line 766 of file pn544_hci.c.

#define MIFARE_KEY_LEN   6

Definition at line 765 of file pn544_hci.c.

#define MIFARE_UID_LEN   4

Definition at line 764 of file pn544_hci.c.

#define PN544_CB_TYPE_READER_F   1

Definition at line 741 of file pn544_hci.c.

#define PN544_CMDS_HEADROOM   2

Definition at line 130 of file pn544_hci.c.

#define PN544_FELICA_ID   0x04

Definition at line 90 of file pn544_hci.c.

#define PN544_FELICA_RAW   0x20

Definition at line 91 of file pn544_hci.c.

#define PN544_FRAME_HEADROOM   1

Definition at line 131 of file pn544_hci.c.

#define PN544_FRAME_TAILROOM   2

Definition at line 132 of file pn544_hci.c.

#define PN544_HCI_DRIVER_NAME   "pn544_hci"

Definition at line 38 of file pn544_hci.c.

#define PN544_HCI_LLC_CRC   2

Definition at line 55 of file pn544_hci.c.

#define PN544_HCI_LLC_LEN   1

Definition at line 54 of file pn544_hci.c.

#define PN544_HCI_LLC_LEN_CRC   (PN544_HCI_LLC_LEN + PN544_HCI_LLC_CRC)

Definition at line 56 of file pn544_hci.c.

#define PN544_HCI_LLC_MAX_PAYLOAD   29

Definition at line 58 of file pn544_hci.c.

#define PN544_HCI_LLC_MAX_SIZE
Value:
PN544_HCI_LLC_MAX_PAYLOAD)

Definition at line 59 of file pn544_hci.c.

#define PN544_HCI_LLC_MIN_SIZE   (1 + PN544_HCI_LLC_LEN_CRC)

Definition at line 57 of file pn544_hci.c.

#define PN544_HCI_RESETVEN_TIME   30

Definition at line 41 of file pn544_hci.c.

#define PN544_ID_MGMT_FULL_VERSION_SW   0x10

Definition at line 85 of file pn544_hci.c.

#define PN544_JEWEL_RAW_CMD   0x23

Definition at line 94 of file pn544_hci.c.

#define PN544_MIFARE_CMD   0x21

Definition at line 78 of file pn544_hci.c.

#define PN544_NFC_WI_MGMT_GATE   0xA1

Definition at line 109 of file pn544_hci.c.

#define PN544_PL_EMULATION   0x07

Definition at line 104 of file pn544_hci.c.

#define PN544_PL_NFCT_DEACTIVATED   0x09

Definition at line 105 of file pn544_hci.c.

#define PN544_PL_RDPHASES   0x06

Definition at line 103 of file pn544_hci.c.

#define PN544_POLLING_LOOP_MGMT_GATE   0x94

Definition at line 102 of file pn544_hci.c.

#define PN544_RF_READER_A_AUTO_ACTIVATION   0x10

Definition at line 76 of file pn544_hci.c.

#define PN544_RF_READER_A_CMD_CONTINUE_ACTIVATION   0x12

Definition at line 77 of file pn544_hci.c.

#define PN544_RF_READER_CMD_ACTIVATE_NEXT   0x32

Definition at line 82 of file pn544_hci.c.

#define PN544_RF_READER_CMD_PRESENCE_CHECK   0x30

Definition at line 81 of file pn544_hci.c.

#define PN544_RF_READER_F_GATE   0x14

Definition at line 89 of file pn544_hci.c.

#define PN544_RF_READER_ISO15693_GATE   0x12

Definition at line 87 of file pn544_hci.c.

#define PN544_RF_READER_JEWEL_GATE   0x15

Definition at line 93 of file pn544_hci.c.

#define PN544_RF_READER_NFCIP1_INITIATOR_GATE   0x30

Definition at line 96 of file pn544_hci.c.

#define PN544_RF_READER_NFCIP1_TARGET_GATE   0x31

Definition at line 97 of file pn544_hci.c.

#define PN544_SWP_MGMT_GATE   0xA0

Definition at line 107 of file pn544_hci.c.

#define PN544_SYS_MGMT_GATE   0x90

Definition at line 99 of file pn544_hci.c.

#define PN544_SYS_MGMT_INFO_NOTIFICATION   0x02

Definition at line 100 of file pn544_hci.c.

#define PN544_WRITE   0x3f

Definition at line 71 of file pn544_hci.c.

Enumeration Type Documentation

Enumerator:
PN544_ST_COLD 
PN544_ST_FW_READY 
PN544_ST_READY 

Definition at line 62 of file pn544_hci.c.

Function Documentation

MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( i2c  ,
pn544_hci_id_table   
)
module_exit ( pn544_hci_exit  )
module_init ( pn544_hci_init  )
MODULE_LICENSE ( "GPL"  )