From 0e95f6a22ad464b7493135c701b722e551d37900 Mon Sep 17 00:00:00 2001 From: laforge Date: Wed, 14 Jun 2006 19:46:44 +0000 Subject: fix tx chaining git-svn-id: https://svn.gnumonks.org/trunk/librfid@1824 e0336214-984f-0b4b-a45f-81c69e1f0ede --- src/rfid_proto_tcl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rfid_proto_tcl.c b/src/rfid_proto_tcl.c index 66f1edd..b7577e3 100644 --- a/src/rfid_proto_tcl.c +++ b/src/rfid_proto_tcl.c @@ -517,11 +517,6 @@ tcl_transceive(struct rfid_protocol_handle *h, unsigned char ack[10]; unsigned int ack_len; - if (tx_len > max_net_tx_framesize(th)) { - /* slow path: we need to use chaining */ - return -1; - } - tx_buf = malloc(tcl_prlg_len(th) + tx_len); if (!tx_buf) { ret = -ENOMEM; @@ -546,6 +541,12 @@ tcl_transceive(struct rfid_protocol_handle *h, _rx_len = *rx_len; *rx_len = 0; + + if (_tx_len > max_net_tx_framesize(th)+prlg_len) { + /* slow path: we need to use chaining */ + _tx_len = max_net_tx_framesize(th)+prlg_len; + } + do_tx: ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id), _tx, _tx_len, -- cgit v1.2.3