From dd0638d20edf7893eac179c24e0e519bc4fc21cb Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Tue, 25 Jul 2006 08:32:47 +0000 Subject: make rc632 API compatible with librfid. Import real librfid functions. git-svn-id: https://svn.openpcd.org:2342/trunk@45 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/include/rfid.h | 14 +++++++++++ .../include/rfid_protocol_mifare_classic.h | 28 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 openpcd/firmware/include/rfid.h create mode 100644 openpcd/firmware/include/rfid_protocol_mifare_classic.h (limited to 'openpcd/firmware/include') diff --git a/openpcd/firmware/include/rfid.h b/openpcd/firmware/include/rfid.h new file mode 100644 index 0000000..5684884 --- /dev/null +++ b/openpcd/firmware/include/rfid.h @@ -0,0 +1,14 @@ +#ifndef _RFID_H +#define _RFID_H + +struct rfid_asic_handle { +}; + +struct rfid_asic { +}; + +#define RAH NULL + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +#endif diff --git a/openpcd/firmware/include/rfid_protocol_mifare_classic.h b/openpcd/firmware/include/rfid_protocol_mifare_classic.h new file mode 100644 index 0000000..e6b2400 --- /dev/null +++ b/openpcd/firmware/include/rfid_protocol_mifare_classic.h @@ -0,0 +1,28 @@ +#ifndef _MIFARE_CLASSIC_H + +#define MIFARE_CL_KEYA_DEFAULT "\xa0\xa1\xa2\xa3\xa4\xa5" +#define MIFARE_CL_KEYB_DEFAULT "\xb0\xb1\xb2\xb3\xb4\xb5" + +#define MIFARE_CL_KEYA_DEFAULT_INFINEON "\xff\xff\xff\xff\xff\xff" +#define MIFARE_CL_KEYB_DEFAULT_INFINEON MIFARE_CL_KEYA_DEFAULT_INFINEON + +#define MIFARE_CL_PAGE_MAX 0xff + +#define RFID_CMD_MIFARE_AUTH1A 0x60 +#define RFID_CMD_MIFARE_AUTH1B 0x61 + +#ifdef __LIBRFID__ + +extern struct rfid_protocol rfid_protocol_mfcl; + + +#define MIFARE_CL_CMD_WRITE16 0xA0 +#define MIFARE_CL_CMD_READ 0x30 + +#define MIFARE_CL_RESP_ACK 0x0a +#define MIFARE_CL_RESP_NAK 0x00 + + +#endif /* __LIBRFID__ */ + +#endif /* _MIFARE_CLASSIC_H */ -- cgit v1.2.3