From e404cccecd20a2418c2429cd182c18218e54bd28 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 14 Oct 2006 12:34:38 +0000 Subject: Prepare RFID compilation in firmware mode - switch from linked lists to static arrays - remove all non-handle dynamic allocations (at the expense of stack) - declare all proto/reader/asic/layer2 structures as const - wrap all handle allocations in macros that expand to references to static structures in case of firmware mode - update copyright notices - add skeleton code for openpcd-inside-firmware driver - update TODO with remaining TODO for firmware mode git-svn-id: https://svn.gnumonks.org/trunk/librfid@1903 e0336214-984f-0b4b-a45f-81c69e1f0ede --- src/rfid_asic_rc632.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/rfid_asic_rc632.c') diff --git a/src/rfid_asic_rc632.c b/src/rfid_asic_rc632.c index 05ed2cd..f8a8483 100644 --- a/src/rfid_asic_rc632.c +++ b/src/rfid_asic_rc632.c @@ -1,6 +1,6 @@ /* Generic Philips CL RC632 Routines * - * (C) Harald Welte + * (C) 2005-2006 Harald Welte * */ @@ -41,7 +41,7 @@ #define RC632_TMO_AUTH1 14000 #define ENTER() DEBUGP("entering\n") -struct rfid_asic rc632; +const struct rfid_asic rc632; /* Register and FIFO Access functions */ static int @@ -596,7 +596,7 @@ rc632_open(struct rfid_asic_transport_handle *th) { struct rfid_asic_handle *h; - h = malloc(sizeof(*h)); + h = malloc_asic_handle(sizeof(*h)); if (!h) return NULL; memset(h, 0, sizeof(*h)); @@ -609,7 +609,7 @@ rc632_open(struct rfid_asic_transport_handle *th) h->mtu = h->mru = 64; if (rc632_init(h) < 0) { - free(h); + free_asic_handle(h); return NULL; } @@ -620,14 +620,14 @@ void rc632_close(struct rfid_asic_handle *h) { rc632_fini(h); - free(h); + free_asic_handle(h); } /* * Philips CL RC632 primitives for ISO 14443-A compliant PICC's * - * (C) 2005 by Harald Welte + * (C) 2005-2006 by Harald Welte * */ @@ -1581,7 +1581,7 @@ rc632_mifare_transceive(struct rfid_asic_handle *handle, return 0; } -struct rfid_asic rc632 = { +const struct rfid_asic rc632 = { .name = "Philips CL RC632", .fc = ISO14443_FREQ_CARRIER, .priv.rc632 = { -- cgit v1.2.3