From 0c22a9dea729db9495024170484d5b711f2d2c56 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 27 May 2006 14:28:27 +0000 Subject: move ccid direct backend to subdirectory git-svn-id: https://svn.gnumonks.org/trunk/librfid@1797 e0336214-984f-0b4b-a45f-81c69e1f0ede --- src/ccid/rfid_reader_cm5121_ccid_direct.c | 36 +++++++++++++++++++++++++++++++ src/rfid_reader_cm5121_ccid_direct.c | 36 ------------------------------- 2 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 src/ccid/rfid_reader_cm5121_ccid_direct.c delete mode 100644 src/rfid_reader_cm5121_ccid_direct.c diff --git a/src/ccid/rfid_reader_cm5121_ccid_direct.c b/src/ccid/rfid_reader_cm5121_ccid_direct.c new file mode 100644 index 0000000..a2dfb99 --- /dev/null +++ b/src/ccid/rfid_reader_cm5121_ccid_direct.c @@ -0,0 +1,36 @@ +/* CM5121 backend for 'internal' CCID driver */ +#include +#include +#include + +#include + +#include + +/* this is the sole function required by rfid_reader_cm5121.c */ +int +PC_to_RDR_Escape(void *handle, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len) +{ + int rc; + ccid_driver_t ch = handle; + size_t maxrxlen = *rx_len; + + rc = ccid_transceive_escape (ch, tx_buf, tx_len, + rx_buf, maxrxlen, rx_len); + + return rc; +} + +int cm5121_source_init(struct rfid_asic_transport_handle *rath) +{ + int rc; + + rc = ccid_open_reader(&rath->data, NULL); + if (rc) { + fprintf (stderr, "failed to open CCID reader: %#x\n", rc); + return -1; + } + return 0; +} diff --git a/src/rfid_reader_cm5121_ccid_direct.c b/src/rfid_reader_cm5121_ccid_direct.c deleted file mode 100644 index a2dfb99..0000000 --- a/src/rfid_reader_cm5121_ccid_direct.c +++ /dev/null @@ -1,36 +0,0 @@ -/* CM5121 backend for 'internal' CCID driver */ -#include -#include -#include - -#include - -#include - -/* this is the sole function required by rfid_reader_cm5121.c */ -int -PC_to_RDR_Escape(void *handle, - const unsigned char *tx_buf, unsigned int tx_len, - unsigned char *rx_buf, unsigned int *rx_len) -{ - int rc; - ccid_driver_t ch = handle; - size_t maxrxlen = *rx_len; - - rc = ccid_transceive_escape (ch, tx_buf, tx_len, - rx_buf, maxrxlen, rx_len); - - return rc; -} - -int cm5121_source_init(struct rfid_asic_transport_handle *rath) -{ - int rc; - - rc = ccid_open_reader(&rath->data, NULL); - if (rc) { - fprintf (stderr, "failed to open CCID reader: %#x\n", rc); - return -1; - } - return 0; -} -- cgit v1.2.3