summaryrefslogtreecommitdiff
path: root/src/rfid_reader_openpcd.c
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-14 15:04:10 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-14 15:04:10 +0000
commit9ce76f09417c31a8fc904b67624c0f3b397c21c0 (patch)
tree16ba04843e3797cb6018cc02d670566eb5535694 /src/rfid_reader_openpcd.c
parente404cccecd20a2418c2429cd182c18218e54bd28 (diff)
- separate 'STATIC' (non-dyamic-allocation) from 'FIRMWARE' (no host drivers)
- enhance openpcd in-firmware driver stubs - fix 15693 segfaults with cm5121 and openpcd (15693 is not working yet!) git-svn-id: https://svn.gnumonks.org/trunk/librfid@1904 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'src/rfid_reader_openpcd.c')
-rw-r--r--src/rfid_reader_openpcd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rfid_reader_openpcd.c b/src/rfid_reader_openpcd.c
index 15486b6..dc9db10 100644
--- a/src/rfid_reader_openpcd.c
+++ b/src/rfid_reader_openpcd.c
@@ -226,12 +226,14 @@ const struct rfid_asic_transport openpcd_rat = {
static int openpcd_reg_write(struct rfid_asic_transport_handle *rath,
unsigned char reg, unsigned char value)
{
+ return rc632_reg_write(rath, reg, value);
}
static int openpcd_reg_read(struct rfid_asic_transport_handle *rath,
unsigned char reg,
unsigned char *value)
{
+ return rc632_reg_write(rath, reg, value);
}
@@ -239,6 +241,7 @@ static int openpcd_fifo_read(struct rfid_asic_transport_handle *rath,
unsigned char num_bytes,
unsigned char *buf)
{
+ return rc632_reg_write(rath, num_bytes, buf);
}
static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath,
@@ -246,6 +249,7 @@ static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath,
const unsigned char *bytes,
unsigned char flags)
{
+ return rc632_fifo_write(rath, len, bytes, flags);
}
const struct rfid_asic_transport openpcd_rat = {
@@ -365,6 +369,7 @@ openpcd_open(void *data)
snd_hdr = (struct openpcd_hdr *)snd_buf;
rcv_hdr = (struct openpcd_hdr *)rcv_buf;
+#ifndef LIBRFID_FIRMWARE
usb_init();
if (usb_find_busses() < 0)
return NULL;
@@ -388,6 +393,7 @@ openpcd_open(void *data)
usb_close(hdl);
return NULL;
}
+#endif
rh = malloc_reader_handle(sizeof(*rh));
if (!rh)
@@ -426,7 +432,9 @@ openpcd_close(struct rfid_reader_handle *rh)
free_rat_handle(rath);
free_reader_handle(rh);
+#ifndef LIBRFID_FIRMWARE
usb_close(hdl);
+#endif
}
const struct rfid_reader rfid_reader_openpcd = {
@@ -452,6 +460,9 @@ const struct rfid_reader rfid_reader_openpcd = {
.iso14443b = {
.init = &openpcd_14443b_init,
},
+ .iso15693 = {
+ .init = &openpcd_15693_init,
+ },
.mifare_classic = {
.setkey = &openpcd_mifare_setkey,
.auth = &openpcd_mifare_auth,
personal git repositories of Harald Welte. Your mileage may vary