#define SENDBUF_LEN 40
#define RECVBUF_LEN 40
+#if 0
+#ifdef DEBUGP
+#undef DEBUGP
+#define DEBUGP(x, ...)
+#define DEBUGPC(x, ...)
+#endif
+#endif
+
static
int Write1ByteToReg(struct rfid_asic_transport_handle *rath,
unsigned char reg, unsigned char value)
sndbuf[5] = 0x00;
sndbuf[6] = reg;
- DEBUGP("reg=0x%02x, val=%02x: ", reg, *value);
if (PC_to_RDR_Escape(rath->data, sndbuf, 7, recvbuf,
&retlen) == 0) {
*value = recvbuf[1];
+ DEBUGP("reg=0x%02x, val=%02x: ", reg, *value);
DEBUGPC("OK\n");
return 0;
}
static int cm5121_transcieve(struct rfid_reader_handle *rh,
const unsigned char *tx_data, unsigned int tx_len,
unsigned char *rx_data, unsigned int *rx_len,
- unsigned int timeout, unsigned int flags)
+ u_int64_t timeout, unsigned int flags)
{
return rh->ah->asic->priv.rc632.fn.transcieve(rh->ah, tx_data,
tx_len, rx_data,
unsigned char cmd, struct iso14443a_atqa *atqa)
{
return rh->ah->asic->priv.rc632.fn.iso14443a.transcieve_sf(rh->ah,
- cmd,
- (unsigned char *) atqa);
+ cmd,
+ atqa);
}
static int
-cm5121_transcieve_acf(struct rfid_reader_handle *rh, struct iso14443a_anticol_cmd *cmd,
- unsigned int *bit_of_col)
+cm5121_transcieve_acf(struct rfid_reader_handle *rh,
+ struct iso14443a_anticol_cmd *cmd,
+ unsigned int *bit_of_col)
{
return rh->ah->asic->priv.rc632.fn.iso14443a.transcieve_acf(rh->ah,
cmd, bit_of_col);
return rh->ah->asic->priv.rc632.fn.iso14443b.init(rh->ah);
}
+static int
+cm5121_15693_init(struct rfid_reader_handle *rh)
+{
+ return rh->ah->asic->priv.rc632.fn.iso15693.init(rh->ah);
+}
+
struct rfid_asic_transport cm5121_ccid = {
.name = "CM5121 OpenCT",
unsigned int rx_len = sizeof(rx_buf);
PC_to_RDR_Escape(rath->data, tx_buf, 1, rx_buf, &rx_len);
- printf("received %d bytes from 01 command\n", rx_len);
+ printf("received %u bytes from 01 command\n", rx_len);
return 0;
}
.init = &cm5121_14443a_init,
.transcieve_sf = &cm5121_transcieve_sf,
.transcieve_acf = &cm5121_transcieve_acf,
+ .speed = RFID_READER_SPEED_106K | RFID_READER_SPEED_212K |
+ RFID_READER_SPEED_424K | RFID_READER_SPEED_848K,
},
.iso14443b = {
.init = &cm5121_14443b_init,