diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-14 12:34:38 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-14 12:34:38 +0000 |
commit | e404cccecd20a2418c2429cd182c18218e54bd28 (patch) | |
tree | 5a15b5ca51874f0f8e96ccc4ee0457a66de3cec7 /src/rfid_proto_tcl.c | |
parent | 6e87a007525b313dcf2da194977bb1abdf62026f (diff) |
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
Diffstat (limited to 'src/rfid_proto_tcl.c')
-rw-r--r-- | src/rfid_proto_tcl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rfid_proto_tcl.c b/src/rfid_proto_tcl.c index 2ed7a7c..d00e966 100644 --- a/src/rfid_proto_tcl.c +++ b/src/rfid_proto_tcl.c @@ -1,6 +1,6 @@ /* ISO 14443-4 (T=CL) implementation, PCD side. * - * (C) 2005 by Harald Welte <laforge@gnumonks.org> + * (C) 2005-2006 by Harald Welte <laforge@gnumonks.org> * */ @@ -737,13 +737,13 @@ tcl_init(struct rfid_layer2_handle *l2h) struct rfid_protocol_handle *th; unsigned int mru = l2h->rh->ah->mru; - th = malloc(sizeof(struct rfid_protocol_handle) + mru); + th = malloc_protocol_handle(sizeof(struct rfid_protocol_handle)); if (!th) return NULL; /* FIXME: mru should be attribute of layer2 (in case it adds/removes * some overhead */ - memset(th, 0, sizeof(struct rfid_protocol_handle) + mru); + memset(th, 0, sizeof(struct rfid_protocol_handle)); /* maximum received ats length equals mru of asic/reader */ th->priv.tcl.state = TCL_STATE_INITIAL; @@ -758,11 +758,11 @@ tcl_init(struct rfid_layer2_handle *l2h) static int tcl_fini(struct rfid_protocol_handle *ph) { - free(ph); + free_protocol_handle(ph); return 0; } -struct rfid_protocol rfid_protocol_tcl = { +const struct rfid_protocol rfid_protocol_tcl = { .id = RFID_PROTOCOL_TCL, .name = "ISO 14443-4 / T=CL", .fn = { |