diff options
-rw-r--r-- | include/librfid/rfid_asic_rc632.h | 8 | ||||
-rw-r--r-- | include/librfid/rfid_layer2.h | 4 | ||||
-rw-r--r-- | include/librfid/rfid_layer2_iso15693.h | 6 | ||||
-rw-r--r-- | include/librfid/rfid_protocol.h | 6 | ||||
-rw-r--r-- | include/librfid/rfid_protocol_tcl.h | 2 | ||||
-rw-r--r-- | include/librfid/rfid_reader.h | 6 | ||||
-rw-r--r-- | pegoda/pegoda.c | 18 | ||||
-rw-r--r-- | src/rc632.h | 2 | ||||
-rw-r--r-- | src/rfid_asic_rc632.c | 34 | ||||
-rw-r--r-- | src/rfid_layer2.c | 6 | ||||
-rw-r--r-- | src/rfid_layer2_iso14443a.c | 28 | ||||
-rw-r--r-- | src/rfid_layer2_iso14443b.c | 22 | ||||
-rw-r--r-- | src/rfid_layer2_iso15693.c | 30 | ||||
-rw-r--r-- | src/rfid_proto_mifare_classic.c | 4 | ||||
-rw-r--r-- | src/rfid_proto_mifare_ul.c | 6 | ||||
-rw-r--r-- | src/rfid_proto_tcl.c | 22 | ||||
-rw-r--r-- | src/rfid_protocol.c | 4 | ||||
-rw-r--r-- | src/rfid_reader.c | 4 | ||||
-rw-r--r-- | src/rfid_reader_cm5121.c | 18 | ||||
-rw-r--r-- | utils/librfid-tool.c | 10 |
20 files changed, 120 insertions, 120 deletions
diff --git a/include/librfid/rfid_asic_rc632.h b/include/librfid/rfid_asic_rc632.h index 893e73b..ec9b4e4 100644 --- a/include/librfid/rfid_asic_rc632.h +++ b/include/librfid/rfid_asic_rc632.h @@ -35,7 +35,7 @@ struct rfid_asic_rc632 { int (*power_down)(struct rfid_asic_handle *h); int (*turn_on_rf)(struct rfid_asic_handle *h); int (*turn_off_rf)(struct rfid_asic_handle *h); - int (*transcieve)(struct rfid_asic_handle *h, + int (*transceive)(struct rfid_asic_handle *h, enum rfid_frametype, const u_int32_t *tx_buf, unsigned int tx_len, @@ -45,10 +45,10 @@ struct rfid_asic_rc632 { unsigned int flags); struct { int (*init)(struct rfid_asic_handle *h); - int (*transcieve_sf)(struct rfid_asic_handle *h, + int (*transceive_sf)(struct rfid_asic_handle *h, u_int32_t cmd, struct iso14443a_atqa *atqa); - int (*transcieve_acf)(struct rfid_asic_handle *h, + int (*transceive_acf)(struct rfid_asic_handle *h, struct iso14443a_anticol_cmd *cmd, unsigned int *bit_of_col); int (*set_speed)(struct rfid_asic_handle *h, @@ -132,7 +132,7 @@ rc632_transmit(struct rfid_asic_handle *handle, u_int64_t timeout); int -rc632_transcieve(struct rfid_asic_handle *handle, +rc632_transceive(struct rfid_asic_handle *handle, const u_int32_t *tx_buf, u_int32_t tx_len, u_int32_t *rx_buf, diff --git a/include/librfid/rfid_layer2.h b/include/librfid/rfid_layer2.h index 4622a02..3dd54a2 100644 --- a/include/librfid/rfid_layer2.h +++ b/include/librfid/rfid_layer2.h @@ -17,7 +17,7 @@ enum rfid_layer2_id { struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh, unsigned int id); int rfid_layer2_open(struct rfid_layer2_handle *l2h); -int rfid_layer2_transcieve(struct rfid_layer2_handle *l2h, +int rfid_layer2_transceive(struct rfid_layer2_handle *l2h, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, @@ -42,7 +42,7 @@ struct rfid_layer2 { struct { struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h); int (*open)(struct rfid_layer2_handle *h); - int (*transcieve)(struct rfid_layer2_handle *h, + int (*transceive)(struct rfid_layer2_handle *h, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, diff --git a/include/librfid/rfid_layer2_iso15693.h b/include/librfid/rfid_layer2_iso15693.h index ea7f87a..d91b4ec 100644 --- a/include/librfid/rfid_layer2_iso15693.h +++ b/include/librfid/rfid_layer2_iso15693.h @@ -22,14 +22,14 @@ struct iso15693_transport { int (*fini)(struct iso15693_handle *handle); #if 0 - int (*transcieve_sf)(struct iso14443a_handle *handle, + int (*transceive_sf)(struct iso14443a_handle *handle, unsigned char cmd, struct iso14443a_atqa *atqa); - int (*transcieve_acf)(struct iso14443a_handle *handle, + int (*transceive_acf)(struct iso14443a_handle *handle, struct iso14443a_anticol_cmd *acf, unsigned int *bit_of_col); #endif - int (*transcieve)(struct iso15693_handle *handle, + int (*transceive)(struct iso15693_handle *handle, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, diff --git a/include/librfid/rfid_protocol.h b/include/librfid/rfid_protocol.h index 65bda4c..d1960ef 100644 --- a/include/librfid/rfid_protocol.h +++ b/include/librfid/rfid_protocol.h @@ -8,7 +8,7 @@ struct rfid_protocol_handle; struct rfid_protocol_handle * rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id); int rfid_protocol_open(struct rfid_protocol_handle *ph); -int rfid_protocol_transcieve(struct rfid_protocol_handle *ph, +int rfid_protocol_transceive(struct rfid_protocol_handle *ph, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, unsigned int timeout, unsigned int flags); @@ -46,8 +46,8 @@ struct rfid_protocol { int (*open)(struct rfid_protocol_handle *ph); int (*close)(struct rfid_protocol_handle *ph); int (*fini)(struct rfid_protocol_handle *ph); - /* transcieve for session based transport protocols */ - int (*transcieve)(struct rfid_protocol_handle *ph, + /* transceive for session based transport protocols */ + int (*transceive)(struct rfid_protocol_handle *ph, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, diff --git a/include/librfid/rfid_protocol_tcl.h b/include/librfid/rfid_protocol_tcl.h index f754ad9..180c008 100644 --- a/include/librfid/rfid_protocol_tcl.h +++ b/include/librfid/rfid_protocol_tcl.h @@ -10,7 +10,7 @@ enum tcl_transport_rate { TCL_RATE_848 = 0x08, }; -enum tcl_transport_transcieve_flags { +enum tcl_transport_transceive_flags { TCL_TRANSP_F_TX_CRC = 0x01, /* transport adds TX CRC */ TCL_TRANSP_F_RX_CRC = 0x02, }; diff --git a/include/librfid/rfid_reader.h b/include/librfid/rfid_reader.h index 3581cc1..695221d 100644 --- a/include/librfid/rfid_reader.h +++ b/include/librfid/rfid_reader.h @@ -9,7 +9,7 @@ struct rfid_reader_handle; struct rfid_reader { char *name; unsigned int id; - int (*transcieve)(struct rfid_reader_handle *h, + int (*transceive)(struct rfid_reader_handle *h, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, @@ -19,10 +19,10 @@ struct rfid_reader { struct rfid_14443a_reader { int (*init)(struct rfid_reader_handle *h); - int (*transcieve_sf)(struct rfid_reader_handle *h, + int (*transceive_sf)(struct rfid_reader_handle *h, unsigned char cmd, struct iso14443a_atqa *atqa); - int (*transcieve_acf)(struct rfid_reader_handle *h, + int (*transceive_acf)(struct rfid_reader_handle *h, struct iso14443a_anticol_cmd *cmd, unsigned int *bit_of_col); int (*set_speed)(struct rfid_reader_handle *h, diff --git a/pegoda/pegoda.c b/pegoda/pegoda.c index 2eaa61e..f391d62 100644 --- a/pegoda/pegoda.c +++ b/pegoda/pegoda.c @@ -65,7 +65,7 @@ struct usb_device *find_device(u_int16_t vendor, u_int16_t device) return NULL; } -int pegoda_transcieve(struct pegoda_handle *ph, +int pegoda_transceive(struct pegoda_handle *ph, u_int8_t cmd, unsigned char *tx, unsigned int tx_len, unsigned char *rx, unsigned int *rx_len) { @@ -171,7 +171,7 @@ struct pegoda_handle *pegoda_open(void) printf("alt setting 1 selected\n"); - pegoda_transcieve(ph, PEGODA_CMD_PCD_CONFIG, NULL, 0, rbuf, &rlen); + pegoda_transceive(ph, PEGODA_CMD_PCD_CONFIG, NULL, 0, rbuf, &rlen); return ph; out_free: @@ -207,7 +207,7 @@ static int pegoda_auth_e2(struct pegoda_handle *ph, buf[1] = keynr; /* key number */ buf[2] = sector; /* sector */ rlen = sizeof(rbuf); - pegoda_transcieve(ph, PEGODA_CMD_PICC_AUTH, buf, 3, rbuf, &rlen); + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH, buf, 3, rbuf, &rlen); /* FIXME: check response */ @@ -226,7 +226,7 @@ static int pegoda_auth_key(struct pegoda_handle *ph, mifare_transform_key(key6, buf+5); buf[17] = sector; - pegoda_transcieve(ph, PEGODA_CMD_PICC_AUTH_KEY, buf, 18, rbuf, &rlen); + pegoda_transceive(ph, PEGODA_CMD_PICC_AUTH_KEY, buf, 18, rbuf, &rlen); /* FIXME: check response */ @@ -239,7 +239,7 @@ static int pegoda_read16(struct pegoda_handle *ph, int rc; unsigned int rlen = 16; - rc = pegoda_transcieve(ph, PEGODA_CMD_PICC_READ, + rc = pegoda_transceive(ph, PEGODA_CMD_PICC_READ, &page, 1, rx, &rlen); if (rlen != 16) return -EIO; @@ -261,19 +261,19 @@ int main(int argc, char **argv) /* LED off */ buf[0] = 0x00; rlen = sizeof(rbuf); - pegoda_transcieve(ph, PEGODA_CMD_SWITCH_LED, buf, 1, rbuf, &rlen); + pegoda_transceive(ph, PEGODA_CMD_SWITCH_LED, buf, 1, rbuf, &rlen); /* anticollision */ buf[0] = 0x26; rlen = sizeof(rbuf); - pegoda_transcieve(ph, PEGODA_CMD_PICC_COMMON_REQUEST, + pegoda_transceive(ph, PEGODA_CMD_PICC_COMMON_REQUEST, buf, 1, rbuf, &rlen); buf[0] = 0x93; memset(buf+1, 0, 5); rlen = sizeof(rbuf); - pegoda_transcieve(ph, PEGODA_CMD_PICC_CASC_ANTICOLL, + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_ANTICOLL, buf, 6, rbuf, &rlen); memcpy(ph->snr, rbuf, 4); @@ -281,7 +281,7 @@ int main(int argc, char **argv) buf[0] = 0x93; memcpy(buf+1, ph->snr, 4); rlen = sizeof(rbuf); - pegoda_transcieve(ph, PEGODA_CMD_PICC_CASC_SELECT, + pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_SELECT, buf, 5, rbuf, &rlen); pegoda_auth_key(ph, 0, "\xff\xff\xff\xff\xff\xff"); diff --git a/src/rc632.h b/src/rc632.h index 977b0ee..f207661 100644 --- a/src/rc632.h +++ b/src/rc632.h @@ -79,7 +79,7 @@ enum rc632_reg_command { RC632_CMD_RECEIVE = 0x16, RC632_CMD_LOAD_KEY = 0x19, RC632_CMD_TRANSMIT = 0x1a, - RC632_CMD_TRANSCIEVE = 0x1e, + RC632_CMD_TRANSCEIVE = 0x1e, RC632_CMD_STARTUP = 0x3f, }; diff --git a/src/rfid_asic_rc632.c b/src/rfid_asic_rc632.c index 0d4a0c4..6f42208 100644 --- a/src/rfid_asic_rc632.c +++ b/src/rfid_asic_rc632.c @@ -229,7 +229,7 @@ tcl_toggle_pcb(struct rfid_asic_handle *handle) } static int -rc632_transcieve(struct rfid_asic_handle *handle, +rc632_transceive(struct rfid_asic_handle *handle, const u_int8_t *tx_buf, u_int8_t tx_len, u_int8_t *rx_buf, @@ -243,7 +243,7 @@ rc632_transcieve(struct rfid_asic_handle *handle, if (ret < 0) return ret; - ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_TRANSCIEVE); + ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_TRANSCEIVE); if (ret < 0) return ret; @@ -581,7 +581,7 @@ rc632_iso14443a_fini(struct iso14443a_handle *handle_14443) /* issue a 14443-3 A PCD -> PICC command in a short frame, such as REQA, WUPA */ static int -rc632_iso14443a_transcieve_sf(struct rfid_asic_handle *handle, +rc632_iso14443a_transceive_sf(struct rfid_asic_handle *handle, u_int8_t cmd, struct iso14443a_atqa *atqa) { @@ -615,10 +615,10 @@ rc632_iso14443a_transcieve_sf(struct rfid_asic_handle *handle, if (ret < 0) return ret; - ret = rc632_transcieve(handle, tx_buf, sizeof(tx_buf), + ret = rc632_transceive(handle, tx_buf, sizeof(tx_buf), (u_int8_t *)atqa, &rx_len, 0x32, 0); if (ret < 0) { - DEBUGP("error during rc632_transcieve()\n"); + DEBUGP("error during rc632_transceive()\n"); return ret; } @@ -635,9 +635,9 @@ rc632_iso14443a_transcieve_sf(struct rfid_asic_handle *handle, return 0; } -/* transcieve regular frame */ +/* transceive regular frame */ static int -rc632_iso14443ab_transcieve(struct rfid_asic_handle *handle, +rc632_iso14443ab_transceive(struct rfid_asic_handle *handle, unsigned int frametype, const u_int8_t *tx_buf, unsigned int tx_len, u_int8_t *rx_buf, unsigned int *rx_len, @@ -673,7 +673,7 @@ rc632_iso14443ab_transcieve(struct rfid_asic_handle *handle, if (ret < 0) return ret; - ret = rc632_transcieve(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); *rx_len = rxl; if (ret < 0) return ret; @@ -682,9 +682,9 @@ rc632_iso14443ab_transcieve(struct rfid_asic_handle *handle, return 0; } -/* transcieve anti collission bitframe */ +/* transceive anti collission bitframe */ static int -rc632_iso14443a_transcieve_acf(struct rfid_asic_handle *handle, +rc632_iso14443a_transceive_acf(struct rfid_asic_handle *handle, struct iso14443a_anticol_cmd *acf, unsigned int *bit_of_col) { @@ -730,7 +730,7 @@ rc632_iso14443a_transcieve_acf(struct rfid_asic_handle *handle, if (ret < 0) return ret; - ret = rc632_transcieve(handle, (u_int8_t *)acf, tx_bytes, + ret = rc632_transceive(handle, (u_int8_t *)acf, tx_bytes, rx_buf, &rx_len, 0x32, 0); if (ret < 0) return ret; @@ -1371,9 +1371,9 @@ rc632_mifare_auth(struct rfid_asic_handle *h, u_int8_t cmd, u_int32_t serno, } -/* transcieve regular frame */ +/* transceive regular frame */ static int -rc632_mifare_transcieve(struct rfid_asic_handle *handle, +rc632_mifare_transceive(struct rfid_asic_handle *handle, const u_int8_t *tx_buf, unsigned int tx_len, u_int8_t *rx_buf, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) @@ -1397,7 +1397,7 @@ rc632_mifare_transcieve(struct rfid_asic_handle *handle, if (ret < 0) return ret; - ret = rc632_transcieve(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); + ret = rc632_transceive(handle, tx_buf, tx_len, rx_buf, &rxl, 0x32, 0); *rx_len = rxl; if (ret < 0) return ret; @@ -1415,11 +1415,11 @@ struct rfid_asic rc632 = { .power_down = &rc632_power_down, .turn_on_rf = &rc632_turn_on_rf, .turn_off_rf = &rc632_turn_off_rf, - .transcieve = &rc632_iso14443ab_transcieve, + .transceive = &rc632_iso14443ab_transceive, .iso14443a = { .init = &rc632_iso14443a_init, - .transcieve_sf = &rc632_iso14443a_transcieve_sf, - .transcieve_acf = &rc632_iso14443a_transcieve_acf, + .transceive_sf = &rc632_iso14443a_transceive_sf, + .transceive_acf = &rc632_iso14443a_transceive_acf, .set_speed = &rc632_iso14443a_set_speed, }, .iso14443b = { diff --git a/src/rfid_layer2.c b/src/rfid_layer2.c index 8d1544a..eef0560 100644 --- a/src/rfid_layer2.c +++ b/src/rfid_layer2.c @@ -49,16 +49,16 @@ rfid_layer2_open(struct rfid_layer2_handle *ph) } int -rfid_layer2_transcieve(struct rfid_layer2_handle *ph, +rfid_layer2_transceive(struct rfid_layer2_handle *ph, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int len, unsigned char *rx_buf, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) { - if (!ph->l2->fn.transcieve) + if (!ph->l2->fn.transceive) return -EIO; - return ph->l2->fn.transcieve(ph, frametype, tx_buf, len, rx_buf, + return ph->l2->fn.transceive(ph, frametype, tx_buf, len, rx_buf, rx_len, timeout, flags); } diff --git a/src/rfid_layer2_iso14443a.c b/src/rfid_layer2_iso14443a.c index da2628f..839cffe 100644 --- a/src/rfid_layer2_iso14443a.c +++ b/src/rfid_layer2_iso14443a.c @@ -31,37 +31,37 @@ #define TIMEOUT 1236 -/* Transcieve a 7-bit short frame */ +/* Transceive a 7-bit short frame */ static int -iso14443a_transcieve_sf(struct rfid_layer2_handle *handle, +iso14443a_transceive_sf(struct rfid_layer2_handle *handle, unsigned char cmd, struct iso14443a_atqa *atqa) { struct rfid_reader *rdr = handle->rh->reader; - return rdr->iso14443a.transcieve_sf(handle->rh, cmd, atqa); + return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa); } /* Transmit an anticollission bit frame */ static int -iso14443a_transcieve_acf(struct rfid_layer2_handle *handle, +iso14443a_transceive_acf(struct rfid_layer2_handle *handle, struct iso14443a_anticol_cmd *acf, unsigned int *bit_of_col) { struct rfid_reader *rdr = handle->rh->reader; - return rdr->iso14443a.transcieve_acf(handle->rh, acf, bit_of_col); + return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col); } /* Transmit a regular frame */ static int -iso14443a_transcieve(struct rfid_layer2_handle *handle, +iso14443a_transceive(struct rfid_layer2_handle *handle, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) { - return handle->rh->reader->transcieve(handle->rh, frametype, tx_buf, + return handle->rh->reader->transceive(handle->rh, frametype, tx_buf, tx_len, rx_buf, rx_len, timeout, flags); } @@ -111,10 +111,10 @@ iso14443a_anticol(struct rfid_layer2_handle *handle) memset(&atqa, 0, sizeof(atqa)); memset(&acf, 0, sizeof(acf)); - ret = iso14443a_transcieve_sf(handle, ISO14443A_SF_CMD_REQA, &atqa); + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, &atqa); if (ret < 0) { h->state = ISO14443A_STATE_REQA_SENT; - DEBUGP("error during transcieve_sf: %d\n", ret); + DEBUGP("error during transceive_sf: %d\n", ret); return ret; } h->state = ISO14443A_STATE_ATQA_RCVD; @@ -142,7 +142,7 @@ iso14443a_anticol(struct rfid_layer2_handle *handle) cascade: iso14443a_code_nvb_bits(&acf.nvb, 16); - ret = iso14443a_transcieve_acf(handle, &acf, &bit_of_col); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); if (ret < 0) return ret; DEBUGP("bit_of_col = %u\n", bit_of_col); @@ -150,14 +150,14 @@ cascade: while (bit_of_col != ISO14443A_BITOFCOL_NONE) { set_bit_in_field(&acf.uid_bits[0], bit_of_col-16); iso14443a_code_nvb_bits(&acf.nvb, bit_of_col); - ret = iso14443a_transcieve_acf(handle, &acf, &bit_of_col); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); DEBUGP("bit_of_col = %u\n", bit_of_col); if (ret < 0) return ret; } iso14443a_code_nvb_bits(&acf.nvb, 7*8); - ret = iso14443a_transcieve(handle, RFID_14443A_FRAME_REGULAR, + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, (unsigned char *)&acf, 7, (unsigned char *) &sak, &rx_len, TIMEOUT, 0); @@ -241,7 +241,7 @@ iso14443a_hlta(struct rfid_layer2_handle *handle) unsigned char rx_buf[10]; unsigned int rx_len = sizeof(rx_buf); - ret = iso14443a_transcieve(handle, RFID_14443A_FRAME_REGULAR, + ret = iso14443a_transceive(handle, RFID_14443A_FRAME_REGULAR, tx_buf, sizeof(tx_buf), rx_buf, &rx_len, 1000 /* 1ms */, 0); if (ret < 0) { @@ -314,7 +314,7 @@ struct rfid_layer2 rfid_layer2_iso14443a = { .fn = { .init = &iso14443a_init, .open = &iso14443a_anticol, - .transcieve = &iso14443a_transcieve, + .transceive = &iso14443a_transceive, .close = &iso14443a_hlta, .fini = &iso14443a_fini, .setopt = &iso14443a_setopt, diff --git a/src/rfid_layer2_iso14443b.c b/src/rfid_layer2_iso14443b.c index 7c92562..454df0a 100644 --- a/src/rfid_layer2_iso14443b.c +++ b/src/rfid_layer2_iso14443b.c @@ -114,13 +114,13 @@ send_reqb(struct rfid_layer2_handle *h, unsigned char afi, if (is_wup) reqb[2] |= 0x08; - ret = h->rh->reader->transcieve(h->rh, RFID_14443B_FRAME_REGULAR, + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, reqb, sizeof(reqb), (unsigned char *)&atqb, &atqb_len, ATQB_TIMEOUT, 0); h->priv.iso14443b.state = ISO14443B_STATE_REQB_SENT; if (ret < 0) { - DEBUGP("error during transcieve of REQB/WUBP\n"); + DEBUGP("error during transceive of REQB/WUBP\n"); continue; } @@ -152,7 +152,7 @@ static inline unsigned int mbli_to_mbl(struct rfid_layer2_handle *h, } static int -transcieve_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, +transceive_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, unsigned int inf_len, unsigned char *rx_data, unsigned int *rx_len) { struct iso14443b_attrib_hdr *attrib; @@ -200,14 +200,14 @@ transcieve_attrib(struct rfid_layer2_handle *h, const unsigned char *inf, attrib->param3.protocol_type = 0x1; *rx_len = *rx_len + 1; - ret = h->rh->reader->transcieve(h->rh, RFID_14443B_FRAME_REGULAR, + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, (unsigned char *) attrib, sizeof(*attrib)+inf_len, rx_buf, rx_len, h->priv.iso14443b.fwt, 0); h->priv.iso14443b.state = ISO14443B_STATE_ATTRIB_SENT; if (ret < 0) { - DEBUGP("transcieve problem\n"); + DEBUGP("transceive problem\n"); goto out_rx; } @@ -244,13 +244,13 @@ iso14443b_hltb(struct rfid_layer2_handle *h) hltb[0] = 0x50; memcpy(hltb+1, h->uid, 4); - ret = h->rh->reader->transcieve(h->rh, RFID_14443B_FRAME_REGULAR, + ret = h->rh->reader->transceive(h->rh, RFID_14443B_FRAME_REGULAR, hltb, 5, hltb_resp, &hltb_len, h->priv.iso14443b.fwt, 0); h->priv.iso14443b.state = ISO14443B_STATE_HLTB_SENT; if (ret < 0) { - DEBUGP("transcieve problem\n"); + DEBUGP("transceive problem\n"); return ret; } @@ -275,7 +275,7 @@ iso14443b_anticol(struct rfid_layer2_handle *handle) if (ret < 0) return ret; - ret = transcieve_attrib(handle, NULL, 0, buf, &buf_len); + ret = transceive_attrib(handle, NULL, 0, buf, &buf_len); if (ret < 0) return ret; @@ -319,14 +319,14 @@ iso14443b_fini(struct rfid_layer2_handle *handle) } static int -iso14443b_transcieve(struct rfid_layer2_handle *handle, +iso14443b_transceive(struct rfid_layer2_handle *handle, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) { DEBUGP("transcieving %u bytes, expecting max %u\n", tx_len, *rx_len); - return handle->rh->reader->transcieve(handle->rh, frametype, + return handle->rh->reader->transceive(handle->rh, frametype, tx_buf, tx_len, rx_buf, rx_len, timeout, flags); } @@ -337,7 +337,7 @@ struct rfid_layer2 rfid_layer2_iso14443b = { .fn = { .init = &iso14443b_init, .open = &iso14443b_anticol, - .transcieve = &iso14443b_transcieve, + .transceive = &iso14443b_transceive, .close = &iso14443b_hltb, .fini = &iso14443b_fini, }, diff --git a/src/rfid_layer2_iso15693.c b/src/rfid_layer2_iso15693.c index 1a93a19..8c5d808 100644 --- a/src/rfid_layer2_iso15693.c +++ b/src/rfid_layer2_iso15693.c @@ -29,36 +29,36 @@ #include <librfid/rfid_layer2_iso15693.h> #if 0 -/* Transcieve a 7-bit short frame */ +/* Transceive a 7-bit short frame */ static int -iso14443a_transcieve_sf(struct rfid_layer2_handle *handle, +iso14443a_transceive_sf(struct rfid_layer2_handle *handle, unsigned char cmd, struct iso14443a_atqa *atqa) { struct rfid_reader *rdr = handle->rh->reader; - return rdr->iso14443a.transcieve_sf(handle->rh, cmd, atqa); + return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa); } /* Transmit an anticollission bit frame */ static int -iso14443a_transcieve_acf(struct rfid_layer2_handle *handle, +iso14443a_transceive_acf(struct rfid_layer2_handle *handle, struct iso14443a_anticol_cmd *acf, unsigned int *bit_of_col) { struct rfid_reader *rdr = handle->rh->reader; - return rdr->iso14443a.transcieve_acf(handle->rh, acf, bit_of_col); + return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col); } /* Transmit a regular frame */ static int -iso14443a_transcieve(struct rfid_layer2_handle *handle, +iso14443a_transceive(struct rfid_layer2_handle *handle, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, u_int64_t, unsigned int flags) { - return handle->rh->reader->transcieve(handle->rh, tx_buf, tx_len, + return handle->rh->reader->transceive(handle->rh, tx_buf, tx_len, rx_buf, rx_len, timeout, flags); } @@ -111,16 +111,16 @@ iso14443a_anticol(struct rfid_layer2_handle *handle) if (first == 0) { DEBUGP("Sending REQA\n"); - ret = iso14443a_transcieve_sf(handle, ISO14443A_SF_CMD_REQA, &atqa); + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, &atqa); first = 1; } else { DEBUGP("Sending WUPA\n"); - ret = iso14443a_transcieve_sf(handle, ISO14443A_SF_CMD_WUPA, &atqa); + ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_WUPA, &atqa); } if (ret < 0) { handle->priv.iso14443a.state = ISO14443A_STATE_REQA_SENT; - DEBUGP("error during transcieve_sf: %d\n", ret); + DEBUGP("error during transceive_sf: %d\n", ret); return ret; } handle->priv.iso14443a.state = ISO14443A_STATE_ATQA_RCVD; @@ -148,7 +148,7 @@ iso14443a_anticol(struct rfid_layer2_handle *handle) cascade: iso14443a_code_nvb_bits(&acf.nvb, 16); - ret = iso14443a_transcieve_acf(handle, &acf, &bit_of_col); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); if (ret < 0) return ret; DEBUGP("bit_of_col = %u\n", bit_of_col); @@ -156,14 +156,14 @@ cascade: while (bit_of_col != ISO14443A_BITOFCOL_NONE) { set_bit_in_field(&acf.uid_bits[0], bit_of_col-16); iso14443a_code_nvb_bits(&acf.nvb, bit_of_col); - ret = iso14443a_transcieve_acf(handle, &acf, &bit_of_col); + ret = iso14443a_transceive_acf(handle, &acf, &bit_of_col); DEBUGP("bit_of_col = %u\n", bit_of_col); if (ret < 0) return ret; } iso14443a_code_nvb_bits(&acf.nvb, 7*8); - ret = iso14443a_transcieve(handle, (unsigned char *)&acf, 7, + ret = iso14443a_transceive(handle, (unsigned char *)&acf, 7, (unsigned char *) &sak, &rx_len, TIMEOUT, 0); if (ret < 0) @@ -249,7 +249,7 @@ iso14443a_hlta(struct rfid_layer2_handle *handle) return 0; - ret = iso14443a_transcieve(handle, tx_buf, sizeof(tx_buf), + ret = iso14443a_transceive(handle, tx_buf, sizeof(tx_buf), rx_buf, &rx_len, 1000 /* 1ms */, 0); if (ret < 0) { /* "error" case: we don't get somethng back from the card */ @@ -294,7 +294,7 @@ struct rfid_layer2 rfid_layer2_iso15693 = { .fn = { .init = &iso15693_init, //.open = &iso15693_anticol, - //.transcieve = &iso15693_transcieve, + //.transceive = &iso15693_transceive, //.close = &iso14443a_hlta, .fini = &iso15693_fini, }, diff --git a/src/rfid_proto_mifare_classic.c b/src/rfid_proto_mifare_classic.c index e2ee80c..5d2b3ff 100644 --- a/src/rfid_proto_mifare_classic.c +++ b/src/rfid_proto_mifare_classic.c @@ -57,7 +57,7 @@ mfcl_read(struct rfid_protocol_handle *ph, unsigned int page, tx[0] = MIFARE_CL_CMD_READ; tx[1] = page & 0xff; - ret = rfid_layer2_transcieve(ph->l2h, RFID_MIFARE_FRAME, tx, + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, sizeof(tx), rx_buf, &real_rx_len, MIFARE_CL_READ_FWT, 0); @@ -93,7 +93,7 @@ mfcl_write(struct rfid_protocol_handle *ph, unsigned int page, memcpy(tx+2, tx_data, 16); - ret = rfid_layer2_transcieve(ph->l2h, RFID_MIFARE_FRAME, tx, + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, sizeof(tx), rx, &rx_len, MIFARE_CL_WRITE_FWT, 0); diff --git a/src/rfid_proto_mifare_ul.c b/src/rfid_proto_mifare_ul.c index 747f38c..5de050d 100644 --- a/src/rfid_proto_mifare_ul.c +++ b/src/rfid_proto_mifare_ul.c @@ -52,7 +52,7 @@ mful_read(struct rfid_protocol_handle *ph, unsigned int page, tx[0] = MIFARE_UL_CMD_READ; tx[1] = page & 0xff; - ret = rfid_layer2_transcieve(ph->l2h, RFID_14443A_FRAME_REGULAR, + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, tx, sizeof(tx), rx_buf, &real_rx_len, MIFARE_UL_READ_FWT, 0); @@ -86,7 +86,7 @@ mful_write(struct rfid_protocol_handle *ph, unsigned int page, for (i = 0; i < 4; i++) tx[2+i] = tx_data[i]; - ret = rfid_layer2_transcieve(ph->l2h, RFID_14443A_FRAME_REGULAR, + ret = rfid_layer2_transceive(ph->l2h, RFID_14443A_FRAME_REGULAR, tx, sizeof(tx), rx, &rx_len, MIFARE_UL_WRITE_FWT, 0); @@ -100,7 +100,7 @@ mful_write(struct rfid_protocol_handle *ph, unsigned int page, } static int -mful_transcieve(struct rfid_protocol_handle *ph, +mful_transceive(struct rfid_protocol_handle *ph, const unsigned char *tx_data, unsigned int tx_len, unsigned char *rx_data, unsigned int *rx_len, unsigned int timeout, unsigned int flags) diff --git a/src/rfid_proto_tcl.c b/src/rfid_proto_tcl.c index 901e42c..66f1edd 100644 --- a/src/rfid_proto_tcl.c +++ b/src/rfid_proto_tcl.c @@ -176,13 +176,13 @@ tcl_request_ats(struct rfid_protocol_handle *h) rats[0] = 0xe0; rats[1] = (h->priv.tcl.cid & 0x0f) | ((fsdi << 4) & 0xf0); - /* transcieve (with CRC) */ - ret = rfid_layer2_transcieve(h->l2h, RFID_14443A_FRAME_REGULAR, + /* transceive (with CRC) */ + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, rats, 2, h->priv.tcl.ats, &h->priv.tcl.ats_len, activation_fwt(h), TCL_TRANSP_F_TX_CRC); if (ret < 0) { - DEBUGP("transcieve of rats failed\n"); + DEBUGP("transceive of rats failed\n"); h->priv.tcl.state = TCL_STATE_RATS_SENT; /* FIXME: retransmit */ return ret; @@ -279,7 +279,7 @@ tcl_do_pps(struct rfid_protocol_handle *h) ppss[2] = (ppss[2] & 0xf0) | (DrI | DsI << 2); - ret = rfid_layer2_transcieve(h->l2h, RFID_14443A_FRAME_REGULAR, + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, ppss, 3, pps_response, &rx_len, h->priv.tcl.fwt, TCL_TRANSP_F_TX_CRC); if (ret < 0) @@ -478,7 +478,7 @@ tcl_deselect(struct rfid_protocol_handle *h) if (ret < 0) return ret; - ret = rfid_layer2_transcieve(h->l2h, RFID_14443A_FRAME_REGULAR, + ret = rfid_layer2_transceive(h->l2h, RFID_14443A_FRAME_REGULAR, frame, prlg_len, rx, &rx_len, deactivation_fwt(h), TCL_TRANSP_F_TX_CRC); @@ -497,7 +497,7 @@ tcl_deselect(struct rfid_protocol_handle *h) #define is_i_block(x) ((x & 0xc0) == 0x00) static int -tcl_transcieve(struct rfid_protocol_handle *h, +tcl_transceive(struct rfid_protocol_handle *h, const unsigned char *tx_data, unsigned int tx_len, unsigned char *rx_data, unsigned int *rx_len, unsigned int timeout, unsigned int flags) @@ -547,10 +547,10 @@ tcl_transcieve(struct rfid_protocol_handle *h, *rx_len = 0; do_tx: - ret = rfid_layer2_transcieve(h->l2h, l2_to_frame(h->l2h->l2->id), + ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id), _tx, _tx_len, rx_buf, &_rx_len, _timeout, 0); - DEBUGP("l2 transcieve finished\n"); + DEBUGP("l2 transceive finished\n"); if (ret < 0) goto out_rxb; @@ -629,8 +629,8 @@ do_tx: _tx_len = prlg_len+1; _timeout = th->fwt * inf; - /* start over with next transcieve */ - goto do_tx; /* FIXME: do transcieve locally since we use + /* start over with next transceive */ + goto do_tx; /* FIXME: do transceive locally since we use totally different buffer */ } else if (is_i_block(*rx_buf)) { @@ -713,7 +713,7 @@ struct rfid_protocol rfid_protocol_tcl = { .fn = { .init = &tcl_init, .open = &tcl_connect, - .transcieve = &tcl_transcieve, + .transceive = &tcl_transceive, .close = &tcl_deselect, .fini = &tcl_fini, }, diff --git a/src/rfid_protocol.c b/src/rfid_protocol.c index c401a2c..46dc48d 100644 --- a/src/rfid_protocol.c +++ b/src/rfid_protocol.c @@ -57,12 +57,12 @@ rfid_protocol_open(struct rfid_protocol_handle *ph) } int -rfid_protocol_transcieve(struct rfid_protocol_handle *ph, +rfid_protocol_transceive(struct rfid_protocol_handle *ph, const unsigned char *tx_buf, unsigned int len, unsigned char *rx_buf, unsigned int *rx_len, unsigned int timeout, unsigned int flags) { - return ph->proto->fn.transcieve(ph, tx_buf, len, rx_buf, rx_len, + return ph->proto->fn.transceive(ph, tx_buf, len, rx_buf, rx_len, timeout, flags); } diff --git a/src/rfid_reader.c b/src/rfid_reader.c index 9486cae..f41ae8f 100644 --- a/src/rfid_reader.c +++ b/src/rfid_reader.c @@ -39,13 +39,13 @@ rfid_reader_open(void *data, unsigned int id) } int -rfid_reader_transcieve(struct rfid_reader_handle *rh, +rfid_reader_transceive(struct rfid_reader_handle *rh, enum rfid_frametype frametype, const unsigned char *tx_buf, unsigned int len, unsigned char *rx_buf, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) { - return rh->reader->transcieve(rh, frametype, tx_buf, len, rx_buf, + return rh->reader->transceive(rh, frametype, tx_buf, len, rx_buf, rx_len, timeout, flags); } diff --git a/src/rfid_reader_cm5121.c b/src/rfid_reader_cm5121.c index 2acc267..5affeb5 100644 --- a/src/rfid_reader_cm5121.c +++ b/src/rfid_reader_cm5121.c @@ -176,31 +176,31 @@ static int TestFIFO(struct rc632_handle *handle) } #endif -static int cm5121_transcieve(struct rfid_reader_handle *rh, +static int cm5121_transceive(struct rfid_reader_handle *rh, enum rfid_frametype frametype, const unsigned char *tx_data, unsigned int tx_len, unsigned char *rx_data, unsigned int *rx_len, u_int64_t timeout, unsigned int flags) { - return rh->ah->asic->priv.rc632.fn.transcieve(rh->ah, frametype, + return rh->ah->asic->priv.rc632.fn.transceive(rh->ah, frametype, tx_data, tx_len, rx_data, rx_len, timeout, flags); } -static int cm5121_transcieve_sf(struct rfid_reader_handle *rh, +static int cm5121_transceive_sf(struct rfid_reader_handle *rh, unsigned char cmd, struct iso14443a_atqa *atqa) { - return rh->ah->asic->priv.rc632.fn.iso14443a.transcieve_sf(rh->ah, + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_sf(rh->ah, cmd, atqa); } static int -cm5121_transcieve_acf(struct rfid_reader_handle *rh, +cm5121_transceive_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, + return rh->ah->asic->priv.rc632.fn.iso14443a.transceive_acf(rh->ah, cmd, bit_of_col); } @@ -346,11 +346,11 @@ struct rfid_reader rfid_reader_cm5121 = { .name = "Omnikey CardMan 5121 RFID", .open = &cm5121_open, .close = &cm5121_close, - .transcieve = &cm5121_transcieve, + .transceive = &cm5121_transceive, .iso14443a = { .init = &cm5121_14443a_init, - .transcieve_sf = &cm5121_transcieve_sf, - .transcieve_acf = &cm5121_transcieve_acf, + .transceive_sf = &cm5121_transceive_sf, + .transceive_acf = &cm5121_transceive_acf, .speed = RFID_14443A_SPEED_106K | RFID_14443A_SPEED_212K | RFID_14443A_SPEED_424K, //| RFID_14443A_SPEED_848K, .set_speed = &cm5121_14443a_set_speed, diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c index edb282b..6e130d5 100644 --- a/utils/librfid-tool.c +++ b/utils/librfid-tool.c @@ -114,7 +114,7 @@ static int select_mf(void) int rv; - rv = rfid_protocol_transcieve(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); if (rv < 0) return rv; @@ -134,7 +134,7 @@ static int iso7816_get_challenge(unsigned char len) int rv; - rv = rfid_protocol_transcieve(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), ret, &rlen, 0, 0); if (rv < 0) return rv; @@ -153,7 +153,7 @@ iso7816_select_application(void) int rv; - rv = rfid_protocol_transcieve(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); if (rv < 0) return rv; @@ -175,7 +175,7 @@ iso7816_select_ef(u_int16_t fid) cmd[5] = (fid >> 8) & 0xff; cmd[6] = fid & 0xff; - rv = rfid_protocol_transcieve(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); if (rv < 0) return rv; @@ -194,7 +194,7 @@ iso7816_read_binary(unsigned char *buf, unsigned int *len) int rv; - rv = rfid_protocol_transcieve(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); + rv = rfid_protocol_transceive(ph, cmd, sizeof(cmd), resp, &rlen, 0, 0); if (rv < 0) return rv; |