projects
/
librfid
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare RFID compilation in firmware mode
[librfid]
/
src
/
rfid_reader_cm5121.c
diff --git
a/src/rfid_reader_cm5121.c
b/src/rfid_reader_cm5121.c
index
d61b5f7
..
dd15fd6
100644
(file)
--- a/
src/rfid_reader_cm5121.c
+++ b/
src/rfid_reader_cm5121.c
@@
-1,6
+1,6
@@
/* Omnikey CardMan 5121 specific RC632 transport layer
*
/* Omnikey CardMan 5121 specific RC632 transport layer
*
- * (C) 2005 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2005
-2006
by Harald Welte <laforge@gnumonks.org>
*
* The 5121 is an Atmel AT89C5122 based USB CCID reader (probably the same
* design like the 3121). It's CL RC632 is connected via address/data bus,
*
* The 5121 is an Atmel AT89C5122 based USB CCID reader (probably the same
* design like the 3121). It's CL RC632 is connected via address/data bus,
@@
-27,6
+27,8
@@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef LIBRFID_FIRMWARE
+
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@@
-37,6
+39,10
@@
#include <librfid/rfid_asic.h>
#include <librfid/rfid_asic_rc632.h>
#include <librfid/rfid_reader_cm5121.h>
#include <librfid/rfid_asic.h>
#include <librfid/rfid_asic_rc632.h>
#include <librfid/rfid_reader_cm5121.h>
+#include <librfid/rfid_layer2.h>
+#include <librfid/rfid_protocol.h>
+
+#include "cm5121_source.h"
/* FIXME */
#include "rc632.h"
/* FIXME */
#include "rc632.h"
@@
-310,12
+316,12
@@
cm5121_open(void *data)
struct rfid_reader_handle *rh;
struct rfid_asic_transport_handle *rath;
struct rfid_reader_handle *rh;
struct rfid_asic_transport_handle *rath;
- rh = malloc(sizeof(*rh));
+ rh = malloc
_reader_handle
(sizeof(*rh));
if (!rh)
return NULL;
memset(rh, 0, sizeof(*rh));
if (!rh)
return NULL;
memset(rh, 0, sizeof(*rh));
- rath = malloc(sizeof(*rath));
+ rath = malloc
_rat_handle
(sizeof(*rath));
if (!rath)
goto out_rh;
memset(rath, 0, sizeof(*rath));
if (!rath)
goto out_rh;
memset(rath, 0, sizeof(*rath));
@@
-337,9
+343,9
@@
cm5121_open(void *data)
return rh;
out_rath:
return rh;
out_rath:
- free(rath);
+ free
_rat_handle
(rath);
out_rh:
out_rh:
- free(rh);
+ free
_reader_handle
(rh);
return NULL;
}
return NULL;
}
@@
-349,15
+355,21
@@
cm5121_close(struct rfid_reader_handle *rh)
{
struct rfid_asic_transport_handle *rath = rh->ah->rath;
rc632_close(rh->ah);
{
struct rfid_asic_transport_handle *rath = rh->ah->rath;
rc632_close(rh->ah);
- free(rath);
- free(rh);
+ free
_rat_handle
(rath);
+ free
_reader_handle
(rh);
}
}
-struct rfid_reader rfid_reader_cm5121 = {
+
const
struct rfid_reader rfid_reader_cm5121 = {
.name = "Omnikey CardMan 5121 RFID",
.open = &cm5121_open,
.close = &cm5121_close,
.transceive = &cm5121_transceive,
.name = "Omnikey CardMan 5121 RFID",
.open = &cm5121_open,
.close = &cm5121_close,
.transceive = &cm5121_transceive,
+ .l2_supported = (1 << RFID_LAYER2_ISO14443A) |
+ (1 << RFID_LAYER2_ISO14443B) |
+ (1 << RFID_LAYER2_ISO15693),
+ .proto_supported = (1 << RFID_PROTOCOL_TCL) |
+ (1 << RFID_PROTOCOL_MIFARE_UL) |
+ (1 << RFID_PROTOCOL_MIFARE_CLASSIC),
.iso14443a = {
.init = &cm5121_14443a_init,
.transceive_sf = &cm5121_transceive_sf,
.iso14443a = {
.init = &cm5121_14443a_init,
.transceive_sf = &cm5121_transceive_sf,
@@
-375,4
+387,4
@@
struct rfid_reader rfid_reader_cm5121 = {
},
};
},
};
-
+#endif /* LIBRFID_FIRMWARE */