X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid_proto_mifare_classic.c;h=d45eefc392012b7757f215f6eddba172ef3cc1b2;hb=34c1b5ea856324e7ff3e8c8198ea06583426d0a9;hp=99386a18dc116a51854944621279f78230446212;hpb=43ac27739b392c67471c2101a88afaa6ef4edbd3;p=librfid diff --git a/src/rfid_proto_mifare_classic.c b/src/rfid_proto_mifare_classic.c index 99386a1..d45eefc 100644 --- a/src/rfid_proto_mifare_classic.c +++ b/src/rfid_proto_mifare_classic.c @@ -1,7 +1,7 @@ /* Mifare Classic implementation, PCD side. * - * (C) 2005 by Harald Welte + * (C) 2005-2006 by Harald Welte * */ @@ -25,12 +25,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include #include "rfid_iso14443_common.h" @@ -57,9 +57,9 @@ mfcl_read(struct rfid_protocol_handle *ph, unsigned int page, tx[0] = MIFARE_CL_CMD_READ; tx[1] = page & 0xff; - ret = ph->l2h->l2->fn.transcieve(ph->l2h, RFID_MIFARE_FRAME, tx, - sizeof(tx), rx_buf, &real_rx_len, - MIFARE_CL_READ_FWT, 0); + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + sizeof(tx), rx_buf, &real_rx_len, + MIFARE_CL_READ_FWT, 0); if (ret < 0) return ret; @@ -93,9 +93,9 @@ mfcl_write(struct rfid_protocol_handle *ph, unsigned int page, memcpy(tx+2, tx_data, 16); - ret = ph->l2h->l2->fn.transcieve(ph->l2h, RFID_MIFARE_FRAME, tx, - sizeof(tx), rx, &rx_len, - MIFARE_CL_WRITE_FWT, 0); + ret = rfid_layer2_transceive(ph->l2h, RFID_MIFARE_FRAME, tx, + sizeof(tx), rx, &rx_len, + MIFARE_CL_WRITE_FWT, 0); if (ret < 0) return ret; @@ -110,17 +110,17 @@ static struct rfid_protocol_handle * mfcl_init(struct rfid_layer2_handle *l2h) { struct rfid_protocol_handle *ph; - ph = malloc(sizeof(struct rfid_protocol_handle)); + ph = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); return ph; } static int mfcl_fini(struct rfid_protocol_handle *ph) { - free(ph); + free_protocol_handle(ph); return 0; } -struct rfid_protocol rfid_protocol_mfcl = { +const struct rfid_protocol rfid_protocol_mfcl = { .id = RFID_PROTOCOL_MIFARE_CLASSIC, .name = "Mifare Classic", .fn = {